diff options
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..c415fb3 --- /dev/null +++ b/Rakefile @@ -0,0 +1,34 @@ +begin + require 'bundler' + require 'rspec/core/rake_task' + Bundler.setup +rescue LoadError + warn 'missing dependencies' + exit 42 +end + +gemspec = eval(File.read(Dir['*.gemspec'].first)) + +desc 'Validate the gemspec' +task :gemspec do + gemspec.validate +end + +RSpec::Core::RakeTask.new(:spec) + +desc "Build gem locally" +task :build => [:spec, :gemspec] do + system "gem build #{gemspec.name}.gemspec" + FileUtils.mkdir_p "gems" + FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "gems" +end + +desc "Install gem locally" +task :install => :build do + system "sudo sh -c \'umask 022; gem install gems/#{gemspec.name}-#{gemspec.version}\'" +end + +desc "Clean automatically generated files" +task :clean do + FileUtils.rm_rf "gems" +end |