dev_commands 0.0.57 → 0.0.58

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/text.rb +3 -3
  2. metadata +2 -2
data/lib/text.rb CHANGED
@@ -4,13 +4,13 @@ class Text
4
4
  end
5
5
 
6
6
  def self.replace_in_file(filename,search,replace)
7
- #text1 = IO.read(filename).force_encoding("ISO-8859-1").encode("utf-8", replace: nil)
8
- text1 = IO.read(filename)#.encode("utf-8", replace: nil)
9
- #File.read(f,:encoding=>'UTF-8')
7
+ text1 = IO.read(filename)
10
8
  text2 = text1.gsub(search) { |str| str=replace }
11
9
  unless text1==text2
12
10
  File.open(filename,"w") { |f| f.puts text2 }
11
+ return true
13
12
  end
13
+ false
14
14
  end
15
15
 
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.57
4
+ version: 0.0.58
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: 2015-02-04 00:00:00.000000000 Z
12
+ date: 2015-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake