pry 0.9.4pre4-java → 0.9.4pre5-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,9 +101,10 @@ class Pry
101
101
  # @param max_size The maximum number of chars before clipping occurs.
102
102
  # @return [String] The string representation of `obj`.
103
103
  def self.view_clip(obj, max_length = 60)
104
- if obj.kind_of?(Module) && obj.name && obj.name != "" && obj.name.to_s.length <= max_length
104
+ if obj.kind_of?(Module) && obj.name.to_s != "" && obj.name.to_s.length <= max_length
105
105
  obj.name.to_s
106
- elsif obj.inspect.length <= max_length
106
+ elsif TOPLEVEL_BINDING.eval('self') == obj
107
+ # special case for 'main' object :)
107
108
  obj.inspect
108
109
  else
109
110
  "#<#{obj.class}:%#x>" % (obj.object_id << 1)
@@ -160,7 +161,7 @@ class Pry
160
161
 
161
162
  output = options[:show_output] ? options[:output] : StringIO.new
162
163
 
163
- Pry.new(:output => output, :input => StringIO.new(command_string), :commands => options[:commands]).rep(options[:context])
164
+ Pry.new(:output => output, :input => StringIO.new(command_string), :commands => options[:commands], :prompt => proc {""}, :hooks => {}).rep(options[:context])
164
165
  end
165
166
 
166
167
  def self.default_editor_for_platform
@@ -175,7 +176,7 @@ class Pry
175
176
  config.input = Readline
176
177
  config.output = $stdout
177
178
  config.commands = Pry::Commands
178
- config.prompt = NAV_PROMPT
179
+ config.prompt = DEFAULT_PROMPT
179
180
  config.print = DEFAULT_PRINT
180
181
  config.exception_handler = DEFAULT_EXCEPTION_HANDLER
181
182
  config.hooks = DEFAULT_HOOKS
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.9.4pre4"
2
+ VERSION = "0.9.4pre5"
3
3
  end
@@ -1126,21 +1126,28 @@ describe Pry do
1126
1126
 
1127
1127
  VC_MAX_LENGTH = 60
1128
1128
 
1129
- describe "given an object with an #inspect string shorter than the maximum specified" do
1130
- it "returns the #inspect string" do
1129
+ describe "given an object with an #inspect string" do
1130
+ it "returns the #<> format of the object (never use inspect)" do
1131
1131
  o = Object.new
1132
1132
  def o.inspect; "a" * VC_MAX_LENGTH; end
1133
1133
 
1134
- Pry.view_clip(o, VC_MAX_LENGTH).should == o.inspect
1134
+ Pry.view_clip(o, VC_MAX_LENGTH).should =~ /Object:0x.*?/
1135
1135
  end
1136
1136
  end
1137
1137
 
1138
+ # describe "given the 'main' object" do
1139
+ # it "returns the #inspect of main (special case)" do
1140
+ # o = TOPLEVEL_BINDING.eval('self')
1141
+ # Pry.view_clip(o, VC_MAX_LENGTH).should == o.inspect
1142
+ # end
1143
+ # end
1144
+
1138
1145
  describe "given an object with an #inspect string as long as the maximum specified" do
1139
- it "returns the #inspect string" do
1146
+ it "returns the #<> format of the object (never use inspect)" do
1140
1147
  o = Object.new
1141
1148
  def o.inspect; "a" * VC_MAX_LENGTH; end
1142
1149
 
1143
- Pry.view_clip(o, VC_MAX_LENGTH).should == o.inspect
1150
+ Pry.view_clip(o, VC_MAX_LENGTH).should =~ /Object:0x.*?/
1144
1151
  end
1145
1152
  end
1146
1153
 
@@ -1151,7 +1158,7 @@ describe Pry do
1151
1158
  o = Object.new
1152
1159
  def o.inspect; "a" * (VC_MAX_LENGTH + 1); end
1153
1160
 
1154
- Pry.view_clip(o, VC_MAX_LENGTH).should =~ /Object:0x\d+?/
1161
+ Pry.view_clip(o, VC_MAX_LENGTH).should =~ /Object:0x.*?/
1155
1162
  end
1156
1163
  end
1157
1164
 
metadata CHANGED
@@ -1,103 +1,100 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pry
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.4pre5
4
5
  prerelease: 5
5
- version: 0.9.4pre4
6
6
  platform: java
7
- authors:
7
+ authors:
8
8
  - John Mair (banisterfiend)
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-09-08 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-09-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: ruby_parser
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70196681763660 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
23
21
  version: 2.0.5
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: coderay
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70196681763660
25
+ - !ruby/object:Gem::Dependency
26
+ name: coderay
27
+ requirement: &70196681762800 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
34
32
  version: 0.9.8
35
33
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: slop
39
34
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70196681762800
36
+ - !ruby/object:Gem::Dependency
37
+ name: slop
38
+ requirement: &70196681762160 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
40
+ requirements:
43
41
  - - ~>
44
- - !ruby/object:Gem::Version
42
+ - !ruby/object:Gem::Version
45
43
  version: 2.1.0
46
44
  type: :runtime
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: method_source
50
45
  prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70196681762160
47
+ - !ruby/object:Gem::Dependency
48
+ name: method_source
49
+ requirement: &70196681761520 !ruby/object:Gem::Requirement
52
50
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
56
54
  version: 0.6.5
57
55
  type: :runtime
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
60
- name: bacon
61
56
  prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70196681761520
58
+ - !ruby/object:Gem::Dependency
59
+ name: bacon
60
+ requirement: &70196681760780 !ruby/object:Gem::Requirement
63
61
  none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
67
65
  version: 1.1.0
68
66
  type: :development
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
71
- name: open4
72
67
  prerelease: false
73
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *70196681760780
69
+ - !ruby/object:Gem::Dependency
70
+ name: open4
71
+ requirement: &70196681702460 !ruby/object:Gem::Requirement
74
72
  none: false
75
- requirements:
73
+ requirements:
76
74
  - - ~>
77
- - !ruby/object:Gem::Version
75
+ - !ruby/object:Gem::Version
78
76
  version: 1.0.1
79
77
  type: :development
80
- version_requirements: *id006
81
- - !ruby/object:Gem::Dependency
82
- name: spoon
83
78
  prerelease: false
84
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *70196681702460
80
+ - !ruby/object:Gem::Dependency
81
+ name: spoon
82
+ requirement: &70196681701680 !ruby/object:Gem::Requirement
85
83
  none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
89
87
  version: 0.0.1
90
88
  type: :runtime
91
- version_requirements: *id007
89
+ prerelease: false
90
+ version_requirements: *70196681701680
92
91
  description: An IRB alternative and runtime developer console
93
92
  email: jrmair@gmail.com
94
- executables:
93
+ executables:
95
94
  - pry
96
95
  extensions: []
97
-
98
96
  extra_rdoc_files: []
99
-
100
- files:
97
+ files:
101
98
  - .document
102
99
  - .gemtest
103
100
  - .gitignore
@@ -173,32 +170,29 @@ files:
173
170
  - wiki/Home.md
174
171
  homepage: http://pry.github.com
175
172
  licenses: []
176
-
177
173
  post_install_message:
178
174
  rdoc_options: []
179
-
180
- require_paths:
175
+ require_paths:
181
176
  - lib
182
- required_ruby_version: !ruby/object:Gem::Requirement
177
+ required_ruby_version: !ruby/object:Gem::Requirement
183
178
  none: false
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: "0"
188
- required_rubygems_version: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ! '>='
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ required_rubygems_version: !ruby/object:Gem::Requirement
189
184
  none: false
190
- requirements:
191
- - - ">"
192
- - !ruby/object:Gem::Version
185
+ requirements:
186
+ - - ! '>'
187
+ - !ruby/object:Gem::Version
193
188
  version: 1.3.1
194
189
  requirements: []
195
-
196
190
  rubyforge_project:
197
- rubygems_version: 1.7.2
191
+ rubygems_version: 1.8.6
198
192
  signing_key:
199
193
  specification_version: 3
200
194
  summary: An IRB alternative and runtime developer console
201
- test_files:
195
+ test_files:
202
196
  - test/helper.rb
203
197
  - test/test_command_helpers.rb
204
198
  - test/test_command_processor.rb