Browse files

newgem should require the version file

the version constant is not only important for the gemspec, but should
also be required by the main gem file by default.
  • Loading branch information...
1 parent 9fedde2 commit a8f48732565eb2b5fae3927b991e21713daedfef @rubiii rubiii committed May 8, 2011
Showing with 7 additions and 1 deletion.
  1. +2 −0 lib/bundler/templates/newgem/lib/newgem.rb.tt
  2. +5 −1 spec/other/newgem_spec.rb
View
2 lib/bundler/templates/newgem/lib/newgem.rb.tt
@@ -1,3 +1,5 @@
+require "<%=config[:name]%>/version"
+
<%- config[:constant_array].each_with_index do |c,i| -%>
<%= ' '*i %>module <%= c %>
<%- end -%>
View
6 spec/other/newgem_spec.rb
@@ -21,4 +21,8 @@
bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /module Test\n module Gem/
bundled_app("test-gem/lib/test-gem.rb").read.should =~ /module Test\n module Gem/
end
-end
+
+ it "requires the version file" do
+ bundled_app("test-gem/lib/test-gem.rb").read.should =~ /require "test-gem\/version"/
+ end
+end

0 comments on commit a8f4873

Please sign in to comment.