Class: Venom::Generators::Workshop
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Venom::Generators::Workshop
- Includes:
- Thor::Actions
- Defined in:
- lib/venom/generators/workshop.rb
Class Method Summary collapse
Instance Method Summary collapse
- #copy_base ⇒ Object
- #copy_driver ⇒ Object
- #copy_dsl_runner ⇒ Object
- #copy_env ⇒ Object
- #copy_errors ⇒ Object
- #copy_gemfile ⇒ Object
- #copy_hooks ⇒ Object
- #copy_rakefile ⇒ Object
- #create_definitions_directory ⇒ Object
- #create_library_directory ⇒ Object
- #create_workshop_directory ⇒ Object
- #create_workshop_structure ⇒ Object
- #spit_back_values ⇒ Object
Class Method Details
.source_root ⇒ Object
15 16 17 |
# File 'lib/venom/generators/workshop.rb', line 15 def self.source_root File.dirname(__FILE__) + "/workshop" end |
Instance Method Details
#copy_base ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/venom/generators/workshop.rb', line 83 def copy_base if use_library template "base.rb.tt", "#{name}/lib/definitions/base.rb" else template "base.rb.tt", "#{name}/specs/definitions/base.rb" end end |
#copy_driver ⇒ Object
67 68 69 |
# File 'lib/venom/generators/workshop.rb', line 67 def copy_driver template "driver.rb.tt", "#{name}/specs/support/driver.rb" end |
#copy_dsl_runner ⇒ Object
55 56 57 |
# File 'lib/venom/generators/workshop.rb', line 55 def copy_dsl_runner copy_file "cucumber.yml", "#{name}/cucumber.yml" end |
#copy_env ⇒ Object
71 72 73 |
# File 'lib/venom/generators/workshop.rb', line 71 def copy_env template "env.rb.tt", "#{name}/specs/support/env.rb" end |
#copy_errors ⇒ Object
79 80 81 |
# File 'lib/venom/generators/workshop.rb', line 79 def copy_errors copy_file "errors.rb", "#{name}/specs/support/errors.rb" end |
#copy_gemfile ⇒ Object
63 64 65 |
# File 'lib/venom/generators/workshop.rb', line 63 def copy_gemfile template "Gemfile.tt", "#{name}/Gemfile" end |
#copy_hooks ⇒ Object
75 76 77 |
# File 'lib/venom/generators/workshop.rb', line 75 def copy_hooks template "hooks.rb.tt", "#{name}/specs/support/hooks.rb" end |
#copy_rakefile ⇒ Object
59 60 61 |
# File 'lib/venom/generators/workshop.rb', line 59 def copy_rakefile copy_file "Rakefile", "#{name}/Rakefile" end |
#create_definitions_directory ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/venom/generators/workshop.rb', line 47 def create_definitions_directory if use_library empty_directory("#{name}/lib/definitions") else empty_directory("#{name}/specs/definitions") end end |
#create_library_directory ⇒ Object
29 30 31 |
# File 'lib/venom/generators/workshop.rb', line 29 def create_library_directory empty_directory("#{name}/lib") if use_library end |
#create_workshop_directory ⇒ Object
25 26 27 |
# File 'lib/venom/generators/workshop.rb', line 25 def create_workshop_directory empty_directory(name) end |
#create_workshop_structure ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/venom/generators/workshop.rb', line 33 def create_workshop_structure empty_directory("#{name}/specs") empty_directory("#{name}/specs/support") if use_library empty_directory("#{name}/lib/test_steps") empty_directory("#{name}/lib/test_data") empty_directory("#{name}/lib/test_helpers") else empty_directory("#{name}/specs/support/test_steps") empty_directory("#{name}/specs/support/test_data") empty_directory("#{name}/specs/support/test_helpers") end end |
#spit_back_values ⇒ Object
19 20 21 22 23 |
# File 'lib/venom/generators/workshop.rb', line 19 def spit_back_values puts "Create workshop '#{name}' using #{driver}." puts "Use a separate library." if use_library puts "Restart browser for each scenario." if restart_browser end |