Methods
Public Class methods
new(base_command)
     # File railties/lib/commands/plugin.rb, line 752
752:     def initialize(base_command)
753:       @base_command = base_command
754:       @method = :http
755:       @options = { :quiet => false, :revision => nil, :force => false }
756:     end
Public Instance methods
determine_install_method()
     # File railties/lib/commands/plugin.rb, line 788
788:     def determine_install_method
789:       best = @base_command.environment.best_install_method
790:       @method = :http if best == :http and @method == :export
791:       case
792:       when (best == :http and @method != :http)
793:         msg = "Cannot install using subversion because `svn' cannot be found in your PATH"
794:       when (best == :export and (@method != :export and @method != :http))
795:         msg = "Cannot install using #{@method} because this project is not under subversion."
796:       when (best != :externals and @method == :externals)
797:         msg = "Cannot install using externals because vendor/plugins is not under subversion."
798:       end
799:       if msg
800:         puts msg
801:         exit 1
802:       end
803:       @method
804:     end
options()
     # File railties/lib/commands/plugin.rb, line 758
758:     def options
759:       OptionParser.new do |o|
760:         o.set_summary_indent('  ')
761:         o.banner =    "Usage: #{@base_command.script_name} install PLUGIN [PLUGIN [PLUGIN] ...]"
762:         o.define_head "Install one or more plugins."
763:         o.separator   ""
764:         o.separator   "Options:"
765:         o.on(         "-x", "--externals", 
766:                       "Use svn:externals to grab the plugin.", 
767:                       "Enables plugin updates and plugin versioning.") { |v| @method = :externals }
768:         o.on(         "-o", "--checkout",
769:                       "Use svn checkout to grab the plugin.",
770:                       "Enables updating but does not add a svn:externals entry.") { |v| @method = :checkout }
771:         o.on(         "-e", "--export",
772:                       "Use svn export to grab the plugin.",
773:                       "Exports the plugin, allowing you to check it into your local repository. Does not enable updates, or add an svn:externals entry.") { |v| @method = :export }
774:         o.on(         "-q", "--quiet",
775:                       "Suppresses the output from installation.",
776:                       "Ignored if -v is passed (./script/plugin -v install ...)") { |v| @options[:quiet] = true }
777:         o.on(         "-r REVISION", "--revision REVISION",
778:                       "Checks out the given revision from subversion or git.",
779:                       "Ignored if subversion/git is not used.") { |v| @options[:revision] = v }
780:         o.on(         "-f", "--force",
781:                       "Reinstalls a plugin if it's already installed.") { |v| @options[:force] = true }
782:         o.separator   ""
783:         o.separator   "You can specify plugin names as given in 'plugin list' output or absolute URLs to "
784:         o.separator   "a plugin repository."
785:       end
786:     end
parse!(args)
     # File railties/lib/commands/plugin.rb, line 806
806:     def parse!(args)
807:       options.parse!(args)
808:       environment = @base_command.environment
809:       install_method = determine_install_method
810:       puts "Plugins will be installed using #{install_method}" if $verbose
811:       args.each do |name|
812:         ::Plugin.find(name).install(install_method, @options)
813:       end
814:     rescue StandardError => e
815:       puts "Plugin not found: #{args.inspect}"
816:       puts e.inspect if $verbose
817:       exit 1
818:     end