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