Extracted version from gemspec and placed it in its own file. This is consistent with the approach taken by "bundle gem", and is expected by gems such as svenfuchs/gem-release which can be used to bump / tag versions of gems.

This commit is contained in:
Dan Gebhardt
2011-07-26 18:51:44 -04:00
parent 5515a18aa5
commit d9b59c341c
3 changed files with 11 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ module Rails
def lib
template "lib/%name%.rb"
template "lib/tasks/%name%_tasks.rake"
template "lib/%name%/version.rb"
if full?
template "lib/%name%/engine.rb"
end

View File

@@ -1,8 +1,12 @@
# Provide a simple gemspec so you can easily use your
# project in your rails apps through git.
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "<%= name %>/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "<%= name %>"
s.version = "0.0.1"
s.version = <%= camelized %>::VERSION
s.authors = ["TODO: Your name"]
s.email = ["TODO: Your email"]
s.homepage = "TODO"

View File

@@ -0,0 +1,3 @@
module <%= camelized %>
VERSION = "0.0.1"
end