applocale-ruby 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/standardrb.yml +33 -0
- data/.github/workflows/tests.yml +33 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -0
- data/.standard.yml +3 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +6 -1
- data/Gemfile.lock +58 -11
- data/README.md +47 -10
- data/Rakefile +1 -1
- data/applocale-ruby.gemspec +15 -14
- data/bin/console +2 -9
- data/bin/format +3 -0
- data/bin/lint +3 -0
- data/bin/standardrb +29 -0
- data/lib/applocale/cli.rb +15 -3
- data/lib/applocale/client.rb +6 -9
- data/lib/applocale/config.rb +7 -6
- data/lib/applocale/file_writer.rb +4 -4
- data/lib/applocale/pull.rb +5 -5
- data/lib/applocale/templates/config.yml +6 -0
- data/lib/applocale/version.rb +1 -1
- metadata +38 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e5340b80c6e0d9d94fa912d01302df841937c319e432f6be4872d58bbf92281
|
4
|
+
data.tar.gz: c625d587a6c8d9c9bdc29cc9e97db27ac62322d6888d58d747909120c1b21602
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f3779798fc60bdf5c6a6fd9bc175c0c5c742318b606c7832f2e9a20ecc800b9f89a4628cc22396b2ecaaec267674408b528ddb73cc5396a97f7ee91d475975a
|
7
|
+
data.tar.gz: 60098535492022c3ca2dd421999a6fd3c4df6e78af69564054eff8bb1bcb5e7a82c188441f41dcc5240bda8e61742dbb2e3318cb4cf4210bb2636ba622775f31
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: StandardRB
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- '*'
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
standard:
|
13
|
+
name: StandardRB Check Action
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@master
|
17
|
+
- name: Set up Ruby 2.6.6
|
18
|
+
uses: actions/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 2.6.6
|
21
|
+
- uses: actions/cache@master
|
22
|
+
with:
|
23
|
+
path: vendor/bundle
|
24
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
25
|
+
restore-keys: |
|
26
|
+
${{ runner.os }}-gems-
|
27
|
+
- name: Bundle install
|
28
|
+
run: |
|
29
|
+
gem install bundler
|
30
|
+
bundle config path vendor/bundle
|
31
|
+
bundle install --jobs 4 --retry 3
|
32
|
+
- name: Run StandardRB
|
33
|
+
run: bin/lint
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- '*'
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
name: Ruby Test Action
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@master
|
17
|
+
- name: Set up Ruby 2.6
|
18
|
+
uses: actions/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 2.6.x
|
21
|
+
- uses: actions/cache@master
|
22
|
+
with:
|
23
|
+
path: vendor/bundle
|
24
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
25
|
+
restore-keys: |
|
26
|
+
${{ runner.os }}-gems-
|
27
|
+
- name: Bundle install
|
28
|
+
run: |
|
29
|
+
gem install bundler
|
30
|
+
bundle config path vendor/bundle
|
31
|
+
bundle install --jobs 4 --retry 3
|
32
|
+
- name: Run ruby tests
|
33
|
+
run: bundle exec rake test
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.3.5
|
data/.standard.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,23 +1,67 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
applocale-ruby (0.0
|
4
|
+
applocale-ruby (0.1.0)
|
5
5
|
httparty (~> 0.18.0)
|
6
|
-
thor (
|
6
|
+
thor (>= 0.18.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
|
11
|
+
ansi (1.5.0)
|
12
|
+
ast (2.4.2)
|
13
|
+
bigdecimal (3.1.8)
|
14
|
+
builder (3.3.0)
|
15
|
+
coderay (1.1.3)
|
16
|
+
httparty (0.18.1)
|
12
17
|
mime-types (~> 3.0)
|
13
18
|
multi_xml (>= 0.5.2)
|
14
|
-
|
19
|
+
logger (1.6.1)
|
20
|
+
method_source (1.1.0)
|
21
|
+
mime-types (3.6.0)
|
22
|
+
logger
|
15
23
|
mime-types-data (~> 3.2015)
|
16
|
-
mime-types-data (3.
|
17
|
-
minitest (5.
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
mime-types-data (3.2024.1105)
|
25
|
+
minitest (5.25.2)
|
26
|
+
minitest-reporters (1.7.1)
|
27
|
+
ansi
|
28
|
+
builder
|
29
|
+
minitest (>= 5.0)
|
30
|
+
ruby-progressbar
|
31
|
+
multi_xml (0.7.1)
|
32
|
+
bigdecimal (~> 3.1)
|
33
|
+
parallel (1.26.3)
|
34
|
+
parser (3.3.6.0)
|
35
|
+
ast (~> 2.4.1)
|
36
|
+
racc
|
37
|
+
pry (0.15.0)
|
38
|
+
coderay (~> 1.1)
|
39
|
+
method_source (~> 1.0)
|
40
|
+
racc (1.8.1)
|
41
|
+
rainbow (3.1.1)
|
42
|
+
rake (13.2.1)
|
43
|
+
regexp_parser (2.9.3)
|
44
|
+
rexml (3.3.9)
|
45
|
+
rubocop (1.10.0)
|
46
|
+
parallel (~> 1.10)
|
47
|
+
parser (>= 3.0.0.0)
|
48
|
+
rainbow (>= 2.2.2, < 4.0)
|
49
|
+
regexp_parser (>= 1.8, < 3.0)
|
50
|
+
rexml
|
51
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
52
|
+
ruby-progressbar (~> 1.7)
|
53
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
54
|
+
rubocop-ast (1.36.2)
|
55
|
+
parser (>= 3.3.1.0)
|
56
|
+
rubocop-performance (1.9.2)
|
57
|
+
rubocop (>= 0.90.0, < 2.0)
|
58
|
+
rubocop-ast (>= 0.4.0)
|
59
|
+
ruby-progressbar (1.13.0)
|
60
|
+
standard (0.13.0)
|
61
|
+
rubocop (= 1.10.0)
|
62
|
+
rubocop-performance (= 1.9.2)
|
63
|
+
thor (1.3.2)
|
64
|
+
unicode-display_width (2.6.0)
|
21
65
|
|
22
66
|
PLATFORMS
|
23
67
|
ruby
|
@@ -26,7 +70,10 @@ DEPENDENCIES
|
|
26
70
|
applocale-ruby!
|
27
71
|
bundler (~> 2.0)
|
28
72
|
minitest (~> 5.0)
|
29
|
-
|
73
|
+
minitest-reporters (~> 1.4)
|
74
|
+
pry (~> 0.13)
|
75
|
+
rake (~> 13.0)
|
76
|
+
standard (~> 0.4)
|
30
77
|
|
31
78
|
BUNDLED WITH
|
32
|
-
2.
|
79
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,15 +1,23 @@
|
|
1
|
-
#
|
1
|
+
# AppLocale
|
2
2
|
|
3
|
-
|
3
|
+
![Tests](https://github.com/applocale/applocale-ruby/workflows/Tests/badge.svg)
|
4
|
+
![StandardRB](https://github.com/applocale/applocale-ruby/workflows/StandardRB/badge.svg)
|
5
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
|
4
6
|
|
5
|
-
|
7
|
+
Welcome to AppLocale's Ruby gem. This gem helps customers of AppLocale.dev to easily pull down their
|
8
|
+
latest translations with a simple `bundle exec applocale pull`.
|
6
9
|
|
7
10
|
## Installation
|
8
11
|
|
12
|
+
### Manually:
|
13
|
+
|
9
14
|
Add this line to your application's Gemfile:
|
10
15
|
|
11
16
|
```ruby
|
12
|
-
|
17
|
+
|
18
|
+
group :development do
|
19
|
+
gem 'applocale-ruby'
|
20
|
+
end
|
13
21
|
```
|
14
22
|
|
15
23
|
And then execute:
|
@@ -20,20 +28,49 @@ Or install it yourself as:
|
|
20
28
|
|
21
29
|
$ gem install applocale-ruby
|
22
30
|
|
31
|
+
Then follow the instructions in Usage to setup your configuration file.
|
32
|
+
|
23
33
|
## Usage
|
24
34
|
|
25
|
-
|
35
|
+
Using AppLocale's gem requires a configuration file to be present. By default we assume this file to
|
36
|
+
live at `config/applocale.yml` but you can alternatively run each command with `--config-file=path-to-applocale.yml`
|
37
|
+
|
38
|
+
You'll need to login to your AppLocale instance and login to your account, click API Tokens to have the information ready for this step after creating an API Token and Project.
|
39
|
+
|
40
|
+
**Sample configuration file:**
|
41
|
+
|
42
|
+
```yaml
|
43
|
+
applocale:
|
44
|
+
host: https://translations.example.com
|
45
|
+
project_id: 234qfewaf
|
46
|
+
api_key: API_KEY_HERE
|
47
|
+
locale_directory: "config/locales" # Default, you can override this if you wish.
|
48
|
+
```
|
49
|
+
|
50
|
+
Once you have your configuration file setup for your project you can proceed to use the following commands.
|
26
51
|
|
27
|
-
|
52
|
+
After that, to pull ALL your setup languages in AppLocale:
|
28
53
|
|
29
|
-
|
54
|
+
```
|
55
|
+
bundle exec applocale pull
|
56
|
+
```
|
30
57
|
|
31
|
-
|
58
|
+
Or just your specified languages:
|
59
|
+
|
60
|
+
```
|
61
|
+
bundle exec applocale pull en es
|
62
|
+
```
|
32
63
|
|
33
64
|
## Contributing
|
34
65
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
66
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/applocale/applocale-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
67
|
+
|
68
|
+
### Code Formatting
|
69
|
+
|
70
|
+
This project uses [Standard](https://github.com/testdouble/standard) to minimize bike shedding related to source formatting.
|
71
|
+
|
72
|
+
Please run `./bin/format` prior to submitting pull requests.
|
36
73
|
|
37
74
|
## Code of Conduct
|
38
75
|
|
39
|
-
Everyone interacting in the Applocale::Ruby project
|
76
|
+
Everyone interacting in the Applocale::Ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/applocale/applocale-ruby/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
data/applocale-ruby.gemspec
CHANGED
@@ -3,36 +3,37 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require "applocale/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
6
|
+
spec.name = "applocale-ruby"
|
7
|
+
spec.version = AppLocale::VERSION
|
8
|
+
spec.authors = ["Andrea Fomera"]
|
9
|
+
spec.email = ["andrea@zerlex.net"]
|
10
10
|
|
11
|
-
spec.summary
|
12
|
-
spec.description
|
13
|
-
spec.homepage
|
11
|
+
spec.summary = "Easily pull in your locales from AppLocale.dev"
|
12
|
+
spec.description = "Easily pull in your locales from AppLocale.dev"
|
13
|
+
spec.homepage = "https://applocale.dev"
|
14
14
|
|
15
15
|
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/applocale/applocale-ruby"
|
19
|
-
spec.metadata["changelog_uri"] = "https://github.com/applocale/applocale-ruby"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/applocale/applocale-ruby/blob/master/CHANGELOG.md"
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
-
spec.files
|
23
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
24
24
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
25
|
end
|
26
|
-
spec.bindir
|
27
|
-
spec.executables
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
30
|
spec.required_ruby_version = ">= 2.3.0"
|
31
31
|
|
32
|
-
spec.add_dependency
|
33
|
-
spec.add_dependency
|
32
|
+
spec.add_dependency "httparty", "~> 0.18.0"
|
33
|
+
spec.add_dependency "thor", ">= 0.18.0"
|
34
34
|
|
35
35
|
spec.add_development_dependency "bundler", "~> 2.0"
|
36
|
-
spec.add_development_dependency "rake", "~>
|
36
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
37
37
|
spec.add_development_dependency "minitest", "~> 5.0"
|
38
|
+
spec.add_development_dependency "minitest-reporters", "~> 1.4"
|
38
39
|
end
|
data/bin/console
CHANGED
@@ -2,13 +2,6 @@
|
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
4
|
require "applocale/ruby"
|
5
|
+
require "pry"
|
5
6
|
|
6
|
-
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
7
|
+
Pry.start
|
data/bin/format
ADDED
data/bin/lint
ADDED
data/bin/standardrb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'standardrb' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("standard", "standardrb")
|
data/lib/applocale/cli.rb
CHANGED
@@ -2,10 +2,12 @@ require "thor"
|
|
2
2
|
|
3
3
|
module AppLocale
|
4
4
|
class Cli < ::Thor
|
5
|
-
|
5
|
+
include Thor::Actions
|
6
|
+
|
7
|
+
class_option "config-file",
|
6
8
|
default: "config/applocale.yml",
|
7
9
|
desc: "Customize the location of the config file"
|
8
|
-
class_option
|
10
|
+
class_option "verbose",
|
9
11
|
type: :boolean,
|
10
12
|
desc: "Turn on additional logging, helpful for debugging."
|
11
13
|
|
@@ -18,6 +20,7 @@ module AppLocale
|
|
18
20
|
|
19
21
|
> $ applocale pull en es de
|
20
22
|
LONGDESC
|
23
|
+
|
21
24
|
def pull(*languages)
|
22
25
|
AppLocale::Pull.new(config, options).call(languages)
|
23
26
|
end
|
@@ -27,10 +30,19 @@ module AppLocale
|
|
27
30
|
puts "AppLocale Version: #{AppLocale::VERSION}"
|
28
31
|
end
|
29
32
|
|
33
|
+
def self.source_root
|
34
|
+
File.dirname(__FILE__) + "/templates"
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "init", "Generate config file"
|
38
|
+
def init
|
39
|
+
copy_file "config.yml", "config/applocale.yml"
|
40
|
+
end
|
41
|
+
|
30
42
|
private
|
31
43
|
|
32
44
|
def config
|
33
|
-
@config ||= AppLocale::Config.load(options[
|
45
|
+
@config ||= AppLocale::Config.load(options["config-file"])
|
34
46
|
end
|
35
47
|
end
|
36
48
|
end
|
data/lib/applocale/client.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "httparty"
|
2
2
|
|
3
3
|
module AppLocale
|
4
4
|
class Client
|
@@ -33,7 +33,7 @@ module AppLocale
|
|
33
33
|
def export_params(language)
|
34
34
|
export_params = { project_id: project_id }
|
35
35
|
if language
|
36
|
-
export_params
|
36
|
+
export_params[:locale] = language
|
37
37
|
end
|
38
38
|
export_params
|
39
39
|
end
|
@@ -64,20 +64,17 @@ module AppLocale
|
|
64
64
|
def base_payload(body = {}, options = {})
|
65
65
|
{
|
66
66
|
headers: {
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
"Accept" => "application/json",
|
68
|
+
"Authorization" => "Bearer #{params[:api_key]}",
|
69
|
+
"User-Agent" => "AppLocale-Ruby:#{AppLocale::VERSION}"
|
70
70
|
},
|
71
71
|
body: body
|
72
72
|
}.merge(options)
|
73
73
|
end
|
74
74
|
|
75
75
|
# Private: base_uri
|
76
|
-
#
|
77
76
|
def base_uri
|
78
|
-
|
79
|
-
|
80
|
-
"https://applocale.dev/api/v1"
|
77
|
+
params[:base_uri] + "/api/v1"
|
81
78
|
end
|
82
79
|
end
|
83
80
|
end
|
data/lib/applocale/config.rb
CHANGED
@@ -3,7 +3,7 @@ require "yaml"
|
|
3
3
|
|
4
4
|
module AppLocale
|
5
5
|
class Config
|
6
|
-
attr_accessor(:config_file, :configuration_data, :api_key, :project_id, :locale_directory)
|
6
|
+
attr_accessor(:config_file, :configuration_data, :api_key, :host, :project_id, :locale_directory)
|
7
7
|
|
8
8
|
def self.load(config_file)
|
9
9
|
new(config_file)
|
@@ -12,9 +12,10 @@ module AppLocale
|
|
12
12
|
def initialize(config_file)
|
13
13
|
@config_file = config_file
|
14
14
|
parse_config_file!
|
15
|
-
@api_key = env_or_config_value(
|
16
|
-
@project_id = env_or_config_value(
|
17
|
-
@
|
15
|
+
@api_key = env_or_config_value("api_key")
|
16
|
+
@project_id = env_or_config_value("project_id")
|
17
|
+
@host = env_or_config_value("host")
|
18
|
+
@locale_directory = env_or_config_value("locale_directory", default: "config/locales")
|
18
19
|
end
|
19
20
|
|
20
21
|
def parse_config_file!
|
@@ -22,11 +23,11 @@ module AppLocale
|
|
22
23
|
|
23
24
|
file_content = File.read(config_file_path)
|
24
25
|
parsed_config_file = ERB.new(file_content).result
|
25
|
-
@configuration_data = YAML.
|
26
|
+
@configuration_data = YAML.safe_load(parsed_config_file).dig("applocale") || {}
|
26
27
|
end
|
27
28
|
|
28
29
|
def validate_config_file!
|
29
|
-
unless File.
|
30
|
+
unless File.exist?(config_file_path)
|
30
31
|
puts "[AppLocale] Error: #{config_file_path} does not exist."
|
31
32
|
exit 1
|
32
33
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
require
|
1
|
+
require "fileutils"
|
2
2
|
|
3
3
|
module AppLocale
|
4
4
|
class FileWriter < AppLocale::BaseCommand
|
5
5
|
def call(response)
|
6
6
|
create_locale_directory unless File.directory?(config.locale_directory)
|
7
7
|
|
8
|
-
relative_file_path = "#{config.locale_directory}/#{response.dig(
|
8
|
+
relative_file_path = "#{config.locale_directory}/#{response.dig("language_code")}.yml"
|
9
9
|
file_path = File.expand_path(relative_file_path)
|
10
|
-
File.write(file_path, response.dig(
|
11
|
-
puts "[AppLocale] Wrote translations for #{response.dig(
|
10
|
+
File.write(file_path, response.dig("yaml"))
|
11
|
+
puts "[AppLocale] ↳ Wrote translations for #{response.dig("language_code")} to #{relative_file_path}"
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
data/lib/applocale/pull.rb
CHANGED
@@ -8,9 +8,9 @@ module AppLocale
|
|
8
8
|
response = client.project_information
|
9
9
|
if response.dig("success")
|
10
10
|
languages = response.dig("languages")
|
11
|
-
puts "[AppLocale] Received #{languages} from AppLocale..." if options[:verbose]
|
11
|
+
puts "[AppLocale] ↳ Received #{languages} from AppLocale..." if options[:verbose]
|
12
12
|
else
|
13
|
-
puts "[AppLocale] #{response.dig(
|
13
|
+
puts "[AppLocale] #{response.dig("message")}"
|
14
14
|
exit 1
|
15
15
|
end
|
16
16
|
end
|
@@ -20,10 +20,10 @@ module AppLocale
|
|
20
20
|
puts "[AppLocale] Fetching translations for #{language_code}..."
|
21
21
|
response = client.export(language_code)
|
22
22
|
if response.dig("success")
|
23
|
-
puts "[AppLocale] Received #{response} from AppLocale" if options[:verbose]
|
23
|
+
puts "[AppLocale] ↳ Received #{response} from AppLocale" if options[:verbose]
|
24
24
|
AppLocale::FileWriter.new(config, options).call(response)
|
25
25
|
else
|
26
|
-
puts "[AppLocale] #{response.dig(
|
26
|
+
puts "[AppLocale] #{response.dig("message")}"
|
27
27
|
exit 1
|
28
28
|
end
|
29
29
|
end
|
@@ -36,7 +36,7 @@ module AppLocale
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def params
|
39
|
-
{ api_key: config.api_key, project_id: config.project_id }
|
39
|
+
{ api_key: config.api_key, project_id: config.project_id, base_uri: config.host }
|
40
40
|
end
|
41
41
|
|
42
42
|
def client
|
data/lib/applocale/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: applocale-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Andrea Fomera
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.18.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.18.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '13.0'
|
62
62
|
type: :development
|
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: '
|
68
|
+
version: '13.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,15 +80,34 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '5.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest-reporters
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.4'
|
83
97
|
description: Easily pull in your locales from AppLocale.dev
|
84
98
|
email:
|
85
|
-
-
|
99
|
+
- andrea@zerlex.net
|
86
100
|
executables:
|
87
101
|
- applocale
|
88
102
|
extensions: []
|
89
103
|
extra_rdoc_files: []
|
90
104
|
files:
|
105
|
+
- ".github/workflows/standardrb.yml"
|
106
|
+
- ".github/workflows/tests.yml"
|
91
107
|
- ".gitignore"
|
108
|
+
- ".ruby-version"
|
109
|
+
- ".standard.yml"
|
110
|
+
- CHANGELOG.md
|
92
111
|
- CODE_OF_CONDUCT.md
|
93
112
|
- Gemfile
|
94
113
|
- Gemfile.lock
|
@@ -97,7 +116,10 @@ files:
|
|
97
116
|
- applocale-ruby.gemspec
|
98
117
|
- bin/applocale
|
99
118
|
- bin/console
|
119
|
+
- bin/format
|
120
|
+
- bin/lint
|
100
121
|
- bin/setup
|
122
|
+
- bin/standardrb
|
101
123
|
- exe/applocale
|
102
124
|
- lib/applocale/base_command.rb
|
103
125
|
- lib/applocale/cli.rb
|
@@ -106,14 +128,15 @@ files:
|
|
106
128
|
- lib/applocale/file_writer.rb
|
107
129
|
- lib/applocale/pull.rb
|
108
130
|
- lib/applocale/ruby.rb
|
131
|
+
- lib/applocale/templates/config.yml
|
109
132
|
- lib/applocale/version.rb
|
110
133
|
homepage: https://applocale.dev
|
111
134
|
licenses: []
|
112
135
|
metadata:
|
113
136
|
homepage_uri: https://applocale.dev
|
114
137
|
source_code_uri: https://github.com/applocale/applocale-ruby
|
115
|
-
changelog_uri: https://github.com/applocale/applocale-ruby
|
116
|
-
post_install_message:
|
138
|
+
changelog_uri: https://github.com/applocale/applocale-ruby/blob/master/CHANGELOG.md
|
139
|
+
post_install_message:
|
117
140
|
rdoc_options: []
|
118
141
|
require_paths:
|
119
142
|
- lib
|
@@ -128,8 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
151
|
- !ruby/object:Gem::Version
|
129
152
|
version: '0'
|
130
153
|
requirements: []
|
131
|
-
rubygems_version: 3.
|
132
|
-
signing_key:
|
154
|
+
rubygems_version: 3.5.16
|
155
|
+
signing_key:
|
133
156
|
specification_version: 4
|
134
157
|
summary: Easily pull in your locales from AppLocale.dev
|
135
158
|
test_files: []
|