bisu 1.4.2 → 1.4.3
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.
- checksums.yaml +4 -4
- data/bisu.gemspec +1 -1
- data/lib/bisu/one_sky.rb +2 -1
- data/lib/bisu/version.rb +2 -2
- data/spec/fixtures/sample_one_sky_response_with_bug.txt +8 -0
- data/spec/lib/bisu/one_sky_spec.rb +16 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 446a726b593e73b165a48ac438000b7599964496
|
4
|
+
data.tar.gz: 8dcf59ab1e303d41eaf2d748e52d62faa1fe8fe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0da63cddc2297390bf8a3e3d6d292946f4c59fd82ed50d3d4e86f87a99ceee26d443921d77d2d876c9863352b5470f9affa30e882e42366f4927b8b7d57cc3a
|
7
|
+
data.tar.gz: d9c5b5038f8068379fd06a6e320e504903014e99d2bc129c27da2fa8ff2c51f971bc89376350feb11e78b26c1146bae5a2f0de846138b8dbc800aee03aca9c0b
|
data/bisu.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_runtime_dependency 'safe_yaml', '~> 1.0'
|
20
20
|
s.add_runtime_dependency 'colorize', '~> 0.7'
|
21
21
|
s.add_runtime_dependency 'xml-simple', '~> 1.1'
|
22
|
-
s.add_runtime_dependency 'onesky-ruby', '~> 1.0
|
22
|
+
s.add_runtime_dependency 'onesky-ruby', '~> 1.0'
|
23
23
|
|
24
24
|
s.add_development_dependency 'webmock', '~> 1.20'
|
25
25
|
end
|
data/lib/bisu/one_sky.rb
CHANGED
@@ -18,7 +18,8 @@ module Bisu
|
|
18
18
|
hash.each do |lang, v|
|
19
19
|
hash[lang] = v["translation"]
|
20
20
|
hash[lang].each do |key, text|
|
21
|
-
hash[lang][key] = hash[lang][key].join("
|
21
|
+
hash[lang][key] = hash[lang][key].join("\\n") if hash[lang][key].is_a? Array
|
22
|
+
hash[lang][key] = hash[lang][key].gsub("\n", "\\n") # fixes the 'stupid newline bug'
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
data/lib/bisu/version.rb
CHANGED
@@ -22,7 +22,7 @@ describe Bisu::OneSky do
|
|
22
22
|
"ja" => { "kConnectFacebook" => "フェイスブックへ接続" },
|
23
23
|
"fr" => { "kConnectFacebook" => "Connexion par Facebook" },
|
24
24
|
"de" => { "kConnectFacebook" => "Mit Facebook verbinden" },
|
25
|
-
"ko" => { "kConnectFacebook" => "페이스북으로 접속", "kTwitterServer" => "트위터 서버연결 실패.
|
25
|
+
"ko" => { "kConnectFacebook" => "페이스북으로 접속", "kTwitterServer" => "트위터 서버연결 실패. \\n잠시 후 재시도." }
|
26
26
|
})
|
27
27
|
end
|
28
28
|
|
@@ -33,4 +33,19 @@ describe Bisu::OneSky do
|
|
33
33
|
expect { to_i18 }.to raise_error /not allowed/
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
context "when OneSky returns the newline bug" do
|
38
|
+
let(:os_response) { File.read("spec/fixtures/sample_one_sky_response_with_bug.txt") }
|
39
|
+
|
40
|
+
it { expect { to_i18 }.not_to raise_error }
|
41
|
+
|
42
|
+
it "returns an hash in i18 format with the newline bug fixed" do
|
43
|
+
expect(to_i18).to eq({
|
44
|
+
"en" => {
|
45
|
+
"kRegularNewLine" => "This is the first line\\nthis is the second line",
|
46
|
+
"kErrorNewLine" => "This is the first line\\nthis is the second line"
|
47
|
+
}
|
48
|
+
})
|
49
|
+
end
|
50
|
+
end
|
36
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bisu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joaoffcosta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.0
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.0
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- spec/fixtures/sample_kb_public_info.html
|
112
112
|
- spec/fixtures/sample_kb_public_sheet.html
|
113
113
|
- spec/fixtures/sample_one_sky_response.txt
|
114
|
+
- spec/fixtures/sample_one_sky_response_with_bug.txt
|
114
115
|
- spec/lib/bisu/config_spec.rb
|
115
116
|
- spec/lib/bisu/dictionary_spec.rb
|
116
117
|
- spec/lib/bisu/google_sheet_spec.rb
|