require 'pathname' gempath = Pathname.new(File.expand_path('../../', __FILE__)) require gempath.join('..', 'base', 'lib', 'base', 'refinery') gemspec = < #{::Refinery::Version}' end EOF (gemfile = gempath.join("#{gemname}.gemspec")).open('w') {|f| f.puts(gemspec)} puts `cd #{gempath} && gem build #{gemfile}` if ARGV.any?{|a| a == "BUILD=true"}