Class: StepUp::CLI
- Inherits:
-
Thor
- Object
- Thor
- StepUp::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/step-up/cli.rb
Constant Summary collapse
- VERSION_ACTIONS =
%w[show create help]
Instance Attribute Summary collapse
-
#commit_object ⇒ Object
readonly
Returns the value of attribute commit_object.
Instance Method Summary collapse
- #changelog ⇒ Object
- #commands ⇒ Object
- #gem_version ⇒ Object
- #init ⇒ Object
- #notes(action = "show", commit_base = nil) ⇒ Object
- #version(action = nil, commit_base = nil) ⇒ Object
Instance Attribute Details
#commit_object ⇒ Object (readonly)
Returns the value of attribute commit_object.
6 7 8 |
# File 'lib/step-up/cli.rb', line 6 def commit_object @commit_object end |
Instance Method Details
#changelog ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/step-up/cli.rb', line 57 def changelog log = [] method_name = "changelog_format_#{ options[:format] }" method_name = "changelog_format_default" unless internal_respond_to?(method_name) driver = driver([:mask]) driver..each_with_index do |tag, index| break if [:top] && index >= [:top] log << send(method_name, tag, driver.version_tag_info(tag)) end puts log.join("\n\n") end |
#commands ⇒ Object
13 14 15 |
# File 'lib/step-up/cli.rb', line 13 def commands puts self.class.all_commands.keys.join " " end |
#gem_version ⇒ Object
91 92 93 |
# File 'lib/step-up/cli.rb', line 91 def gem_version puts StepUp::VERSION end |
#init ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/step-up/cli.rb', line 42 def init init_create_stepuprc init_update_gemfile if [:gemfile] if [:version_file_support] init_update_version_helper init_update_rakefile init_update_capfile init_update_gitignore end end |
#notes(action = "show", commit_base = nil) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/step-up/cli.rb', line 76 def notes(action = "show", commit_base = nil) unless %w[show add remove help].include?(action) commit_base ||= action action = "show" end @commit_object = commit_base if internal_respond_to?("notes_#{action}") check_notes_config && send("notes_#{action}") else puts "invalid action: #{action}" exit(1) end end |
#version(action = nil, commit_base = nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/step-up/cli.rb', line 25 def version(action = nil, commit_base = nil) unless VERSION_ACTIONS.include?(action) commit_base ||= action action = "show" end @commit_object = commit_base if internal_respond_to?("version_#{action}") send("version_#{action}") else puts "invalid action: #{action}" end end |