Module: Priha
- Defined in:
- lib/priha.rb,
lib/priha/version.rb,
lib/priha/git_command.rb
Defined Under Namespace
Modules: GitCommand
Constant Summary collapse
- IDENTIFIER =
SecureRandom.hex(8)
- VERSION =
"0.1.0"
Instance Method Summary collapse
- #add_remote(token, username, repository_name) ⇒ Object
- #current_branch ⇒ Object
- #push(local_branch, remote_branch) ⇒ Object
- #remove_remote ⇒ Object
Instance Method Details
#add_remote(token, username, repository_name) ⇒ Object
16 17 18 19 20 |
# File 'lib/priha.rb', line 16 def add_remote(token, username, repository_name) status, _result = GitCommand.call_git_remote_add(token, username, repository_name, IDENTIFIER) return false unless status == 0 true end |
#current_branch ⇒ Object
9 10 11 12 13 14 |
# File 'lib/priha.rb', line 9 def current_branch return @current_branch if @current_branch status, result = GitCommand.call_git_name_rev_name_only_head return nil unless status == 0 @current_branch = result.chomp end |
#push(local_branch, remote_branch) ⇒ Object
28 29 30 31 32 |
# File 'lib/priha.rb', line 28 def push(local_branch, remote_branch) status, _result = GitCommand.call_git_push(IDENTIFIER, local_branch, remote_branch) return false unless status == 0 true end |
#remove_remote ⇒ Object
22 23 24 25 26 |
# File 'lib/priha.rb', line 22 def remove_remote status, _result = GitCommand.call_git_remote_remove(IDENTIFIER) return false unless status == 0 true end |