Skip to content

Commit

Permalink
Generate initial .gitignore file with sane defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Reagan committed Jan 5, 2009
1 parent 905684a commit 554d7fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec = Gem::Specification.new do |s|
s.email = 'reaganpr@gmail.com'
s.homepage = 'http://sneaq.net'
s.executables = ['simple-gem']
s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,test,templates}/**/*")
s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,test,templates}/**/.?*")
end

Rake::GemPackageTask.new(spec) do |pkg|
Expand Down
1 change: 1 addition & 0 deletions lib/simple_gem/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def ruby_name
def generate
generate_root_directory
generate_subdirectories
generate_file('.gitignore.erb', '.gitignore')
generate_file('lib.rb.erb', "lib/#{self.ruby_name}.rb")
generate_file('lib_version.rb.erb', "lib/#{self.ruby_name}/version.rb")
generate_file('Rakefile.erb', 'Rakefile')
Expand Down
3 changes: 3 additions & 0 deletions templates/.gitignore.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/pkg/
/doc/
/coverage/
4 changes: 4 additions & 0 deletions test/simple_gem/gem_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def self.should_generate(expectations)
it "should generate the test file" do
File.exist?("#{@tmp_dir}/#{@name}/test/unit/simple_gem_test.rb").should == true
end

it "should generate the .gitignore file" do
File.exist?("#{@tmp_dir}/#{@name}/.gitignore").should == true
end

end

Expand Down

0 comments on commit 554d7fe

Please sign in to comment.