neeto-translate-cli 0.1.8.beta0 → 0.1.8
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/lib/neeto_translate_cli/cli.rb +1 -1
- data/lib/neeto_translate_cli/version.rb +1 -1
- data/test/neeto_translate_cli/cli_test.rb +17 -17
- 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: cb434279a1de983aa87756bcc1417772548a8e8a917cb5fdc78502cb00e3e66e
|
|
4
|
+
data.tar.gz: 5d3d5f98971d257304b1fce67d02187223cd692f97bc0a34cd7ede2babab4518
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d4f2f9f216bedf499006d886b69ce16d2140238b007054e17fda8aa08487044b8cd2414f5a68c1954bde394d4de1a7618b4a3aaa6cf10bbb2ca87ec97002def
|
|
7
|
+
data.tar.gz: 8485944b91dafaa1e583741304b6fd3508eff19ee5662a8e640e1ff51ed32ec9381e9112732f1db31c442d36f2281c22cb32bad83ca3470afb6eb641ad1d004e
|
|
@@ -6,7 +6,7 @@ require "optparse"
|
|
|
6
6
|
|
|
7
7
|
module NeetoTranslateCli
|
|
8
8
|
class CLI
|
|
9
|
-
DEFAULT_LANGUAGES = "en,ar,bg,ca,zh-
|
|
9
|
+
DEFAULT_LANGUAGES = "en,ar,bg,ca,zh-CN,zh-TW,hr,cs,da,nl,et,fil,fi,fr,de,hi,id,it,ja,ko,pl,pt,pt-BR,ro,ru,sk,sl,es,es-MX,sv,th,tr,uk,vi"
|
|
10
10
|
NEETO_TRANSLATE_URL = "https://translate.neeto.com"
|
|
11
11
|
DEFAULT_BACKEND_LOCALE_PATH = "config/locales"
|
|
12
12
|
DEFAULT_FRONTEND_LOCALE_PATH = "app/javascript/src/translations"
|
|
@@ -13,17 +13,17 @@ class NeetoTranslateCli::CLITest < Minitest::Test
|
|
|
13
13
|
def test_start_with_default_options
|
|
14
14
|
cli = NeetoTranslateCli::CLI.new([])
|
|
15
15
|
options = cli.send(:parse_options, [])
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
assert_equal "app/javascript/src/translations", options[:frontend]
|
|
18
18
|
assert_equal "config/locales", options[:backend]
|
|
19
|
-
assert_equal
|
|
19
|
+
assert_equal ::NeetoTranslateCli::CLI::DEFAULT_LANGUAGES.split(","), options[:default_languages]
|
|
20
20
|
assert_equal @original_git_repo, options[:repo]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def test_start_with_custom_frontend_path
|
|
24
24
|
cli = NeetoTranslateCli::CLI.new([])
|
|
25
25
|
options = cli.send(:parse_options, ["--frontend", "custom/frontend/path"])
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
assert_equal "custom/frontend/path", options[:frontend]
|
|
28
28
|
assert_equal "config/locales", options[:backend]
|
|
29
29
|
end
|
|
@@ -31,7 +31,7 @@ class NeetoTranslateCli::CLITest < Minitest::Test
|
|
|
31
31
|
def test_start_with_custom_backend_path
|
|
32
32
|
cli = NeetoTranslateCli::CLI.new([])
|
|
33
33
|
options = cli.send(:parse_options, ["--backend", "custom/backend/path"])
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
assert_equal "app/javascript/src/translations", options[:frontend]
|
|
36
36
|
assert_equal "custom/backend/path", options[:backend]
|
|
37
37
|
end
|
|
@@ -39,26 +39,26 @@ class NeetoTranslateCli::CLITest < Minitest::Test
|
|
|
39
39
|
def test_start_with_custom_languages
|
|
40
40
|
cli = NeetoTranslateCli::CLI.new([])
|
|
41
41
|
options = cli.send(:parse_options, ["--defaults", "ja,ko,zh"])
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
assert_equal %w[ja ko zh], options[:default_languages]
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def test_start_with_custom_repo
|
|
47
47
|
cli = NeetoTranslateCli::CLI.new([])
|
|
48
48
|
options = cli.send(:parse_options, ["--repo", "neetozone/custom-repo"])
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
assert_equal "neetozone/custom-repo", options[:repo]
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def test_start_with_all_custom_options
|
|
54
54
|
cli = NeetoTranslateCli::CLI.new([])
|
|
55
55
|
options = cli.send(:parse_options, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
"--frontend", "custom/frontend",
|
|
57
|
+
"--backend", "custom/backend",
|
|
58
|
+
"--defaults", "ja,ko",
|
|
59
|
+
"--repo", "neetozone/test-repo"
|
|
60
|
+
])
|
|
61
|
+
|
|
62
62
|
assert_equal "custom/frontend", options[:frontend]
|
|
63
63
|
assert_equal "custom/backend", options[:backend]
|
|
64
64
|
assert_equal %w[ja ko], options[:default_languages]
|
|
@@ -69,26 +69,26 @@ class NeetoTranslateCli::CLITest < Minitest::Test
|
|
|
69
69
|
ENV["DEFAULT_LANGUAGES"] = "ja,ko,zh"
|
|
70
70
|
cli = NeetoTranslateCli::CLI.new([])
|
|
71
71
|
options = cli.send(:parse_options, [])
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
assert_equal %w[ja ko zh], options[:default_languages]
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def test_run_calls_translator
|
|
77
77
|
mock_translator = Minitest::Mock.new
|
|
78
78
|
mock_translator.expect :process!, nil
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
options = {
|
|
81
81
|
frontend: "test/fixtures/frontend",
|
|
82
82
|
backend: "test/fixtures/backend",
|
|
83
83
|
default_languages: %w[es de],
|
|
84
84
|
repo: "test-repo"
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
NeetoTranslateCli::Translator.stub :new, mock_translator do
|
|
88
88
|
cli = NeetoTranslateCli::CLI.new([])
|
|
89
89
|
cli.send(:run_with_options, options)
|
|
90
90
|
end
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
mock_translator.verify
|
|
93
93
|
end
|
|
94
94
|
|
|
@@ -98,4 +98,4 @@ class NeetoTranslateCli::CLITest < Minitest::Test
|
|
|
98
98
|
cli = NeetoTranslateCli::CLI.new(args)
|
|
99
99
|
cli.send(:parse_options, args)
|
|
100
100
|
end
|
|
101
|
-
end
|
|
101
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: neeto-translate-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.8
|
|
4
|
+
version: 0.1.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abhay V Ashokan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-08-
|
|
11
|
+
date: 2025-08-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|