pry 0.9.8.1-i386-mingw32 → 0.9.8.2-i386-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 9/2/2012 version 0.9.8.2 bugfix
2
+ * fixed bugs related to --super
3
+ * upgraded slop dependency
4
+ * added edit -c (edit current line)
5
+ * edit now respects Pry.config.disable_autoreload option
6
+
1
7
  30/1/2012 version 0.9.8.1 bugfix
2
8
  * fixed broken --no-plugins option
3
9
  * Ensure ARGV is not mutated during option parsing.
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ def apply_spec_defaults(s)
20
20
  s.files = `git ls-files`.split("\n")
21
21
  s.test_files = `git ls-files -- test/*`.split("\n")
22
22
  s.add_dependency('coderay', '~> 1.0.5')
23
- s.add_dependency('slop', ['>= 2.4.3', '< 3'])
23
+ s.add_dependency('slop', ['>= 2.4.4', '< 3'])
24
24
  s.add_dependency('method_source','~> 0.7')
25
25
  s.add_development_dependency('bacon', '~> 1.1')
26
26
  s.add_development_dependency('open4', '~> 1.3')
data/lib/pry/code.rb CHANGED
@@ -110,7 +110,7 @@ class Pry
110
110
  lines = lines.lines
111
111
  end
112
112
 
113
- @lines = lines.each_with_index.map { |l, i| [l.chomp, i + start_line] }
113
+ @lines = lines.each_with_index.map { |l, i| [l.chomp, i + start_line.to_i] }
114
114
  @code_type = code_type
115
115
  end
116
116
 
@@ -125,6 +125,7 @@ class Pry
125
125
  opt.on :t, :temp, "Open an empty temporary file"
126
126
  opt.on :l, :line, "Jump to this line in the opened file", true, :as => Integer
127
127
  opt.on :n, :"no-reload", "Don't automatically reload the edited code"
128
+ opt.on :c, :"current", "Open the current __FILE__ and at __LINE__ (as returned by `whereami`)."
128
129
  opt.on :r, :reload, "Reload the edited code immediately (default for ruby files)"
129
130
  end
130
131
 
@@ -133,7 +134,7 @@ class Pry
133
134
  raise CommandError, "Only one of --ex, --temp, --in and FILE may be specified."
134
135
  end
135
136
 
136
- if !opts.present?(:ex) && args.empty?
137
+ if !opts.present?(:ex) && !opts.present?(:current) && args.empty?
137
138
  # edit of local code, eval'd within pry.
138
139
  process_local_edit
139
140
  else
@@ -171,7 +172,7 @@ class Pry
171
172
  f.puts(content)
172
173
  f.flush
173
174
  invoke_editor(f.path, line)
174
- if !opts.present?(:'no-reload')
175
+ if !opts.present?(:'no-reload') && !Pry.config.disable_auto_reload
175
176
  silence_warnings do
176
177
  eval_string.replace(File.read(f.path))
177
178
  end
@@ -204,19 +205,26 @@ class Pry
204
205
  if Pry.eval_path == file_name
205
206
  raise CommandError, "Cannot edit exceptions raised in REPL."
206
207
  end
208
+ elsif opts.present?(:current)
209
+ file_name = target.eval("__FILE__")
210
+ line = target.eval("__LINE__")
207
211
  else
212
+
208
213
  # break up into file:line
209
214
  file_name = File.expand_path(args.first)
210
-
211
215
  line = file_name.sub!(/:(\d+)$/, "") ? $1.to_i : 1
212
216
  end
213
217
 
218
+ if not_a_real_file?(file_name)
219
+ raise CommandError, "#{file_name} is not a valid file name, cannot edit!"
220
+ end
221
+
214
222
  line = opts[:l].to_i if opts.present?(:line)
215
223
 
216
224
  invoke_editor(file_name, line)
217
225
  set_file_and_dir_locals(file_name)
218
226
 
219
- if opts.present?(:reload) || ((opts.present?(:ex) || file_name.end_with?(".rb")) && !opts.present?(:'no-reload'))
227
+ if opts.present?(:reload) || ((opts.present?(:ex) || file_name.end_with?(".rb")) && !opts.present?(:'no-reload')) && !Pry.config.disable_auto_reload
220
228
  silence_warnings do
221
229
  TOPLEVEL_BINDING.eval(File.read(file_name), file_name)
222
230
  end
@@ -305,7 +313,7 @@ class Pry
305
313
 
306
314
  invoke_editor(file, opts["no-jump"] ? 0 : line)
307
315
  silence_warnings do
308
- load file unless opts.present?(:'no-jump') || Pry.config.disable_auto_reload
316
+ load file unless opts.present?(:'no-reload') || Pry.config.disable_auto_reload
309
317
  end
310
318
  end
311
319
 
@@ -27,6 +27,10 @@ class Pry
27
27
  Gem::Specification.respond_to?(:find_all_by_name) ? !Gem::Specification.find_all_by_name(gem_name).empty? : Gem.source_index.find_name(gem_name).first
28
28
  end
29
29
 
30
+ def not_a_real_file?(file)
31
+ file =~ /(\(.*\))|<.*>/ || file =~ /__unknown__/ || file == "" || file == "-e"
32
+ end
33
+
30
34
  def command_dependencies_met?(options)
31
35
  return true if !options[:requires_gem]
32
36
  Array(options[:requires_gem]).all? do |g|
data/lib/pry/method.rb CHANGED
@@ -348,11 +348,11 @@ class Pry
348
348
  # @return [Pry::Method, nil] The wrapped method that is called when you
349
349
  # use "super" in the body of this method.
350
350
  def super(times=1)
351
- if respond_to?(:receiver)
351
+ if UnboundMethod === @method
352
+ sup = super_using_ancestors(Pry::Method.instance_resolution_order(owner), times)
353
+ else
352
354
  sup = super_using_ancestors(Pry::Method.resolution_order(receiver), times)
353
355
  sup &&= sup.bind(receiver)
354
- else
355
- sup = super_using_ancestors(Pry::Method.instance_resolution_order(owner), times)
356
356
  end
357
357
  Pry::Method.new(sup) if sup
358
358
  end
@@ -443,8 +443,11 @@ class Pry
443
443
  def super_using_ancestors(ancestors, times=1)
444
444
  next_owner = self.owner
445
445
  times.times do
446
- next_owner = ancestors[ancestors.index(next_owner) + 1]
447
- return nil unless next_owner
446
+ i = ancestors.index(next_owner) + 1
447
+ while ancestors[i] && !(ancestors[i].method_defined?(name) || ancestors[i].private_method_defined?(name))
448
+ i += 1
449
+ end
450
+ next_owner = ancestors[i] or return nil
448
451
  end
449
452
  next_owner.instance_method(name) rescue nil
450
453
  end
data/lib/pry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.9.8.1"
2
+ VERSION = "0.9.8.2"
3
3
  end
data/pry.gemspec CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "pry"
5
- s.version = "0.9.8.1"
5
+ s.version = "0.9.8.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Mair (banisterfiend)"]
9
- s.date = "2012-01-30"
9
+ s.date = "2012-02-09"
10
10
  s.description = "An IRB alternative and runtime developer console"
11
11
  s.email = "jrmair@gmail.com"
12
12
  s.executables = ["pry"]
13
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/basic.rb", "lib/pry/default_commands/context.rb", "lib/pry/default_commands/documentation.rb", "lib/pry/default_commands/easter_eggs.rb", "lib/pry/default_commands/gems.rb", "lib/pry/default_commands/input.rb", "lib/pry/default_commands/introspection.rb", "lib/pry/default_commands/ls.rb", "lib/pry/default_commands/shell.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/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.rb", "test/test_default_commands/test_context.rb", "test/test_default_commands/test_documentation.rb", "test/test_default_commands/test_gems.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_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_special_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.15"
16
+ s.rubygems_version = "1.8.11"
17
17
  s.summary = "An IRB alternative and runtime developer console"
18
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.rb", "test/test_default_commands/test_context.rb", "test/test_default_commands/test_documentation.rb", "test/test_default_commands/test_gems.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_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_special_locals.rb", "test/test_syntax_checking.rb", "test/test_wrapped_module.rb", "test/testrc", "test/testrcbad"]
19
19
 
@@ -22,14 +22,14 @@ Gem::Specification.new do |s|
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.3"])
25
+ s.add_runtime_dependency(%q<slop>, ["< 3", ">= 2.4.4"])
26
26
  s.add_runtime_dependency(%q<method_source>, ["~> 0.7"])
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.3"])
32
+ s.add_dependency(%q<slop>, ["< 3", ">= 2.4.4"])
33
33
  s.add_dependency(%q<method_source>, ["~> 0.7"])
34
34
  s.add_dependency(%q<bacon>, ["~> 1.1"])
35
35
  s.add_dependency(%q<open4>, ["~> 1.3"])
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
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.3"])
40
+ s.add_dependency(%q<slop>, ["< 3", ">= 2.4.4"])
41
41
  s.add_dependency(%q<method_source>, ["~> 0.7"])
42
42
  s.add_dependency(%q<bacon>, ["~> 1.1"])
43
43
  s.add_dependency(%q<open4>, ["~> 1.3"])
data/test/test_method.rb CHANGED
@@ -124,6 +124,60 @@ describe Pry::Method do
124
124
  end
125
125
  end
126
126
 
127
+ describe 'super' do
128
+ it 'should be able to find the super method on a bound method' do
129
+ a = Class.new{ def rar; 4; end }
130
+ b = Class.new(a){ def rar; super; end }
131
+
132
+ obj = b.new
133
+
134
+ zuper = Pry::Method(obj.method(:rar)).super
135
+ zuper.owner.should == a
136
+ zuper.receiver.should == obj
137
+ end
138
+
139
+ it 'should be able to find the super method of an unbound method' do
140
+ a = Class.new{ def rar; 4; end }
141
+ b = Class.new(a){ def rar; super; end }
142
+
143
+ zuper = Pry::Method(b.instance_method(:rar)).super
144
+ zuper.owner.should == a
145
+ end
146
+
147
+ it 'should return nil if no super method exists' do
148
+ a = Class.new{ def rar; super; end }
149
+
150
+ Pry::Method(a.instance_method(:rar)).super.should == nil
151
+ end
152
+
153
+ it 'should be able to find super methods defined on modules' do
154
+ m = Module.new{ def rar; 4; end }
155
+ a = Class.new{ def rar; super; end; include m }
156
+
157
+ zuper = Pry::Method(a.new.method(:rar)).super
158
+ zuper.owner.should == m
159
+ end
160
+
161
+ it 'should be able to find super methods defined on super-classes when there are modules in the way' do
162
+ a = Class.new{ def rar; 4; end }
163
+ m = Module.new{ def mooo; 4; end }
164
+ b = Class.new(a){ def rar; super; end; include m }
165
+
166
+ zuper = Pry::Method(b.new.method(:rar)).super
167
+ zuper.owner.should == a
168
+ end
169
+
170
+ it 'should be able to jump up multiple levels of bound method, even through modules' do
171
+ a = Class.new{ def rar; 4; end }
172
+ m = Module.new{ def rar; 4; end }
173
+ b = Class.new(a){ def rar; super; end; include m }
174
+
175
+ zuper = Pry::Method(b.new.method(:rar)).super
176
+ zuper.owner.should == m
177
+ zuper.super.owner.should == a
178
+ end
179
+ end
180
+
127
181
  describe 'all_from_class' do
128
182
  def should_find_method(name)
129
183
  Pry::Method.all_from_class(@class).map(&:name).should.include(name)
metadata CHANGED
@@ -1,103 +1,106 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pry
3
- version: !ruby/object:Gem::Version
4
- version: 0.9.8.1
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.9.8.2
6
6
  platform: i386-mingw32
7
- authors:
7
+ authors:
8
8
  - John Mair (banisterfiend)
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-30 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2012-02-09 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
15
16
  name: coderay
16
- requirement: &70340903260220 !ruby/object:Gem::Requirement
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
17
19
  none: false
18
- requirements:
20
+ requirements:
19
21
  - - ~>
20
- - !ruby/object:Gem::Version
22
+ - !ruby/object:Gem::Version
21
23
  version: 1.0.5
22
24
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70340903260220
25
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
26
27
  name: slop
27
- requirement: &70340903259700 !ruby/object:Gem::Requirement
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
28
30
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: 2.4.3
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 2.4.4
33
35
  - - <
34
- - !ruby/object:Gem::Version
35
- version: '3'
36
+ - !ruby/object:Gem::Version
37
+ version: "3"
36
38
  type: :runtime
37
- prerelease: false
38
- version_requirements: *70340903259700
39
- - !ruby/object:Gem::Dependency
39
+ version_requirements: *id002
40
+ - !ruby/object:Gem::Dependency
40
41
  name: method_source
41
- requirement: &70340903258940 !ruby/object:Gem::Requirement
42
+ prerelease: false
43
+ requirement: &id003 !ruby/object:Gem::Requirement
42
44
  none: false
43
- requirements:
45
+ requirements:
44
46
  - - ~>
45
- - !ruby/object:Gem::Version
46
- version: '0.7'
47
+ - !ruby/object:Gem::Version
48
+ version: "0.7"
47
49
  type: :runtime
48
- prerelease: false
49
- version_requirements: *70340903258940
50
- - !ruby/object:Gem::Dependency
50
+ version_requirements: *id003
51
+ - !ruby/object:Gem::Dependency
51
52
  name: bacon
52
- requirement: &70340903258460 !ruby/object:Gem::Requirement
53
+ prerelease: false
54
+ requirement: &id004 !ruby/object:Gem::Requirement
53
55
  none: false
54
- requirements:
56
+ requirements:
55
57
  - - ~>
56
- - !ruby/object:Gem::Version
57
- version: '1.1'
58
+ - !ruby/object:Gem::Version
59
+ version: "1.1"
58
60
  type: :development
59
- prerelease: false
60
- version_requirements: *70340903258460
61
- - !ruby/object:Gem::Dependency
61
+ version_requirements: *id004
62
+ - !ruby/object:Gem::Dependency
62
63
  name: open4
63
- requirement: &70340903257920 !ruby/object:Gem::Requirement
64
+ prerelease: false
65
+ requirement: &id005 !ruby/object:Gem::Requirement
64
66
  none: false
65
- requirements:
67
+ requirements:
66
68
  - - ~>
67
- - !ruby/object:Gem::Version
68
- version: '1.3'
69
+ - !ruby/object:Gem::Version
70
+ version: "1.3"
69
71
  type: :development
70
- prerelease: false
71
- version_requirements: *70340903257920
72
- - !ruby/object:Gem::Dependency
72
+ version_requirements: *id005
73
+ - !ruby/object:Gem::Dependency
73
74
  name: rake
74
- requirement: &70340903257440 !ruby/object:Gem::Requirement
75
+ prerelease: false
76
+ requirement: &id006 !ruby/object:Gem::Requirement
75
77
  none: false
76
- requirements:
78
+ requirements:
77
79
  - - ~>
78
- - !ruby/object:Gem::Version
79
- version: '0.9'
80
+ - !ruby/object:Gem::Version
81
+ version: "0.9"
80
82
  type: :development
81
- prerelease: false
82
- version_requirements: *70340903257440
83
- - !ruby/object:Gem::Dependency
83
+ version_requirements: *id006
84
+ - !ruby/object:Gem::Dependency
84
85
  name: win32console
85
- requirement: &70340903256960 !ruby/object:Gem::Requirement
86
+ prerelease: false
87
+ requirement: &id007 !ruby/object:Gem::Requirement
86
88
  none: false
87
- requirements:
89
+ requirements:
88
90
  - - ~>
89
- - !ruby/object:Gem::Version
90
- version: '1.3'
91
+ - !ruby/object:Gem::Version
92
+ version: "1.3"
91
93
  type: :runtime
92
- prerelease: false
93
- version_requirements: *70340903256960
94
+ version_requirements: *id007
94
95
  description: An IRB alternative and runtime developer console
95
96
  email: jrmair@gmail.com
96
- executables:
97
+ executables:
97
98
  - pry
98
99
  extensions: []
100
+
99
101
  extra_rdoc_files: []
100
- files:
102
+
103
+ files:
101
104
  - .document
102
105
  - .gemtest
103
106
  - .gitignore
@@ -198,29 +201,32 @@ files:
198
201
  - wiki/Home.md
199
202
  homepage: http://pry.github.com
200
203
  licenses: []
204
+
201
205
  post_install_message:
202
206
  rdoc_options: []
203
- require_paths:
207
+
208
+ require_paths:
204
209
  - lib
205
- required_ruby_version: !ruby/object:Gem::Requirement
210
+ required_ruby_version: !ruby/object:Gem::Requirement
206
211
  none: false
207
- requirements:
208
- - - ! '>='
209
- - !ruby/object:Gem::Version
210
- version: '0'
211
- required_rubygems_version: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: "0"
216
+ required_rubygems_version: !ruby/object:Gem::Requirement
212
217
  none: false
213
- requirements:
214
- - - ! '>='
215
- - !ruby/object:Gem::Version
216
- version: '0'
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: "0"
217
222
  requirements: []
223
+
218
224
  rubyforge_project:
219
- rubygems_version: 1.8.15
225
+ rubygems_version: 1.8.11
220
226
  signing_key:
221
227
  specification_version: 3
222
228
  summary: An IRB alternative and runtime developer console
223
- test_files:
229
+ test_files:
224
230
  - test/helper.rb
225
231
  - test/test_cli.rb
226
232
  - test/test_code.rb