Class: GitUtils
- Defined in:
- lib/cocoapods-podspec-binary/utils/git_utils.rb
Overview
git utils
Instance Method Summary collapse
- #clone(remote_url, destination_path) ⇒ Object
- #commit(message) ⇒ Object
-
#initialize(repository_path) ⇒ GitUtils
constructor
git utils.
- #open_git_repository(repository_path) ⇒ Object
- #pull ⇒ Object
- #push(remote_name = 'origin', branch_name = 'master') ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(repository_path) ⇒ GitUtils
git utils
8 9 10 |
# File 'lib/cocoapods-podspec-binary/utils/git_utils.rb', line 8 def initialize(repository_path) @repository = open_git_repository(repository_path) end |
Instance Method Details
#clone(remote_url, destination_path) ⇒ Object
16 17 18 |
# File 'lib/cocoapods-podspec-binary/utils/git_utils.rb', line 16 def clone(remote_url, destination_path) Git.clone(remote_url, destination_path) end |
#commit(message) ⇒ Object
24 25 26 27 |
# File 'lib/cocoapods-podspec-binary/utils/git_utils.rb', line 24 def commit() @repository.add(all: true) @repository.commit() end |
#open_git_repository(repository_path) ⇒ Object
12 13 14 |
# File 'lib/cocoapods-podspec-binary/utils/git_utils.rb', line 12 def open_git_repository(repository_path) Git.open(repository_path) end |
#pull ⇒ Object
20 21 22 |
# File 'lib/cocoapods-podspec-binary/utils/git_utils.rb', line 20 def pull @repository.pull end |
#push(remote_name = 'origin', branch_name = 'master') ⇒ Object
29 30 31 |
# File 'lib/cocoapods-podspec-binary/utils/git_utils.rb', line 29 def push(remote_name = 'origin', branch_name = 'master') @repository.push(remote_name, branch_name) end |
#status ⇒ Object
33 34 35 |
# File 'lib/cocoapods-podspec-binary/utils/git_utils.rb', line 33 def status @repository.status end |