Methods
- E
- N
- O
- P
- S
Attributes
[R] | environment | |
[R] | script_name |
Class Public methods
Instance Public methods
# File railties/lib/rails/commands/plugin.rb, line 292 292: def options 293: OptionParser.new do |o| 294: o.set_summary_indent(' ') 295: o.banner = "Usage: plugin [OPTIONS] command" 296: o.define_head "Rails plugin manager." 297: 298: o.separator "" 299: o.separator "GENERAL OPTIONS" 300: 301: o.on("-r", "--root=DIR", String, 302: "Set an explicit rails app directory.", 303: "Default: #{@rails_root}") { |rails_root| @rails_root = rails_root; self.environment = RailsEnvironment.new(@rails_root) } 304: 305: o.on("-v", "--verbose", "Turn on verbose output.") { |verbose| $verbose = verbose } 306: o.on("-h", "--help", "Show this help message.") { puts o; exit } 307: 308: o.separator "" 309: o.separator "COMMANDS" 310: 311: o.separator " install Install plugin(s) from known repositories or URLs." 312: o.separator " remove Uninstall plugins." 313: 314: o.separator "" 315: o.separator "EXAMPLES" 316: o.separator " Install a plugin from a subversion URL:" 317: o.separator " #{@script_name} plugin install http://example.com/my_svn_plugin\n" 318: o.separator " Install a plugin from a git URL:" 319: o.separator " #{@script_name} plugin install git://github.com/SomeGuy/my_awesome_plugin.git\n" 320: o.separator " Install a plugin and add a svn:externals entry to vendor/plugins" 321: o.separator " #{@script_name} plugin install -x my_svn_plugin\n" 322: end 323: end
# File railties/lib/rails/commands/plugin.rb, line 325 325: def parse!(args=ARGV) 326: general, sub = split_args(args) 327: options.parse!(general) 328: 329: command = general.shift 330: if command =~ /^(install|remove)$/ 331: command = Commands.const_get(command.capitalize).new(self) 332: command.parse!(sub) 333: else 334: puts "Unknown command: #{command}" unless command.blank? 335: puts options 336: exit 1 337: end 338: end