lib/watir_install/generators/page.rb in watir_install-0.3.0 vs lib/watir_install/generators/page.rb in watir_install-0.3.1
- old
+ new
@@ -14,15 +14,21 @@
def self.source_root
"#{File.dirname(__FILE__)}/pages"
end
+ def git
+ @git = Git.open('./') if Dir.entries('./').include?('.git')
+ end
+
def name
Dir.pwd[/[^\/]*$/]
end
- def data_files
- template "spec/support/pages/page.rb.tt", "#{Dir.pwd}/spec/support/pages/#{klass.downcase.gsub('::', '/')}.rb"
+ 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
end
end
end
\ No newline at end of file