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

Merge branch 'master' of github.com:banister/pry into refactor/command-set

Conflicts:
	test/test.rb
This commit is contained in:
Mon ouïe 2011-04-29 18:24:20 +02:00
commit 48918816dc
5 changed files with 29 additions and 33 deletions

View file

@ -441,6 +441,11 @@ help that can be accessed via typing `command_name --help`. A command
will typically say in its description if the `--help` option is
avaiable.
### Use Pry as your Rails 3 Console
This is currently a hack, but follow the gist kindly provided by
MyArtChannel: [https://gist.github.com/941174](https://gist.github.com/941174)
### Other Features and limitations

View file

@ -1,14 +1,11 @@
dlext = Config::CONFIG['DLEXT']
direc = File.dirname(__FILE__)
require 'rake/clean'
require 'rake/gempackagetask'
require "#{direc}/lib/pry/version"
CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o",
"ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "**/*#*", "**/*#*.*",
"ext/**/*.def", "ext/**/*.pdb", "**/*_flymake*.*", "**/*_flymake", "**/*.rbc")
$:.unshift 'lib'
require 'pry/version'
CLOBBER.include("**/*~", "**/*#*", "**/*.log")
CLEAN.include("**/*#*", "**/*#*.*", "**/*_flymake*.*", "**/*_flymake", "**/*.rbc")
def apply_spec_defaults(s)
s.name = "pry"
@ -18,25 +15,24 @@ def apply_spec_defaults(s)
s.author = "John Mair (banisterfiend)"
s.email = 'jrmair@gmail.com'
s.description = s.summary
s.require_path = 'lib'
s.add_dependency("ruby_parser",">=2.0.5")
s.add_dependency("coderay",">=0.9.7")
s.add_dependency("slop",">=1.5.3")
s.add_development_dependency("bacon",">=1.1.0")
s.homepage = "http://banisterfiend.wordpress.com"
s.has_rdoc = 'yard'
s.executables = ["pry"]
s.files = Dir["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c", "lib/**/*", "examples/**/*.rb",
"test/*.rb", "test/testrc", "CHANGELOG", "LICENSE", "README.markdown", "Rakefile", ".gemtest"]
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- test/*`.split("\n")
s.add_dependency("ruby_parser",">=2.0.5")
s.add_dependency("coderay",">=0.9.7")
s.add_dependency("slop",">=1.5.3")
s.add_dependency("method_source",">=0.4.0")
s.add_development_dependency("bacon",">=1.1.0")
end
task :test do
sh "bacon #{direc}/test/test.rb"
sh "bacon -Itest -rubygems test/test.rb"
end
desc "run pry"
task :pry do
$LOAD_PATH.unshift "#{direc}/lib"
require 'pry'
binding.pry
end
@ -49,7 +45,6 @@ end
namespace :ruby do
spec = Gem::Specification.new do |s|
apply_spec_defaults(s)
s.add_dependency("method_source",">=0.4.0")
s.platform = Gem::Platform::RUBY
end
@ -63,7 +58,6 @@ end
namespace v do
spec = Gem::Specification.new do |s|
apply_spec_defaults(s)
s.add_dependency("method_source",">=0.4.0")
s.add_dependency("win32console", ">=1.3.0")
s.platform = "i386-#{v}"
end
@ -78,7 +72,6 @@ end
namespace :jruby do
spec = Gem::Specification.new do |s|
apply_spec_defaults(s)
s.add_dependency("method_source",">=0.4.0")
s.platform = "java"
end

View file

@ -54,7 +54,7 @@ class Pry
# @return [Pry] The parent of the current Pry session.
def parent
idx = Pry.sessions.index(self)
Pry.sessions[idx - 1] if idx > 0
Pry.sessions[idx - 1] if idx && idx > 0
end
# Execute the hook `hook_name`, if it is defined.

View file

@ -1,12 +1,4 @@
direc = File.dirname(__FILE__)
$LOAD_PATH.unshift "#{direc}/../lib"
$LOAD_PATH.unshift "#{direc}/../lib"
require 'rubygems'
require 'bacon'
require "pry"
require "#{direc}/test_helper"
require 'test_helper'
puts "Ruby Version #{RUBY_VERSION}"
puts "Testing Pry #{Pry::VERSION}"
@ -136,7 +128,7 @@ describe Pry do
it "should run the rc file only once" do
Pry.should_load_rc = true
Pry::RC_FILES << "#{direc}/testrc"
Pry::RC_FILES << File.expand_path("../testrc", __FILE__)
Pry.start(self, :input => StringIO.new("exit\n"), :output => Pry::NullOutput)
TEST_RC.should == [0]

View file

@ -1,3 +1,10 @@
unless Object.const_defined? 'Pry'
$:.unshift File.expand_path '../../lib', __FILE__
require 'pry'
end
require 'bacon'
# Ensure we do not execute any rc files
Pry::RC_FILES.clear
Pry.color = false
@ -40,8 +47,7 @@ class Pry
end
class CommandTester < Pry::CommandBase
CommandTester = Pry::CommandSet.new :test do
command "command1", "command 1 test" do
output.puts "command1"
end