Methods
E
N
O
P
S
Attributes
[R] environment
[R] script_name
Class Public methods
new()
# File railties/lib/rails/commands/plugin.rb, line 280
def initialize
  @environment = RailsEnvironment.default
  @rails_root = RailsEnvironment.default.root
  @script_name = File.basename($0)
end
parse!(args=ARGV)
# File railties/lib/rails/commands/plugin.rb, line 346
def self.parse!(args=ARGV)
  Plugin.new.parse!(args)
end
Instance Public methods
environment=(value)
# File railties/lib/rails/commands/plugin.rb, line 286
def environment=(value)
  @environment = value
  RailsEnvironment.default = value
end
options()
# File railties/lib/rails/commands/plugin.rb, line 291
def options
  OptionParser.new do |o|
    o.set_summary_indent('  ')
    o.banner =    "Usage: plugin [OPTIONS] command"
    o.define_head "Rails plugin manager."

    o.separator ""
    o.separator "GENERAL OPTIONS"

    o.on("-r", "--root=DIR", String,
         "Set an explicit rails app directory.",
         "Default: #{@rails_root}") { |rails_root| @rails_root = rails_root; self.environment = RailsEnvironment.new(@rails_root) }

    o.on("-v", "--verbose", "Turn on verbose output.") { |verbose| $verbose = verbose }
    o.on("-h", "--help", "Show this help message.") { puts o; exit }

    o.separator ""
    o.separator "COMMANDS"

    o.separator "  install    Install plugin(s) from known repositories or URLs."
    o.separator "  remove     Uninstall plugins."

    o.separator ""
    o.separator "EXAMPLES"
    o.separator "  Install a plugin from a subversion URL:"
    o.separator "    #{@script_name} plugin install http://dev.rubyonrails.com/svn/rails/plugins/continuous_builder\n"
    o.separator "  Install a plugin from a git URL:"
    o.separator "    #{@script_name} plugin install git://github.com/SomeGuy/my_awesome_plugin.git\n"
    o.separator "  Install a plugin and add a svn:externals entry to vendor/plugins"
    o.separator "    #{@script_name} plugin install -x continuous_builder\n"
  end
end
parse!(args=ARGV)
# File railties/lib/rails/commands/plugin.rb, line 324
def parse!(args=ARGV)
  general, sub = split_args(args)
  options.parse!(general)

  command = general.shift
  if command =~ /^(install|remove)$/
    command = Commands.const_get(command.capitalize).new(self)
    command.parse!(sub)
  else
    puts "Unknown command: #{command}" unless command.blank?
    puts options
    exit 1
  end
end
split_args(args)
# File railties/lib/rails/commands/plugin.rb, line 339
def split_args(args)
  left = []
  left << args.shift while args[0] and args[0] =~ /^-/
  left << args.shift if args[0]
  [left, args]
end