app_generators/newgem_simple/templates/Rakefile in newgem-0.23.1 vs app_generators/newgem_simple/templates/Rakefile in newgem-0.24.0
- old
+ new
@@ -1,18 +1,20 @@
require 'rubygems'
require 'rake/gempackagetask'
+require 'rubygems/specification'
+require 'date'
-GEM = "new_gem"
-VERSION = "0.0.1"
+GEM = "<%= name %>"
+GEM_VERSION = "0.0.1"
AUTHOR = "Your Name"
EMAIL = "Your Email"
HOMEPAGE = "http://example.com"
SUMMARY = "A gem that provides..."
spec = Gem::Specification.new do |s|
s.name = GEM
- s.version = VERSION
+ s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
s.summary = SUMMARY
s.description = s.summary
@@ -30,8 +32,16 @@
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
+desc "install the gem locally"
task :install => [:package] do
- sh %{sudo gem install pkg/#{GEM}-#{VERSION}}
+ sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
+end
+
+desc "create a gemspec file"
+task :make_spec do
+ File.open("#{GEM}.gemspec", "w") do |file|
+ file.puts spec.to_ruby
+ end
end
\ No newline at end of file