hammer_cli 0.1.4 → 0.2.0

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -6
  3. data/doc/developer_docs.md +3 -0
  4. data/doc/release_notes.md +14 -0
  5. data/lib/hammer_cli/abstract.rb +4 -2
  6. data/lib/hammer_cli/i18n.rb +3 -8
  7. data/lib/hammer_cli/main.rb +1 -1
  8. data/lib/hammer_cli/options/normalizers.rb +18 -2
  9. data/lib/hammer_cli/output/dsl.rb +1 -2
  10. data/lib/hammer_cli/output/fields.rb +9 -0
  11. data/lib/hammer_cli/version.rb +1 -1
  12. data/locale/Makefile +9 -17
  13. data/locale/de/LC_MESSAGES/hammer-cli.mo +0 -0
  14. data/locale/de/hammer-cli.edit.po +303 -0
  15. data/locale/de/hammer-cli.po +114 -171
  16. data/locale/de/hammer-cli.po.time_stamp +0 -0
  17. data/locale/en/LC_MESSAGES/hammer-cli.mo +0 -0
  18. data/locale/en/hammer-cli.edit.po +290 -0
  19. data/locale/en/hammer-cli.po +98 -96
  20. data/locale/en/hammer-cli.po.time_stamp +0 -0
  21. data/locale/en_GB/LC_MESSAGES/hammer-cli.mo +0 -0
  22. data/locale/en_GB/hammer-cli.edit.po +298 -0
  23. data/locale/en_GB/hammer-cli.po +77 -138
  24. data/locale/en_GB/hammer-cli.po.time_stamp +0 -0
  25. data/locale/es/LC_MESSAGES/hammer-cli.mo +0 -0
  26. data/locale/es/hammer-cli.edit.po +301 -0
  27. data/locale/es/hammer-cli.po +122 -173
  28. data/locale/es/hammer-cli.po.time_stamp +0 -0
  29. data/locale/fr/LC_MESSAGES/hammer-cli.mo +0 -0
  30. data/locale/fr/hammer-cli.edit.po +301 -0
  31. data/locale/fr/hammer-cli.po +122 -173
  32. data/locale/fr/hammer-cli.po.time_stamp +0 -0
  33. data/locale/it/LC_MESSAGES/hammer-cli.mo +0 -0
  34. data/locale/it/hammer-cli.edit.po +300 -0
  35. data/locale/it/hammer-cli.po +117 -172
  36. data/locale/it/hammer-cli.po.time_stamp +0 -0
  37. data/locale/ja/LC_MESSAGES/hammer-cli.mo +0 -0
  38. data/locale/ja/hammer-cli.edit.po +299 -0
  39. data/locale/ja/hammer-cli.po +110 -171
  40. data/locale/ja/hammer-cli.po.time_stamp +0 -0
  41. data/locale/ko/LC_MESSAGES/hammer-cli.mo +0 -0
  42. data/locale/ko/hammer-cli.edit.po +299 -0
  43. data/locale/ko/hammer-cli.po +110 -171
  44. data/locale/ko/hammer-cli.po.time_stamp +0 -0
  45. data/locale/pt_BR/LC_MESSAGES/hammer-cli.mo +0 -0
  46. data/locale/pt_BR/hammer-cli.edit.po +301 -0
  47. data/locale/pt_BR/hammer-cli.po +114 -171
  48. data/locale/pt_BR/hammer-cli.po.time_stamp +0 -0
  49. data/locale/ru/LC_MESSAGES/hammer-cli.mo +0 -0
  50. data/locale/ru/hammer-cli.edit.po +300 -0
  51. data/locale/ru/hammer-cli.po +116 -172
  52. data/locale/ru/hammer-cli.po.time_stamp +0 -0
  53. data/locale/zh_CN/LC_MESSAGES/hammer-cli.mo +0 -0
  54. data/locale/zh_CN/hammer-cli.edit.po +299 -0
  55. data/locale/zh_CN/hammer-cli.po +110 -171
  56. data/locale/zh_CN/hammer-cli.po.time_stamp +0 -0
  57. data/locale/zh_TW/LC_MESSAGES/hammer-cli.mo +0 -0
  58. data/locale/zh_TW/hammer-cli.edit.po +299 -0
  59. data/locale/zh_TW/hammer-cli.po +110 -171
  60. data/locale/zh_TW/hammer-cli.po.time_stamp +0 -0
  61. data/test/unit/options/normalizers_test.rb +28 -0
  62. data/test/unit/output/fields_test.rb +60 -0
  63. metadata +38 -14
@@ -1,292 +1,231 @@
1
1
  # SOME DESCRIPTIVE TITLE.
2
2
  # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
3
  # This file is distributed under the same license as the hammer-cli package.
4
- #
4
+ #
5
5
  # Translators:
6
6
  # Automatically generated, 2014
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer-cli 0.1.4\n"
9
+ "Project-Id-Version: hammer-cli 0.2.0\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2014-09-15 12:50+0100\n"
12
11
  "PO-Revision-Date: 2014-09-16 13:21+0000\n"
13
12
  "Last-Translator: Dominic Cleal <dcleal@redhat.com>\n"
14
- "Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/foreman/language/zh_TW/)\n"
13
+ "Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/foreman/l"
14
+ "anguage/zh_TW/)\n"
15
15
  "MIME-Version: 1.0\n"
16
16
  "Content-Type: text/plain; charset=UTF-8\n"
17
17
  "Content-Transfer-Encoding: 8bit\n"
18
18
  "Language: zh_TW\n"
19
19
  "Plural-Forms: nplurals=1; plural=0;\n"
20
20
 
21
- #: lib/hammer_cli/subcommand.rb:56
21
+ msgid "too many arguments"
22
+ msgstr "引數過多"
23
+
24
+ msgid "option '%<option>s' is required"
25
+ msgstr "需要使用 '%<option>s' 選項"
26
+
27
+ msgid "option '%<option>s' (or env %<env>s) is required"
28
+ msgstr "需要使用 '%<option>s'(或是 %<env>s 環境)選項"
29
+
30
+ msgid "option '%<switch>s': %<message>s"
31
+ msgstr "選項 '%<switch>s':%<message>s"
32
+
33
+ msgid "parameter '%<param>s': %<message>s"
34
+ msgstr "參數 '%<param>s':%<message>s"
35
+
36
+ msgid "%<env>s: %<message>s"
37
+ msgstr "%<env>s:%<message>s"
38
+
39
+ msgid "Unrecognised option '%<switch>s'"
40
+ msgstr "無法辨識的選項 '%<switch>s'"
41
+
42
+ msgid "No such sub-command '%<name>s'"
43
+ msgstr "此類型的次指令不存在:'%<name>s'"
44
+
45
+ msgid "no value provided"
46
+ msgstr "未提供值"
47
+
48
+ msgid "Error: %s"
49
+ msgstr "錯誤:%s"
50
+
51
+ msgid "Error: %{message}"
52
+ msgstr ""
53
+
54
+ msgid "See: '%{path} --help'"
55
+ msgstr ""
56
+
57
+ msgid "Invalid username or password"
58
+ msgstr "無效的使用者名稱或密碼"
59
+
60
+ msgid "Could not load the API description from the server"
61
+ msgstr ""
62
+
63
+ msgid "is the server down?"
64
+ msgstr ""
65
+
22
66
  msgid ""
23
- "can't replace subcommand %<name>s (%<existing_class>s) with %<name>s "
24
- "(%<new_class>s)"
67
+ "was '%s' run on the server when using apipie cache? (typical production settin"
68
+ "gs)"
69
+ msgstr ""
70
+
71
+ msgid "Missing arguments for %s"
25
72
  msgstr ""
26
73
 
27
- #: lib/hammer_cli/logger.rb:28
28
74
  msgid "No permissions to create log dir %s"
29
75
  msgstr "沒有建立日誌目錄 %s 的權限"
30
76
 
31
- #: lib/hammer_cli/logger.rb:43
32
77
  msgid "File %s not writeable, won't log anything to the file!"
33
78
  msgstr "%s 檔案不允許寫入,將不會記錄任何資料至此檔案中!"
34
79
 
35
- #: lib/hammer_cli/main.rb:7
36
80
  msgid "be verbose"
37
81
  msgstr "詳細提供資料"
38
82
 
39
- #: lib/hammer_cli/main.rb:8
40
83
  msgid "show debugging output "
41
84
  msgstr "顯示除錯輸出"
42
85
 
43
- #: lib/hammer_cli/main.rb:9
86
+ msgid "force reload of Apipie cache"
87
+ msgstr ""
88
+
44
89
  msgid "path to custom config file"
45
90
  msgstr "自訂配置檔案的路徑"
46
91
 
47
- #: lib/hammer_cli/main.rb:11
48
92
  msgid "username to access the remote system"
49
93
  msgstr "用來存取遠端系統的使用者名稱"
50
94
 
51
- #: lib/hammer_cli/main.rb:13
52
95
  msgid "password to access the remote system"
53
96
  msgstr "用來存取遠端系統的密碼"
54
97
 
55
- #: lib/hammer_cli/main.rb:15
56
98
  msgid "remote system address"
57
99
  msgstr "遠端系統位址"
58
100
 
59
- #: lib/hammer_cli/main.rb:18
60
101
  msgid "show version"
61
102
  msgstr "顯示版本"
62
103
 
63
- #: lib/hammer_cli/main.rb:27
64
104
  msgid "Show ids of associated resources"
65
105
  msgstr "顯示相聯資源的 id"
66
106
 
67
- #: lib/hammer_cli/main.rb:29
68
107
  msgid "Explicitly turn interactive mode on/off"
69
108
  msgstr "明確開啓或關閉互動式模式"
70
109
 
71
- #: lib/hammer_cli/main.rb:33
72
110
  msgid "Output as CSV (same as --output=csv)"
73
111
  msgstr "輸出為 CSV(與 --output=csv 相同)"
74
112
 
75
- #: lib/hammer_cli/main.rb:34
76
113
  msgid "Set output format. One of [%s]"
77
114
  msgstr "設定輸出模式。[%s] 之一"
78
115
 
79
- #: lib/hammer_cli/main.rb:37
80
116
  msgid "Character to separate the values"
81
117
  msgstr "用來隔開值的字元"
82
118
 
83
- #: lib/hammer_cli/main.rb:41
84
119
  msgid "Get list of possible endings"
85
120
  msgstr "取得一列可能的結尾"
86
121
 
87
- #: lib/hammer_cli/validator.rb:41
88
- msgid "Unknown option name '%s'"
89
- msgstr "不明選項名稱「%s」"
90
-
91
- #: lib/hammer_cli/validator.rb:62
92
- msgid "You can't set all options %s at one time"
93
- msgstr "您不可一次將所有選項設為 %s"
94
-
95
- #: lib/hammer_cli/validator.rb:63
96
- msgid "Options %s are required"
97
- msgstr "%s 選項乃必要的"
98
-
99
- #: lib/hammer_cli/validator.rb:79
100
- msgid "You can't set any of options %s"
101
- msgstr "您不可將任何選項設為 %s"
102
-
103
- #: lib/hammer_cli/validator.rb:80
104
- msgid "At least one of options %s is required"
105
- msgstr "需要至少一項 %s 選項"
106
-
107
- #: lib/hammer_cli/shell.rb:10
108
- msgid "Print help for commands"
109
- msgstr "印出指令的說明"
110
-
111
- #: lib/hammer_cli/shell.rb:22
112
- msgid "Exit interactive shell"
113
- msgstr "退出互動式 shell"
114
-
115
- #: lib/hammer_cli/shell.rb:120
116
- msgid "Welcome to the hammer interactive shell"
117
- msgstr "歡迎使用 hammer 互動式 shell"
118
-
119
- #: lib/hammer_cli/shell.rb:121
120
- msgid "Type 'help' for usage information"
121
- msgstr "請輸入「help」以查看使用說明"
122
-
123
- #: lib/hammer_cli/shell.rb:122
124
122
  msgid ""
125
- "Command completion is disabled on ruby < 1.9 due to compatibility problems."
126
- msgstr "基於相容性上的問題,ruby < 1.9 上已停用了指令完成。"
127
-
128
- #: lib/hammer_cli/shell.rb:138
129
- msgid "Interactive shell"
130
- msgstr "互動式 shell"
131
-
132
- #: lib/hammer_cli/clamp.rb:5
133
- msgid "too many arguments"
134
- msgstr "引數過多"
135
-
136
- #: lib/hammer_cli/clamp.rb:6
137
- msgid "option '%<option>s' is required"
138
- msgstr "需要使用 '%<option>s' 選項"
139
-
140
- #: lib/hammer_cli/clamp.rb:7
141
- msgid "option '%<option>s' (or env %<env>s) is required"
142
- msgstr "需要使用 '%<option>s'(或是 %<env>s 環境)選項"
143
-
144
- #: lib/hammer_cli/clamp.rb:8
145
- msgid "option '%<switch>s': %<message>s"
146
- msgstr "選項 '%<switch>s':%<message>s"
147
-
148
- #: lib/hammer_cli/clamp.rb:9
149
- msgid "parameter '%<param>s': %<message>s"
150
- msgstr "參數 '%<param>s':%<message>s"
151
-
152
- #: lib/hammer_cli/clamp.rb:10
153
- msgid "%<env>s: %<message>s"
154
- msgstr "%<env>s:%<message>s"
155
-
156
- #: lib/hammer_cli/clamp.rb:11
157
- msgid "Unrecognised option '%<switch>s'"
158
- msgstr "無法辨識的選項 '%<switch>s'"
159
-
160
- #: lib/hammer_cli/clamp.rb:12
161
- msgid "No such sub-command '%<name>s'"
162
- msgstr "此類型的次指令不存在:'%<name>s'"
163
-
164
- #: lib/hammer_cli/clamp.rb:13
165
- msgid "no value provided"
166
- msgstr "未提供值"
167
-
168
- #: lib/hammer_cli/options/option_definition.rb:68
169
- msgid "Can be specified multiple times. "
170
- msgstr "可指定多次。"
123
+ "Legacy configuration of modules detected. Check section about configuration in"
124
+ " user manual"
125
+ msgstr "偵測到了舊式的模組配置。請查看使用者指南中的配置部分"
171
126
 
172
- #: lib/hammer_cli/options/option_definition.rb:69
173
- msgid "Default: "
174
- msgstr "預設值:"
127
+ msgid "Warning: An error occured while loading module %s"
128
+ msgstr "警告:載入 %s 模組時發生了錯誤"
175
129
 
176
- #: lib/hammer_cli/options/option_definition.rb:69
177
- msgid ", or "
178
- msgstr ",或是"
130
+ msgid "Error: Some of the required modules are disabled in configuration: %s "
131
+ msgstr ""
179
132
 
180
- #: lib/hammer_cli/options/normalizers.rb:26
181
133
  msgid "Comma-separated list of key=value."
182
134
  msgstr "逗號區隔開的一列 key=value。"
183
135
 
184
- #: lib/hammer_cli/options/normalizers.rb:39
185
136
  msgid "value must be defined as a comma-separated list of key=value"
186
137
  msgstr "值必須以一列逗號區隔開的 key=value 來定義"
187
138
 
188
- #: lib/hammer_cli/options/normalizers.rb:57
189
139
  msgid "Comma separated list of values."
190
140
  msgstr "逗號區隔開的值。"
191
141
 
192
- #: lib/hammer_cli/options/normalizers.rb:69
193
142
  msgid "One of true/false, yes/no, 1/0."
194
143
  msgstr "true/false、yes/no、1/0 之一。"
195
144
 
196
- #: lib/hammer_cli/options/normalizers.rb:79
197
145
  msgid "value must be one of true/false, yes/no, 1/0"
198
146
  msgstr "值必須是 true/false、yes/no、1/0 之一"
199
147
 
200
- #: lib/hammer_cli/options/normalizers.rb:118
201
148
  msgid "Unable to parse JSON input"
202
149
  msgstr "無法叵析 JSON 輸入"
203
150
 
204
- #: lib/hammer_cli/options/normalizers.rb:131
205
151
  msgid "One of %s"
206
152
  msgstr "%s 之一"
207
153
 
208
- #: lib/hammer_cli/options/normalizers.rb:138
209
154
  msgid "value must be one of '%s'"
210
155
  msgstr "值必須是「%s」之一"
211
156
 
212
- #: lib/hammer_cli/options/normalizers.rb:157
213
157
  msgid "Date and time in YYYY-MM-DD HH:MM:SS or ISO 8601 format"
214
158
  msgstr "日期與時間,格式為 YYYY-MM-DD HH:MM:SS 或是 ISO 8601 格式"
215
159
 
216
- #: lib/hammer_cli/options/normalizers.rb:164
217
160
  msgid "'%s' is not a valid date"
218
161
  msgstr "「%s」不是個有效的日期"
219
162
 
220
- #: lib/hammer_cli/options/normalizers.rb:175
221
163
  msgid "Any combination (comma separated list) of '%s'"
222
164
  msgstr "任何(以逗號隔開的)「%s」的組合"
223
165
 
224
- #: lib/hammer_cli/options/normalizers.rb:195
225
166
  msgid "value must be a combination of '%s'"
226
167
  msgstr "值必須是「%s」的組合"
227
168
 
228
- #: lib/hammer_cli/settings.rb:28
229
- msgid ""
230
- "Warning: location hammer.modules.d is deprecated, move your module "
231
- "configurations to cli.modules.d"
232
- msgstr "警告:hammer.modules.d 這個位置已淘汰使用,請將您的模組配置移至 cli.modules.d"
233
-
234
- #: lib/hammer_cli/exception_handler.rb:60
235
- msgid "Error: %s"
236
- msgstr "錯誤:%s"
237
-
238
- #: lib/hammer_cli/exception_handler.rb:66
239
- msgid "Error: %{message}"
240
- msgstr ""
169
+ msgid "Can be specified multiple times. "
170
+ msgstr "可指定多次。"
241
171
 
242
- #: lib/hammer_cli/exception_handler.rb:67
243
- msgid "See: '%{path} --help'"
244
- msgstr ""
172
+ msgid ", or "
173
+ msgstr ",或是"
245
174
 
246
- #: lib/hammer_cli/exception_handler.rb:84
247
- msgid "Invalid username or password"
248
- msgstr "無效的使用者名稱或密碼"
175
+ msgid "Default: "
176
+ msgstr "預設值:"
249
177
 
250
- #: lib/hammer_cli/exception_handler.rb:91
251
- msgid "Could not load the API description from the server"
252
- msgstr ""
178
+ msgid "Message"
179
+ msgstr "訊息"
253
180
 
254
- #: lib/hammer_cli/exception_handler.rb:92
255
- msgid "is the server down?"
256
- msgstr ""
181
+ msgid "Id"
182
+ msgstr "ID"
257
183
 
258
- #: lib/hammer_cli/exception_handler.rb:93
259
- msgid ""
260
- "was '%s' run on the server when using apipie cache? (typical production "
261
- "settings)"
262
- msgstr ""
184
+ msgid "Name"
185
+ msgstr "名稱"
263
186
 
264
- #: lib/hammer_cli/output/formatters.rb:154
265
187
  msgid "no"
266
188
  msgstr "否"
267
189
 
268
- #: lib/hammer_cli/output/formatters.rb:154
269
190
  msgid "yes"
270
191
  msgstr "是"
271
192
 
272
- #: lib/hammer_cli/output/adapter/csv.rb:171
273
- msgid "Message"
274
- msgstr "訊息"
193
+ msgid ""
194
+ "Warning: location hammer.modules.d is deprecated, move your module configurati"
195
+ "ons to cli.modules.d"
196
+ msgstr "警告:hammer.modules.d 這個位置已淘汰使用,請將您的模組配置移至 cli.modules.d"
275
197
 
276
- #: lib/hammer_cli/output/adapter/csv.rb:175
277
- msgid "Id"
278
- msgstr "ID"
198
+ msgid "Print help for commands"
199
+ msgstr "印出指令的說明"
279
200
 
280
- #: lib/hammer_cli/output/adapter/csv.rb:180
281
- msgid "Name"
282
- msgstr "名稱"
201
+ msgid "Exit interactive shell"
202
+ msgstr "退出互動式 shell"
203
+
204
+ msgid "Welcome to the hammer interactive shell"
205
+ msgstr "歡迎使用 hammer 互動式 shell"
206
+
207
+ msgid "Type 'help' for usage information"
208
+ msgstr "請輸入「help」以查看使用說明"
209
+
210
+ msgid "Interactive shell"
211
+ msgstr "互動式 shell"
283
212
 
284
- #: lib/hammer_cli/modules.rb:10
285
213
  msgid ""
286
- "Legacy configuration of modules detected. Check section about configuration "
287
- "in user manual"
288
- msgstr "偵測到了舊式的模組配置。請查看使用者指南中的配置部分"
214
+ "can't replace subcommand %<name>s (%<existing_class>s) with %<name>s (%<new_cl"
215
+ "ass>s)"
216
+ msgstr ""
289
217
 
290
- #: lib/hammer_cli/modules.rb:42
291
- msgid "Warning: An error occured while loading module %s"
292
- msgstr "警告:載入 %s 模組時發生了錯誤"
218
+ msgid "Unknown option name '%s'"
219
+ msgstr "不明選項名稱「%s"
220
+
221
+ msgid "You can't set all options %s at one time"
222
+ msgstr "您不可一次將所有選項設為 %s"
223
+
224
+ msgid "Options %s are required"
225
+ msgstr "%s 選項乃必要的"
226
+
227
+ msgid "You can't set any of options %s"
228
+ msgstr "您不可將任何選項設為 %s"
229
+
230
+ msgid "At least one of options %s is required"
231
+ msgstr "需要至少一項 %s 選項"
File without changes
@@ -56,10 +56,38 @@ describe HammerCLI::Options::Normalizers do
56
56
  formatter.format("a=1,b=2,c=3").must_equal({'a' => '1', 'b' => '2', 'c' => '3'})
57
57
  end
58
58
 
59
+ it "should parse a comma separated string with spaces" do
60
+ formatter.format("a= 1 , b = 2 ,c =3").must_equal({'a' => '1', 'b' => '2', 'c' => '3'})
61
+ end
62
+
63
+ it "should parse a comma separated string with spaces using single quotes" do
64
+ formatter.format("a= ' 1 ' , b =' 2',c ='3'").must_equal({'a' => ' 1 ', 'b' => ' 2', 'c' => '3'})
65
+ end
66
+
67
+ it "should parse a comma separated string with spaces using double quotes" do
68
+ formatter.format("a= \" 1 \" , b =\" 2\",c =\"3\"").must_equal({'a' => ' 1 ', 'b' => ' 2', 'c' => '3'})
69
+ end
70
+
71
+ it "should deal with equal sign in value" do
72
+ formatter.format("a=1,b='2=2',c=3").must_equal({'a' => '1', 'b' => '2=2', 'c' => '3'})
73
+ end
74
+
59
75
  it "should parse arrays" do
60
76
  formatter.format("a=1,b=[1,2,3],c=3").must_equal({'a' => '1', 'b' => ['1', '2', '3'], 'c' => '3'})
61
77
  end
62
78
 
79
+ it "should parse arrays with spaces" do
80
+ formatter.format("a=1,b=[1, 2, 3],c=3").must_equal({'a' => '1', 'b' => ['1', '2', '3'], 'c' => '3'})
81
+ end
82
+
83
+ it "should parse arrays with spaces using by single quotes" do
84
+ formatter.format("a=1,b=['1 1', ' 2 ', ' 3 3'],c=3").must_equal({'a' => '1', 'b' => ['1 1', ' 2 ', ' 3 3'], 'c' => '3'})
85
+ end
86
+
87
+ it "should parse arrays with spaces using by double quotes" do
88
+ formatter.format("a=1,b=[\"1 1\", \" 2 \", \" 3 3\"],c=3").must_equal({'a' => '1', 'b' => ['1 1', ' 2 ', ' 3 3'], 'c' => '3'})
89
+ end
90
+
63
91
  it "should parse array with one item" do
64
92
  formatter.format("a=1,b=[abc],c=3").must_equal({'a' => '1', 'b' => ['abc'], 'c' => '3'})
65
93
  end
@@ -126,3 +126,63 @@ describe Fields::ContainerField do
126
126
  end
127
127
 
128
128
  end
129
+
130
+
131
+ describe Fields::Label do
132
+
133
+ describe "display?" do
134
+
135
+ context "blank is allowed" do
136
+ let(:field) do
137
+ Fields::Label.new :label => "Label" do
138
+ field :a, "A"
139
+ field :b, "B"
140
+ end
141
+ end
142
+
143
+ it "returns true when all the keys are present" do
144
+ field.display?({:a => 1, :b => 2}).must_equal true
145
+ end
146
+
147
+ it "returns true when some of the keys are present" do
148
+ field.display?({:a => 1}).must_equal true
149
+ end
150
+
151
+ it "returns true the hash is empty" do
152
+ field.display?({}).must_equal true
153
+ end
154
+
155
+ it "returns true the hash does not contain the required keys" do
156
+ field.display?({:c => 3}).must_equal true
157
+ end
158
+
159
+ end
160
+
161
+ context "blank is not allowed" do
162
+ let(:field) do
163
+ Fields::Label.new :label => "Label", :hide_blank => true do
164
+ field :a, "A", Fields::Field, :hide_blank => true
165
+ field :b, "B", Fields::Field, :hide_blank => true
166
+ end
167
+ end
168
+
169
+ it "returns true when all the keys are present" do
170
+ field.display?({:a => 1, :b => 2}).must_equal true
171
+ end
172
+
173
+ it "returns true when some of the keys are present" do
174
+ field.display?({:a => 1}).must_equal true
175
+ end
176
+
177
+ it "returns false when there are some displayed subfields" do
178
+ field.display?({}).must_equal false
179
+ end
180
+
181
+ it "returns false the hash does not contain the required keys" do
182
+ field.display?({:c => 3}).must_equal false
183
+ end
184
+
185
+ end
186
+
187
+ end
188
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Bačovský
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-10 00:00:00.000000000 Z
12
+ date: 2015-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -43,16 +43,16 @@ dependencies:
43
43
  name: logging
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - <
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: 2.0.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - <
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: 2.0.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: awesome_print
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -85,16 +85,16 @@ dependencies:
85
85
  name: highline
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - <
89
89
  - !ruby/object:Gem::Version
90
- version: '0'
90
+ version: 1.7.0
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - <
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: 1.7.0
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: fast_gettext
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -113,16 +113,16 @@ dependencies:
113
113
  name: locale
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - <=
116
+ - - '>='
117
117
  - !ruby/object:Gem::Version
118
- version: 2.0.9
118
+ version: 2.0.6
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - <=
123
+ - - '>='
124
124
  - !ruby/object:Gem::Version
125
- version: 2.0.9
125
+ version: 2.0.6
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: json
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -293,31 +293,55 @@ files:
293
293
  - locale/Makefile
294
294
  - locale/README.md
295
295
  - locale/de/LC_MESSAGES/hammer-cli.mo
296
+ - locale/de/hammer-cli.edit.po
296
297
  - locale/de/hammer-cli.po
298
+ - locale/de/hammer-cli.po.time_stamp
297
299
  - locale/en/LC_MESSAGES/hammer-cli.mo
300
+ - locale/en/hammer-cli.edit.po
298
301
  - locale/en/hammer-cli.po
302
+ - locale/en/hammer-cli.po.time_stamp
299
303
  - locale/en_GB/LC_MESSAGES/hammer-cli.mo
304
+ - locale/en_GB/hammer-cli.edit.po
300
305
  - locale/en_GB/hammer-cli.po
306
+ - locale/en_GB/hammer-cli.po.time_stamp
301
307
  - locale/es/LC_MESSAGES/hammer-cli.mo
308
+ - locale/es/hammer-cli.edit.po
302
309
  - locale/es/hammer-cli.po
310
+ - locale/es/hammer-cli.po.time_stamp
303
311
  - locale/fr/LC_MESSAGES/hammer-cli.mo
312
+ - locale/fr/hammer-cli.edit.po
304
313
  - locale/fr/hammer-cli.po
314
+ - locale/fr/hammer-cli.po.time_stamp
305
315
  - locale/hammer-cli.pot
306
316
  - locale/it/LC_MESSAGES/hammer-cli.mo
317
+ - locale/it/hammer-cli.edit.po
307
318
  - locale/it/hammer-cli.po
319
+ - locale/it/hammer-cli.po.time_stamp
308
320
  - locale/ja/LC_MESSAGES/hammer-cli.mo
321
+ - locale/ja/hammer-cli.edit.po
309
322
  - locale/ja/hammer-cli.po
323
+ - locale/ja/hammer-cli.po.time_stamp
310
324
  - locale/ko/LC_MESSAGES/hammer-cli.mo
325
+ - locale/ko/hammer-cli.edit.po
311
326
  - locale/ko/hammer-cli.po
327
+ - locale/ko/hammer-cli.po.time_stamp
312
328
  - locale/pt_BR/LC_MESSAGES/hammer-cli.mo
329
+ - locale/pt_BR/hammer-cli.edit.po
313
330
  - locale/pt_BR/hammer-cli.po
331
+ - locale/pt_BR/hammer-cli.po.time_stamp
314
332
  - locale/ru/LC_MESSAGES/hammer-cli.mo
333
+ - locale/ru/hammer-cli.edit.po
315
334
  - locale/ru/hammer-cli.po
335
+ - locale/ru/hammer-cli.po.time_stamp
316
336
  - locale/zanata.xml
317
337
  - locale/zh_CN/LC_MESSAGES/hammer-cli.mo
338
+ - locale/zh_CN/hammer-cli.edit.po
318
339
  - locale/zh_CN/hammer-cli.po
340
+ - locale/zh_CN/hammer-cli.po.time_stamp
319
341
  - locale/zh_TW/LC_MESSAGES/hammer-cli.mo
342
+ - locale/zh_TW/hammer-cli.edit.po
320
343
  - locale/zh_TW/hammer-cli.po
344
+ - locale/zh_TW/hammer-cli.po.time_stamp
321
345
  - test/reports/TEST-Fields-ContainerField-display-.xml
322
346
  - test/reports/TEST-Fields-ContainerField-display-blank-is-allowed.xml
323
347
  - test/reports/TEST-Fields-ContainerField-display-blank-is-not-allowed.xml