Class: Lucid::Generators::Project

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/lucid/generators/project.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



13
14
15
# File 'lib/lucid/generators/project.rb', line 13

def self.source_root
  File.dirname(__FILE__) + '/project'
end

Instance Method Details

#copy_browserObject



40
41
42
43
44
# File 'lib/lucid/generators/project.rb', line 40

def copy_browser
  if driver.downcase == 'fluent'
    copy_file 'browser-fluent.rb', "#{name}/common/support/browser.rb"
  end
end

#copy_driverObject



46
47
48
49
50
# File 'lib/lucid/generators/project.rb', line 46

def copy_driver
  if driver.downcase == 'fluent'
    copy_file 'driver-fluent.rb', "#{name}/common/support/driver.rb"
  end
end

#copy_errorsObject



36
37
38
# File 'lib/lucid/generators/project.rb', line 36

def copy_errors
  copy_file 'errors.rb', "#{name}/common/support/errors.rb"
end

#copy_eventsObject



52
53
54
55
56
# File 'lib/lucid/generators/project.rb', line 52

def copy_events
  if driver.downcase == 'fluent'
    copy_file 'events-fluent.rb', "#{name}/common/support/events.rb"
  end
end

#copy_gemfileObject



58
59
60
# File 'lib/lucid/generators/project.rb', line 58

def copy_gemfile
  template 'Gemfile.tt', "#{name}/Gemfile"
end

#create_project_directoryObject



21
22
23
# File 'lib/lucid/generators/project.rb', line 21

def create_project_directory
  empty_directory(name)
end

#create_project_structureObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/lucid/generators/project.rb', line 25

def create_project_structure
  empty_directory("#{name}/specs")
  empty_directory("#{name}/common")
  empty_directory("#{name}/common/helpers")
  empty_directory("#{name}/common/support")
  empty_directory("#{name}/common/config")
  empty_directory("#{name}/common/data")
  empty_directory("#{name}/steps")
  empty_directory("#{name}/pages")
end

#spit_back_valuesObject



17
18
19
# File 'lib/lucid/generators/project.rb', line 17

def spit_back_values
  puts "Create project '#{name}' using #{driver}."
end