rogerdpack-rbeautify 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rbeautify +3 -3
- metadata +1 -1
data/bin/rbeautify
CHANGED
@@ -192,13 +192,13 @@ module RBeautify
|
|
192
192
|
dest,error = beautify_string(source,"stdin")
|
193
193
|
print dest
|
194
194
|
else # named file source
|
195
|
-
source = File.
|
195
|
+
source = File.open(path, 'rb') do |file| file.read; end
|
196
196
|
dest,error = beautify_string(source,path)
|
197
197
|
if(source != dest)
|
198
198
|
# make a backup copy
|
199
|
-
File.open(path + "~","
|
199
|
+
File.open(path + "~","wb") { |f| f.write(source) }
|
200
200
|
# overwrite the original
|
201
|
-
File.open(path,"
|
201
|
+
File.open(path,"wb") { |f| f.write(dest) }
|
202
202
|
end
|
203
203
|
end
|
204
204
|
return error
|