Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 137 lines (111 sloc) 3.035 kb
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
1 require 'rake/clean'
a588a23 @sferik Replace deprecated rake/gempackagetask with rubygems/package_task
sferik authored
2 require 'rubygems/package_task'
7e59e5c no need for this variable, rearrange requires
Lee Jarvis authored
3
4 $:.unshift 'lib'
71ac555 unshift lib into load path
Lee Jarvis authored
5 require 'pry/version'
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
6
fd64f75 @sferik Update gem dependencies
sferik authored
7 CLOBBER.include('**/*~', '**/*#*', '**/*.log')
8 CLEAN.include('**/*#*', '**/*#*.*', '**/*_flymake*.*', '**/*_flymake', '**/*.rbc', '**/.#*.*')
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
9
bab85e7 @rue Behave like a nice library and run rake test as default
rue authored
10 desc "Set up and run tests"
11 task :default => [:test]
12
7449821 @rking Factoring sorted run into 'rake recspec'
rking authored
13 def run_specs paths
144d32e @JoshCheek Switch test suite to RSpec
JoshCheek authored
14 format = ENV['VERBOSE'] ? '--format documentation ' : ''
cc6bbb5 @mvz Enable warnings during spec runs
mvz authored
15 sh "rspec -w #{format}#{paths.join ' '}"
7449821 @rking Factoring sorted run into 'rake recspec'
rking authored
16 end
17
28b58fb Adding a Desc to the test task so it shows up running "rake -T"
David Palm authored
18 desc "Run tests"
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
19 task :test do
7449821 @rking Factoring sorted run into 'rake recspec'
rking authored
20 paths =
6861a36 @rking Deduplicate bacon invocation
rking authored
21 if explicit_list = ENV['run']
22 explicit_list.split(',')
23 else
a0a4625 @rf- Move Readline-loading specs inside normal suite
rf- authored
24 Dir['spec/**/*_spec.rb'].shuffle!
6861a36 @rking Deduplicate bacon invocation
rking authored
25 end
7449821 @rking Factoring sorted run into 'rake recspec'
rking authored
26 run_specs paths
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
27 end
848b6bd @rking Rename for tabcompletion-friendliness.
rking authored
28 task :spec => :test
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
29
7449821 @rking Factoring sorted run into 'rake recspec'
rking authored
30 task :recspec do
31 all = Dir['spec/**/*_spec.rb'].sort_by{|path| File.mtime(path)}.reverse
32 warn "Running all, sorting by mtime: #{all[0..2].join(' ')} ...etc."
33 run_specs all
34 end
35
d40527a @ConradIrwin All passing arguments to `rake pry`.
ConradIrwin authored
36 desc "Run pry (you can pass arguments using _ in place of -)"
228b95f @banister added new 'alias_command' and 'desc' commands to CommandBase; also made ...
banister authored
37 task :pry do
d40527a @ConradIrwin All passing arguments to `rake pry`.
ConradIrwin authored
38 ARGV.shift if ARGV.first == "pry"
39 ARGV.map! do |arg|
40 arg.sub(/^_*/) { |m| "-" * m.size }
41 end
bbb375d @banister changed 'rake pry' to invoke executable instead of starting pry session ...
banister authored
42 load 'bin/pry'
228b95f @banister added new 'alias_command' and 'desc' commands to CommandBase; also made ...
banister authored
43 end
44
a68d269 @banister dummy commit to force travis to do its thing
banister authored
45 desc "Show pry version."
8682e26 @banister Version 0.4.2
banister authored
46 task :version do
47 puts "Pry version: #{Pry::VERSION}"
48 end
49
36d685f @rf- ensure gem environment matches gemspec before some rake tasks
rf- authored
50 desc "Profile pry's startup time"
51 task :profile do
52 require 'profile'
53 require 'pry'
54 Pry.start(TOPLEVEL_BINDING, :input => StringIO.new('exit'))
55 end
56
fcad0a4 @rf- Make the .gemspec canonical instead of generated
rf- authored
57 def modify_base_gemspec
58 eval(File.read('pry.gemspec')).tap { |s| yield s }
59 end
0eeef45 @banister make :gems task regenerate gemspec
banister authored
60
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
61 namespace :ruby do
fcad0a4 @rf- Make the .gemspec canonical instead of generated
rf- authored
62 spec = modify_base_gemspec do |s|
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
63 s.platform = Gem::Platform::RUBY
64 end
169090c dont alter LOAD_PATH and require files relative to lib/
Lee Jarvis authored
65
a588a23 @sferik Replace deprecated rake/gempackagetask with rubygems/package_task
sferik authored
66 Gem::PackageTask.new(spec) do |pkg|
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
67 pkg.need_zip = false
68 pkg.need_tar = false
69 end
70 end
71
e589710 @banister JRuby finally supported, passing 100% of tests - requires updated method...
banister authored
72 namespace :jruby do
fcad0a4 @rf- Make the .gemspec canonical instead of generated
rf- authored
73 spec = modify_base_gemspec do |s|
fd64f75 @sferik Update gem dependencies
sferik authored
74 s.add_dependency('spoon', '~> 0.0')
75 s.platform = 'java'
e589710 @banister JRuby finally supported, passing 100% of tests - requires updated method...
banister authored
76 end
77
a588a23 @sferik Replace deprecated rake/gempackagetask with rubygems/package_task
sferik authored
78 Gem::PackageTask.new(spec) do |pkg|
e589710 @banister JRuby finally supported, passing 100% of tests - requires updated method...
banister authored
79 pkg.need_zip = false
80 pkg.need_tar = false
81 end
82 end
83
84
ee0ea8f @drbrain Use CPU-less platforms for windows
drbrain authored
85 ['mswin32', 'mingw32'].each do |platform|
0978a57 @ConradIrwin Add support for x64-mingw32 platform [Fixes #834]
ConradIrwin authored
86 namespace platform do
fcad0a4 @rf- Make the .gemspec canonical instead of generated
rf- authored
87 spec = modify_base_gemspec do |s|
fd64f75 @sferik Update gem dependencies
sferik authored
88 s.add_dependency('win32console', '~> 1.3')
ee0ea8f @drbrain Use CPU-less platforms for windows
drbrain authored
89 s.platform = Gem::Platform.new [nil, platform, nil]
f1c5fa4 @banister version 0.6.7pre3, getting syntax higlighting working and adding new com...
banister authored
90 end
91
a588a23 @sferik Replace deprecated rake/gempackagetask with rubygems/package_task
sferik authored
92 Gem::PackageTask.new(spec) do |pkg|
f1c5fa4 @banister version 0.6.7pre3, getting syntax higlighting working and adding new com...
banister authored
93 pkg.need_zip = false
94 pkg.need_tar = false
95 end
96 end
ee0ea8f @drbrain Use CPU-less platforms for windows
drbrain authored
97
98 task gems: "#{platform}:gem"
f1c5fa4 @banister version 0.6.7pre3, getting syntax higlighting working and adding new com...
banister authored
99 end
100
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
101 desc "build all platform gems at once"
ee0ea8f @drbrain Use CPU-less platforms for windows
drbrain authored
102 task :gems => [:clean, :rmgems, 'ruby:gem', 'jruby:gem']
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
103
104 desc "remove all platform gems"
fd64f75 @sferik Update gem dependencies
sferik authored
105 task :rmgems => ['ruby:clobber_package']
0229255 @banister add a few rake task aliases
banister authored
106 task :rm_gems => :rmgems
107 task :rm_pkgs => :rmgems
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
108
3bce2f9 @banister added gem reinstall task to Rakefile (for easy local testing)
banister authored
109 desc "reinstall gem"
110 task :reinstall => :gems do
2cca181 @banister bumped version and fixed reinstall rake task
banister authored
111 sh "gem uninstall pry" rescue nil
79b1641 @banister fixed rake reinstall task
banister authored
112 sh "gem install #{File.dirname(__FILE__)}/pkg/pry-#{Pry::VERSION}.gem"
3bce2f9 @banister added gem reinstall task to Rakefile (for easy local testing)
banister authored
113 end
114
0229255 @banister add a few rake task aliases
banister authored
115 task :install => :reinstall
116
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
117 desc "build and push latest gems"
118 task :pushgems => :gems do
bbcf802 @banister fixed Rakefile path for pushgems task
banister authored
119 chdir("#{File.dirname(__FILE__)}/pkg") do
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
120 Dir["*.gem"].each do |gemfile|
121 sh "gem push #{gemfile}"
122 end
123 end
124 end
8f8dfc8 @AndrewVos Add rake task for running tests on multiple rubies
AndrewVos authored
125
126 namespace :docker do
127 desc "build a docker container with multiple rubies"
128 task :build do
129 system "docker build -t pry/pry ."
130 end
131
132 desc "test pry on multiple ruby versions"
133 task :test => :build do
134 system "docker run -i -t -v /tmp/prytmp:/tmp/prytmp pry/pry ./multi_test_inside_docker.sh"
135 end
136 end
Something went wrong with that request. Please try again.