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.
Files changed (2) hide show
  1. data/bin/rbeautify +3 -3
  2. 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.read(path)
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 + "~","w") { |f| f.write(source) }
199
+ File.open(path + "~","wb") { |f| f.write(source) }
200
200
  # overwrite the original
201
- File.open(path,"w") { |f| f.write(dest) }
201
+ File.open(path,"wb") { |f| f.write(dest) }
202
202
  end
203
203
  end
204
204
  return error
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rogerdpack-rbeautify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Pack