2011-02-04 04:13:41 +00:00
|
|
|
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 = "impressionist"
|
2011-03-07 04:26:50 +00:00
|
|
|
gem.homepage = "http://github.com/cowboycoded/impressionist"
|
2011-02-04 04:13:41 +00:00
|
|
|
gem.license = "MIT"
|
|
|
|
gem.summary = %Q{Easy way to log impressions}
|
|
|
|
gem.description = %Q{Log impressions from controller actions or from a model}
|
|
|
|
gem.email = "john.mcaliley@gmail.com"
|
|
|
|
gem.authors = ["cowboycoded"]
|
2011-11-30 17:25:17 +00:00
|
|
|
gem.files.exclude "test_app/**/*", "test_app/**/.*"
|
2011-02-04 04:13:41 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
task :default => :test
|
|
|
|
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
Rake::RDocTask.new do |rdoc|
|
|
|
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
|
|
|
|
|
|
rdoc.rdoc_dir = 'rdoc'
|
|
|
|
rdoc.title = "impressionist #{version}"
|
|
|
|
rdoc.rdoc_files.include('README*')
|
|
|
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
|
|
end
|
|
|
|
|
|
|
|
namespace :version do
|
|
|
|
desc "create a new version, create tag and push to github"
|
|
|
|
task :patch_release do
|
|
|
|
if Jeweler::Commands::ReleaseToGit.new.clean_staging_area?
|
|
|
|
Rake::Task['version:bump:patch'].invoke
|
|
|
|
Rake::Task['gemspec:release'].invoke
|
|
|
|
Rake::Task['git:release'].invoke
|
|
|
|
else
|
|
|
|
puts "Commit your changed files first"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "create a new version, create tag and push to github"
|
|
|
|
task :minor_release do
|
2011-02-04 16:11:44 +00:00
|
|
|
if Jeweler::Commands::ReleaseToGit.new.clean_staging_area?
|
|
|
|
Rake::Task['version:bump:minor'].invoke
|
|
|
|
Rake::Task['gemspec:release'].invoke
|
|
|
|
Rake::Task['git:release'].invoke
|
|
|
|
else
|
|
|
|
puts "Commit your changed files first"
|
2011-11-28 02:56:44 +00:00
|
|
|
end
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|
2011-11-28 02:56:44 +00:00
|
|
|
|
2011-02-04 04:13:41 +00:00
|
|
|
desc "create a new version, create tag and push to github"
|
|
|
|
task :major_release do
|
2011-02-04 16:11:44 +00:00
|
|
|
if Jeweler::Commands::ReleaseToGit.new.clean_staging_area?
|
|
|
|
Rake::Task['version:bump:major'].invoke
|
2011-11-28 02:56:44 +00:00
|
|
|
Rake::Task['gemspec:release'].invoke
|
2011-02-04 16:11:44 +00:00
|
|
|
Rake::Task['git:release'].invoke
|
|
|
|
else
|
|
|
|
puts "Commit your changed files first"
|
|
|
|
end
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
namespace :impressionist do
|
|
|
|
require File.dirname(__FILE__) + "/lib/impressionist/bots"
|
2011-11-28 02:56:44 +00:00
|
|
|
|
2011-02-04 04:13:41 +00:00
|
|
|
desc "output the list of bots from http://www.user-agents.org/"
|
2011-11-28 02:56:44 +00:00
|
|
|
task :bots do
|
2011-02-04 04:13:41 +00:00
|
|
|
p Impressionist::Bots.consume
|
|
|
|
end
|
|
|
|
end
|