rosette 0.3.3 → 0.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 514d0d011935666b1e2a7455cd29df13f12b2cd2130cd9625349f9f9013198d3
4
- data.tar.gz: 637e017006a28f72e16a19a457f1760cae3c1a428a2f3e5efa0921fae2f1e7c5
3
+ metadata.gz: 7a6d97a97a755feb6b3d7a69bb1059ca61a4d13775feee044bd984bd2d676c9a
4
+ data.tar.gz: ac18c0186280744399171f29f64a2f63e36b027c9e2147227dfac4690d1387a7
5
5
  SHA512:
6
- metadata.gz: 272ae0fe075b3a4927806cc5ec1e28331673b35d652acb7af746964bbe844c7478b650d0468c1b6d16f0f65724faf4dad0de5707bf813703988e07e9e5a88708
7
- data.tar.gz: 07fefd534e3d8be9822c3a6f5d293deba54042af6f1744981e97fd245e6e399b6ccd3772c6efaef518da0d9144708ce318ec1ec67c83b99b65edc15ab777d01c
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 exit?
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. Help", "help")
35
- menu.choice("5. Exit", "exit")
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 help?
51
- command == "help"
52
- end
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 valid keys:
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rosette
4
4
 
5
- VERSION = "0.3.3"
5
+ VERSION = "0.3.4"
6
6
 
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rosette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Platteeuw