18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/pickaxe/generator.rb', line 18
def setup_project
remove_file "#{gem_name}/Rakefile"
remove_file "#{gem_name}/Gemfile"
directory "test"
template 'test_helper.tt', "#{gem_name}/test/test_helper.rb"
template 'Guardfile.tt', "#{gem_name}/Guardfile"
template 'Gemfile.tt', "#{gem_name}/Gemfile"
template 'Rakefile.tt', "#{gem_name}/Rakefile"
inside gem_name do
create_file "test/#{gem_name}_test.rb" do
<<-EOS
require 'test_helper'
describe #{gem_name.classify} do
subject { #{gem_name.classify} }
end
EOS
end
append_to_file "test/test_helper.rb" do
"require '#{gem_name}'"
end
end
bundle
commit "Initial gem creation with testing!"
end
|