summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2013-04-17 17:48:50 +0300
committerSaku Ytti <saku@ytti.fi>2013-04-17 17:48:50 +0300
commit9d217025fac3e335c308f02e7377e14ccfdc0e66 (patch)
treeb90d4d04947fe26a9e592e12d8c4352142380c03 /Rakefile
Initial commit
Silly for shit-and-giggles attempt at rancid
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile34
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