Permalink
Browse files

Using Project open struct

  • Loading branch information...
1 parent 7a5b05e commit d5b167701bc4dd8cd3fdfa49864be8bf57e26f13 @jimweirich jimweirich committed Oct 12, 2010
Showing with 17 additions and 9 deletions.
  1. +9 −1 Rakefile
  2. +8 −8 rakelib/gem.rake
View
10 Rakefile
@@ -1,8 +1,16 @@
#!/usr/bin/ruby -wKU
+require 'rake/clean'
require './lib/rspec-collection/version'
-$package_version = RSpecCollection::VERSION
+CLOBBER.include('*.gemspec')
+
+Project = OpenStruct.new(
+ :name => "rspec-collection",
+ :version => RSpecCollection::VERSION,
+ :author => "Jim Weirich",
+ :author_email => "jim@edgecase.com",
+ :home_page => "http://github.com/jimweirich/rspec-collection")
task :default => :spec
View
16 rakelib/gem.rake
@@ -14,8 +14,8 @@ else
#### Basic information.
- s.name = 'rspec-collection'
- s.version = $package_version
+ s.name = Project.name
+ s.version = Project.version
s.summary = "Allow RSpec assertions over the elements of a collection."
s.description = <<-EOF
For example:
@@ -43,22 +43,22 @@ else
#### Author and project details.
- s.author = "Jim Weirich"
- s.email = "jim@edgecase.com"
- s.homepage = "http://github.com/jimweirich/rspec-collection"
- s.rubyforge_project = ""
+ s.author = Project.author
+ s.email = Project.author_email
+ s.homepage = Project.home_page
+ s.rubyforge_project = "n/a"
end
Rake::GemPackageTask.new(SPEC) do |pkg|
pkg.need_zip = false
pkg.need_tar = false
end
- file "rspec-collection.gemspec" => ["Rakefile", "rakelib/gem.rake"] do |t|
+ file "#{Project.name}.gemspec" => ["Rakefile", "rakelib/gem.rake"] do |t|
require 'yaml'
open(t.name, "w") { |f| f.puts SPEC.to_yaml }
end
desc "Create a stand-alone gemspec"
- task :gemspec => "rspec-collection.gemspec"
+ task :gemspec => "#{Project.name}.gemspec"
end

0 comments on commit d5b1677

Please sign in to comment.