Skip to content
Browse files

Align -plugins Rakefiles with those in -core and -more.

  • Loading branch information...
1 parent afa4528 commit 0652b5e085cba961f4fe3d8a0083d389348bb39a @michaelklishin michaelklishin committed Aug 3, 2008
Showing with 397 additions and 198 deletions.
  1. +41 −22 merb_activerecord/Rakefile
  2. +59 −30 merb_helpers/Rakefile
  3. +56 −23 merb_laszlo/Rakefile
  4. +56 −31 merb_param_protection/Rakefile
  5. +46 −24 merb_screw_unit/Rakefile
  6. +59 −27 merb_sequel/Rakefile
  7. +35 −20 merb_stories/Rakefile
  8. +45 −21 merb_test_unit/Rakefile
View
63 merb_activerecord/Rakefile
@@ -1,45 +1,64 @@
require 'rubygems'
require 'rake/gempackagetask'
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
-NAME = "merb_activerecord"
-GEM_VERSION = "0.9.4"
-AUTHOR = "Duane Johnson"
-EMAIL = "canadaduane@gmail.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Merb plugin that provides ActiveRecord support for Merb"
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Merb plugin that provides ActiveRecord support for Merb"
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Duane Johnson"
+GEM_EMAIL = "canadaduane@gmail.com"
+
+GEM_NAME = "merb_activerecord"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
+
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
spec = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
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
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
- s.add_dependency("merb-core", ">= 0.9.4")
- s.require_path = "lib"
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,activerecord_generators}/**/*")
-end
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
+ s.add_dependency('merb-core', '>= 0.9.4')
+ s.require_path = 'lib'
+ s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,activerecord_generators}/**/*") end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
-desc "Install merb_activerecord"
-task :install => :package do
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri --no-update-sources}
+desc "Install the gem"
+task :install => [:package] do
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
end
namespace :jruby do
desc "Run :package and install the resulting .gem with jruby"
task :install => :package do
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
-end
+end
+
+desc "Run all specs"
+Spec::Rake::SpecTask.new("specs") do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir["spec/**/*_spec.rb"].sort
+end
View
89 merb_helpers/Rakefile
@@ -1,29 +1,42 @@
require 'rubygems'
require 'rake/gempackagetask'
-require 'rake/rdoctask'
-require 'spec/rake/spectask'
+require "rake/rdoctask"
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
-NAME = "merb_helpers"
-GEM_VERSION = "0.9.4"
-AUTHOR = "Yehuda Katz"
-EMAIL = "wycats@gmail.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Helper support for merb (similar to the Rails form helpers)"
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Helper support for merb (similar to the Rails form helpers)"
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Yehuda Katz"
+GEM_EMAIL = "ykatz@engineyard.com"
+
+GEM_NAME = "merb_helpers"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
+
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
spec = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
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
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
- s.add_dependency("merb-core", ">=0.9.4")
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
+ s.add_dependency('merb-core', '>= 0.9.4')
s.require_path = 'lib'
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
end
@@ -32,24 +45,28 @@ Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
-desc "Run :package and install resulting .gem"
-task :install => [:spec, :package] do
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri --no-update-sources}
+##############################################################################
+# Installation
+##############################################################################
+desc "Install the gem"
+task :install => [:package] do
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
end
-Rake::RDocTask.new do |rdoc|
- files = ['README', 'LICENSE',
- 'lib/**/*.rb']
- rdoc.rdoc_files.add(files)
- rdoc.main = 'README'
- rdoc.title = 'Merb Helper Docs'
- rdoc.rdoc_dir = 'doc/rdoc'
- rdoc.options << '--line-numbers' << '--inline-source'
+namespace :jruby do
+ desc "Run :package and install the resulting .gem with jruby"
+ task :install => :package do
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ end
end
-Spec::Rake::SpecTask.new do |t|
- t.spec_opts = ["--format", "specdoc", "--colour"]
- t.spec_files = Dir['spec/**/*_spec.rb'].sort
+##############################################################################
+# Specs
+##############################################################################
+desc "Run all specs"
+Spec::Rake::SpecTask.new("specs") do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir["spec/**/*_spec.rb"].sort
end
desc "Run all specs and generate an rcov report"
@@ -61,3 +78,15 @@ Spec::Rake::SpecTask.new('rcov') do |t|
t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
end
+##############################################################################
+# Documentation
+##############################################################################
+Rake::RDocTask.new do |rdoc|
+ files = ['README', 'LICENSE',
+ 'lib/**/*.rb']
+ rdoc.rdoc_files.add(files)
+ rdoc.main = 'README'
+ rdoc.title = 'Merb Helper Docs'
+ rdoc.rdoc_dir = 'doc/rdoc'
+ rdoc.options << '--line-numbers' << '--inline-source'
+end
View
79 merb_laszlo/Rakefile
@@ -1,54 +1,87 @@
require 'rubygems'
-require 'rake/gempackagetask'
require 'rubygems/specification'
require 'date'
+require 'rake/gempackagetask'
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
+
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Merb plugin that provides support for Laszlo."
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Yehuda Katz"
+GEM_EMAIL = "ykatz@engineyard.com"
+
+GEM_NAME = "merb_laszlo"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = "0.5.0" + PKG_BUILD
-NAME = "merb-laszlo"
-GEM_VERSION = "0.5.0"
-AUTHOR = "Yehuda Katz"
-EMAIL = "wycats@gmail.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Merb plugin that provides support for Laszlo"
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
spec = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README", "LICENSE"]
- s.summary = SUMMARY
- s.description = s.summary
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
s.add_dependency('merb-core', '>= 0.9.4')
s.require_path = 'lib'
- s.files = %w(LICENSE README Rakefile) + Dir.glob("{lib,spec}/**/*")
+ s.files = %w(LICENSE README Rakefile) + Dir.glob("{lib,specs}/**/*")
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
-desc "install the plugin locally"
-task :install => [:package] do
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-update-sources}
-end
-
desc "create a gemspec file"
task :make_spec do
File.open("#{NAME}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end
-namespace :jruby do
+##############################################################################
+# Installation
+##############################################################################
+
+task :install => [:package] do
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
+end
- desc "Run :package and install the resulting .gem with jruby"
+namespace :jruby do
+"Run :package and install the resulting .gem with jruby"
task :install => :package do
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
+end
+
+##############################################################################
+# Specs
+##############################################################################
+desc "Run all specs"
+Spec::Rake::SpecTask.new("specs") do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir["spec/**/*_spec.rb"].sort
+end
+desc "Run all specs and generate an rcov report"
+Spec::Rake::SpecTask.new('rcov') do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.rcov = true
+ t.rcov_dir = 'coverage'
+ t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
end
View
87 merb_param_protection/Rakefile
@@ -1,62 +1,87 @@
require 'rubygems'
+require 'rubygems/specification'
require 'rake/gempackagetask'
-require 'spec/rake/spectask'
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
-NAME = "merb_param_protection"
-GEM_VERSION = "0.9.4"
-AUTHOR = "Lance Carlson"
-EMAIL = "lancecarlson@gmail.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Merb plugin that provides params_accessible and params_protected class methods"
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Merb plugin that provides params_accessible and params_protected class methods"
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Lance Carlson"
+GEM_EMAIL = "lancecarlson@gmail.com"
+
+GEM_NAME = "merb_param_protection"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
+
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
spec = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
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
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
+ s.extra_rdoc_files = ["README", "LICENSE"]
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
s.add_dependency('merb-core', '>= 0.9.4')
s.require_path = 'lib'
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
+ s.files = %w(LICENSE README Rakefile) + Dir.glob("{lib,specs}/**/*")
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
-desc "install merb_param_protection"
-task :install => [:specs, :package] do
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri --no-update-sources}
+desc "create a gemspec file"
+task :make_spec do
+ File.open("#{NAME}.gemspec", "w") do |file|
+ file.puts spec.to_ruby
+ end
end
-namespace :jruby do
+##############################################################################
+# Installation
+##############################################################################
- desc "Run :package and install the resulting .gem with jruby"
+desc "Install the gem"
+task :install => [:package] do
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
+end
+
+namespace :jruby do
+"Run :package and install the resulting .gem with jruby"
task :install => :package do
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
-
end
+##############################################################################
+# Specs
+##############################################################################
desc "Run all specs"
-Spec::Rake::SpecTask.new('specs') do |t|
+Spec::Rake::SpecTask.new("specs") do |t|
t.spec_opts = ["--format", "specdoc", "--colour"]
- t.spec_files = Dir['spec/**/*_spec.rb'].sort
+ t.spec_files = Dir["spec/**/*_spec.rb"].sort
end
-desc "RCov"
-Spec::Rake::SpecTask.new("rcov") do |t|
- t.rcov_opts = ["--exclude", "gems", "--exclude", "spec"]
+desc "Run all specs and generate an rcov report"
+Spec::Rake::SpecTask.new('rcov') do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ["--format", "specdoc", "--colour"]
- t.rcov_opts = ["--exclude","gems", "--exclude", "spec"]
- t.spec_files = Dir["spec/**/*_spec.rb"].sort
- t.libs = ["lib", "server/lib" ]
t.rcov = true
+ t.rcov_dir = 'coverage'
+ t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
end
View
70 merb_screw_unit/Rakefile
@@ -1,29 +1,42 @@
require 'rubygems'
+require 'rubygems/specification'
require 'rake/gempackagetask'
-require 'spec/rake/spectask'
-require 'merb-core/version'
-require 'merb-core/test/tasks/spectasks'
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
-NAME = "merb_screw_unit"
-AUTHOR = "Yehuda Katz"
-EMAIL = "wycats@gmail.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Merb Slice that provides support for Screw.Unit testing"
-GEM_VERSION = "0.9.4"
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Merb Slice that provides support for Screw.Unit testing"
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Yehuda Katz"
+GEM_EMAIL = "ykatz@engineyard.com"
+
+GEM_NAME = "merb_screw_unit"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
+
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
spec = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
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
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
+ s.extra_rdoc_files = ["README", "LICENSE"]
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
+ s.add_dependency('merb-core', '>= 0.9.4')
s.add_dependency('merb-slices', '>= 0.9.4')
s.require_path = 'lib'
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,spec,app,public,stubs}/**/*")
@@ -33,16 +46,25 @@ Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
-desc "Install MerbScrewUnit as a gem"
+desc "create a gemspec file"
+task :make_spec do
+ File.open("#{NAME}.gemspec", "w") do |file|
+ file.puts spec.to_ruby
+ end
+end
+
+##############################################################################
+# Installation
+##############################################################################
+
+desc "Install the gem"
task :install => [:package] do
- sh %{#{sudo} gem install pkg/#{NAME}-#{GEM_VERSION} --no-update-sources}
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
end
namespace :jruby do
-
- desc "Run :package and install the resulting .gem with jruby"
+"Run :package and install the resulting .gem with jruby"
task :install => :package do
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
-
-end
+end
View
86 merb_sequel/Rakefile
@@ -1,47 +1,79 @@
-require "rubygems"
-require "rake/gempackagetask"
+require 'rubygems'
+require 'rake/gempackagetask'
+require "rake/rdoctask"
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
-NAME = "merb_sequel"
-GEM_VERSION = "0.9.4"
-AUTHOR = "Wayne E. Seguin, Lance Carlson"
-EMAIL = "wayneeseguin@gmail.com, lancecarlson@gmail.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Merb plugin that provides support for Sequel and Sequel::Model"
-
-specification = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
- s.email = EMAIL
- s.author = AUTHOR
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Merb plugin that provides support for Sequel and Sequel::Model"
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Wayne E. Seguin, Lance Carlson"
+GEM_EMAIL = "wayneeseguin@gmail.com, lancecarlson@gmail.com"
+
+GEM_NAME = "merb_sequel"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
+
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
+
+spec = Gem::Specification.new do |s|
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
s.version = GEM_VERSION
- s.summary = SUMMARY
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
- s.homepage = HOMEPAGE
- s.description = SUMMARY
- s.require_path = "lib"
s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
-
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
s.add_dependency("merb-core", ">= 0.9.4")
s.add_dependency("sequel", ">= 1.4.0")
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,sequel_generators}/**/*")
end
-Rake::GemPackageTask.new(specification) do |package|
- package.gem_spec = specification
+Rake::GemPackageTask.new(spec) do |pkg|
+ pkg.gem_spec = spec
end
-desc "Install merb_sequel"
-task :install => :package do
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri --no-update-sources}
+##############################################################################
+# Installation
+##############################################################################
+desc "Install the gem"
+task :install => [:package] do
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
end
namespace :jruby do
-
desc "Run :package and install the resulting .gem with jruby"
task :install => :package do
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
+end
-end
+##############################################################################
+# Specs
+##############################################################################
+desc "Run all specs"
+Spec::Rake::SpecTask.new("specs") do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir["spec/**/*_spec.rb"].sort
+end
+
+desc "Run all specs and generate an rcov report"
+Spec::Rake::SpecTask.new('rcov') do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.rcov = true
+ t.rcov_dir = 'coverage'
+ t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
+end
View
55 merb_stories/Rakefile
@@ -1,46 +1,61 @@
require 'rubygems'
require 'rake/gempackagetask'
+require "rake/rdoctask"
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
-NAME = "merb_stories"
-GEM_VERSION = "0.9.4"
-AUTHOR = "Yehuda Katz"
-EMAIL = "ykatz@engineyard.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Merb plugin that provides RSpec support"
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Merb plugin that provides RSpec stories support"
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Yehuda Katz"
+GEM_EMAIL = "ykatz@engineyard.com"
+
+GEM_NAME = "merb_stories"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
+
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
spec = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
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
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
- s.add_dependency('merb-core', '>= 0.9.4')
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
s.add_dependency('rspec', '>= 1.1.3')
s.require_path = 'lib'
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,rspec_generators}/**/*")
+ s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,rspec_generators}/**/*")
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
-desc "Install merb_rspec"
+##############################################################################
+# Installation
+##############################################################################
+desc "Install the gem"
task :install => [:package] do
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri --no-update-sources}
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
end
namespace :jruby do
-
desc "Run :package and install the resulting .gem with jruby"
task :install => :package do
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
-
end
View
66 merb_test_unit/Rakefile
@@ -1,45 +1,69 @@
require 'rubygems'
+require 'rubygems/specification'
require 'rake/gempackagetask'
+require "extlib"
require 'merb-core/tasks/merb_rake_helper'
+require "spec/rake/spectask"
-NAME = "merb_test_unit"
-GEM_VERSION = "0.9.4"
-AUTHOR = "Yehuda Katz"
-EMAIL = "ykatz@engineyard.com"
-HOMEPAGE = "http://merbivore.com/"
-SUMMARY = "Merb plugin that provides Test::Unit support"
+##############################################################################
+# Package && release
+##############################################################################
+RUBY_FORGE_PROJECT = "merb"
+PROJECT_URL = "http://merbivore.com"
+PROJECT_SUMMARY = "Merb plugin that provides Test::Unit support"
+PROJECT_DESCRIPTION = PROJECT_SUMMARY
+
+GEM_AUTHOR = "Yehuda Katz"
+GEM_EMAIL = "ykatz@engineyard.com"
+
+GEM_NAME = "merb_test_unit"
+PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
+GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
+
+RELEASE_NAME = "REL #{GEM_VERSION}"
+
+require "extlib/tasks/release"
spec = Gem::Specification.new do |s|
- s.rubyforge_project = 'merb'
- s.name = NAME
+ s.rubyforge_project = RUBY_FORGE_PROJECT
+ s.name = GEM_NAME
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
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
+ s.extra_rdoc_files = ["README", "LICENSE"]
+ s.summary = PROJECT_SUMMARY
+ s.description = PROJECT_DESCRIPTION
+ s.author = GEM_AUTHOR
+ s.email = GEM_EMAIL
+ s.homepage = PROJECT_URL
s.add_dependency('merb-core', '>= 0.9.4')
s.require_path = 'lib'
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,test_unit_generators}/**/*")
+ s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,test_unit_generators}/**/*")
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
-desc "Install merb_test_unit"
+desc "create a gemspec file"
+task :make_spec do
+ File.open("#{NAME}.gemspec", "w") do |file|
+ file.puts spec.to_ruby
+ end
+end
+
+##############################################################################
+# Installation
+##############################################################################
+
+desc "Install the gem"
task :install => [:package] do
- sh %{#{sudo} gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri --no-update-sources}
+ sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
end
namespace :jruby do
-
- desc "Run :package and install the resulting .gem with jruby"
+"Run :package and install the resulting .gem with jruby"
task :install => :package do
- sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
+ sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
-
end

0 comments on commit 0652b5e

Please sign in to comment.
Something went wrong with that request. Please try again.