lib/dm-gen/templates/is/Rakefile in dm-gen-0.4.2 vs lib/dm-gen/templates/is/Rakefile in dm-gen-0.5.0
- old
+ new
@@ -1,30 +1,22 @@
-require 'pathname'
-require 'rubygems'
-require 'hoe'
+begin
+ require 'jeweler'
-ROOT = Pathname(__FILE__).dirname.expand_path
-JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+ Jeweler::Tasks.new do |gem|
+ gem.name = '<%= gem_name %>'
+ gem.summary = 'SUMMARY'
+ gem.description = gem.summary
+ gem.email = 'EMAIL'
+ gem.homepage = 'http://github.com/USERNAME/<%= gem_name %>'
+ gem.authors = [ 'NAME' ]
-require ROOT + 'lib/<%= gem_name %>/is/version'
+ gem.add_dependency 'dm-core', '~> <%= DMGen::DM_VERSION %>'
-# define some constants to help with task files
-GEM_NAME = '<%= gem_name %>'
-GEM_VERSION = DataMapper::Is::<%= class_name %>::VERSION
+ gem.add_development_dependency 'rspec', '~> 1.3'
+ end
-Hoe.new(GEM_NAME, GEM_VERSION) do |p|
- p.developer('John Doe', 'john [a] doe [d] com')
+ Jeweler::GemcutterTasks.new
- p.description = 'A DataMapper plugin that ...'
- p.summary = 'A DataMapper plugin that ...'
- p.url = 'http://github.com/USERNAME/<%= gem_name %>'
-
- p.clean_globs |= %w[ log pkg coverage ]
- p.spec_extras = { :has_rdoc => true, :extra_rdoc_files => %w[ README.txt LICENSE TODO History.txt ] }
-
- p.extra_deps << ['dm-core', "~> <%= DMGen::DM_VERSION"]
-
+ FileList['tasks/**/*.rake'].each { |task| import task }
+rescue LoadError
+ puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
end
-
-Pathname.glob(ROOT.join('tasks/**/*.rb').to_s).each { |f| require f }