lib/generators/cucumber/install/install_generator.rb in cucumber-rails-0.3.2 vs lib/generators/cucumber/install/install_generator.rb in cucumber-rails-0.4.0.beta.1

- old
+ new

@@ -1,14 +1,12 @@ +require 'rbconfig' require File.join(File.dirname(__FILE__), 'install_base') module Cucumber - class InstallGenerator < Rails::Generators::Base - + class InstallGenerator < ::Rails::Generators::Base include Cucumber::Generators::InstallBase - DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) - argument :language, :type => :string, :banner => "LANG", :optional => true class_option :webrat, :type => :boolean, :desc => "Use Webrat" class_option :capybara, :type => :boolean, :desc => "Use Capybara" class_option :rspec, :type => :boolean, :desc => "Use RSpec" @@ -23,42 +21,32 @@ @framework = framework_from_options || detect_current_framework || detect_default_framework @driver = driver_from_options || detect_current_driver || detect_default_driver end def generate - check_upgrade_limitations - create_templates - create_scripts - create_step_definitions - create_feature_support - create_tasks - create_database unless options[:skip_database] + install_cucumber_rails(self) end def self.gem_root File.expand_path("../../../../../", __FILE__) end def self.source_root File.join(gem_root, 'templates/install') end - def cucumber_rails_env - 'test' - end - private - + def framework_from_options - return :rspec if options[:rspec] - return :testunit if options[:testunit] - return nil + return 'rspec-rails' if options[:rspec] + return 'testunit' if options[:testunit] + return 'rspec-rails' end def driver_from_options - return :webrat if options[:webrat] - return :capybara if options[:capybara] - return nil + return 'webrat' if options[:webrat] + return 'capybara' if options[:capybara] + return 'capybara' end end end \ No newline at end of file