flutter_polyglot_cli 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/flutter_polyglot_cli/api/base.rb +1 -1
- data/lib/flutter_polyglot_cli/helpers/general.rb +14 -1
- data/lib/flutter_polyglot_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: adce03efa77bd0f484e177ec3b95eada20c6ca97f643762affde404212f22dba
|
|
4
|
+
data.tar.gz: 62a4090e52a4f544456ac72a7ea3b91fa08bda0b296917829250b80a6d16d0bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5fbbf9ba706b986d4015600c5ed690d0c9793065539d27d995a4c5c1a7defb0bc9696403f357722c8c9dab914cc95b262af8726c247d6cb9ba651ecf7402719
|
|
7
|
+
data.tar.gz: f66947d88580974c41b0736f5a0e9525b0f5ba7a9bf8261975402bf53b4c650d23f28665d86bb43f6f991525054bef9c998afb1a946dbdef7253268a1ac87934
|
data/Gemfile.lock
CHANGED
|
@@ -3,7 +3,7 @@ module PolyglotFlutter
|
|
|
3
3
|
class Base < JsonApiClient::Resource
|
|
4
4
|
extend PolyglotFlutter::Helper::Depaginate
|
|
5
5
|
|
|
6
|
-
self.site = 'https://
|
|
6
|
+
self.site = 'https://infinum.polyglothq.com/api/v2/'
|
|
7
7
|
|
|
8
8
|
def self.token(token)
|
|
9
9
|
self.connection_options = { headers: { 'X-Auth-Token' => token } }
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
module PolyglotFlutter
|
|
2
2
|
module Helper
|
|
3
3
|
module General
|
|
4
|
-
|
|
4
|
+
ESCAPE_KEYWORDS = %w[abstract as assert async await break case
|
|
5
|
+
catch class const continue covariant default deferred do
|
|
6
|
+
else enum export extends external factory false final
|
|
7
|
+
finally for Function get hide if import in interface
|
|
8
|
+
is library mixin new null on operator part rethrow return
|
|
9
|
+
set static super switch sync this throw true try typedef var
|
|
10
|
+
void while with yield _]
|
|
5
11
|
def token
|
|
6
12
|
@token ||= PolyglotFlutter::IO::Token.read
|
|
7
13
|
if @token.to_s.empty?
|
|
@@ -56,6 +62,7 @@ module PolyglotFlutter
|
|
|
56
62
|
.join
|
|
57
63
|
|
|
58
64
|
escaped_underscore = escape_with_underscore_if_needed(clean_name)
|
|
65
|
+
escape_keyword_if_needed(escaped_underscore)
|
|
59
66
|
end
|
|
60
67
|
|
|
61
68
|
def escape_with_underscore_if_needed(name)
|
|
@@ -64,6 +71,12 @@ module PolyglotFlutter
|
|
|
64
71
|
'_' + name
|
|
65
72
|
end
|
|
66
73
|
|
|
74
|
+
def escape_keyword_if_needed(name)
|
|
75
|
+
return name unless ESCAPE_KEYWORDS.include? name
|
|
76
|
+
|
|
77
|
+
"#{name}_"
|
|
78
|
+
end
|
|
79
|
+
|
|
67
80
|
def generate_locales(languages)
|
|
68
81
|
language_locales = languages.each.map { |value| value['locale'].split('_').first }.join("', '")
|
|
69
82
|
"['#{language_locales}']"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flutter_polyglot_cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maroje Marcelic
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-05-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|