Class: Sashimi::Commands::Update
- Inherits:
-
Object
- Object
- Sashimi::Commands::Update
- Defined in:
- lib/sashimi/commands.rb
Instance Method Summary collapse
-
#initialize(base_command) ⇒ Update
constructor
A new instance of Update.
- #options ⇒ Object
- #parse!(args) ⇒ Object
- #update_plugins(plugins) ⇒ Object
Constructor Details
#initialize(base_command) ⇒ Update
Returns a new instance of Update.
135 136 137 |
# File 'lib/sashimi/commands.rb', line 135 def initialize(base_command) @base_command = base_command end |
Instance Method Details
#options ⇒ Object
139 140 141 142 143 144 145 146 147 |
# File 'lib/sashimi/commands.rb', line 139 def OptionParser.new do |o| o.set_summary_indent(' ') o. = "Usage: #{@base_command.script_name} update [OPTIONS] PLUGIN [PLUGIN2, PLUGIN3]" o.define_head "Update installed plugin(s)." o.on("-a", "--all", "Update all installed plugins.") { |@all| } o.on("-r", "--rails", "Install the plugin(s) in a Rails app.") { |@rails| } end end |
#parse!(args) ⇒ Object
149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/sashimi/commands.rb', line 149 def parse!(args) .parse!(args) raise "Can't use both --all and --rails arguments." if @all and @rails if @all update_plugins(AbstractRepository.plugins_names) elsif @rails AbstractRepository.update_rails_plugins(args) else update_plugins(args) end end |