dev_commands 0.0.57 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/text.rb +3 -3
- 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
|
-
|
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.
|
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-
|
12
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|