Class: WatirInstall::Generators::Data

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

Constant Summary collapse

TRANSLATIONS =
%i(full_name first_name last_name name_prefix name_suffix
title street_address secondary_address city state state_abbr zip_code
country company_name catch_phrase credit_card_number credit_card_type
words sentence sentences paragraphs characters email_address domain_name
url user_name phone_number cell_phone password).freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



20
21
22
# File 'lib/watir_install/generators/data.rb', line 20

def self.source_root
  "#{File.dirname(__FILE__)}/data"
end

Instance Method Details

#data_filesObject



32
33
34
35
36
# File 'lib/watir_install/generators/data.rb', line 32

def data_files
  file = "#{Dir.pwd}/spec/support/data/#{klass.downcase}.rb"
  template "spec/support/data/data.rb.tt", file
  @git.add(file) if @git
end

#gitObject



24
25
26
# File 'lib/watir_install/generators/data.rb', line 24

def git
  @git = Git.open('./') if Dir.entries('./').include?('.git')
end

#nameObject



28
29
30
# File 'lib/watir_install/generators/data.rb', line 28

def name
  Dir.pwd[/[^\/]*$/]
end