rosette 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rosette/cli.rb +13 -11
- data/lib/rosette/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a6d97a97a755feb6b3d7a69bb1059ca61a4d13775feee044bd984bd2d676c9a
|
4
|
+
data.tar.gz: ac18c0186280744399171f29f64a2f63e36b027c9e2147227dfac4690d1387a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3fc87c9790ff2227446db2c29b91b238b7b9de9c25a172e98afc4663f291977301dc0dd66d70f35ceff0eee0adc5a6e14864ec1b7dca1e5a0009951308b6065
|
7
|
+
data.tar.gz: 8f5fa5333bde31e318d9d1da5f3cd73889073d0210c08185c0380caa909aec93c00d390be151274ce38c6a56e81f321e24c7b777c8cbbb9076ab828c582a3dd0
|
data/lib/rosette/cli.rb
CHANGED
@@ -14,9 +14,10 @@ module Rosette
|
|
14
14
|
def run
|
15
15
|
loop do
|
16
16
|
ask_for_command
|
17
|
-
return if
|
17
|
+
return exit 0 if exit_cli?
|
18
18
|
|
19
19
|
next display_help if help?
|
20
|
+
next normalize! if normalize?
|
20
21
|
|
21
22
|
ask_for_key
|
22
23
|
send command
|
@@ -31,8 +32,9 @@ module Rosette
|
|
31
32
|
menu.choice("1. Read a translation", "read")
|
32
33
|
menu.choice("2. Add a translation", "add")
|
33
34
|
menu.choice("3. Remove a translation", "remove")
|
34
|
-
menu.choice("4.
|
35
|
-
menu.choice("5.
|
35
|
+
menu.choice("4. Normalize locales", "normalize")
|
36
|
+
menu.choice("5. Help", "help")
|
37
|
+
menu.choice("6. Exit", "exit_cli")
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
@@ -47,13 +49,9 @@ module Rosette
|
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
50
|
-
def
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
def exit?
|
55
|
-
command == "exit"
|
56
|
-
end
|
52
|
+
def exit_cli? = command == "exit_cli"
|
53
|
+
def help? = command == "help"
|
54
|
+
def normalize? = command == "normalize"
|
57
55
|
|
58
56
|
# COMMANDS
|
59
57
|
|
@@ -77,11 +75,15 @@ module Rosette
|
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
78
|
+
def normalize!
|
79
|
+
Manager.normalize!
|
80
|
+
end
|
81
|
+
|
80
82
|
def display_help
|
81
83
|
puts <<~HELP
|
82
84
|
|
83
85
|
For commands read/add/remove you must provide a key pointing to the translation.
|
84
|
-
It can begin with or without the locale. These are all
|
86
|
+
It can begin with or without the locale. These keys are all considered equivalent:
|
85
87
|
|
86
88
|
fr.activemodel.errors.blank
|
87
89
|
en.activemodel.errors.blank
|
data/lib/rosette/version.rb
CHANGED