pry 0.9.9.6pre2-i386-mingw32 → 0.9.10-i386-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/CHANGELOG +41 -0
  2. data/CONTRIBUTORS +27 -26
  3. data/README.markdown +4 -4
  4. data/Rakefile +2 -2
  5. data/lib/pry.rb +25 -19
  6. data/lib/pry/cli.rb +31 -10
  7. data/lib/pry/code.rb +41 -83
  8. data/lib/pry/command.rb +87 -76
  9. data/lib/pry/command_set.rb +13 -20
  10. data/lib/pry/completion.rb +139 -121
  11. data/lib/pry/config.rb +4 -0
  12. data/lib/pry/core_extensions.rb +88 -31
  13. data/lib/pry/default_commands/cd.rb +31 -8
  14. data/lib/pry/default_commands/context.rb +4 -58
  15. data/lib/pry/default_commands/easter_eggs.rb +1 -1
  16. data/lib/pry/default_commands/editing.rb +21 -14
  17. data/lib/pry/default_commands/find_method.rb +5 -7
  18. data/lib/pry/default_commands/gist.rb +187 -0
  19. data/lib/pry/default_commands/hist.rb +6 -6
  20. data/lib/pry/default_commands/input_and_output.rb +73 -129
  21. data/lib/pry/default_commands/introspection.rb +107 -52
  22. data/lib/pry/default_commands/ls.rb +1 -1
  23. data/lib/pry/default_commands/misc.rb +0 -5
  24. data/lib/pry/default_commands/whereami.rb +92 -0
  25. data/lib/pry/helpers/base_helpers.rb +6 -1
  26. data/lib/pry/helpers/command_helpers.rb +30 -9
  27. data/lib/pry/helpers/documentation_helpers.rb +7 -7
  28. data/lib/pry/helpers/options_helpers.rb +1 -1
  29. data/lib/pry/helpers/text.rb +7 -9
  30. data/lib/pry/history.rb +15 -2
  31. data/lib/pry/hooks.rb +1 -1
  32. data/lib/pry/indent.rb +17 -10
  33. data/lib/pry/method.rb +35 -19
  34. data/lib/pry/module_candidate.rb +130 -0
  35. data/lib/pry/pry_class.rb +54 -22
  36. data/lib/pry/pry_instance.rb +71 -14
  37. data/lib/pry/repl_file_loader.rb +80 -0
  38. data/lib/pry/version.rb +1 -1
  39. data/lib/pry/wrapped_module.rb +121 -142
  40. data/pry.gemspec +13 -13
  41. data/test/candidate_helper1.rb +11 -0
  42. data/test/candidate_helper2.rb +8 -0
  43. data/test/helper.rb +16 -0
  44. data/test/test_code.rb +1 -1
  45. data/test/test_command.rb +364 -270
  46. data/test/test_command_integration.rb +235 -267
  47. data/test/test_completion.rb +36 -0
  48. data/test/test_control_d_handler.rb +45 -0
  49. data/test/test_default_commands/example.erb +5 -0
  50. data/test/test_default_commands/test_cd.rb +316 -11
  51. data/test/test_default_commands/test_context.rb +143 -192
  52. data/test/test_default_commands/test_documentation.rb +81 -14
  53. data/test/test_default_commands/test_find_method.rb +10 -2
  54. data/test/test_default_commands/test_input.rb +102 -111
  55. data/test/test_default_commands/test_introspection.rb +17 -12
  56. data/test/test_default_commands/test_ls.rb +8 -6
  57. data/test/test_default_commands/test_shell.rb +18 -15
  58. data/test/test_default_commands/test_show_source.rb +170 -44
  59. data/test/test_exception_whitelist.rb +6 -2
  60. data/test/test_hooks.rb +32 -0
  61. data/test/test_input_stack.rb +19 -16
  62. data/test/test_method.rb +0 -4
  63. data/test/test_prompt.rb +60 -0
  64. data/test/test_pry.rb +23 -31
  65. data/test/test_pry_defaults.rb +75 -57
  66. data/test/test_syntax_checking.rb +12 -11
  67. data/test/test_wrapped_module.rb +103 -0
  68. metadata +72 -26
@@ -1,4 +1,4 @@
1
- require 'pry/helpers/documentation_helpers'
1
+ require 'pry/module_candidate'
2
2
 
3
3
  class Pry
4
4
  class << self
@@ -14,7 +14,7 @@ class Pry
14
14
  end
15
15
 
16
16
  class WrappedModule
17
- include Helpers::DocumentationHelpers
17
+ include Pry::Helpers::DocumentationHelpers
18
18
 
19
19
  attr_reader :wrapped
20
20
  private :wrapped
@@ -40,12 +40,12 @@ class Pry
40
40
  nil
41
41
  end
42
42
 
43
- # Create a new WrappedModule
44
- # @raise ArgumentError, if the argument is not a Module
45
- # @param [Module]
43
+ # @raise [ArgumentError] if the argument is not a `Module`
44
+ # @param [Module] mod
46
45
  def initialize(mod)
47
46
  raise ArgumentError, "Tried to initialize a WrappedModule with a non-module #{mod.inspect}" unless ::Module === mod
48
47
  @wrapped = mod
48
+ @memoized_candidates = []
49
49
  @host_file_lines = nil
50
50
  @source = nil
51
51
  @source_location = nil
@@ -110,141 +110,140 @@ class Pry
110
110
  super || wrapped.respond_to?(method_name)
111
111
  end
112
112
 
113
- def yard_docs?
114
- !!(defined?(YARD) && YARD::Registry.at(name))
113
+ # Retrieve the source location of a module. Return value is in same
114
+ # format as Method#source_location. If the source location
115
+ # cannot be found this method returns `nil`.
116
+ #
117
+ # @param [Module] mod The module (or class).
118
+ # @return [Array<String, Fixnum>, nil] The source location of the
119
+ # module (or class), or `nil` if no source location found.
120
+ def source_location
121
+ @source_location ||= primary_candidate.source_location
122
+ rescue Pry::RescuableException
123
+ nil
115
124
  end
116
125
 
117
- def process_doc(doc)
118
- process_comment_markup(strip_leading_hash_and_whitespace_from_ruby_comments(doc),
119
- :ruby)
126
+ # @return [String, nil] The associated file for the module (i.e
127
+ # the primary candidate: highest ranked monkeypatch).
128
+ def file
129
+ Array(source_location).first
120
130
  end
131
+ alias_method :source_file, :file
121
132
 
122
- def doc
123
- return @doc if @doc
124
-
125
- file_name, line = source_location
126
-
127
- if yard_docs?
128
- from_yard = YARD::Registry.at(name)
129
- @doc = from_yard.docstring
130
- elsif source_location.nil?
131
- raise CommandError, "Can't find module's source location"
132
- else
133
- @doc = extract_doc_for_candidate(0)
134
- end
135
-
136
- raise CommandError, "Can't find docs for module: #{name}." if !@doc
137
-
138
- @doc = process_doc(@doc)
133
+ # @return [Fixnum, nil] The associated line for the module (i.e
134
+ # the primary candidate: highest ranked monkeypatch).
135
+ def line
136
+ Array(source_location).last
139
137
  end
140
-
141
- def doc_for_candidate(idx)
142
- doc = extract_doc_for_candidate(idx)
143
- raise CommandError, "Can't find docs for module: #{name}." if !doc
144
-
145
- process_doc(doc)
138
+ alias_method :source_line, :line
139
+
140
+ # Returns documentation for the module.
141
+ # This documentation is for the primary candidate, if
142
+ # you would like documentation for other candidates use
143
+ # `WrappedModule#candidate` to select the candidate you're
144
+ # interested in.
145
+ # @raise [Pry::CommandError] If documentation cannot be found.
146
+ # @return [String] The documentation for the module.
147
+ def doc
148
+ @doc ||= primary_candidate.doc
146
149
  end
147
150
 
148
- # Retrieve the source for the module.
151
+ # Returns the source for the module.
152
+ # This source is for the primary candidate, if
153
+ # you would like source for other candidates use
154
+ # `WrappedModule#candidate` to select the candidate you're
155
+ # interested in.
156
+ # @raise [Pry::CommandError] If source cannot be found.
157
+ # @return [String] The source for the module.
149
158
  def source
150
- @source ||= source_for_candidate(0)
159
+ @source ||= primary_candidate.source
151
160
  end
152
161
 
153
- def source_for_candidate(idx)
154
- file, line = module_source_location_for_candidate(idx)
155
- raise CommandError, "Could not locate source for #{wrapped}!" if file.nil?
156
-
157
- strip_leading_whitespace(Pry::Code.retrieve_complete_expression_from(lines_for_file(file)[(line - 1)..-1]))
162
+ # @return [String] Return the associated file for the
163
+ # module from YARD, if one exists.
164
+ def yard_file
165
+ YARD::Registry.at(name).file if yard_docs?
158
166
  end
159
167
 
160
- def source_file
161
- if yard_docs?
162
- from_yard = YARD::Registry.at(name)
163
- from_yard.file
164
- else
165
- source_file_for_candidate(0)
166
- end
168
+ # @return [Fixnum] Return the associated line for the
169
+ # module from YARD, if one exists.
170
+ def yard_line
171
+ YARD::Registry.at(name).line if yard_docs?
167
172
  end
168
173
 
169
- def source_line
170
- source_line_for_candidate(0)
174
+ # @return [String] Return the YARD docs for this module.
175
+ def yard_doc
176
+ YARD::Registry.at(name).docstring.to_s if yard_docs?
171
177
  end
172
178
 
173
- def source_file_for_candidate(idx)
174
- Array(module_source_location_for_candidate(idx)).first
179
+ # Return a candidate for this module of specified rank. A `rank`
180
+ # of 0 is equivalent to the 'primary candidate', which is the
181
+ # module definition with the highest number of methods. A `rank`
182
+ # of 1 is the module definition with the second highest number of
183
+ # methods, and so on. Module candidates are necessary as modules
184
+ # can be reopened multiple times and in multiple places in Ruby,
185
+ # the candidate API gives you access to the module definition
186
+ # representing each of those reopenings.
187
+ # @raise [Pry::CommandError] If the `rank` is out of range. That
188
+ # is greater than `number_of_candidates - 1`.
189
+ # @param [Fixnum] rank
190
+ # @return [Pry::WrappedModule::Candidate]
191
+ def candidate(rank)
192
+ @memoized_candidates[rank] ||= Candidate.new(self, rank)
175
193
  end
176
194
 
177
- def source_line_for_candidate(idx)
178
- Array(module_source_location_for_candidate(idx)).last
179
- end
180
195
 
181
- # Retrieve the source location of a module. Return value is in same
182
- # format as Method#source_location. If the source location
183
- # cannot be found this method returns `nil`.
184
- #
185
- # @param [Module] mod The module (or class).
186
- # @return [Array<String, Fixnum>] The source location of the
187
- # module (or class).
188
- def source_location
189
- @source_location ||= module_source_location_for_candidate(0)
190
- rescue Pry::RescuableException
191
- nil
196
+ # @return [Fixnum] The number of candidate definitions for the
197
+ # current module.
198
+ def number_of_candidates
199
+ method_candidates.count
192
200
  end
193
201
 
194
- # memoized lines for file
195
- def lines_for_file(file)
196
- @lines_for_file ||= {}
197
-
198
- if file == Pry.eval_path
199
- @lines_for_file[file] ||= Pry.line_buffer.drop(1)
200
- else
201
- @lines_for_file[file] ||= File.readlines(file)
202
- end
202
+ # @return [Boolean] Whether YARD docs are available for this module.
203
+ def yard_docs?
204
+ !!(defined?(YARD) && YARD::Registry.at(name))
203
205
  end
204
206
 
205
- def module_source_location_for_candidate(idx)
206
- mod_type_string = wrapped.class.to_s.downcase
207
- file, line = method_source_location_for_candidate(idx)
208
-
209
- return nil if !file.is_a?(String)
210
-
211
- class_regex1 = /#{mod_type_string}\s*(\w*)(::)?#{wrapped.name.split(/::/).last}/
212
- class_regex2 = /(::)?#{wrapped.name.split(/::/).last}\s*?=\s*?#{wrapped.class}/
213
-
214
- host_file_lines = lines_for_file(file)
207
+ private
215
208
 
216
- search_lines = host_file_lines[0..(line - 2)]
217
- idx = search_lines.rindex { |v| class_regex1 =~ v || class_regex2 =~ v }
218
-
219
- source_location = [file, idx + 1]
220
- rescue Pry::RescuableException
221
- nil
209
+ # @return [Pry::WrappedModule::Candidate] The candidate of rank 0,
210
+ # that is the 'monkey patch' of this module with the highest
211
+ # number of methods. It is considered the 'canonical' definition
212
+ # for the module.
213
+ def primary_candidate
214
+ @primary_candidate ||= candidate(0)
222
215
  end
223
216
 
224
- def extract_doc
225
- extract_doc_for_candidate(0)
217
+ # @return [Array<Array<Pry::Method>>] The array of `Pry::Method` objects,
218
+ # there are two associated with each candidate. The first is the 'base
219
+ # method' for a candidate and it serves as the start point for
220
+ # the search in uncovering the module definition. The second is
221
+ # the last method defined for that candidate and it is used to
222
+ # speed up source code extraction.
223
+ def method_candidates
224
+ @method_candidates ||= all_source_locations_by_popularity.map do |group|
225
+ methods_sorted_by_source_line = group.last.sort_by(&:source_line)
226
+ [methods_sorted_by_source_line.first, methods_sorted_by_source_line.last]
227
+ end
226
228
  end
227
229
 
228
- def extract_doc_for_candidate(idx)
229
- file_name, line = module_source_location_for_candidate(idx)
230
+ # A helper method.
231
+ def all_source_locations_by_popularity
232
+ return @all_source_locations_by_popularity if @all_source_locations_by_popularity
233
+
234
+ ims = all_methods_for(wrapped)
230
235
 
231
- buffer = ""
232
- lines_for_file(source_file_for_candidate(idx))[0..(line - 2)].each do |line|
233
- # Add any line that is a valid ruby comment,
234
- # but clear as soon as we hit a non comment line.
235
- if (line =~ /^\s*#/) || (line =~ /^\s*$/)
236
- buffer << line.lstrip
237
- else
238
- buffer.replace("")
239
- end
240
- end
236
+ # reject __class_init__ because it's an odd rbx specific thing that causes tests to fail
237
+ ims = ims.select(&:source_location).reject{ |x| x.name == '__class_init__' }
241
238
 
242
- buffer
239
+ @all_source_locations_by_popularity = ims.group_by { |v| Array(v.source_location).first }.
240
+ sort_by { |k, v| -v.size }
243
241
  end
244
242
 
245
- # FIXME: this method is also found in Pry::Method
246
- def safe_send(obj, method, *args, &block)
247
- (Module === obj ? Module : Object).instance_method(method).bind(obj).call(*args, &block)
243
+ # Return all methods (instance methods and class methods) for a
244
+ # given module.
245
+ def all_methods_for(mod)
246
+ all_from_common(mod, :instance_method) + all_from_common(mod, :method)
248
247
  end
249
248
 
250
249
  # FIXME: a variant of this method is also found in Pry::Method
@@ -262,47 +261,27 @@ class Pry
262
261
  end.flatten
263
262
  end
264
263
 
265
- def all_methods_for(mod)
266
- all_from_common(mod, :instance_method) + all_from_common(mod, :method)
267
- end
268
-
269
- def all_source_locations_by_popularity
270
- return @all_source_locations_by_popularity if @all_source_locations_by_popularity
271
-
272
- ims = all_methods_for(wrapped)
273
-
274
- ims.reject! do |v|
275
- begin
276
- v.alias? || v.source_location.nil?
277
- rescue Pry::RescuableException
278
- true
279
- end
280
- end
281
-
282
- @all_source_locations_by_popularity = ims.group_by { |v| Array(v.source_location).first }.
283
- sort_by { |k, v| -v.size }
284
- end
264
+ # memoized lines for file
265
+ def lines_for_file(file)
266
+ @lines_for_file ||= {}
285
267
 
286
- def method_candidates
287
- @method_candidtates ||= all_source_locations_by_popularity.map do |group|
288
- sorted_by_lowest_line_number = group.last.sort_by(&:source_line)
289
- best_candidate_for_group = sorted_by_lowest_line_number.first
268
+ if file == Pry.eval_path
269
+ @lines_for_file[file] ||= Pry.line_buffer.drop(1)
270
+ else
271
+ @lines_for_file[file] ||= File.readlines(file)
290
272
  end
291
273
  end
292
274
 
293
- def number_of_candidates
294
- method_candidates.count
275
+ # FIXME: this method is also found in Pry::Method
276
+ def safe_send(obj, method, *args, &block)
277
+ (Module === obj ? Module : Object).instance_method(method).bind(obj).call(*args, &block)
295
278
  end
296
279
 
297
- def method_source_location_for_candidate(idx)
298
- file, line = method_candidates[idx].source_location
299
-
300
- if file && RbxPath.is_core_path?(file)
301
- file = RbxPath.convert_path_to_full(file)
280
+ # @param [String] doc The raw docstring to process.
281
+ # @return [String] Process docstring markup and strip leading white space.
282
+ def process_doc(doc)
283
+ process_comment_markup(strip_leading_hash_and_whitespace_from_ruby_comments(doc))
302
284
  end
303
285
 
304
- [file, line]
305
- end
306
-
307
286
  end
308
287
  end
@@ -2,43 +2,43 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "pry"
5
- s.version = "0.9.9.5"
5
+ s.version = "0.9.10"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["John Mair (banisterfiend)"]
9
- s.date = "2012-05-09"
8
+ s.authors = ["John Mair (banisterfiend)", "Conrad Irwin"]
9
+ s.date = "2012-07-15"
10
10
  s.description = "An IRB alternative and runtime developer console"
11
- s.email = "jrmair@gmail.com"
11
+ s.email = ["jrmair@gmail.com", "conrad.irwin@gmail.com"]
12
12
  s.executables = ["pry"]
13
- s.files = [".document", ".gemtest", ".gitignore", ".travis.yml", ".yardopts", "CHANGELOG", "CONTRIBUTORS", "Gemfile", "LICENSE", "README.markdown", "Rakefile", "TODO", "bin/pry", "examples/example_basic.rb", "examples/example_command_override.rb", "examples/example_commands.rb", "examples/example_hooks.rb", "examples/example_image_edit.rb", "examples/example_input.rb", "examples/example_input2.rb", "examples/example_output.rb", "examples/example_print.rb", "examples/example_prompt.rb", "examples/helper.rb", "lib/pry.rb", "lib/pry/cli.rb", "lib/pry/code.rb", "lib/pry/command.rb", "lib/pry/command_set.rb", "lib/pry/commands.rb", "lib/pry/completion.rb", "lib/pry/config.rb", "lib/pry/core_extensions.rb", "lib/pry/custom_completions.rb", "lib/pry/default_commands/cd.rb", "lib/pry/default_commands/commands.rb", "lib/pry/default_commands/context.rb", "lib/pry/default_commands/easter_eggs.rb", "lib/pry/default_commands/editing.rb", "lib/pry/default_commands/find_method.rb", "lib/pry/default_commands/gems.rb", "lib/pry/default_commands/help.rb", "lib/pry/default_commands/hist.rb", "lib/pry/default_commands/input_and_output.rb", "lib/pry/default_commands/introspection.rb", "lib/pry/default_commands/ls.rb", "lib/pry/default_commands/misc.rb", "lib/pry/default_commands/navigating_pry.rb", "lib/pry/extended_commands/experimental.rb", "lib/pry/helpers.rb", "lib/pry/helpers/base_helpers.rb", "lib/pry/helpers/command_helpers.rb", "lib/pry/helpers/documentation_helpers.rb", "lib/pry/helpers/options_helpers.rb", "lib/pry/helpers/text.rb", "lib/pry/history.rb", "lib/pry/history_array.rb", "lib/pry/hooks.rb", "lib/pry/indent.rb", "lib/pry/method.rb", "lib/pry/plugins.rb", "lib/pry/pry_class.rb", "lib/pry/pry_instance.rb", "lib/pry/rbx_method.rb", "lib/pry/rbx_path.rb", "lib/pry/version.rb", "lib/pry/wrapped_module.rb", "man/pry.1", "man/pry.1.html", "man/pry.1.ronn", "pry.gemspec", "test/helper.rb", "test/test_cli.rb", "test/test_code.rb", "test/test_command.rb", "test/test_command_helpers.rb", "test/test_command_integration.rb", "test/test_command_set.rb", "test/test_completion.rb", "test/test_default_commands/test_cd.rb", "test/test_default_commands/test_context.rb", "test/test_default_commands/test_documentation.rb", "test/test_default_commands/test_find_method.rb", "test/test_default_commands/test_gems.rb", "test/test_default_commands/test_help.rb", "test/test_default_commands/test_input.rb", "test/test_default_commands/test_introspection.rb", "test/test_default_commands/test_ls.rb", "test/test_default_commands/test_shell.rb", "test/test_default_commands/test_show_source.rb", "test/test_exception_whitelist.rb", "test/test_history_array.rb", "test/test_hooks.rb", "test/test_indent.rb", "test/test_input_stack.rb", "test/test_method.rb", "test/test_pry.rb", "test/test_pry_defaults.rb", "test/test_pry_history.rb", "test/test_pry_output.rb", "test/test_sticky_locals.rb", "test/test_syntax_checking.rb", "test/test_wrapped_module.rb", "test/testrc", "test/testrcbad", "wiki/Customizing-pry.md", "wiki/Home.md"]
13
+ s.files = [".document", ".gemtest", ".gitignore", ".travis.yml", ".yardopts", "CHANGELOG", "CONTRIBUTORS", "Gemfile", "LICENSE", "README.markdown", "Rakefile", "TODO", "bin/pry", "examples/example_basic.rb", "examples/example_command_override.rb", "examples/example_commands.rb", "examples/example_hooks.rb", "examples/example_image_edit.rb", "examples/example_input.rb", "examples/example_input2.rb", "examples/example_output.rb", "examples/example_print.rb", "examples/example_prompt.rb", "examples/helper.rb", "lib/pry.rb", "lib/pry/cli.rb", "lib/pry/code.rb", "lib/pry/command.rb", "lib/pry/command_set.rb", "lib/pry/commands.rb", "lib/pry/completion.rb", "lib/pry/config.rb", "lib/pry/core_extensions.rb", "lib/pry/custom_completions.rb", "lib/pry/default_commands/cd.rb", "lib/pry/default_commands/commands.rb", "lib/pry/default_commands/context.rb", "lib/pry/default_commands/easter_eggs.rb", "lib/pry/default_commands/editing.rb", "lib/pry/default_commands/find_method.rb", "lib/pry/default_commands/gems.rb", "lib/pry/default_commands/gist.rb", "lib/pry/default_commands/help.rb", "lib/pry/default_commands/hist.rb", "lib/pry/default_commands/input_and_output.rb", "lib/pry/default_commands/introspection.rb", "lib/pry/default_commands/ls.rb", "lib/pry/default_commands/misc.rb", "lib/pry/default_commands/navigating_pry.rb", "lib/pry/default_commands/whereami.rb", "lib/pry/extended_commands/experimental.rb", "lib/pry/helpers.rb", "lib/pry/helpers/base_helpers.rb", "lib/pry/helpers/command_helpers.rb", "lib/pry/helpers/documentation_helpers.rb", "lib/pry/helpers/options_helpers.rb", "lib/pry/helpers/text.rb", "lib/pry/history.rb", "lib/pry/history_array.rb", "lib/pry/hooks.rb", "lib/pry/indent.rb", "lib/pry/method.rb", "lib/pry/module_candidate.rb", "lib/pry/plugins.rb", "lib/pry/pry_class.rb", "lib/pry/pry_instance.rb", "lib/pry/rbx_method.rb", "lib/pry/rbx_path.rb", "lib/pry/repl_file_loader.rb", "lib/pry/version.rb", "lib/pry/wrapped_module.rb", "man/pry.1", "man/pry.1.html", "man/pry.1.ronn", "pry.gemspec", "test/candidate_helper1.rb", "test/candidate_helper2.rb", "test/helper.rb", "test/test_cli.rb", "test/test_code.rb", "test/test_command.rb", "test/test_command_helpers.rb", "test/test_command_integration.rb", "test/test_command_set.rb", "test/test_completion.rb", "test/test_control_d_handler.rb", "test/test_default_commands/example.erb", "test/test_default_commands/test_cd.rb", "test/test_default_commands/test_context.rb", "test/test_default_commands/test_documentation.rb", "test/test_default_commands/test_find_method.rb", "test/test_default_commands/test_gems.rb", "test/test_default_commands/test_help.rb", "test/test_default_commands/test_input.rb", "test/test_default_commands/test_introspection.rb", "test/test_default_commands/test_ls.rb", "test/test_default_commands/test_shell.rb", "test/test_default_commands/test_show_source.rb", "test/test_exception_whitelist.rb", "test/test_history_array.rb", "test/test_hooks.rb", "test/test_indent.rb", "test/test_input_stack.rb", "test/test_method.rb", "test/test_prompt.rb", "test/test_pry.rb", "test/test_pry_defaults.rb", "test/test_pry_history.rb", "test/test_pry_output.rb", "test/test_sticky_locals.rb", "test/test_syntax_checking.rb", "test/test_wrapped_module.rb", "test/testrc", "test/testrcbad", "wiki/Customizing-pry.md", "wiki/Home.md"]
14
14
  s.homepage = "http://pry.github.com"
15
15
  s.require_paths = ["lib"]
16
- s.rubygems_version = "1.8.23"
16
+ s.rubygems_version = "1.8.24"
17
17
  s.summary = "An IRB alternative and runtime developer console"
18
- s.test_files = ["test/helper.rb", "test/test_cli.rb", "test/test_code.rb", "test/test_command.rb", "test/test_command_helpers.rb", "test/test_command_integration.rb", "test/test_command_set.rb", "test/test_completion.rb", "test/test_default_commands/test_cd.rb", "test/test_default_commands/test_context.rb", "test/test_default_commands/test_documentation.rb", "test/test_default_commands/test_find_method.rb", "test/test_default_commands/test_gems.rb", "test/test_default_commands/test_help.rb", "test/test_default_commands/test_input.rb", "test/test_default_commands/test_introspection.rb", "test/test_default_commands/test_ls.rb", "test/test_default_commands/test_shell.rb", "test/test_default_commands/test_show_source.rb", "test/test_exception_whitelist.rb", "test/test_history_array.rb", "test/test_hooks.rb", "test/test_indent.rb", "test/test_input_stack.rb", "test/test_method.rb", "test/test_pry.rb", "test/test_pry_defaults.rb", "test/test_pry_history.rb", "test/test_pry_output.rb", "test/test_sticky_locals.rb", "test/test_syntax_checking.rb", "test/test_wrapped_module.rb", "test/testrc", "test/testrcbad"]
18
+ s.test_files = ["test/candidate_helper1.rb", "test/candidate_helper2.rb", "test/helper.rb", "test/test_cli.rb", "test/test_code.rb", "test/test_command.rb", "test/test_command_helpers.rb", "test/test_command_integration.rb", "test/test_command_set.rb", "test/test_completion.rb", "test/test_control_d_handler.rb", "test/test_default_commands/example.erb", "test/test_default_commands/test_cd.rb", "test/test_default_commands/test_context.rb", "test/test_default_commands/test_documentation.rb", "test/test_default_commands/test_find_method.rb", "test/test_default_commands/test_gems.rb", "test/test_default_commands/test_help.rb", "test/test_default_commands/test_input.rb", "test/test_default_commands/test_introspection.rb", "test/test_default_commands/test_ls.rb", "test/test_default_commands/test_shell.rb", "test/test_default_commands/test_show_source.rb", "test/test_exception_whitelist.rb", "test/test_history_array.rb", "test/test_hooks.rb", "test/test_indent.rb", "test/test_input_stack.rb", "test/test_method.rb", "test/test_prompt.rb", "test/test_pry.rb", "test/test_pry_defaults.rb", "test/test_pry_history.rb", "test/test_pry_output.rb", "test/test_sticky_locals.rb", "test/test_syntax_checking.rb", "test/test_wrapped_module.rb", "test/testrc", "test/testrcbad"]
19
19
 
20
20
  if s.respond_to? :specification_version then
21
21
  s.specification_version = 3
22
22
 
23
23
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
24
24
  s.add_runtime_dependency(%q<coderay>, ["~> 1.0.5"])
25
- s.add_runtime_dependency(%q<slop>, ["< 3", ">= 2.4.4"])
26
- s.add_runtime_dependency(%q<method_source>, ["~> 0.7.1"])
25
+ s.add_runtime_dependency(%q<slop>, ["~> 3.3.1"])
26
+ s.add_runtime_dependency(%q<method_source>, ["~> 0.8"])
27
27
  s.add_development_dependency(%q<bacon>, ["~> 1.1"])
28
28
  s.add_development_dependency(%q<open4>, ["~> 1.3"])
29
29
  s.add_development_dependency(%q<rake>, ["~> 0.9"])
30
30
  else
31
31
  s.add_dependency(%q<coderay>, ["~> 1.0.5"])
32
- s.add_dependency(%q<slop>, ["< 3", ">= 2.4.4"])
33
- s.add_dependency(%q<method_source>, ["~> 0.7.1"])
32
+ s.add_dependency(%q<slop>, ["~> 3.3.1"])
33
+ s.add_dependency(%q<method_source>, ["~> 0.8"])
34
34
  s.add_dependency(%q<bacon>, ["~> 1.1"])
35
35
  s.add_dependency(%q<open4>, ["~> 1.3"])
36
36
  s.add_dependency(%q<rake>, ["~> 0.9"])
37
37
  end
38
38
  else
39
39
  s.add_dependency(%q<coderay>, ["~> 1.0.5"])
40
- s.add_dependency(%q<slop>, ["< 3", ">= 2.4.4"])
41
- s.add_dependency(%q<method_source>, ["~> 0.7.1"])
40
+ s.add_dependency(%q<slop>, ["~> 3.3.1"])
41
+ s.add_dependency(%q<method_source>, ["~> 0.8"])
42
42
  s.add_dependency(%q<bacon>, ["~> 1.1"])
43
43
  s.add_dependency(%q<open4>, ["~> 1.3"])
44
44
  s.add_dependency(%q<rake>, ["~> 0.9"])
@@ -0,0 +1,11 @@
1
+ # rank 0
2
+ class CandidateTest
3
+ def test1
4
+ end
5
+
6
+ def test2
7
+ end
8
+
9
+ def test3
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ # rank 1
2
+ class CandidateTest
3
+ def test4
4
+ end
5
+
6
+ def test5
7
+ end
8
+ end
@@ -8,6 +8,11 @@ puts "Ruby v#{RUBY_VERSION} (#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"}), P
8
8
  require 'bacon'
9
9
  require 'open4'
10
10
 
11
+ # A global space for storing temporary state during tests.
12
+ Pad = OpenStruct.new
13
+ def Pad.clear
14
+ @table = {}
15
+ end
11
16
 
12
17
  # turn warnings off (esp for Pry::Hooks which will generate warnings
13
18
  # in tests)
@@ -46,6 +51,16 @@ class TestClassForShowSource
46
51
  end
47
52
  end
48
53
 
54
+ class TestClassForShowSourceClassEval
55
+ def alpha
56
+ end
57
+ end
58
+
59
+ class TestClassForShowSourceInstanceEval
60
+ def alpha
61
+ end
62
+ end
63
+
49
64
  # in case the tests call reset_defaults, ensure we reset them to
50
65
  # amended (test friendly) values
51
66
  class << Pry
@@ -56,6 +71,7 @@ class << Pry
56
71
  Pry.color = false
57
72
  Pry.pager = false
58
73
  Pry.config.should_load_rc = false
74
+ Pry.config.should_load_local_rc= false
59
75
  Pry.config.should_load_plugins = false
60
76
  Pry.config.history.should_load = false
61
77
  Pry.config.history.should_save = false