require 'rubygems' require 'bundler' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end require 'rake' require 'jeweler' Jeweler::Tasks.new do |gem| # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options gem.name = "logbox" gem.executables = %w(download_logs obsstats rotate viewobs) gem.homepage = "https://github.com/icehouse/logbox" gem.license = "MIT" gem.summary = %Q{A Toolbox for Logs and Observations} gem.description = %Q{Log-related code and tools that are used cross different applications} gem.email = "dev@icehouse.se" gem.authors = ["dvrensk", "enarsson", "Jell"] gem.files.include(["lib/*"]) # Include your dependencies below. Runtime dependencies are required when using your gem, # and development dependencies are only needed for development (ie running rake tasks, tests, etc) # gem.add_runtime_dependency 'jabber4r', '> 0.1' # gem.add_development_dependency 'rspec', '> 1.2.3' end Jeweler::RubygemsDotOrgTasks.new require 'rake/testtask' Rake::TestTask.new(:test) do |test| test.libs << 'lib' << 'test' test.pattern = 'test/**/*_test.rb' test.verbose = true end require 'rcov/rcovtask' Rcov::RcovTask.new do |test| test.libs << 'test' test.pattern = 'test/**/test_*.rb' test.verbose = true end require 'rake/rdoctask' Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION') : "" rdoc.rdoc_dir = 'rdoc' rdoc.title = "logbox #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end RUBIES = %w[1.8.7-p302 1.9.2-p0] desc "Run tests with ruby 1.8.7 and 1.9.2" task :default do RUBIES.each do |ruby| sh "rvm #{ruby}@logbox rake test" end end desc "Install bundler and gems for each environment in #{RUBIES.join','}" task :setup do cmd = [] RUBIES.each do |ruby| cmd << "rvm --create #{ruby}@logbox" cmd << "gem list | grep -q ^rake || gem install rake" cmd << "gem list | grep -q ^bundler || gem install bundler" cmd << "bundle install" end puts "# RUN THE FOLLOWING LINES IN YOUR SHELL" puts cmd end