pry 0.7.5.3-java → 0.7.6-java

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 26/3/2011 version 0.7.6
2
+ * `whereami` command now accepts parameter AROUND, to display AROUND lines on eitherside of invocation line.
3
+ * made it so `whereami` is invoked even if no method exists in current context (i.e in rspec tests)
4
+ * added rubinius support for `whereami` invocation in HOOKS by checking for __unknown__.rb rather than just <main>
5
+
1
6
  15/3/2011 version 0.7.0
2
7
  * add pry-doc support with syntax highlighting for docs
3
8
  * add 'mj' option to ls (restrict to singleton methods)
@@ -269,9 +269,6 @@ If you want to access a method of the same name, prefix the invocation by whites
269
269
  * `jump-to NEST_LEVEL` Unwinds the Pry stack (nesting level) until the appropriate nesting level is reached.
270
270
  * `exit-all` breaks out of all Pry nesting levels and returns to the
271
271
  calling process.
272
- * You can type `Pry.start(obj)` or `obj.pry` to nest another Pry session within the
273
- current one with `obj` as the receiver of the new session. Very useful
274
- when exploring large or complicated runtime state.
275
272
 
276
273
  Syntax Highlighting
277
274
  --------------------
@@ -14,4 +14,4 @@ end
14
14
  # Start pry session at top-level.
15
15
  # The local variable `a` and the `hello` method will
16
16
  # be accessible.
17
- pry
17
+ binding.pry
@@ -158,24 +158,34 @@ class Pry
158
158
  output.puts "Last result: #{Pry.view(Pry.last_result)}"
159
159
  end
160
160
 
161
- command "whereami", "Show the code context for the session." do
161
+ command "whereami", "Show the code context for the session. Shows AROUND lines around the invocation line. AROUND defaults to 5 lines. " do |num|
162
162
  file = target.eval('__FILE__')
163
163
  line_num = target.eval('__LINE__')
164
164
  klass = target.eval('self.class')
165
165
 
166
+ if num
167
+ i_num = num.to_i
168
+ else
169
+ i_num = 5
170
+ end
171
+
166
172
  meth_name = meth_name_from_binding.call(target)
167
173
  meth_name = "N/A" if !meth_name
168
174
 
169
175
  # FIX ME!!! this line is screwed
170
176
  # check_for_dynamically_defined_method.call()
177
+ if file =~ /(\(.*\))|<.*>/
178
+ output.puts "Cannot find local context."
179
+ next
180
+ end
171
181
 
172
182
  output.puts "--\nFrom #{file} @ line #{line_num} in #{klass}##{meth_name}:\n--"
173
183
 
174
184
  # This method inspired by http://rubygems.org/gems/ir_b
175
185
  File.open(file).each_with_index do |line, index|
176
186
  line_n = index + 1
177
- next unless line_n > (line_num - 6)
178
- break if line_n > (line_num + 5)
187
+ next unless line_n > (line_num - i_num - 1)
188
+ break if line_n > (line_num + i_num)
179
189
  if line_n == line_num
180
190
  code =" =>#{line_n.to_s.rjust(3)}: #{line.chomp}"
181
191
  if Pry.color
@@ -555,6 +565,8 @@ e.g: show-method hello_method
555
565
 
556
566
  next if options[:h]
557
567
 
568
+ meth_name = meth_name_from_binding.call(target) if !meth_name
569
+
558
570
  if (meth = get_method_object.call(meth_name, target, options)).nil?
559
571
  output.puts "Invalid method name: #{meth_name}. Type `show-method --help` for help"
560
572
  next
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.7.5.3"
2
+ VERSION = "0.7.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 7
8
- - 5
9
- - 3
10
- version: 0.7.5.3
9
+ - 6
10
+ version: 0.7.6
11
11
  platform: java
12
12
  authors:
13
13
  - John Mair (banisterfiend)
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-25 00:00:00 +13:00
18
+ date: 2011-03-26 00:00:00 +13:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,6 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
+ hash: 5
29
30
  segments:
30
31
  - 2
31
32
  - 0
@@ -41,6 +42,7 @@ dependencies:
41
42
  requirements:
42
43
  - - ">="
43
44
  - !ruby/object:Gem::Version
45
+ hash: 53
44
46
  segments:
45
47
  - 0
46
48
  - 9
@@ -56,6 +58,7 @@ dependencies:
56
58
  requirements:
57
59
  - - ">="
58
60
  - !ruby/object:Gem::Version
61
+ hash: 19
59
62
  segments:
60
63
  - 1
61
64
  - 1
@@ -71,6 +74,7 @@ dependencies:
71
74
  requirements:
72
75
  - - "="
73
76
  - !ruby/object:Gem::Version
77
+ hash: 23
74
78
  segments:
75
79
  - 0
76
80
  - 2
@@ -131,6 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
135
  requirements:
132
136
  - - ">="
133
137
  - !ruby/object:Gem::Version
138
+ hash: 3
134
139
  segments:
135
140
  - 0
136
141
  version: "0"
@@ -139,6 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
144
  requirements:
140
145
  - - ">="
141
146
  - !ruby/object:Gem::Version
147
+ hash: 3
142
148
  segments:
143
149
  - 0
144
150
  version: "0"