Rakefile in ripple-0.6.1 vs Rakefile in ripple-0.7.0
- old
+ new
@@ -1,61 +1,74 @@
require 'rubygems'
-require 'rake'
-require 'rake/clean'
+require 'rake/gempackagetask'
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "ripple"
- gem.summary = %Q{ripple is a rich Ruby client for Riak, Basho's distributed database.}
- gem.description = %Q{ripple is a rich Ruby client for Riak, Basho's distributed database. It includes all the basics of accessing and manipulating Riak buckets and objects, and an object mapper library for building a rich domain on top of Riak.}
- gem.email = "seancribbs@gmail.com"
- gem.homepage = "http://seancribbs.github.com/ripple"
- gem.authors = ["Sean Cribbs"]
- gem.add_development_dependency "rspec", ">= 1.3"
- gem.add_development_dependency "fakeweb", ">=1.2"
- gem.add_development_dependency "rack", ">=1.0"
- gem.add_development_dependency "yard", ">=0.5.2"
- gem.add_development_dependency "curb", ">=0.6"
- gem.add_dependency "activesupport", "~>3.0.0.beta"
- gem.add_dependency "activemodel", "~>3.0.0.beta"
- gem.requirements << "`gem install curb` for better HTTP performance"
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+version = File.read('../VERSION').strip
+
+gemspec = Gem::Specification.new do |gem|
+ gem.name = "ripple"
+ gem.summary = %Q{ripple is an object-mapper library for Riak, the distributed database by Basho.}
+ gem.description = %Q{ripple is an object-mapper library for Riak, the distributed database by Basho. It uses ActiveModel to provide an experience that integrates well with Rails 3 applications.}
+ gem.version = version
+ gem.email = "seancribbs@gmail.com"
+ gem.homepage = "http://seancribbs.github.com/ripple"
+ gem.authors = ["Sean Cribbs"]
+ gem.add_development_dependency "rspec", "~>2.0.0.beta.6"
+ gem.add_dependency "riak-client", version
+ gem.add_dependency "activesupport", "3.0.0.beta3"
+ gem.add_dependency "activemodel", "3.0.0.beta3"
+
+ files = FileList["**/*"]
+ files.exclude /\.DS_Store/
+ files.exclude /\#/
+ files.exclude /~/
+ files.exclude /\.swp/
+ files.exclude '**/._*'
+ files.exclude '**/*.orig'
+ files.exclude '**/*.rej'
+ files.exclude /^pkg/
+ files.exclude 'ripple.gemspec'
+
+ gem.files = files.to_a
+
+ gem.test_files = FileList["spec/**/*.rb"].to_a
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
+# Gem packaging tasks
+Rake::GemPackageTask.new(gemspec) do |pkg|
+ pkg.need_zip = false
+ pkg.need_tar = false
end
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
- spec.rcov_opts = ['--exclude', 'lib\/spec,bin\/spec,config\/boot.rb,gems,spec_helper']
+task :gem => :gemspec
+
+desc %{Build the gemspec file.}
+task :gemspec do
+ gemspec.validate
+ File.open("#{gemspec.name}.gemspec", 'w'){|f| f.write gemspec.to_ruby }
end
-task :spec => :check_dependencies
+desc %{Release the gem to RubyGems.org}
+task :release => :gem do
+ "gem push pkg/#{gemspec.name}-#{gemspec.version}.gem"
+end
-task :default => :spec
+require 'rspec/core'
+require 'rspec/core/rake_task'
-require 'yard'
-YARD::Rake::YardocTask.new do |yard|
- docfiles = FileList['lib/**/*.rb', 'README*', 'VERSION', 'LICENSE', 'RELEASE_NOTES.textile']
- yard.files = docfiles
- yard.options = ["--no-private"]
+desc "Run Unit Specs Only"
+Rspec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = "spec/ripple/**/*_spec.rb"
end
-task :doc => :yard do
- original_dir = Dir.pwd
- docs_dir = File.expand_path(File.join(original_dir, "..", "ripple-docs"))
- rm_rf File.join(docs_dir, "*")
- cp_r File.join(original_dir, "doc", "."), docs_dir
- touch File.join(docs_dir, '.nojekyll')
+namespace :spec do
+ desc "Run Integration Specs Only"
+ Rspec::Core::RakeTask.new(:integration) do |spec|
+ spec.pattern = "spec/integration/**/*_spec.rb"
+ end
+
+ desc "Run All Specs"
+ Rspec::Core::RakeTask.new(:all) do |spec|
+ spec.pattern = "spec/**/*_spec.rb"
+ end
end
-CLOBBER.include(".yardoc")
-CLOBBER.include("doc")
+task :default => :spec