Class: WatirInstall::Generators::Page
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- WatirInstall::Generators::Page
- Includes:
- Thor::Actions
- Defined in:
- lib/watir_install/generators/page.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
15 16 17 |
# File 'lib/watir_install/generators/page.rb', line 15 def self.source_root "#{File.dirname(__FILE__)}/pages" end |
Instance Method Details
#git ⇒ Object
19 20 21 |
# File 'lib/watir_install/generators/page.rb', line 19 def git @git = Git.open('./') if Dir.entries('./').include?('.git') end |
#name ⇒ Object
23 24 25 |
# File 'lib/watir_install/generators/page.rb', line 23 def name Dir.pwd[/[^\/]*$/] end |
#page_files ⇒ Object
27 28 29 30 31 |
# 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 |