Module: Pointer::Helpers
- Included in:
- EasyDeploy
- Defined in:
- lib/pointer/helpers.rb
Instance Method Summary collapse
Instance Method Details
#assert_git ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/pointer/helpers.rb', line 9 def assert_git() unless File.exists?('.git') raise "Please run from a Git repository (use private Git hosting from bitbucket.org for example)" end if remote_repo.to_s == '' raise "This tool assumes you have git remote branch, named #{'origin'.green}" end end |
#remote_repo ⇒ Object
5 6 7 |
# File 'lib/pointer/helpers.rb', line 5 def remote_repo() `git config --get remote.origin.url`.gsub(/^ssh:\/\/(.*?)\//, '\\1:').strip end |
#what(string) ⇒ Object
19 20 21 |
# File 'lib/pointer/helpers.rb', line 19 def what(string) puts "# #{string}".green end |