dev_commands 0.0.55 → 0.0.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/text.rb +2 -1
- data/spec/text_spec.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6255c8427cb8be657efeba220fe9eecad031971f
|
4
|
+
data.tar.gz: a3ee4e0ef8ef1943453b56ac321206b3b725b633
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87cd1f477f28e1e4f542b19a4a81ec2e0709e4828623edee857a570a98bcd7932c71d3689352adc8ef3f1488c58b87c0182cfc8da6cdfedbc954744e93b12f56
|
7
|
+
data.tar.gz: 12de83f02a04caa26d0bbb9d9adedde7f69fa0ab841a2bf6d6bb7b06ce14720ee32abdf73675946f45a9d8ae493a43aa6859140b5fae6dc051c5a3508bd4cc7f
|
data/lib/text.rb
CHANGED
@@ -4,7 +4,8 @@ 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)
|
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)
|
8
9
|
#File.read(f,:encoding=>'UTF-8')
|
9
10
|
text2 = text1.gsub(search) { |str| str=replace }
|
10
11
|
unless text1==text2
|
data/spec/text_spec.rb
CHANGED
@@ -8,5 +8,8 @@ describe Text do
|
|
8
8
|
}
|
9
9
|
Text.replace_in_file('tmp/test.txt','thing','string')
|
10
10
|
expect(IO.read('tmp/test.txt').include?('test string')).to eq(true)
|
11
|
+
|
12
|
+
FileUtils.cp('spec/sln-vs12-example/csharp-library/csharp-library.cs','tmp/csharp-library.cs')
|
13
|
+
Text.replace_in_file('tmp/csharp-library.cs','Test','Test2')
|
11
14
|
end
|
12
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|