pry 0.9.4pre4 → 0.9.4pre5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/pry/pry_class.rb CHANGED
@@ -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
data/lib/pry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.9.4pre4"
2
+ VERSION = "0.9.4pre5"
3
3
  end
data/test/test_pry.rb CHANGED
@@ -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,92 +1,89 @@
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: ruby
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: &70196682021800 !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: *70196682021800
25
+ - !ruby/object:Gem::Dependency
26
+ name: coderay
27
+ requirement: &70196682020120 !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: *70196682020120
36
+ - !ruby/object:Gem::Dependency
37
+ name: slop
38
+ requirement: &70196682019580 !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: *70196682019580
47
+ - !ruby/object:Gem::Dependency
48
+ name: method_source
49
+ requirement: &70196682018860 !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: *70196682018860
58
+ - !ruby/object:Gem::Dependency
59
+ name: bacon
60
+ requirement: &70196682033740 !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: *70196682033740
69
+ - !ruby/object:Gem::Dependency
70
+ name: open4
71
+ requirement: &70196682031180 !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
78
+ prerelease: false
79
+ version_requirements: *70196682031180
81
80
  description: An IRB alternative and runtime developer console
82
81
  email: jrmair@gmail.com
83
- executables:
82
+ executables:
84
83
  - pry
85
84
  extensions: []
86
-
87
85
  extra_rdoc_files: []
88
-
89
- files:
86
+ files:
90
87
  - .document
91
88
  - .gemtest
92
89
  - .gitignore
@@ -162,32 +159,29 @@ files:
162
159
  - wiki/Home.md
163
160
  homepage: http://pry.github.com
164
161
  licenses: []
165
-
166
162
  post_install_message:
167
163
  rdoc_options: []
168
-
169
- require_paths:
164
+ require_paths:
170
165
  - lib
171
- required_ruby_version: !ruby/object:Gem::Requirement
166
+ required_ruby_version: !ruby/object:Gem::Requirement
172
167
  none: false
173
- requirements:
174
- - - ">="
175
- - !ruby/object:Gem::Version
176
- version: "0"
177
- required_rubygems_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ! '>='
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
178
173
  none: false
179
- requirements:
180
- - - ">"
181
- - !ruby/object:Gem::Version
174
+ requirements:
175
+ - - ! '>'
176
+ - !ruby/object:Gem::Version
182
177
  version: 1.3.1
183
178
  requirements: []
184
-
185
179
  rubyforge_project:
186
- rubygems_version: 1.7.2
180
+ rubygems_version: 1.8.6
187
181
  signing_key:
188
182
  specification_version: 3
189
183
  summary: An IRB alternative and runtime developer console
190
- test_files:
184
+ test_files:
191
185
  - test/helper.rb
192
186
  - test/test_command_helpers.rb
193
187
  - test/test_command_processor.rb