class Cucumber::ProjectInitializer
Generates generic file structure for a cucumber project
Public Instance Methods
Source
# File lib/cucumber/project_initializer.rb, line 6 def run create_directory('features') create_directory('features/step_definitions') create_directory('features/support') create_file('features/support/env.rb') end
Private Instance Methods
Source
# File lib/cucumber/project_initializer.rb, line 15 def create_directory(directory_name) create_directory_or_file(directory_name, command: :mkdir_p) end
Source
# File lib/cucumber/project_initializer.rb, line 23 def create_directory_or_file(name, command:) if File.exist?(name) puts "#{name} already exists" else puts "creating #{name}" FileUtils.send(command, name) end end
Source
# File lib/cucumber/project_initializer.rb, line 19 def create_file(filename) create_directory_or_file(filename, command: :touch) end