pry 0.9.7.2-i386-mswin32 → 0.9.7.3-i386-mswin32

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
+ 28/10/2011 version 0.9.7.3 hotfix-hotfix ;)
2
+ * really fixed indentation for 'super if' and friends
3
+ * Fixed indentation for tmux
4
+ * added Pry.config.correct_indent option (to toggle whether indentation
5
+ * corrected optional param behaviour for method signatures: e.g Signature meth(param1=?, param2=?)
6
+
1
7
  27/10/2011 version 0.9.7.2 hotfix
2
8
  * fixed indentation for 'super if' and 'ensure', 'next if', etc
3
9
  * refactored Pry#run_command so it can accept an eval_string parameter (so amend-line and so on can work with it)
data/lib/pry/config.rb CHANGED
@@ -134,6 +134,10 @@ class Pry
134
134
  # @return [Boolean] Whether or not code should be indented
135
135
  # using Pry::Indent.
136
136
  attr_accessor :auto_indent
137
+
138
+ # @return [Boolean] Whether or not indentation should be corrected
139
+ # after hitting enter. This feature is not supported by all terminals.
140
+ attr_accessor :correct_indent
137
141
  end
138
142
  end
139
143
 
data/lib/pry/indent.rb CHANGED
@@ -48,7 +48,10 @@ class Pry
48
48
  # Tokens that indicate the end of a statement (i.e. that, if they appear
49
49
  # directly before an "if" indicates that that if applies to the same line,
50
50
  # not the next line)
51
- STATEMENT_END_TOKENS = IGNORE_TOKENS + [:regexp, :integer, :float, :keyword]
51
+ #
52
+ # :reserved and :keywords are the CodeRay 0.9.8 and 1.0.0 respectively
53
+ # classifications of "super", "next", "return", etc.
54
+ STATEMENT_END_TOKENS = IGNORE_TOKENS + [:regexp, :integer, :float, :keyword, :reserved]
52
55
 
53
56
  # Collection of tokens that should appear dedented even though they
54
57
  # don't affect the surrounding code.
@@ -195,9 +198,14 @@ class Pry
195
198
  lines = 1
196
199
  end
197
200
 
198
- move_up = "\e[#{lines}F"
201
+ if defined?(Win32::Console)
202
+ move_up = "\e[#{lines}F"
203
+ move_down = "\e[#{lines}E"
204
+ else
205
+ move_up = "\e[#{lines}A\e[0G"
206
+ move_down = "\e[#{lines}B\e[0G"
207
+ end
199
208
  whitespace = ' ' * overhang
200
- move_down = "\e[#{lines}E"
201
209
 
202
210
  "#{move_up}#{full_line}#{whitespace}#{move_down}"
203
211
  end
data/lib/pry/method.rb CHANGED
@@ -259,9 +259,10 @@ class Pry
259
259
  args = parameters.inject([]) do |arr, (type, name)|
260
260
  name ||= (type == :block ? 'block' : "arg#{arr.size + 1}")
261
261
  arr << case type
262
- when :req then name.to_s
263
- when :opt, :rest then "*#{name}"
264
- when :block then "&#{name}"
262
+ when :req then name.to_s
263
+ when :opt then "#{name}=?"
264
+ when :rest then "*#{name}"
265
+ when :block then "&#{name}"
265
266
  else '?'
266
267
  end
267
268
  end
data/lib/pry/pry_class.rb CHANGED
@@ -191,6 +191,7 @@ class Pry
191
191
  config.disable_auto_reload = false
192
192
  config.command_prefix = ""
193
193
  config.auto_indent = true
194
+ config.correct_indent = true
194
195
 
195
196
  config.plugins ||= OpenStruct.new
196
197
  config.plugins.enabled = true
@@ -321,7 +321,7 @@ class Pry
321
321
  orig_val = "#{indentation}#{val}"
322
322
  val = @indent.indent(val)
323
323
 
324
- if orig_val != val && output.tty? && Pry::Helpers::BaseHelpers.use_ansi_codes?
324
+ if orig_val != val && output.tty? && Pry::Helpers::BaseHelpers.use_ansi_codes? && Pry.config.correct_indent
325
325
  output.print @indent.correct_indentation(current_prompt + val, orig_val.length - val.length)
326
326
  end
327
327
  end
data/lib/pry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.9.7.2"
2
+ VERSION = "0.9.7.3"
3
3
  end
data/test/test_indent.rb CHANGED
@@ -195,6 +195,7 @@ TXT
195
195
  @indent.reset.indent("foo() if bar\n#").should == "foo() if bar\n#"
196
196
  @indent.reset.indent("foo 'hi' if bar\n#").should == "foo 'hi' if bar\n#"
197
197
  @indent.reset.indent("foo 1 while bar\n#").should == "foo 1 while bar\n#"
198
+ @indent.reset.indent("super if true\n#").should == "super if true\n#"
198
199
  end
199
200
 
200
201
  it "should indent cunningly disguised ifs" do
metadata CHANGED
@@ -1,14 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 9
9
- - 7
10
- - 2
11
- version: 0.9.7.2
5
+ version: 0.9.7.3
12
6
  platform: i386-mswin32
13
7
  authors:
14
8
  - John Mair (banisterfiend)
@@ -26,11 +20,6 @@ dependencies:
26
20
  requirements:
27
21
  - - ">="
28
22
  - !ruby/object:Gem::Version
29
- hash: 1
30
- segments:
31
- - 2
32
- - 3
33
- - 1
34
23
  version: 2.3.1
35
24
  type: :runtime
36
25
  version_requirements: *id001
@@ -42,11 +31,6 @@ dependencies:
42
31
  requirements:
43
32
  - - ~>
44
33
  - !ruby/object:Gem::Version
45
- hash: 43
46
- segments:
47
- - 0
48
- - 9
49
- - 8
50
34
  version: 0.9.8
51
35
  type: :runtime
52
36
  version_requirements: *id002
@@ -58,11 +42,6 @@ dependencies:
58
42
  requirements:
59
43
  - - ~>
60
44
  - !ruby/object:Gem::Version
61
- hash: 11
62
- segments:
63
- - 2
64
- - 1
65
- - 0
66
45
  version: 2.1.0
67
46
  type: :runtime
68
47
  version_requirements: *id003
@@ -74,11 +53,6 @@ dependencies:
74
53
  requirements:
75
54
  - - ~>
76
55
  - !ruby/object:Gem::Version
77
- hash: 9
78
- segments:
79
- - 0
80
- - 6
81
- - 7
82
56
  version: 0.6.7
83
57
  type: :runtime
84
58
  version_requirements: *id004
@@ -90,11 +64,6 @@ dependencies:
90
64
  requirements:
91
65
  - - ~>
92
66
  - !ruby/object:Gem::Version
93
- hash: 19
94
- segments:
95
- - 1
96
- - 1
97
- - 0
98
67
  version: 1.1.0
99
68
  type: :development
100
69
  version_requirements: *id005
@@ -106,11 +75,6 @@ dependencies:
106
75
  requirements:
107
76
  - - ~>
108
77
  - !ruby/object:Gem::Version
109
- hash: 21
110
- segments:
111
- - 1
112
- - 0
113
- - 1
114
78
  version: 1.0.1
115
79
  type: :development
116
80
  version_requirements: *id006
@@ -122,10 +86,6 @@ dependencies:
122
86
  requirements:
123
87
  - - ~>
124
88
  - !ruby/object:Gem::Version
125
- hash: 25
126
- segments:
127
- - 0
128
- - 9
129
89
  version: "0.9"
130
90
  type: :development
131
91
  version_requirements: *id007
@@ -137,11 +97,6 @@ dependencies:
137
97
  requirements:
138
98
  - - ~>
139
99
  - !ruby/object:Gem::Version
140
- hash: 27
141
- segments:
142
- - 1
143
- - 3
144
- - 0
145
100
  version: 1.3.0
146
101
  type: :runtime
147
102
  version_requirements: *id008
@@ -252,23 +207,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
252
207
  requirements:
253
208
  - - ">="
254
209
  - !ruby/object:Gem::Version
255
- hash: 3
256
- segments:
257
- - 0
258
210
  version: "0"
259
211
  required_rubygems_version: !ruby/object:Gem::Requirement
260
212
  none: false
261
213
  requirements:
262
214
  - - ">="
263
215
  - !ruby/object:Gem::Version
264
- hash: 3
265
- segments:
266
- - 0
267
216
  version: "0"
268
217
  requirements: []
269
218
 
270
219
  rubyforge_project:
271
- rubygems_version: 1.8.10
220
+ rubygems_version: 1.8.11
272
221
  signing_key:
273
222
  specification_version: 3
274
223
  summary: An IRB alternative and runtime developer console