yaml-translator 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.editorconfig +7 -0
- data/.gitignore +52 -0
- data/.rspec +2 -0
- data/.travis.yml +9 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +74 -0
- data/LICENSE +21 -0
- data/README.md +27 -0
- data/Rakefile +6 -0
- data/example/en.yml +2 -0
- data/example/google_translate.rb +12 -0
- data/lib/yaml-translator/adapters/base_adapter.rb +13 -0
- data/lib/yaml-translator/adapters/google_translate_adapter.rb +23 -0
- data/lib/yaml-translator/adapters/noop_adapter.rb +9 -0
- data/lib/yaml-translator/adapters.rb +3 -0
- data/lib/yaml-translator/key_path.rb +25 -0
- data/lib/yaml-translator/translated_result.rb +20 -0
- data/lib/yaml-translator/translator.rb +69 -0
- data/lib/yaml-translator/version.rb +3 -0
- data/lib/yaml-translator.rb +5 -0
- data/spec/fixtures/no_root.yml +5 -0
- data/spec/fixtures/with_root.yml +6 -0
- data/spec/helpers/locale_helper.rb +10 -0
- data/spec/spec_helper.rb +28 -0
- data/spec/yaml-translator/translator_spec.rb +19 -0
- data/yaml-translator.gemspec +29 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 13d5127e89cdcf1352b50cea2386223c6527f8f5
|
4
|
+
data.tar.gz: 25d87ba4c158a2e875c4e0ccea84079ba3aed1eb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: afcce2a1c2fed210f3a0446b8b649117ee8bab49a782a05e97675a67517b4e2b95ffcf672185b1943a555ee886253c4eaa98d4463e322961d23e9a0a667bfc5b
|
7
|
+
data.tar.gz: a654337993e4d42bb0d2d4b34b4c4b52eead7fb21d1c6544d77d7101bb1c5b7aaccfc8ca411f9dc3a9348b67a7d1839be3e3ee38e7eaa186b893c615ee08d401
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
## Specific to RubyMotion:
|
17
|
+
.dat*
|
18
|
+
.repl_history
|
19
|
+
build/
|
20
|
+
*.bridgesupport
|
21
|
+
build-iPhoneOS/
|
22
|
+
build-iPhoneSimulator/
|
23
|
+
|
24
|
+
## Specific to RubyMotion (use of CocoaPods):
|
25
|
+
#
|
26
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
27
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
28
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
29
|
+
#
|
30
|
+
# vendor/Pods/
|
31
|
+
|
32
|
+
## Documentation cache and generated files:
|
33
|
+
/.yardoc/
|
34
|
+
/_yardoc/
|
35
|
+
/doc/
|
36
|
+
/rdoc/
|
37
|
+
|
38
|
+
## Environment normalization:
|
39
|
+
/.bundle/
|
40
|
+
/vendor/bundle
|
41
|
+
/lib/bundler/man/
|
42
|
+
|
43
|
+
# for a library or gem, you might want to ignore these files since the code is
|
44
|
+
# intended to run in multiple environments; otherwise, check them in:
|
45
|
+
# Gemfile.lock
|
46
|
+
# .ruby-version
|
47
|
+
# .ruby-gemset
|
48
|
+
|
49
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
50
|
+
.rvmrc
|
51
|
+
|
52
|
+
example/ja.yml
|
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
language: ruby
|
2
|
+
env:
|
3
|
+
secure: "OPbJVv+xHdc56rzLDDpBiPsVtQ6Gmc7k4373BaZArjJbB1Dx34FHBNG0UoyF2XUKXVRs5TWgwbs9M4MDM9U13hv2VozT8/RaOkH48d2eHQ93vJX4P8vfR68AA73TV+LtJ7ktlkPp0JLJ54yfHVmANyOxRv2MIDSGGxg+m/FdaTssded4v0YF2dQSKCwfokwyVSCtAx8dsP0Q5UbOYKRDyjn5MR8xZWWiB9wmxuyTnhtKSyGASb+hO4aHll7pTYhebz1NViQhz0vB8BBP5AWdoi5LsToHi2obhu3+5f18pEfqtraJQJ2wa8ix3VaTuL5z1FHfxw2Etq9Eooa3sbrxvQEisSX+JpCPrxBNy4S4GcpXcc8Zg4b2IhLIww6EpDnOxod85N6Q1EzYvo5URxdM5bYVBNuFLjeVg8BSFGGYfebR/Xx4Zh5vDVWJlfkc7fbpGV4IGKUMHhTVSyT19TwTnJnKcahVZO9lChZFPj+SkTFp+SsdReJg3xnIOr+AuPuxqn2n9PPMMyvQng3VxWog7a2SP8Db6VTY5A1JPpOJXVEsNkHwqiUuE3nNLp6WFIXbYIzmJyYFmm5ij7aoaK/gcvDNHoGz/cPZrW+juIXKJC24Qk8hXrZPzEO54+e+M6qsR3p8TlpN5TSxPoeO0hET2cMX0xHFOHU+UnFDx1oTC0c="
|
4
|
+
rvm:
|
5
|
+
- 2.0.0
|
6
|
+
- 2.1
|
7
|
+
- 2.2
|
8
|
+
- 2.3.0
|
9
|
+
cache: bundler
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
yaml-translator (0.1.0)
|
5
|
+
easy_translate
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ansi (1.5.0)
|
11
|
+
coveralls (0.7.2)
|
12
|
+
multi_json (~> 1.3)
|
13
|
+
rest-client (= 1.6.7)
|
14
|
+
simplecov (>= 0.7)
|
15
|
+
term-ansicolor (= 1.2.2)
|
16
|
+
thor (= 0.18.1)
|
17
|
+
diff-lcs (1.3)
|
18
|
+
docile (1.1.5)
|
19
|
+
easy_translate (0.5.0)
|
20
|
+
json
|
21
|
+
thread
|
22
|
+
thread_safe
|
23
|
+
hirb (0.7.3)
|
24
|
+
json (2.0.3)
|
25
|
+
mime-types (3.1)
|
26
|
+
mime-types-data (~> 3.2015)
|
27
|
+
mime-types-data (3.2016.0521)
|
28
|
+
multi_json (1.12.1)
|
29
|
+
rake (10.5.0)
|
30
|
+
rest-client (1.6.7)
|
31
|
+
mime-types (>= 1.16)
|
32
|
+
rspec (3.5.0)
|
33
|
+
rspec-core (~> 3.5.0)
|
34
|
+
rspec-expectations (~> 3.5.0)
|
35
|
+
rspec-mocks (~> 3.5.0)
|
36
|
+
rspec-core (3.5.4)
|
37
|
+
rspec-support (~> 3.5.0)
|
38
|
+
rspec-expectations (3.5.0)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.5.0)
|
41
|
+
rspec-mocks (3.5.0)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.5.0)
|
44
|
+
rspec-support (3.5.0)
|
45
|
+
simplecov (0.13.0)
|
46
|
+
docile (~> 1.1.0)
|
47
|
+
json (>= 1.8, < 3)
|
48
|
+
simplecov-html (~> 0.10.0)
|
49
|
+
simplecov-console (0.4.1)
|
50
|
+
ansi
|
51
|
+
hirb
|
52
|
+
simplecov
|
53
|
+
simplecov-html (0.10.0)
|
54
|
+
term-ansicolor (1.2.2)
|
55
|
+
tins (~> 0.8)
|
56
|
+
thor (0.18.1)
|
57
|
+
thread (0.2.2)
|
58
|
+
thread_safe (0.3.5)
|
59
|
+
tins (0.13.2)
|
60
|
+
|
61
|
+
PLATFORMS
|
62
|
+
ruby
|
63
|
+
|
64
|
+
DEPENDENCIES
|
65
|
+
bundler (~> 1.0)
|
66
|
+
coveralls
|
67
|
+
rake (~> 10.0)
|
68
|
+
rspec
|
69
|
+
simplecov
|
70
|
+
simplecov-console
|
71
|
+
yaml-translator!
|
72
|
+
|
73
|
+
BUNDLED WITH
|
74
|
+
1.14.1
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 Noritaka Horio
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# yaml-translator
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/holyshared/yaml-translator.svg?branch=master)](https://travis-ci.org/holyshared/yaml-translator)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/github/holyshared/yaml-translator/badge.svg?branch=master)](https://coveralls.io/github/holyshared/yaml-translator?branch=master)
|
5
|
+
|
6
|
+
# Basic usage
|
7
|
+
|
8
|
+
Translate the language file, do as follows.
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'yaml'
|
12
|
+
require 'yaml-translator'
|
13
|
+
|
14
|
+
adapter = ::YamlTranslator::Adapters::GoogleTranslateAdapter.new(ENV['GOOGLE_TRANSLATE_API_KEY'])
|
15
|
+
|
16
|
+
yaml = YAML.load(File.open("#{dir}/en.yml", &:read))
|
17
|
+
translator = ::YamlTranslator::Translator.new(adapter)
|
18
|
+
|
19
|
+
result = translator.translate(yaml, to: :ja)
|
20
|
+
result.save_to('/path/to/directory') # Write a ja.yml
|
21
|
+
```
|
22
|
+
|
23
|
+
## Run the test
|
24
|
+
|
25
|
+
bundle install
|
26
|
+
rake spec
|
27
|
+
|
data/Rakefile
ADDED
data/example/en.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require 'yaml-translator'
|
5
|
+
|
6
|
+
dir = File.dirname(__FILE__)
|
7
|
+
adapter = ::YamlTranslator::Adapters::GoogleTranslateAdapter.new(ENV['GOOGLE_TRANSLATE_API_KEY'])
|
8
|
+
translator = ::YamlTranslator::Translator.new(adapter)
|
9
|
+
result = translator.translate(YAML.load(File.open("#{dir}/en.yml", &:read)), to: :ja)
|
10
|
+
|
11
|
+
p result.to_s
|
12
|
+
p result.save_to(dir)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'easy_translate'
|
2
|
+
|
3
|
+
module YamlTranslator
|
4
|
+
module Adapters
|
5
|
+
class GoogleTranslateAdapter < BaseAdapter
|
6
|
+
def initialize(api_key=nil)
|
7
|
+
@api_key = api_key
|
8
|
+
end
|
9
|
+
def translate(values, options={})
|
10
|
+
keys = []
|
11
|
+
texts = []
|
12
|
+
opts = default_options.merge(options)
|
13
|
+
|
14
|
+
values.each_with_index do |(key, text)|
|
15
|
+
keys << key # 0: a.b, 1: a.b.c
|
16
|
+
texts << text # 0: a, 1: b
|
17
|
+
end
|
18
|
+
translated_texts = EasyTranslate.translate(texts, :to => opts[:to], :key => @api_key)
|
19
|
+
Hash[keys.zip(translated_texts)]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module YamlTranslator
|
2
|
+
class KeyPath
|
3
|
+
attr_reader :keys
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@keys = []
|
7
|
+
end
|
8
|
+
|
9
|
+
def move_to(key)
|
10
|
+
@keys.push(key)
|
11
|
+
end
|
12
|
+
|
13
|
+
def leave
|
14
|
+
@keys.pop
|
15
|
+
end
|
16
|
+
|
17
|
+
def current
|
18
|
+
@keys.join('.')
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_s
|
22
|
+
current
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module YamlTranslator
|
4
|
+
class TranslatedResult
|
5
|
+
attr_reader :lang, :values
|
6
|
+
|
7
|
+
def initialize(values, lang)
|
8
|
+
@lang = lang
|
9
|
+
@values = values
|
10
|
+
end
|
11
|
+
|
12
|
+
def save_to(dir)
|
13
|
+
File.write("#{dir}/#{lang}.yml", YAML.dump(@values))
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_s
|
17
|
+
@values.to_s
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require "yaml-translator/adapters"
|
2
|
+
|
3
|
+
module YamlTranslator
|
4
|
+
class Translator
|
5
|
+
def initialize(adapter = Adapters::NoopAdaptor.new)
|
6
|
+
@path = KeyPath.new
|
7
|
+
@adapter = adapter
|
8
|
+
end
|
9
|
+
|
10
|
+
# Translate target
|
11
|
+
#
|
12
|
+
# @param [Hash] values Hash of translate target
|
13
|
+
# @return [Hash] translated hash
|
14
|
+
def translate(values, options={})
|
15
|
+
TranslatedResult.new(rebuild(translate_tree(flatten(values), options)), options[:to])
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
# Translate target
|
21
|
+
#
|
22
|
+
# @param [Hash] values Hash of translate target
|
23
|
+
# @return [Hash] translated hash
|
24
|
+
def translate_tree(values, options={})
|
25
|
+
@adapter.translate(values, options)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returning the flattened structure to the tree structure
|
29
|
+
#
|
30
|
+
# @param [Hash] values flatten Hash
|
31
|
+
# @return [Hash] translated hash
|
32
|
+
def rebuild(values)
|
33
|
+
result = {}
|
34
|
+
current = result
|
35
|
+
values.each do |k, v|
|
36
|
+
keys = k.split('.')
|
37
|
+
last_key = keys.pop
|
38
|
+
keys.each do |ks|
|
39
|
+
current = if current.key?(ks)
|
40
|
+
current[ks]
|
41
|
+
else
|
42
|
+
current[ks] = {}
|
43
|
+
current[ks]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
current[last_key] = v
|
47
|
+
current = result
|
48
|
+
end
|
49
|
+
result
|
50
|
+
end
|
51
|
+
|
52
|
+
# Covert to a flat hash
|
53
|
+
# @param [Hash] values flatten target
|
54
|
+
# @return [Hash]
|
55
|
+
def flatten(values)
|
56
|
+
result = {}
|
57
|
+
values.each_with_index do |(i, v)|
|
58
|
+
@path.move_to(i)
|
59
|
+
if v.is_a?(Hash)
|
60
|
+
result.merge!(flatten(v))
|
61
|
+
else
|
62
|
+
result[@path.to_s] = v
|
63
|
+
end
|
64
|
+
@path.leave
|
65
|
+
end
|
66
|
+
result
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
|
3
|
+
require 'simplecov'
|
4
|
+
require 'simplecov-console'
|
5
|
+
|
6
|
+
SimpleCov.add_filter do |source_file|
|
7
|
+
filename = source_file.filename
|
8
|
+
filename =~ /spec|fixtures|helpers/
|
9
|
+
end
|
10
|
+
|
11
|
+
SimpleCov.start
|
12
|
+
|
13
|
+
require 'yaml'
|
14
|
+
require 'yaml-translator'
|
15
|
+
require 'helpers/locale_helper'
|
16
|
+
|
17
|
+
if ENV['COVERALLS_REPO_TOKEN']
|
18
|
+
require 'coveralls'
|
19
|
+
Coveralls.wear!
|
20
|
+
else
|
21
|
+
SimpleCov.formatters = [
|
22
|
+
SimpleCov::Formatter::Console
|
23
|
+
]
|
24
|
+
end
|
25
|
+
|
26
|
+
RSpec.configure do |c|
|
27
|
+
c.include Helpers::LocaleHelper
|
28
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
describe YamlTranslator::Translator do
|
2
|
+
describe '#translate' do
|
3
|
+
let(:translator) { YamlTranslator::Translator.new }
|
4
|
+
context 'when have root' do
|
5
|
+
let(:yaml_tree) { load_yaml(:with_root) }
|
6
|
+
it 'translated tree' do
|
7
|
+
translated_tree = translator.translate(yaml_tree)
|
8
|
+
expect(translated_tree.values).to eq(yaml_tree)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
context 'when have root' do
|
12
|
+
let(:yaml_tree) { load_yaml(:no_root) }
|
13
|
+
it 'translated tree' do
|
14
|
+
translated_tree = translator.translate(yaml_tree)
|
15
|
+
expect(translated_tree.values).to eq(yaml_tree)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'yaml-translator/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "yaml-translator"
|
8
|
+
spec.version = YamlTranslator::VERSION
|
9
|
+
spec.authors = ["Noritaka Horio"]
|
10
|
+
spec.email = ["holy.shared.design@gmail.com"]
|
11
|
+
spec.summary = ""
|
12
|
+
spec.description = ""
|
13
|
+
spec.homepage = "https://github.com/holyshared/yaml-translator"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'easy_translate'
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.0"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
spec.add_development_dependency "simplecov"
|
27
|
+
spec.add_development_dependency "simplecov-console"
|
28
|
+
spec.add_development_dependency "coveralls"
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yaml-translator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Noritaka Horio
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: easy_translate
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov-console
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: coveralls
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: ''
|
112
|
+
email:
|
113
|
+
- holy.shared.design@gmail.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".coveralls.yml"
|
119
|
+
- ".editorconfig"
|
120
|
+
- ".gitignore"
|
121
|
+
- ".rspec"
|
122
|
+
- ".travis.yml"
|
123
|
+
- Gemfile
|
124
|
+
- Gemfile.lock
|
125
|
+
- LICENSE
|
126
|
+
- README.md
|
127
|
+
- Rakefile
|
128
|
+
- example/en.yml
|
129
|
+
- example/google_translate.rb
|
130
|
+
- lib/yaml-translator.rb
|
131
|
+
- lib/yaml-translator/adapters.rb
|
132
|
+
- lib/yaml-translator/adapters/base_adapter.rb
|
133
|
+
- lib/yaml-translator/adapters/google_translate_adapter.rb
|
134
|
+
- lib/yaml-translator/adapters/noop_adapter.rb
|
135
|
+
- lib/yaml-translator/key_path.rb
|
136
|
+
- lib/yaml-translator/translated_result.rb
|
137
|
+
- lib/yaml-translator/translator.rb
|
138
|
+
- lib/yaml-translator/version.rb
|
139
|
+
- spec/fixtures/no_root.yml
|
140
|
+
- spec/fixtures/with_root.yml
|
141
|
+
- spec/helpers/locale_helper.rb
|
142
|
+
- spec/spec_helper.rb
|
143
|
+
- spec/yaml-translator/translator_spec.rb
|
144
|
+
- yaml-translator.gemspec
|
145
|
+
homepage: https://github.com/holyshared/yaml-translator
|
146
|
+
licenses:
|
147
|
+
- MIT
|
148
|
+
metadata: {}
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
requirements: []
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.5.2
|
166
|
+
signing_key:
|
167
|
+
specification_version: 4
|
168
|
+
summary: ''
|
169
|
+
test_files:
|
170
|
+
- spec/fixtures/no_root.yml
|
171
|
+
- spec/fixtures/with_root.yml
|
172
|
+
- spec/helpers/locale_helper.rb
|
173
|
+
- spec/spec_helper.rb
|
174
|
+
- spec/yaml-translator/translator_spec.rb
|