Class: Cucumber::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Generators::InstallBase
Defined in:
lib/generators/cucumber/install/install_generator.rb

Constant Summary collapse

DEFAULT_SHEBANG =
File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Generators::InstallBase

#check_upgrade_limitations, #configure_gemfile, #create_database, #create_feature_support, #create_scripts, #create_step_definitions, #create_tasks, #create_templates, #print_instructions

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver.



19
20
21
# File 'lib/generators/cucumber/install/install_generator.rb', line 19

def driver
  @driver
end

#frameworkObject (readonly)

Returns the value of attribute framework.



19
20
21
# File 'lib/generators/cucumber/install/install_generator.rb', line 19

def framework
  @framework
end

Class Method Details

.gem_rootObject



37
38
39
# File 'lib/generators/cucumber/install/install_generator.rb', line 37

def self.gem_root
  File.expand_path("../../../../../", __FILE__)
end

.source_rootObject



41
42
43
# File 'lib/generators/cucumber/install/install_generator.rb', line 41

def self.source_root
  File.join(gem_root, 'templates/install')
end

Instance Method Details

#configure_defaultsObject



21
22
23
24
25
# File 'lib/generators/cucumber/install/install_generator.rb', line 21

def configure_defaults
  @language ||= 'en'
  @framework  = framework_from_options || detect_current_framework || detect_default_framework
  @driver     = driver_from_options    || detect_current_driver    || detect_default_driver
end

#cucumber_rails_envObject



45
46
47
# File 'lib/generators/cucumber/install/install_generator.rb', line 45

def cucumber_rails_env
  'test'
end

#generateObject



27
28
29
30
31
32
33
34
35
# File 'lib/generators/cucumber/install/install_generator.rb', line 27

def generate
  check_upgrade_limitations
  create_templates
  create_scripts
  create_step_definitions
  create_feature_support
  create_tasks
  create_database unless options[:skip_database]
end