pry 0.9.6.1-i386-mingw32 → 0.9.6.2-i386-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Rakefile +6 -6
- data/lib/pry.rb +0 -3
- data/lib/pry/command_context.rb +0 -1
- data/lib/pry/command_set.rb +0 -2
- data/lib/pry/default_commands/basic.rb +7 -5
- data/lib/pry/default_commands/context.rb +3 -5
- data/lib/pry/default_commands/documentation.rb +79 -28
- data/lib/pry/default_commands/input.rb +7 -3
- data/lib/pry/default_commands/introspection.rb +52 -33
- data/lib/pry/default_commands/shell.rb +2 -2
- data/lib/pry/extended_commands/experimental.rb +6 -2
- data/lib/pry/helpers/base_helpers.rb +1 -1
- data/lib/pry/helpers/command_helpers.rb +247 -11
- data/lib/pry/version.rb +1 -1
- data/pry.gemspec +15 -15
- data/test/test_command_helpers.rb +69 -1
- data/test/test_command_set.rb +28 -29
- data/test/test_default_commands/test_introspection.rb +25 -0
- metadata +22 -27
- data/lib/pry/method.rb +0 -184
- data/lib/pry/rbx_method.rb +0 -20
- data/lib/pry/rbx_path.rb +0 -34
- data/test/test_method.rb +0 -72
data/lib/pry/rbx_method.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
class Pry
|
2
|
-
module RbxMethod
|
3
|
-
private
|
4
|
-
def core?
|
5
|
-
source_file and RbxPath.is_core_path?(source_file)
|
6
|
-
end
|
7
|
-
|
8
|
-
def core_code
|
9
|
-
MethodSource.source_helper(core_path_line)
|
10
|
-
end
|
11
|
-
|
12
|
-
def core_doc
|
13
|
-
MethodSource.comment_helper(core_path_line)
|
14
|
-
end
|
15
|
-
|
16
|
-
def core_path_line
|
17
|
-
[RbxPath.convert_path_to_full(source_file), source_line]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/lib/pry/rbx_path.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
class Pry
|
2
|
-
module RbxPath
|
3
|
-
module_function
|
4
|
-
def is_core_path?(path)
|
5
|
-
path.start_with?("kernel")
|
6
|
-
end
|
7
|
-
|
8
|
-
def convert_path_to_full(path)
|
9
|
-
if rvm_ruby?(Rubinius::BIN_PATH)
|
10
|
-
rvm_convert_path_to_full(path)
|
11
|
-
else
|
12
|
-
std_convert_path_to_full(path)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def rvm_ruby?(path)
|
17
|
-
!!(path =~ /\.rvm/)
|
18
|
-
end
|
19
|
-
|
20
|
-
def rvm_convert_path_to_full(path)
|
21
|
-
ruby_name = File.dirname(Rubinius::BIN_PATH).split("/").last
|
22
|
-
source_path = File.join(File.dirname(File.dirname(File.dirname(Rubinius::BIN_PATH))), "src", ruby_name)
|
23
|
-
file_name = File.join(source_path, path)
|
24
|
-
raise "Cannot find rbx core source" if !File.exists?(file_name)
|
25
|
-
file_name
|
26
|
-
end
|
27
|
-
|
28
|
-
def std_convert_path_to_full(path)
|
29
|
-
file_name = File.join(Rubinius::BIN_PATH, "..", path)
|
30
|
-
raise "Cannot find rbx core source" if !File.exists?(file_name)
|
31
|
-
file_name
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
data/test/test_method.rb
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
describe Pry::Method do
|
4
|
-
describe ".from_str" do
|
5
|
-
it 'should look up instance methods if no methods available and no options provided' do
|
6
|
-
klass = Class.new { def hello; end }
|
7
|
-
meth = Pry::Method.from_str(:hello, Pry.binding_for(klass))
|
8
|
-
meth.should == klass.instance_method(:hello)
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should look up methods if no instance methods available and no options provided' do
|
12
|
-
klass = Class.new { def self.hello; end }
|
13
|
-
meth = Pry::Method.from_str(:hello, Pry.binding_for(klass))
|
14
|
-
meth.should == klass.method(:hello)
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should look up instance methods first even if methods available and no options provided' do
|
18
|
-
klass = Class.new { def hello; end; def self.hello; end }
|
19
|
-
meth = Pry::Method.from_str(:hello, Pry.binding_for(klass))
|
20
|
-
meth.should == klass.instance_method(:hello)
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should look up instance methods if "instance-methods" option provided' do
|
24
|
-
klass = Class.new { def hello; end; def self.hello; end }
|
25
|
-
meth = Pry::Method.from_str(:hello, Pry.binding_for(klass), {"instance-methods" => true})
|
26
|
-
meth.should == klass.instance_method(:hello)
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should look up methods if :methods option provided' do
|
30
|
-
klass = Class.new { def hello; end; def self.hello; end }
|
31
|
-
meth = Pry::Method.from_str(:hello, Pry.binding_for(klass), {:methods => true})
|
32
|
-
meth.should == klass.method(:hello)
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should look up instance methods using the Class#method syntax' do
|
36
|
-
klass = Class.new { def hello; end; def self.hello; end }
|
37
|
-
meth = Pry::Method.from_str("klass#hello", Pry.binding_for(binding))
|
38
|
-
meth.should == klass.instance_method(:hello)
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'should look up methods using the object.method syntax' do
|
42
|
-
klass = Class.new { def hello; end; def self.hello; end }
|
43
|
-
meth = Pry::Method.from_str("klass.hello", Pry.binding_for(binding))
|
44
|
-
meth.should == klass.method(:hello)
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'should NOT look up instance methods using the Class#method syntax if no instance methods defined' do
|
48
|
-
klass = Class.new { def self.hello; end }
|
49
|
-
meth = Pry::Method.from_str("klass#hello", Pry.binding_for(binding))
|
50
|
-
meth.should == nil
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'should NOT look up methods using the object.method syntax if no methods defined' do
|
54
|
-
klass = Class.new { def hello; end }
|
55
|
-
meth = Pry::Method.from_str("klass.hello", Pry.binding_for(binding))
|
56
|
-
meth.should == nil
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'should look up methods using klass.new.method syntax' do
|
60
|
-
klass = Class.new { def hello; :hello; end }
|
61
|
-
meth = Pry::Method.from_str("klass.new.hello", Pry.binding_for(binding))
|
62
|
-
meth.name.to_sym.should == :hello
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'should look up instance methods using klass.meth#method syntax' do
|
66
|
-
klass = Class.new { def self.meth; Class.new; end }
|
67
|
-
meth = Pry::Method.from_str("klass.meth#initialize", Pry.binding_for(binding))
|
68
|
-
meth.name.to_sym.should == :initialize
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|