Rakefile in spraypaint-1.0.0 vs Rakefile in spraypaint-1.0.1
- old
+ new
@@ -1,21 +1,52 @@
$: << File.expand_path(File.join(File.dirname(__FILE__), "lib"))
-$: << File.expand_path(File.join(File.dirname(__FILE__), "vendor/penknife/lib"))
-require 'penknife/rake/plugin_tasks'
+require 'spraypaint'
+require 'spec/rake/spectask' rescue nil
namespace :spraypaint do
- Penknife::Rake::PluginTasks.new do |plugin|
- plugin.plugin_root = File.dirname(File.expand_path(__FILE__))
- plugin.name = 'spraypaint'
- plugin.summary = 'Simple tagging in a can'
- plugin.authors = ['Tom Ward (tomafro)']
- plugin.email = 'tom@popdog.net'
- plugin.homepage = 'http://github.com/tomafro/spraypaint'
- plugin.code = 'http://github.com/tomafro/spraypaint.git'
- plugin.license = 'MIT'
- plugin.rails_version = '2.3+'
- plugin.files = `git ls-files`.split("\n")
+ begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "spraypaint"
+ gemspec.version = Spraypaint::Version::STRING
+ gemspec.summary = "Simple tagging plugin for rails"
+ gemspec.description = "Simple tagging in a can"
+ gemspec.email = "tom@popdog.net"
+ gemspec.homepage = "http://github.com/tomafro/spraypaint.git"
+ gemspec.authors = ['Tom Ward']
+ end
+ rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+ end
+
+ if Object.const_defined?(:Spec)
+ desc "Run specs for spraypaint"
+ Spec::Rake::SpecTask.new(:spec) do |t|
+ t.spec_opts = ["-f n -c"]
+ t.spec_files = FileList["#{File.dirname(__FILE__)}/test/spec/**/*_spec.rb"]
+ end
+ else
+ task :spec do
+ puts "To run specs for spraypaint you must install rspec"
+ end
+ end
+
+ task 'about.yml' do
+ gemspec = Rake.application.jeweler_tasks.jeweler.gemspec
+ File.open(File.join(File.dirname(__FILE__), "about.yml"), 'w+') do |f|
+ YAML.dump({
+ :name => gemspec.name,
+ :summary => gemspec.summary,
+ :email => 'tom@popdog.net',
+ :homepage => gemspec.homepage,
+ :author => gemspec.authors.join(", "),
+ :plugin => gemspec.homepage,
+ :license => 'MIT',
+ :rails_version => '2.3+',
+ :version => gemspec.version.to_s
+ }, f)
+ end
end
end
task 'default' => ['spraypaint:spec', 'spraypaint:features']