bisu 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99d4468262164cad922609d84154ed59b2886ce9
4
- data.tar.gz: 3d8c75a9fd72a75041d481cbaed00033e9b19a83
3
+ metadata.gz: 446a726b593e73b165a48ac438000b7599964496
4
+ data.tar.gz: 8dcf59ab1e303d41eaf2d748e52d62faa1fe8fe4
5
5
  SHA512:
6
- metadata.gz: c392b28a1c3fbefcdb027fd4fbc5ed752949c5e18b072a379966ab3086b089bc9b0877c40da575664a5f6a470fe260d54b30ae0a385817afad96c84870c6bfda
7
- data.tar.gz: 24b2b02a51a114e09bcd01eb1a3b0f50b17b751b804b66b49ff21c497460ec802f501ab56ba27662de12c9a35864bacd4a4278298e43e7d9952495bb89cc996b
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.1'
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("\n") if hash[lang][key].is_a? Array
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
@@ -1,4 +1,4 @@
1
1
  module Bisu
2
- VERSION = '1.4.2'
3
- VERSION_UPDATED_AT = '2016-12-12'
2
+ VERSION = '1.4.3'
3
+ VERSION_UPDATED_AT = '2016-12-22'
4
4
  end
@@ -0,0 +1,8 @@
1
+ {
2
+ "en": {
3
+ "translation": {
4
+ "kRegularNewLine": "This is the first line\\nthis is the second line",
5
+ "kErrorNewLine": "This is the first line\nthis is the second line"
6
+ }
7
+ }
8
+ }
@@ -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" => "트위터 서버연결 실패. \n잠시 후 재시도." }
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.2
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-12 00:00:00.000000000 Z
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.1
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.1
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