pry 0.5.0pre4 → 0.5.0pre5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pry/commands.rb +30 -12
- data/lib/pry/version.rb +1 -1
- metadata +38 -76
data/lib/pry/commands.rb
CHANGED
@@ -111,6 +111,18 @@ Shows local and instance variables by default.
|
|
111
111
|
options[:M] = true
|
112
112
|
end
|
113
113
|
|
114
|
+
opts.on("-P", "--public", "Display public methods.") do
|
115
|
+
options[:P] = true
|
116
|
+
end
|
117
|
+
|
118
|
+
opts.on("-r", "--protected", "Display protected methods.") do
|
119
|
+
options[:r] = true
|
120
|
+
end
|
121
|
+
|
122
|
+
opts.on("-p", "--private", "Display private methods.") do
|
123
|
+
options[:p] = true
|
124
|
+
end
|
125
|
+
|
114
126
|
opts.on("-s", "--super", "Include superclass entries (relevant to constant and methods options).") do
|
115
127
|
options[:s] = true
|
116
128
|
end
|
@@ -137,10 +149,13 @@ Shows local and instance variables by default.
|
|
137
149
|
# default is locals/ivars/class vars.
|
138
150
|
# Only occurs when no options or when only option is verbose
|
139
151
|
options.merge!({
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
152
|
+
:l => true,
|
153
|
+
:i => true,
|
154
|
+
:k => true
|
155
|
+
}) if options.empty? || (options.size == 1 && options[:v])
|
156
|
+
|
157
|
+
# Display public methods by default if -m or -M switch is used.
|
158
|
+
options[:P] = true if (options[:m] || options[:M]) && !(options[:p] || options[:r])
|
144
159
|
|
145
160
|
info = {}
|
146
161
|
target_self = target.eval('self')
|
@@ -164,14 +179,17 @@ Shows local and instance variables by default.
|
|
164
179
|
|
165
180
|
info["global variables"] = [Array(target.eval("global_variables")).sort, i += 1] if options[:g] || options[:a]
|
166
181
|
|
167
|
-
info["methods"] = [Array(target.eval("
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
info["
|
172
|
-
|
173
|
-
|
174
|
-
|
182
|
+
info["public methods"] = [Array(target.eval("public_methods(#{options[:s]})")).uniq.sort, i += 1] if (options[:m] && options[:P]) || options[:a]
|
183
|
+
|
184
|
+
info["protected methods"] = [Array(target.eval("protected_methods(#{options[:s]})")).sort, i += 1] if (options[:m] && options[:r]) || options[:a]
|
185
|
+
|
186
|
+
info["private methods"] = [Array(target.eval("private_methods(#{options[:s]})")).sort, i += 1] if (options[:m] && options[:p]) || options[:a]
|
187
|
+
|
188
|
+
info["public instance methods"] = [Array(target.eval("public_instance_methods(#{options[:s]})")).uniq.sort, i += 1] if target_self.is_a?(Module) && ((options[:M] && options[:P]) || options[:a])
|
189
|
+
|
190
|
+
info["protected instance methods"] = [Array(target.eval("protected_instance_methods(#{options[:s]})")).uniq.sort, i += 1] if target_self.is_a?(Module) && ((options[:M] && options[:r]) || options[:a])
|
191
|
+
|
192
|
+
info["private instance methods"] = [Array(target.eval("private_instance_methods(#{options[:s]})")).uniq.sort, i += 1] if target_self.is_a?(Module) && ((options[:M] && options[:p]) || options[:a])
|
175
193
|
|
176
194
|
# dealing with 1.8/1.9 compatibility issues :/
|
177
195
|
csuper = options[:s]
|
data/lib/pry/version.rb
CHANGED
metadata
CHANGED
@@ -1,82 +1,56 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0pre5
|
5
5
|
prerelease: 5
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 0
|
10
|
-
- pre
|
11
|
-
- 4
|
12
|
-
version: 0.5.0pre4
|
13
6
|
platform: ruby
|
14
|
-
authors:
|
7
|
+
authors:
|
15
8
|
- John Mair (banisterfiend)
|
16
9
|
autorequire:
|
17
10
|
bindir: bin
|
18
11
|
cert_chain: []
|
19
|
-
|
20
|
-
date: 2011-02-17 00:00:00 +13:00
|
12
|
+
date: 2011-02-17 00:00:00.000000000 +13:00
|
21
13
|
default_executable:
|
22
|
-
dependencies:
|
23
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
24
16
|
name: ruby_parser
|
25
|
-
|
26
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &17271936 !ruby/object:Gem::Requirement
|
27
18
|
none: false
|
28
|
-
requirements:
|
29
|
-
- -
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
hash: 5
|
32
|
-
segments:
|
33
|
-
- 2
|
34
|
-
- 0
|
35
|
-
- 5
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
36
22
|
version: 2.0.5
|
37
23
|
type: :runtime
|
38
|
-
version_requirements: *id001
|
39
|
-
- !ruby/object:Gem::Dependency
|
40
|
-
name: method_source
|
41
24
|
prerelease: false
|
42
|
-
|
25
|
+
version_requirements: *17271936
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: method_source
|
28
|
+
requirement: &17271636 !ruby/object:Gem::Requirement
|
43
29
|
none: false
|
44
|
-
requirements:
|
45
|
-
- -
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
hash: 23
|
48
|
-
segments:
|
49
|
-
- 0
|
50
|
-
- 2
|
51
|
-
- 0
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
52
33
|
version: 0.2.0
|
53
34
|
type: :runtime
|
54
|
-
version_requirements: *id002
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: bacon
|
57
35
|
prerelease: false
|
58
|
-
|
36
|
+
version_requirements: *17271636
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: bacon
|
39
|
+
requirement: &17271336 !ruby/object:Gem::Requirement
|
59
40
|
none: false
|
60
|
-
requirements:
|
61
|
-
- -
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
hash: 19
|
64
|
-
segments:
|
65
|
-
- 1
|
66
|
-
- 1
|
67
|
-
- 0
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
68
44
|
version: 1.1.0
|
69
45
|
type: :development
|
70
|
-
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *17271336
|
71
48
|
description: attach an irb-like session to any object at runtime
|
72
49
|
email: jrmair@gmail.com
|
73
50
|
executables: []
|
74
|
-
|
75
51
|
extensions: []
|
76
|
-
|
77
52
|
extra_rdoc_files: []
|
78
|
-
|
79
|
-
files:
|
53
|
+
files:
|
80
54
|
- lib/pry/commands.rb
|
81
55
|
- lib/pry/command_base.rb
|
82
56
|
- lib/pry/completion.rb
|
@@ -108,38 +82,26 @@ files:
|
|
108
82
|
has_rdoc: true
|
109
83
|
homepage: http://banisterfiend.wordpress.com
|
110
84
|
licenses: []
|
111
|
-
|
112
85
|
post_install_message:
|
113
86
|
rdoc_options: []
|
114
|
-
|
115
|
-
require_paths:
|
87
|
+
require_paths:
|
116
88
|
- lib
|
117
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
90
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
|
124
|
-
- 0
|
125
|
-
version: "0"
|
126
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
96
|
none: false
|
128
|
-
requirements:
|
129
|
-
- -
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
hash: 25
|
132
|
-
segments:
|
133
|
-
- 1
|
134
|
-
- 3
|
135
|
-
- 1
|
97
|
+
requirements:
|
98
|
+
- - ! '>'
|
99
|
+
- !ruby/object:Gem::Version
|
136
100
|
version: 1.3.1
|
137
101
|
requirements: []
|
138
|
-
|
139
102
|
rubyforge_project:
|
140
103
|
rubygems_version: 1.5.2
|
141
104
|
signing_key:
|
142
105
|
specification_version: 3
|
143
106
|
summary: attach an irb-like session to any object at runtime
|
144
107
|
test_files: []
|
145
|
-
|