pry 0.9.4pre4-i386-mswin32 → 0.9.4pre5-i386-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pry/pry_class.rb +5 -4
- data/lib/pry/version.rb +1 -1
- data/test/test_pry.rb +13 -6
- metadata +67 -73
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
|
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
|
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 =
|
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
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
|
1130
|
-
it "returns the
|
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
|
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
|
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
|
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
|
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: i386-mswin32
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- John Mair (banisterfiend)
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70196685468520 !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
|
-
|
24
|
+
version_requirements: *70196685468520
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: coderay
|
27
|
+
requirement: &70196685467820 !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
|
-
|
35
|
+
version_requirements: *70196685467820
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: slop
|
38
|
+
requirement: &70196685467020 !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
|
-
|
46
|
+
version_requirements: *70196685467020
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: method_source
|
49
|
+
requirement: &70196685466120 !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
|
-
|
57
|
+
version_requirements: *70196685466120
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: bacon
|
60
|
+
requirement: &70196685464660 !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
|
-
|
68
|
+
version_requirements: *70196685464660
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: open4
|
71
|
+
requirement: &70196685463160 !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: win32console
|
83
78
|
prerelease: false
|
84
|
-
|
79
|
+
version_requirements: *70196685463160
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: win32console
|
82
|
+
requirement: &70196685462380 !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: 1.3.0
|
90
88
|
type: :runtime
|
91
|
-
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70196685462380
|
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:
|
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.
|
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
|