Module: Capistrano::Helpers::CapflowHelper
- Defined in:
- lib/capistrano/helpers/capflow_helper.rb
Instance Method Summary collapse
- #available_releases ⇒ Object
- #available_tags ⇒ Object
- #banner ⇒ Object
- #branches ⇒ Object
- #current_branch ⇒ Object
- #latest_release ⇒ Object
- #non_release_tags ⇒ Object
- #releases ⇒ Object
- #tags ⇒ Object
- #version_tag_prefix ⇒ Object
- #who ⇒ Object
Instance Method Details
#available_releases ⇒ Object
43 44 45 46 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 43 def available_releases Capistrano::CLI.ui.say "\nAvailable Releases:" Capistrano::CLI.ui.say "#{releases.join("\n")}" end |
#available_tags ⇒ Object
38 39 40 41 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 38 def Capistrano::CLI.ui.say "Available Tags:" Capistrano::CLI.ui.say "#{.join("\n")}" end |
#banner ⇒ Object
48 49 50 51 52 53 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 48 def <<-BANNER \nCapflow for Gitflow BANNER end |
#branches ⇒ Object
22 23 24 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 22 def branches `git branch --no-color`.split("\n") end |
#current_branch ⇒ Object
18 19 20 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 18 def current_branch branches.select{|b| b =~ /^\*\s/}.first.gsub(/^\*\s/,"") end |
#latest_release ⇒ Object
34 35 36 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 34 def latest_release releases.sort{|x,y| x.split(version_tag_prefix).last <=> y.split(version_tag_prefix).last}.last end |
#non_release_tags ⇒ Object
14 15 16 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 14 def - releases end |
#releases ⇒ Object
30 31 32 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 30 def releases .select{|t| t =~ /^#{version_tag_prefix}(\d+)/} end |
#tags ⇒ Object
10 11 12 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 10 def `git tag`.split("\n").compact end |
#version_tag_prefix ⇒ Object
26 27 28 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 26 def version_tag_prefix `git config gitflow.prefix.versiontag`.split("\n").first end |
#who ⇒ Object
5 6 7 8 |
# File 'lib/capistrano/helpers/capflow_helper.rb', line 5 def who identity = (`git config user.name` || `whoami`) identity.chomp.to_url end |