[SVN] io.rb: Changes for Ruby 1.9
Charles Turner
vze26m98 at optonline.net
Thu Aug 28 18:16:42 UTC 2008
This diff file shows the patches I made to get the support file
io.rb to work with ruby 1.9.0 (2007-12-25 revision 14709)
[i686-darwin9.4.0]
I made no attempt to write code that works for another Ruby version.
Zip of the diff attached below.
-Charles
--- /Library/Application Support/TextMate/Support/lib/io.rb
+++ io.rb
@@ -37,8 +37,8 @@
lines = leftovers[name].to_s + $1
leftovers[name] = $2
case block.arity
- when 1 then lines.each_line { |line| block.call(line) }
- when 2 then lines.each_line { |line| block.call(line,
name) }
+ when 1: lines.each { |line| block.call(line) }
+ when 2: lines.each { |line| block.call(line, name) }
end
else
raise "Allan's regexp did not match #{str}"
@@ -46,8 +46,8 @@
elsif sync?
case block.arity
- when 1 then block.call(data)
- when 2 then block.call(data, name)
+ when 1: block.call(data)
+ when 2: block.call(data, name)
end
end
@@ -57,8 +57,8 @@
if not sync?
leftovers.delete_if {|name,crumb| crumb == ""}
case block.arity
- when 1 then leftovers.each_pair { |name, crumb|
block.call(crumb) }
- when 2 then leftovers.each_pair { |name, crumb|
block.call(crumb, name) }
+ when 1: leftovers.each_pair { |name, crumb|
block.call(crumb) }
+ when 2: leftovers.each_pair { |name, crumb|
block.call(crumb, name) }
end
end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: io-1.9.diff.zip
Type: application/zip
Size: 955 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20080828/bd3d4983/attachment.zip>
More information about the textmate-dev
mailing list