unix_utils 0.0.11 → 0.0.12

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
+ 0.0.12 / 2012-05-09
2
+
3
+ * Bug fixes
4
+
5
+ * Unreleased code (dos2unix and unix2dos) appeared in gem release - got rid of that.
6
+
1
7
  0.0.11 / 2012-05-07
2
8
 
3
9
  * Bug fixes
data/lib/unix_utils.rb CHANGED
@@ -177,12 +177,7 @@ module UnixUtils
177
177
 
178
178
  def self.unix2dos(infile)
179
179
  infile = ::File.expand_path infile
180
- if available?('unix2dos')
181
- outfile = tmp_path infile
182
- argv = ['unix2dos', '--force', '--newfile', infile, outfile ]
183
- spawn argv
184
- outfile
185
- elsif available?('gawk') or available?('awk')
180
+ if available?('gawk') or available?('awk')
186
181
  awk infile, '{ sub(/\r/, ""); printf("%s\r\n", $0) }'
187
182
  else
188
183
  perl infile, 's/\r\n|\n|\r/\r\n/g'
@@ -191,12 +186,7 @@ module UnixUtils
191
186
 
192
187
  def self.dos2unix(infile)
193
188
  infile = ::File.expand_path infile
194
- if available?('dos2unix')
195
- outfile = tmp_path infile
196
- argv = ['dos2unix', '--force', '--newfile', infile, outfile ]
197
- spawn argv
198
- outfile
199
- elsif available?('gawk') or available?('awk')
189
+ if available?('gawk') or available?('awk')
200
190
  awk infile, '{ sub(/\r/, ""); printf("%s\n", $0) }'
201
191
  else
202
192
  perl infile, 's/\r\n|\n|\r/\n/g'
@@ -1,3 +1,3 @@
1
1
  module UnixUtils
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unix_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-08 00:00:00.000000000 Z
12
+ date: 2012-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: posix-spawn