onesky-rails 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -12
- data/lib/onesky/rails/file_client.rb +5 -1
- data/lib/onesky/rails/version.rb +1 -1
- data/spec/fixtures/sample_files/en/{special_en.yml → menu.yml} +0 -0
- data/spec/fixtures/sample_files/ja/{special_ja.yml → menu.yml} +0 -0
- data/spec/fixtures/sample_files/original/{special_en.yml → menu.yml} +0 -0
- data/spec/onesky/rails/file_client_spec.rb +13 -7
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d7915661efea085a8c067dbe1e636776cc3a4ed
|
4
|
+
data.tar.gz: 1472df68e788bdd979dea54c21ba92943709de6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf3fb008dd2a75cdc91973a074afc7453593472c9f23254b18e7d1f4e12ca6a762d66b61b82f5a9112ad1955ccf6fb436e409f25e1fc15a6faab996ed4e5c2e2
|
7
|
+
data.tar.gz: 40100c3a9ae3878a5c1c2be2a317998c97e1d9a0312f56e96bb1da7a482ea81b7f88b1b6dd23422fa1ce8f26e89199bbe2958db9c4ed93ff0057eb8652d8b0d0
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
###
|
1
|
+
### 1.3.1 - 17-MAY-2016
|
2
2
|
|
3
|
-
*
|
4
|
-
* Upload base locale string files to OneSky
|
5
|
-
* Download translations from OneSky
|
3
|
+
* fix downloaded file naming
|
6
4
|
|
7
|
-
### 1.
|
5
|
+
### 1.3.0 - 13-MAY-2016
|
8
6
|
|
9
|
-
*
|
10
|
-
*
|
7
|
+
* support download base language only translation files
|
8
|
+
* support download all translation files
|
9
|
+
|
10
|
+
### 1.2.0 - 13-JUL-2015
|
11
|
+
|
12
|
+
* support custom locale
|
11
13
|
|
12
14
|
### 1.1.0 - 9-JUN-2015
|
13
15
|
|
@@ -15,11 +17,13 @@
|
|
15
17
|
* able to parse ERB template
|
16
18
|
* able to customize base_locale
|
17
19
|
|
18
|
-
### 1.
|
20
|
+
### 1.0.0 - 31-DEC-2014
|
19
21
|
|
20
|
-
*
|
22
|
+
* Add custom header
|
23
|
+
* bump version to 1.0.0 as stable version
|
21
24
|
|
22
|
-
###
|
25
|
+
### 0.0.1 - 4-NOV-2014
|
23
26
|
|
24
|
-
*
|
25
|
-
*
|
27
|
+
* Generate config file
|
28
|
+
* Upload base locale string files to OneSky
|
29
|
+
* Download translations from OneSky
|
@@ -79,7 +79,11 @@ NOTICE
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def locale_file_name(file, to_locale)
|
82
|
-
|
82
|
+
if File.basename(file, '.*') == @base_locale.to_s
|
83
|
+
file.sub(@base_locale.to_s, to_locale)
|
84
|
+
else
|
85
|
+
file
|
86
|
+
end
|
83
87
|
end
|
84
88
|
|
85
89
|
def get_default_locale_files(string_path)
|
data/lib/onesky/rails/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -24,13 +24,19 @@ describe Onesky::Rails::FileClient do
|
|
24
24
|
stub_request(:post, full_path_with_auth_hash("/projects/#{config_hash['project_id']}/files", config_hash['api_key'], config_hash['api_secret']))
|
25
25
|
.to_return(status: 201)
|
26
26
|
|
27
|
-
expect(client.upload(file_path)).to match_array(["#{file_path}/en.yml","#{file_path}/
|
27
|
+
expect(client.upload(file_path)).to match_array(["#{file_path}/en.yml","#{file_path}/menu.yml"])
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
context 'download' do
|
32
32
|
|
33
|
-
let(:file_names)
|
33
|
+
let(:file_names) do
|
34
|
+
# source filename => downloaded filename
|
35
|
+
{
|
36
|
+
'en.yml' => {'en' => 'en.yml', 'ja' => 'ja.yml'},
|
37
|
+
'menu.yml' => {'en' => 'menu.yml', 'ja' => 'menu.yml'}
|
38
|
+
}
|
39
|
+
end
|
34
40
|
|
35
41
|
def locale_dir(locale)
|
36
42
|
locale == I18n.default_locale.to_s ? file_path : File.join(file_path, 'onesky_ja')
|
@@ -41,7 +47,7 @@ describe Onesky::Rails::FileClient do
|
|
41
47
|
end
|
42
48
|
|
43
49
|
def expected_locale_files(locale)
|
44
|
-
["#{locale_dir(locale)}/#{locale}.yml", "#{locale_dir(locale)}/
|
50
|
+
["#{locale_dir(locale)}/#{locale}.yml", "#{locale_dir(locale)}/menu.yml"]
|
45
51
|
end
|
46
52
|
|
47
53
|
it 'download translations from OneSky and save as YAML files' do
|
@@ -65,7 +71,7 @@ describe Onesky::Rails::FileClient do
|
|
65
71
|
|
66
72
|
# test file content
|
67
73
|
content = YAML.load_file(expected_files.pop)
|
68
|
-
expected_content = YAML.load_file(File.join(sample_file_path, locale, '
|
74
|
+
expected_content = YAML.load_file(File.join(sample_file_path, locale, 'menu.yml'))
|
69
75
|
expect(content).to eq(expected_content)
|
70
76
|
end
|
71
77
|
|
@@ -82,15 +88,15 @@ describe Onesky::Rails::FileClient do
|
|
82
88
|
|
83
89
|
# test file content
|
84
90
|
content = YAML.load_file(expected_files.pop)
|
85
|
-
expected_content = YAML.load_file(File.join(sample_file_path, locale, "
|
91
|
+
expected_content = YAML.load_file(File.join(sample_file_path, locale, "menu.yml"))
|
86
92
|
expect(content).to eq(expected_content)
|
87
93
|
end
|
88
94
|
end
|
89
95
|
|
90
96
|
def prepare_download_requests!(locale)
|
91
97
|
Timecop.freeze
|
92
|
-
file_names.each do |file_name|
|
93
|
-
downloaded_file_name = file_name
|
98
|
+
file_names.keys.each do |file_name|
|
99
|
+
downloaded_file_name = file_names[file_name][locale]
|
94
100
|
response_headers = {
|
95
101
|
'Content-Type' => 'text/plain',
|
96
102
|
'Content-Disposition' => "attachment; filename=#{downloaded_file_name}",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onesky-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Lam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -134,11 +134,11 @@ files:
|
|
134
134
|
- lib/tasks/onesky.rake
|
135
135
|
- onesky-rails.gemspec
|
136
136
|
- spec/fixtures/sample_files/en/en.yml
|
137
|
-
- spec/fixtures/sample_files/en/
|
137
|
+
- spec/fixtures/sample_files/en/menu.yml
|
138
138
|
- spec/fixtures/sample_files/ja/ja.yml
|
139
|
-
- spec/fixtures/sample_files/ja/
|
139
|
+
- spec/fixtures/sample_files/ja/menu.yml
|
140
140
|
- spec/fixtures/sample_files/original/en.yml
|
141
|
-
- spec/fixtures/sample_files/original/
|
141
|
+
- spec/fixtures/sample_files/original/menu.yml
|
142
142
|
- spec/onesky/rails/client_spec.rb
|
143
143
|
- spec/onesky/rails/file_client_spec.rb
|
144
144
|
- spec/spec_helper.rb
|
@@ -168,11 +168,11 @@ specification_version: 4
|
|
168
168
|
summary: Rails plugin to sync string files with OneSky
|
169
169
|
test_files:
|
170
170
|
- spec/fixtures/sample_files/en/en.yml
|
171
|
-
- spec/fixtures/sample_files/en/
|
171
|
+
- spec/fixtures/sample_files/en/menu.yml
|
172
172
|
- spec/fixtures/sample_files/ja/ja.yml
|
173
|
-
- spec/fixtures/sample_files/ja/
|
173
|
+
- spec/fixtures/sample_files/ja/menu.yml
|
174
174
|
- spec/fixtures/sample_files/original/en.yml
|
175
|
-
- spec/fixtures/sample_files/original/
|
175
|
+
- spec/fixtures/sample_files/original/menu.yml
|
176
176
|
- spec/onesky/rails/client_spec.rb
|
177
177
|
- spec/onesky/rails/file_client_spec.rb
|
178
178
|
- spec/spec_helper.rb
|