2010-12-08 07:30:38 +00:00
|
|
|
require 'rake/clean'
|
2011-10-22 01:44:01 +00:00
|
|
|
require 'rake/gempackagetask'
|
2011-04-29 15:16:53 +00:00
|
|
|
|
|
|
|
$:.unshift 'lib'
|
2011-04-29 15:13:44 +00:00
|
|
|
require 'pry/version'
|
2010-12-08 07:30:38 +00:00
|
|
|
|
2011-04-29 15:13:44 +00:00
|
|
|
CLOBBER.include("**/*~", "**/*#*", "**/*.log")
|
2011-05-05 10:06:56 +00:00
|
|
|
CLEAN.include("**/*#*", "**/*#*.*", "**/*_flymake*.*", "**/*_flymake",
|
|
|
|
"**/*.rbc", "**/.#*.*")
|
2010-12-08 07:30:38 +00:00
|
|
|
|
|
|
|
def apply_spec_defaults(s)
|
|
|
|
s.name = "pry"
|
2011-07-15 04:09:47 +00:00
|
|
|
s.summary = "An IRB alternative and runtime developer console"
|
2010-12-08 07:30:38 +00:00
|
|
|
s.version = Pry::VERSION
|
|
|
|
s.date = Time.now.strftime '%Y-%m-%d'
|
|
|
|
s.author = "John Mair (banisterfiend)"
|
|
|
|
s.email = 'jrmair@gmail.com'
|
|
|
|
s.description = s.summary
|
2011-07-15 04:09:47 +00:00
|
|
|
s.homepage = "http://pry.github.com"
|
2011-02-20 16:54:18 +00:00
|
|
|
s.executables = ["pry"]
|
2011-04-29 15:07:57 +00:00
|
|
|
s.files = `git ls-files`.split("\n")
|
2011-04-29 15:08:29 +00:00
|
|
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
2011-09-26 23:51:56 +00:00
|
|
|
s.add_dependency("coderay","~>0.9.8")
|
2011-12-10 15:06:35 +00:00
|
|
|
s.add_dependency("slop","~>2")
|
2011-10-26 09:01:59 +00:00
|
|
|
s.add_dependency("method_source","~>0.6.7")
|
2011-09-26 23:51:56 +00:00
|
|
|
s.add_development_dependency("bacon","~>1.1.0")
|
2011-06-05 22:41:24 +00:00
|
|
|
s.add_development_dependency("open4", "~>1.0.1")
|
2011-09-21 13:41:06 +00:00
|
|
|
s.add_development_dependency("rake", "~>0.9")
|
2010-12-08 07:30:38 +00:00
|
|
|
end
|
|
|
|
|
2011-09-20 19:38:18 +00:00
|
|
|
desc "Set up and run tests"
|
|
|
|
task :default => [:test]
|
|
|
|
|
2011-06-09 11:18:21 +00:00
|
|
|
desc "Run tests"
|
2010-12-08 07:30:38 +00:00
|
|
|
task :test do
|
2011-09-12 07:55:31 +00:00
|
|
|
sh "bacon -Itest -rubygems -a -q"
|
2010-12-08 07:30:38 +00:00
|
|
|
end
|
|
|
|
|
2011-10-22 07:59:44 +00:00
|
|
|
desc "profile pry's startup time"
|
|
|
|
task :profile do
|
|
|
|
require 'profile'
|
|
|
|
require 'pry'
|
|
|
|
Pry.start(TOPLEVEL_BINDING, :input => StringIO.new('exit'))
|
|
|
|
end
|
|
|
|
|
2011-01-26 10:13:46 +00:00
|
|
|
desc "run pry"
|
|
|
|
task :pry do
|
2011-05-30 03:54:42 +00:00
|
|
|
load 'bin/pry'
|
2011-01-26 10:13:46 +00:00
|
|
|
end
|
|
|
|
|
2011-01-26 18:05:40 +00:00
|
|
|
desc "show pry version"
|
|
|
|
task :version do
|
|
|
|
puts "Pry version: #{Pry::VERSION}"
|
|
|
|
end
|
|
|
|
|
2010-12-08 07:30:38 +00:00
|
|
|
namespace :ruby do
|
|
|
|
spec = Gem::Specification.new do |s|
|
2011-03-01 13:14:38 +00:00
|
|
|
apply_spec_defaults(s)
|
2010-12-08 07:30:38 +00:00
|
|
|
s.platform = Gem::Platform::RUBY
|
|
|
|
end
|
2011-04-24 11:56:47 +00:00
|
|
|
|
2011-10-22 01:44:01 +00:00
|
|
|
Rake::GemPackageTask.new(spec) do |pkg|
|
2010-12-08 07:30:38 +00:00
|
|
|
pkg.need_zip = false
|
|
|
|
pkg.need_tar = false
|
|
|
|
end
|
2011-06-16 13:41:03 +00:00
|
|
|
|
2011-05-31 13:46:26 +00:00
|
|
|
desc "Generate gemspec file"
|
|
|
|
task :gemspec do
|
2011-06-09 11:13:42 +00:00
|
|
|
File.open("#{spec.name}.gemspec", "w") do |f|
|
2011-05-31 13:46:26 +00:00
|
|
|
f << spec.to_ruby
|
2011-06-01 06:29:48 +00:00
|
|
|
end
|
2011-05-31 13:46:26 +00:00
|
|
|
end
|
2010-12-08 07:30:38 +00:00
|
|
|
end
|
|
|
|
|
2011-09-06 17:20:04 +00:00
|
|
|
namespace :jruby do
|
|
|
|
spec = Gem::Specification.new do |s|
|
|
|
|
apply_spec_defaults(s)
|
2011-09-26 23:51:56 +00:00
|
|
|
s.add_dependency("spoon", "~>0.0.1")
|
2011-09-06 17:20:04 +00:00
|
|
|
s.platform = "java"
|
|
|
|
end
|
|
|
|
|
2011-10-22 01:44:01 +00:00
|
|
|
Rake::GemPackageTask.new(spec) do |pkg|
|
2011-09-06 17:20:04 +00:00
|
|
|
pkg.need_zip = false
|
|
|
|
pkg.need_tar = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2011-03-02 11:18:26 +00:00
|
|
|
[:mingw32, :mswin32].each do |v|
|
|
|
|
namespace v do
|
|
|
|
spec = Gem::Specification.new do |s|
|
2011-04-24 11:56:47 +00:00
|
|
|
apply_spec_defaults(s)
|
2011-09-26 23:51:56 +00:00
|
|
|
s.add_dependency("win32console", "~>1.3.0")
|
2011-03-02 11:18:26 +00:00
|
|
|
s.platform = "i386-#{v}"
|
|
|
|
end
|
|
|
|
|
2011-10-22 01:44:01 +00:00
|
|
|
Rake::GemPackageTask.new(spec) do |pkg|
|
2011-03-02 11:18:26 +00:00
|
|
|
pkg.need_zip = false
|
|
|
|
pkg.need_tar = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-12-08 07:30:38 +00:00
|
|
|
desc "build all platform gems at once"
|
2011-09-07 06:58:16 +00:00
|
|
|
task :gems => [:clean, :rmgems, "ruby:gem", "mswin32:gem", "mingw32:gem", "jruby:gem"]
|
2010-12-08 07:30:38 +00:00
|
|
|
|
|
|
|
desc "remove all platform gems"
|
|
|
|
task :rmgems => ["ruby:clobber_package"]
|
|
|
|
|
|
|
|
desc "build and push latest gems"
|
|
|
|
task :pushgems => :gems do
|
2011-05-04 14:19:32 +00:00
|
|
|
chdir("#{File.dirname(__FILE__)}/pkg") do
|
2010-12-08 07:30:38 +00:00
|
|
|
Dir["*.gem"].each do |gemfile|
|
|
|
|
sh "gem push #{gemfile}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|