instance method plugin

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

plugin(name, options)

Install a plugin. You must provide either a Subversion url or Git url. For a Git-hosted plugin, you can specify if it should be added as a submodule instead of cloned.

Examples

plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true
plugin 'restful-authentication', :svn => 'svn://svnhub.com/technoweenie/restful-authentication/trunk'

Parameters

name req
options req
Source
# File railties/lib/rails_generator/generators/applications/app/template_runner.rb, line 69
    def plugin(name, options)
      log 'plugin', name

      if options[:git] && options[:submodule]
        in_root do
          Git.run("submodule add #{options[:git]} vendor/plugins/#{name}")
        end
      elsif options[:git] || options[:svn]
        in_root do
          run_ruby_script("script/plugin install #{options[:svn] || options[:git]}", false)
        end
      else
        log "! no git or svn provided for #{name}.  skipping..."
      end
    end

Defined in railties/lib/rails_generator/generators/applications/app/template_runner.rb line 69 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::TemplateRunner

Type at least 2 characters to search.

↑↓ navigate · open · esc close