ios_polyglot_cli 2.2.2 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +68 -59
- data/README.md +3 -1
- data/exe/polyglot +1 -1
- data/ios-polyglot-cli.gemspec +1 -2
- data/lib/ios_polyglot_cli/commands/pull.rb +5 -3
- data/lib/ios_polyglot_cli/helpers/general.rb +4 -0
- data/lib/ios_polyglot_cli/io/token.rb +25 -9
- data/lib/ios_polyglot_cli/serializers/languages/languages_serializer.rb +1 -1
- data/lib/ios_polyglot_cli/serializers/languages/languages_serializer_objc.rb +2 -2
- data/lib/ios_polyglot_cli/serializers/sources/sources_serializer_swift.rb +1 -1
- data/lib/ios_polyglot_cli/version.rb +1 -1
- data/lib/ios_polyglot_cli.rb +0 -1
- metadata +5 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a4772a7586a26e165ab7b05bb5adc917e597f80d0aadd1681c447eb18294e80
|
4
|
+
data.tar.gz: 8a441b6e7f109e310aa33caf67ec22751a39da6eb46766f83a002e9f801d9802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b776a929067b05d066076163a060bab2ff210db020d9a75c3d2357e217b817247a4b5fc1a44ae9abd78fbb746879659b7d47f3126c557d9b86f1e77821a5c5a
|
7
|
+
data.tar.gz: 0173e073f01dbfcf7a9318ecf9a9cbebabcfea04be5433c19a2c398d0d092f0fdbfc268d6efa5e910d5f5b4f680059bd8505e077558a6f9fab6c2e1d4002e3a3
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.0
|
data/Gemfile.lock
CHANGED
@@ -1,92 +1,101 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ios_polyglot_cli (2.
|
4
|
+
ios_polyglot_cli (2.4.0)
|
5
5
|
activesupport
|
6
6
|
commander
|
7
7
|
json_api_client
|
8
|
-
osx_keychain
|
9
8
|
tty-prompt
|
10
9
|
|
11
10
|
GEM
|
12
11
|
remote: https://rubygems.org/
|
13
12
|
specs:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
activemodel (6.0.0)
|
18
|
-
activesupport (= 6.0.0)
|
19
|
-
activesupport (6.0.0)
|
13
|
+
activemodel (7.0.4)
|
14
|
+
activesupport (= 7.0.4)
|
15
|
+
activesupport (7.0.4)
|
20
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
21
|
-
i18n (>=
|
22
|
-
minitest (
|
23
|
-
tzinfo (~>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
commander (4.4.7)
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
addressable (2.8.1)
|
21
|
+
public_suffix (>= 2.0.2, < 6.0)
|
22
|
+
byebug (11.1.3)
|
23
|
+
coderay (1.1.3)
|
24
|
+
commander (4.6.0)
|
30
25
|
highline (~> 2.0.0)
|
31
|
-
concurrent-ruby (1.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
faraday (
|
26
|
+
concurrent-ruby (1.2.2)
|
27
|
+
faraday (1.10.2)
|
28
|
+
faraday-em_http (~> 1.0)
|
29
|
+
faraday-em_synchrony (~> 1.0)
|
30
|
+
faraday-excon (~> 1.1)
|
31
|
+
faraday-httpclient (~> 1.0)
|
32
|
+
faraday-multipart (~> 1.0)
|
33
|
+
faraday-net_http (~> 1.0)
|
34
|
+
faraday-net_http_persistent (~> 1.0)
|
35
|
+
faraday-patron (~> 1.0)
|
36
|
+
faraday-rack (~> 1.0)
|
37
|
+
faraday-retry (~> 1.0)
|
38
|
+
ruby2_keywords (>= 0.0.4)
|
39
|
+
faraday-em_http (1.0.0)
|
40
|
+
faraday-em_synchrony (1.0.0)
|
41
|
+
faraday-excon (1.1.0)
|
42
|
+
faraday-httpclient (1.0.1)
|
43
|
+
faraday-multipart (1.0.4)
|
44
|
+
multipart-post (~> 2)
|
45
|
+
faraday-net_http (1.0.1)
|
46
|
+
faraday-net_http_persistent (1.2.0)
|
47
|
+
faraday-patron (1.0.0)
|
48
|
+
faraday-rack (1.0.0)
|
49
|
+
faraday-retry (1.0.3)
|
50
|
+
faraday_middleware (1.2.0)
|
51
|
+
faraday (~> 1.0)
|
37
52
|
highline (2.0.3)
|
38
|
-
i18n (1.
|
53
|
+
i18n (1.12.0)
|
39
54
|
concurrent-ruby (~> 1.0)
|
40
|
-
json_api_client (1.
|
55
|
+
json_api_client (1.21.0)
|
41
56
|
activemodel (>= 3.2.0)
|
42
57
|
activesupport (>= 3.2.0)
|
43
58
|
addressable (~> 2.2)
|
44
|
-
faraday (
|
45
|
-
faraday_middleware (
|
59
|
+
faraday (>= 0.15.2, < 2.0)
|
60
|
+
faraday_middleware (>= 0.9.0, < 2.0)
|
46
61
|
rack (>= 0.2)
|
47
|
-
method_source (0.
|
48
|
-
minitest (5.
|
49
|
-
multipart-post (2.
|
50
|
-
|
51
|
-
osx_keychain (1.0.2)
|
52
|
-
RubyInline (~> 3)
|
53
|
-
pastel (0.7.3)
|
54
|
-
equatable (~> 0.6)
|
62
|
+
method_source (1.0.0)
|
63
|
+
minitest (5.16.3)
|
64
|
+
multipart-post (2.2.3)
|
65
|
+
pastel (0.8.0)
|
55
66
|
tty-color (~> 0.5)
|
56
|
-
pry (0.
|
57
|
-
coderay (~> 1.1
|
58
|
-
method_source (~>
|
59
|
-
pry-byebug (3.
|
67
|
+
pry (0.14.1)
|
68
|
+
coderay (~> 1.1)
|
69
|
+
method_source (~> 1.0)
|
70
|
+
pry-byebug (3.10.1)
|
60
71
|
byebug (~> 11.0)
|
61
|
-
pry (
|
62
|
-
public_suffix (
|
63
|
-
rack (
|
72
|
+
pry (>= 0.13, < 0.15)
|
73
|
+
public_suffix (5.0.0)
|
74
|
+
rack (3.0.1)
|
64
75
|
rake (10.5.0)
|
65
|
-
|
66
|
-
tty-color (0.
|
67
|
-
tty-cursor (0.7.
|
68
|
-
tty-prompt (0.
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
tty-reader (0.6.0)
|
76
|
+
ruby2_keywords (0.0.5)
|
77
|
+
tty-color (0.6.0)
|
78
|
+
tty-cursor (0.7.1)
|
79
|
+
tty-prompt (0.23.1)
|
80
|
+
pastel (~> 0.8)
|
81
|
+
tty-reader (~> 0.8)
|
82
|
+
tty-reader (0.9.0)
|
73
83
|
tty-cursor (~> 0.7)
|
74
|
-
tty-screen (~> 0.
|
75
|
-
wisper (~> 2.0
|
76
|
-
tty-screen (0.
|
77
|
-
tzinfo (
|
78
|
-
|
84
|
+
tty-screen (~> 0.8)
|
85
|
+
wisper (~> 2.0)
|
86
|
+
tty-screen (0.8.1)
|
87
|
+
tzinfo (2.0.5)
|
88
|
+
concurrent-ruby (~> 1.0)
|
79
89
|
wisper (2.0.1)
|
80
|
-
zeitwerk (2.3.1)
|
81
90
|
|
82
91
|
PLATFORMS
|
83
|
-
|
92
|
+
arm64-darwin-21
|
84
93
|
|
85
94
|
DEPENDENCIES
|
86
|
-
bundler (~>
|
95
|
+
bundler (~> 2.3)
|
87
96
|
ios_polyglot_cli!
|
88
97
|
pry-byebug
|
89
98
|
rake (~> 10.0)
|
90
99
|
|
91
100
|
BUNDLED WITH
|
92
|
-
|
101
|
+
2.3.26
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ You will have to login with your Infinum ID if you want to use polyglot:
|
|
30
30
|
|
31
31
|
polyglot login
|
32
32
|
|
33
|
-
If your login action is successful, polyglot will ask you to
|
33
|
+
If your login action is successful, polyglot will ask you to store your Polyglot token to local environment variables, so you don’t have to enter your credentials every time when you use `polyglot` command.
|
34
34
|
|
35
35
|
### Setup
|
36
36
|
|
@@ -70,6 +70,8 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
|
|
70
70
|
|
71
71
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
72
72
|
|
73
|
+
In order to release a new version to rubygems, you will need to be added as an owner of polyglot project on rubygems. Owners that can add other users are listed on [project's rubygems page.](https://rubygems.org/gems/ios_polyglot_cli)
|
74
|
+
|
73
75
|
## Contributing
|
74
76
|
|
75
77
|
Bug reports and pull requests are welcome on GitHub at https://github.com/infinum/ios_polyglot_cli.
|
data/exe/polyglot
CHANGED
@@ -11,7 +11,7 @@ program :description, 'An iOS client for managing polyglot\'s translations.'
|
|
11
11
|
|
12
12
|
command :login do |c|
|
13
13
|
c.syntax = 'polyglot login'
|
14
|
-
c.description = '
|
14
|
+
c.description = 'Login to Polyglot and fetches the token using the email and password you provide.'
|
15
15
|
c.action do
|
16
16
|
PolyglotIos::ErrorHandler.rescuable do
|
17
17
|
PolyglotIos::Command::Login.init
|
data/ios-polyglot-cli.gemspec
CHANGED
@@ -23,13 +23,12 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.add_development_dependency 'bundler', '~>
|
26
|
+
spec.add_development_dependency 'bundler', '~> 2.3'
|
27
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
28
|
spec.add_development_dependency 'pry-byebug'
|
29
29
|
|
30
30
|
spec.add_dependency 'json_api_client'
|
31
31
|
spec.add_dependency 'tty-prompt'
|
32
32
|
spec.add_dependency 'commander'
|
33
|
-
spec.add_dependency 'osx_keychain'
|
34
33
|
spec.add_dependency 'activesupport'
|
35
34
|
end
|
@@ -10,20 +10,22 @@ module PolyglotIos
|
|
10
10
|
|
11
11
|
def call
|
12
12
|
prompt.say("Fetching translations...")
|
13
|
-
generate_translations(project_configs, programming_language)
|
13
|
+
generate_translations(project_configs, programming_language, skip_writing_language_struct)
|
14
14
|
success("Translations successfully generated!")
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
18
|
|
19
|
-
def generate_translations(projects, programming_language)
|
19
|
+
def generate_translations(projects, programming_language, skip_writing_language_struct)
|
20
20
|
projects.each do |project|
|
21
21
|
project_id = project[:id]
|
22
22
|
languages = pull_languages(project_id)
|
23
23
|
translation_keys = pull_translation_keys(project_id)
|
24
24
|
|
25
25
|
write_translations(translation_keys, languages, project[:path], project[:useOldNaming])
|
26
|
-
|
26
|
+
if !skip_writing_language_struct
|
27
|
+
write_languages(languages, project[:sourceFilesPath], programming_language)
|
28
|
+
end
|
27
29
|
write_translation_sources(translation_keys, project[:sourceFilesPath], programming_language)
|
28
30
|
end
|
29
31
|
end
|
@@ -28,6 +28,10 @@ module PolyglotIos
|
|
28
28
|
@programming_language ||= config[:language]
|
29
29
|
end
|
30
30
|
|
31
|
+
def skip_writing_language_struct
|
32
|
+
@skip_writing_language_struct ||= config[:skip_writing_language_struct]
|
33
|
+
end
|
34
|
+
|
31
35
|
def use_old_naming
|
32
36
|
@useOldNaming ||= config[:useOldNaming]
|
33
37
|
end
|
@@ -2,22 +2,38 @@ module PolyglotIos
|
|
2
2
|
module IO
|
3
3
|
class Token
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
@@in_memory_token = nil
|
6
|
+
|
7
|
+
POLYGLOT_TOKEN_KEY = "POLYGLOT_TOKEN".freeze
|
7
8
|
|
8
9
|
class << self
|
10
|
+
|
9
11
|
def write(token)
|
10
|
-
|
12
|
+
if @@in_memory_token.nil?
|
13
|
+
out = <<-HELLO
|
14
|
+
|
15
|
+
#{POLYGLOT_TOKEN_KEY}=#{token}
|
16
|
+
|
17
|
+
To stay logged in, add the Polyglot token to your local environment (.zshrc, .bashrc...).
|
18
|
+
zsh:
|
19
|
+
echo '\\nexport #{POLYGLOT_TOKEN_KEY}=#{token}' >> ~/.zshrc
|
20
|
+
source ~/.zshrc
|
21
|
+
bash:
|
22
|
+
echo '\\nexport #{POLYGLOT_TOKEN_KEY}=#{token}' >> ~/.bashrc
|
23
|
+
source ~/.bashrc
|
24
|
+
HELLO
|
25
|
+
puts out
|
26
|
+
end
|
27
|
+
@@in_memory_token = token
|
11
28
|
end
|
12
29
|
|
13
30
|
def read
|
14
|
-
|
31
|
+
if !@@in_memory_token.nil?
|
32
|
+
return @@in_memory_token
|
33
|
+
else
|
34
|
+
return ENV[POLYGLOT_TOKEN_KEY]
|
35
|
+
end
|
15
36
|
end
|
16
|
-
|
17
|
-
def keychain
|
18
|
-
@keychain ||= OSXKeychain.new
|
19
|
-
end
|
20
|
-
|
21
37
|
end
|
22
38
|
end
|
23
39
|
end
|
@@ -6,8 +6,8 @@ module PolyglotIos
|
|
6
6
|
class ObjC < Base
|
7
7
|
|
8
8
|
def render()
|
9
|
-
h_file = ERB.new(h_template,
|
10
|
-
m_file = ERB.new(m_template,
|
9
|
+
h_file = ERB.new(h_template, trim_mode: '-').result(binding)
|
10
|
+
m_file = ERB.new(m_template, trim_mode: '-').result(binding)
|
11
11
|
return h_file, m_file
|
12
12
|
end
|
13
13
|
|
data/lib/ios_polyglot_cli.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ios_polyglot_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filip Gulan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: osx_keychain
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: activesupport
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,8 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
172
|
- !ruby/object:Gem::Version
|
187
173
|
version: '0'
|
188
174
|
requirements: []
|
189
|
-
|
190
|
-
rubygems_version: 2.7.6
|
175
|
+
rubygems_version: 3.3.3
|
191
176
|
signing_key:
|
192
177
|
specification_version: 4
|
193
178
|
summary: A CLI for pulling polyglot translations and generating iOS Source Files
|