Methods
E
N
O
P
S
Attributes
[R] environment
[R] script_name
Class Public methods
new()
     # File railties/lib/rails/commands/plugin.rb, line 281
281:       def initialize
282:         @environment = RailsEnvironment.default
283:         @rails_root = RailsEnvironment.default.root
284:         @script_name = File.basename($0)
285:       end
parse!(args=ARGV)
     # File railties/lib/rails/commands/plugin.rb, line 347
347:       def self.parse!(args=ARGV)
348:         Plugin.new.parse!(args)
349:       end
Instance Public methods
environment=(value)
     # File railties/lib/rails/commands/plugin.rb, line 287
287:       def environment=(value)
288:         @environment = value
289:         RailsEnvironment.default = value
290:       end
options()
     # 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
parse!(args=ARGV)
     # 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
split_args(args)
     # File railties/lib/rails/commands/plugin.rb, line 340
340:       def split_args(args)
341:         left = []
342:         left << args.shift while args[0] and args[0] =~ /^-/
343:         left << args.shift if args[0]
344:         [left, args]
345:       end