From 8091a227a0aa39a490c89c69038d03cf05cc550f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 20 Mar 2012 22:05:54 -0400 Subject: [PATCH] add sane rakefile + license --- LICENSE.txt | 22 ++++++++++++++++++++++ Rakefile | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 LICENSE.txt create mode 100644 Rakefile diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..b0b7edc --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,22 @@ +The MIT LICENSE + +Copyright (c) 2012 Gabriel Horner + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..ae65181 --- /dev/null +++ b/Rakefile @@ -0,0 +1,36 @@ +require 'rake' +require 'fileutils' + +def gemspec + @gemspec ||= eval(File.read('.gemspec'), binding, '.gemspec') +end + +desc "Build the gem" +task :gem=>:gemspec do + sh "gem build .gemspec" + FileUtils.mkdir_p 'pkg' + FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", 'pkg' +end + +desc "Install the gem locally" +task :install => :gem do + sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}} +end + +desc "Generate the gemspec" +task :generate do + puts gemspec.to_ruby +end + +desc "Validate the gemspec" +task :gemspec do + gemspec.validate +end + +desc 'Run tests' +task :test do |t| + ENV['RUBYLIB'] = ['lib', '.', ENV['RUBYLIB']].compact.join(':') + sh 'testrb spec/*_spec.rb' +end + +task :default => :test