Module: Kickstart::Plugins
- Defined in:
- lib/plugins.rb
Instance Method Summary collapse
-
#default_plugins ⇒ Object
a callback for some plugins you would like to install in every project.
-
#install_plugins ⇒ Object
installs all necessary plugins.
-
#plugin_bank ⇒ Object
list of plugins that can be downloaded by name.
-
#required_plugins ⇒ Object
list of plugins required by kickstart and, therefore, will be installed in the course of running kickstart this list is expandable in the
~/.kickstart
folder. -
#rspec_version ⇒ Object
define the version of rspec that you are using.
-
#rspec_version=(what) ⇒ Object
set the rspec version.
-
#use_plugin(plugin) ⇒ Object
install a plugin.
-
#use_plugins(*args) ⇒ Object
define a list of plugins to install.
Instance Method Details
#default_plugins ⇒ Object
a callback for some plugins you would like to install in every project. can be dealt with in the home folder
43 44 45 |
# File 'lib/plugins.rb', line 43 def default_plugins [] end |
#install_plugins ⇒ Object
installs all necessary plugins
48 49 50 51 52 53 |
# File 'lib/plugins.rb', line 48 def install_plugins puts "\n\n+ installing plugins +" unless default_plugins.empty? default_plugins.each do |plugin| use_plugin plugin end end |
#plugin_bank ⇒ Object
list of plugins that can be downloaded by name. this list is expandable in the ~/.kickstart
folder
30 31 32 33 34 |
# File 'lib/plugins.rb', line 30 def plugin_bank { :rspec_on_rails => "svn://rubyforge.org/var/svn/rspec/tags/REL_#{rspec_version}/rspec_on_rails/vendor/plugins/rspec_on_rails", } end |
#required_plugins ⇒ Object
list of plugins required by kickstart and, therefore, will be installed in the course of running kickstart this list is expandable in the ~/.kickstart
folder
38 39 40 |
# File 'lib/plugins.rb', line 38 def required_plugins [ :rspec_on_rails ] end |
#rspec_version ⇒ Object
define the version of rspec that you are using. formatted as it would be in the rspec_on_rails url
4 5 6 7 8 |
# File 'lib/plugins.rb', line 4 def rspec_version $RSPEC_VERSION ||= request_value("please enter the version of rspec on your computer [default: 0_7_5_1]") $RSPEC_VERSION = '0_7_5_1' if $RSPEC_VERSION == '' $RSPEC_VERSION end |
#rspec_version=(what) ⇒ Object
set the rspec version
11 12 13 14 |
# File 'lib/plugins.rb', line 11 def rspec_version= what puts "setting rspec version to #{what}" @rspec_version = what end |
#use_plugin(plugin) ⇒ Object
install a plugin
17 18 19 20 |
# File 'lib/plugins.rb', line 17 def use_plugin(plugin) puts "\n\n+ installing #{plugin} +" puts `script/plugin install #{ plugin_bank.include?(plugin) ? plugin_bank[plugin] : plugin }` end |
#use_plugins(*args) ⇒ Object
define a list of plugins to install
23 24 25 26 |
# File 'lib/plugins.rb', line 23 def use_plugins(*args) args=args.flatten args.each{|arg| use_plugin(arg)} end |