1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Remove code made obsolete by Bundler dependency

Since 2cdf739baa started always loading
bundler/setup during tests, we can get rid of some manual load path
setup and dependency checking. We should also explicitly add bundler as
a development dependency.
This commit is contained in:
Ryan Fitzgerald 2014-03-14 00:00:48 -07:00
parent 9c3d2899eb
commit 4e1f1d42bc
3 changed files with 6 additions and 20 deletions

View file

@ -7,17 +7,6 @@ require 'pry/version'
CLOBBER.include('**/*~', '**/*#*', '**/*.log') CLOBBER.include('**/*~', '**/*#*', '**/*.log')
CLEAN.include('**/*#*', '**/*#*.*', '**/*_flymake*.*', '**/*_flymake', '**/*.rbc', '**/.#*.*') CLEAN.include('**/*#*', '**/*#*.*', '**/*_flymake*.*', '**/*_flymake', '**/*.rbc', '**/.#*.*')
def check_dependencies
require 'bundler'
Bundler.definition.missing_specs
eval('nil', TOPLEVEL_BINDING, '<main>') # workaround for issue #395
rescue LoadError
# if Bundler isn't installed, we'll just assume your setup is ok.
rescue Bundler::GemNotFound
raise RuntimeError, "You're missing one or more required gems. Run `bundle install` first."
end
desc "Set up and run tests" desc "Set up and run tests"
task :default => [:test] task :default => [:test]
@ -28,7 +17,6 @@ end
desc "Run tests" desc "Run tests"
task :test do task :test do
check_dependencies unless ENV['SKIP_DEP_CHECK']
paths = paths =
if explicit_list = ENV['run'] if explicit_list = ENV['run']
explicit_list.split(',') explicit_list.split(',')
@ -47,7 +35,6 @@ end
desc "Run pry (you can pass arguments using _ in place of -)" desc "Run pry (you can pass arguments using _ in place of -)"
task :pry do task :pry do
check_dependencies unless ENV['SKIP_DEP_CHECK']
ARGV.shift if ARGV.first == "pry" ARGV.shift if ARGV.first == "pry"
ARGV.map! do |arg| ARGV.map! do |arg|
arg.sub(/^_*/) { |m| "-" * m.size } arg.sub(/^_*/) { |m| "-" * m.size }

View file

@ -20,6 +20,7 @@ Gem::Specification.new do |s|
s.add_dependency 'slop', '~> 3.4' s.add_dependency 'slop', '~> 3.4'
s.add_dependency 'method_source', '~> 0.8' s.add_dependency 'method_source', '~> 0.8'
s.add_development_dependency 'bundler', '~> 1.0'
s.add_development_dependency 'bacon', '~> 1.2' s.add_development_dependency 'bacon', '~> 1.2'
s.add_development_dependency 'rake', '~> 10.0' s.add_development_dependency 'rake', '~> 10.0'
s.add_development_dependency 'mocha', '~> 1.0' s.add_development_dependency 'mocha', '~> 1.0'

View file

@ -1,7 +1,10 @@
require "bundler/setup" require 'bundler/setup'
require 'mocha/api' require 'mocha/api'
require "ostruct" require 'ostruct'
require 'pry'
require 'pry/test/helper' require 'pry/test/helper'
require_relative 'spec_helpers/bacon' require_relative 'spec_helpers/bacon'
require_relative 'spec_helpers/mock_pry' require_relative 'spec_helpers/mock_pry'
require_relative 'spec_helpers/repl_tester' require_relative 'spec_helpers/repl_tester'
@ -11,11 +14,6 @@ if ENV["COVERAGE"]
SimpleCov.start SimpleCov.start
end end
unless Object.const_defined? 'Pry'
$:.unshift File.expand_path '../../lib', __FILE__
require 'pry'
end
class Module class Module
public :remove_const public :remove_const
public :remove_method public :remove_method