Rakefile in struct_packing-0.0.1 vs Rakefile in struct_packing-0.0.2
- old
+ new
@@ -1,26 +1,53 @@
+# encoding: utf-8
+
require 'rubygems'
-gem 'hoe', '>= 2.1.0'
-require 'hoe'
-require 'fileutils'
-require './lib/struct_packing'
+require 'bundler'
+begin
+ Bundler.setup(:default, :development)
+rescue Bundler::BundlerError => e
+ $stderr.puts e.message
+ $stderr.puts "Run `bundle install` to install missing gems"
+ exit e.status_code
+end
+require 'rake'
-Hoe.plugin :newgem
-# Hoe.plugin :website
-# Hoe.plugin :cucumberfeatures
+require 'jeweler'
+Jeweler::Tasks.new do |gem|
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
+ gem.name = "struct_packing"
+ gem.homepage = "http://github.com/TOKITAHiroshi/struct_packing"
+ gem.license = "MIT"
+ gem.summary = %Q{* Read/Write ruby object to byte array with C-like struct declarations.}
+ gem.description = %Q{* Read/Write ruby object to byte array with C-like struct declarations.}
+ gem.email = ["tokita.hiroshi@gmail.com"]
+ gem.authors = ["TOKITA Hiroshi"]
+ # dependencies defined in Gemfile
+end
+Jeweler::RubygemsDotOrgTasks.new
-# Generate all the Rake tasks
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
-$hoe = Hoe.spec 'struct_packing' do
- self.developer 'TOKITA Hiroshi', 'tokita.hiroshi@gmail.com'
- self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
- self.rubyforge_name = self.name # TODO this is default value
- # self.extra_deps = [['activesupport','>= 2.0.2']]
-
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
end
+=begin
+require 'rcov/rcovtask'
+Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+ test.rcov_opts << '--exclude "gems/*"'
+end
+=end
+task :default => :test
-require 'newgem/tasks'
-Dir['tasks/**/*.rake'].each { |t| load t }
+require 'rdoc/task'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
-# TODO - want other tests/tasks run by default? Add them to the list
-# remove_task :default
-# task :default => [:spec, :features]
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "struct_packing #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end