class WatirInstall::Generators::Page

Public Class Methods

source_root() click to toggle source
# File lib/watir_install/generators/page.rb, line 15
def self.source_root
  "#{File.dirname(__FILE__)}/pages"
end

Public Instance Methods

git() click to toggle source
# File lib/watir_install/generators/page.rb, line 19
def git
  @git = Git.open('./') if Dir.entries('./').include?('.git')
end
name() click to toggle source
# File lib/watir_install/generators/page.rb, line 23
def name
  Dir.pwd[/[^\/]*$/]
end
page_files() click to toggle source
# File lib/watir_install/generators/page.rb, line 27
def page_files
  file = "#{Dir.pwd}/spec/support/pages/#{klass.downcase.gsub('::', '/')}.rb"
  template "spec/support/pages/page.rb.tt", file
  @git.add(file) if @git
end