hammer_cli 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hammer +14 -4
  3. data/doc/release_notes.md +8 -0
  4. data/lib/hammer_cli/abstract.rb +1 -3
  5. data/lib/hammer_cli/logger.rb +29 -0
  6. data/lib/hammer_cli/settings.rb +1 -3
  7. data/lib/hammer_cli/version.rb +1 -1
  8. data/locale/de/LC_MESSAGES/hammer-cli.mo +0 -0
  9. data/locale/de/hammer-cli.edit.po +21 -21
  10. data/locale/de/hammer-cli.po +32 -24
  11. data/locale/en/LC_MESSAGES/hammer-cli.mo +0 -0
  12. data/locale/en/hammer-cli.edit.po +4 -4
  13. data/locale/en/hammer-cli.po +1 -1
  14. data/locale/en_GB/LC_MESSAGES/hammer-cli.mo +0 -0
  15. data/locale/en_GB/hammer-cli.edit.po +71 -70
  16. data/locale/en_GB/hammer-cli.po +81 -69
  17. data/locale/es/LC_MESSAGES/hammer-cli.mo +0 -0
  18. data/locale/es/hammer-cli.edit.po +35 -34
  19. data/locale/es/hammer-cli.po +46 -41
  20. data/locale/fr/LC_MESSAGES/hammer-cli.mo +0 -0
  21. data/locale/fr/hammer-cli.edit.po +4 -4
  22. data/locale/fr/hammer-cli.po +10 -9
  23. data/locale/hammer-cli.pot +6 -6
  24. data/locale/it/LC_MESSAGES/hammer-cli.mo +0 -0
  25. data/locale/it/hammer-cli.edit.po +12 -12
  26. data/locale/it/hammer-cli.po +19 -12
  27. data/locale/ja/LC_MESSAGES/hammer-cli.mo +0 -0
  28. data/locale/ja/hammer-cli.edit.po +13 -13
  29. data/locale/ja/hammer-cli.po +19 -18
  30. data/locale/ko/LC_MESSAGES/hammer-cli.mo +0 -0
  31. data/locale/ko/hammer-cli.edit.po +12 -12
  32. data/locale/ko/hammer-cli.po +16 -15
  33. data/locale/pt_BR/LC_MESSAGES/hammer-cli.mo +0 -0
  34. data/locale/pt_BR/hammer-cli.edit.po +13 -12
  35. data/locale/pt_BR/hammer-cli.po +18 -13
  36. data/locale/ru/LC_MESSAGES/hammer-cli.mo +0 -0
  37. data/locale/ru/hammer-cli.edit.po +17 -17
  38. data/locale/ru/hammer-cli.po +26 -21
  39. data/locale/zh_CN/LC_MESSAGES/hammer-cli.mo +0 -0
  40. data/locale/zh_CN/hammer-cli.edit.po +40 -40
  41. data/locale/zh_CN/hammer-cli.po +58 -54
  42. data/locale/zh_TW/LC_MESSAGES/hammer-cli.mo +0 -0
  43. data/locale/zh_TW/hammer-cli.edit.po +12 -12
  44. data/locale/zh_TW/hammer-cli.po +16 -15
  45. data/test/unit/abstract_test.rb +25 -7
  46. data/test/unit/logger_test.rb +18 -0
  47. data/test/unit/settings_test.rb +4 -3
  48. data/test/unit/test_helper.rb +1 -1
  49. metadata +13 -81
@@ -1,28 +1,25 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
- # This file is distributed under the same license as the hammer-cli package.
4
- #
5
- # Translators:
6
- # Automatically generated, 2014
1
+ # Leah Liu <lliu@redhat.com>, 2013. #zanata
2
+ # Leah Liu <lliu@redhat.com>, 2014. #zanata
3
+ # Leah Liu <lliu@redhat.com>, 2015. #zanata
7
4
  msgid ""
8
5
  msgstr ""
9
- "Project-Id-Version: hammer-cli 0.3.0\n"
6
+ "Project-Id-Version: hammer-cli 0.4.0\n"
10
7
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2014-09-16 12:21+0000\n"
12
- "Last-Translator: Dominic Cleal <dcleal@redhat.com>\n"
13
- "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/foreman/la"
14
- "nguage/zh_CN/)\n"
8
+ "PO-Revision-Date: 2015-04-27 01:22+0000\n"
9
+ "Last-Translator: Leah Liu <lliu@redhat.com>\n"
10
+ "Language-Team: Chinese (China)\n"
11
+ "Language: zh-CN\n"
15
12
  "MIME-Version: 1.0\n"
16
13
  "Content-Type: text/plain; charset=UTF-8\n"
17
14
  "Content-Transfer-Encoding: 8bit\n"
18
- "Language: zh_CN\n"
19
- "Plural-Forms: nplurals=1; plural=0;\n"
15
+ "Plural-Forms: nplurals=1; plural=0\n"
16
+ "X-Generator: Zanata 3.6.0\n"
20
17
 
21
18
  msgid "too many arguments"
22
- msgstr "太多参数"
19
+ msgstr "参数太多"
23
20
 
24
21
  msgid "option '%<option>s' is required"
25
- msgstr "需要选项 '%<option>s' "
22
+ msgstr "需要选项 '%<option>s'"
26
23
 
27
24
  msgid "option '%<option>s' (or env %<env>s) is required"
28
25
  msgstr "需要选项 '%<option>s'(或者 env %<env>s)"
@@ -37,57 +34,58 @@ msgid "%<env>s: %<message>s"
37
34
  msgstr "%<env>s: %<message>s"
38
35
 
39
36
  msgid "Unrecognised option '%<switch>s'"
40
- msgstr "未识别的选项 '%<switch>s' "
37
+ msgstr "无法识别的选项 '%<switch>s'"
41
38
 
42
39
  msgid "No such sub-command '%<name>s'"
43
- msgstr "没有此子命令 '%<name>s'"
40
+ msgstr "没有子命令 '%<name>s'"
44
41
 
45
42
  msgid "no value provided"
46
- msgstr "未提供值"
43
+ msgstr "未提供数值"
47
44
 
45
+ # translation auto-copied from project nm-applet, version 0.8.1, document nm-applet
48
46
  msgid "Error: %s"
49
47
  msgstr "错误:%s"
50
48
 
51
49
  msgid "Error: %{message}"
52
- msgstr ""
50
+ msgstr "错误:%{message}"
53
51
 
54
52
  msgid "See: '%{path} --help'"
55
- msgstr ""
53
+ msgstr "请查看: '%{path} --help'"
56
54
 
57
55
  msgid "Invalid username or password"
58
- msgstr "无效用户名或者密码"
56
+ msgstr "无效用户名或密码"
59
57
 
60
58
  msgid "Could not load the API description from the server"
61
- msgstr ""
59
+ msgstr "无法从服务器载入 API 描述"
62
60
 
63
61
  msgid "is the server down?"
64
- msgstr ""
62
+ msgstr "服务器宕机了吗?"
65
63
 
66
64
  msgid ""
67
65
  "was '%s' run on the server when using apipie cache? (typical production settin"
68
66
  "gs)"
69
- msgstr ""
67
+ msgstr "使用 apipie 缓存时服务器中是否运行了 '%s'?(典型产品设置)"
70
68
 
71
69
  msgid "Missing arguments for %s"
72
- msgstr ""
70
+ msgstr "缺少 %s 的参数"
73
71
 
74
72
  msgid "No permissions to create log dir %s"
75
- msgstr "没有生产日志目录 %s 的权限"
73
+ msgstr "没有创建日志目录 %s 的权限"
76
74
 
77
75
  msgid "File %s not writeable, won't log anything to the file!"
78
- msgstr "无法写入文件 %s,不会在该文件中记录任何信息!"
76
+ msgstr "无法写入文件 %s,因此无法记录文件的任何变化!"
79
77
 
80
78
  msgid "be verbose"
81
- msgstr "详细输出"
79
+ msgstr "更详细"
82
80
 
83
81
  msgid "show debugging output "
84
- msgstr "显示 debug 输出结果"
82
+ msgstr "显示调试输出结果"
85
83
 
86
84
  msgid "force reload of Apipie cache"
87
- msgstr ""
85
+ msgstr "强制重新载入 Apipie 缓存"
88
86
 
89
87
  msgid "path to custom config file"
90
- msgstr "定制配置文件路径"
88
+ msgstr "到自定义配置文件的路径"
91
89
 
92
90
  msgid "username to access the remote system"
93
91
  msgstr "访问远程系统的用户名"
@@ -98,12 +96,12 @@ msgstr "访问远程系统的密码"
98
96
  msgid "remote system address"
99
97
  msgstr "远程系统地址"
100
98
 
99
+ # translation auto-copied from project libvirt, version 1.1.1, document libvirt
101
100
  msgid "show version"
102
101
  msgstr "显示版本"
103
102
 
104
- #, fuzzy
105
103
  msgid "unknown version"
106
- msgstr "显示版本"
104
+ msgstr "未知版本"
107
105
 
108
106
  msgid "Show ids of associated resources"
109
107
  msgstr "显示关联资源的 id"
@@ -112,13 +110,13 @@ msgid "Explicitly turn interactive mode on/off"
112
110
  msgstr "明确打开/关闭互动模式"
113
111
 
114
112
  msgid "Output as CSV (same as --output=csv)"
115
- msgstr "输出为 CSV(等同于 --output=csv"
113
+ msgstr "作为 CSV 输出(与 --output=csv 相同) "
116
114
 
117
115
  msgid "Set output format. One of [%s]"
118
- msgstr "设定输出格式。[%s] 之一。"
116
+ msgstr "设定输出格式。[%s] 之一"
119
117
 
120
118
  msgid "Character to separate the values"
121
- msgstr "分开选项值的字符"
119
+ msgstr "用来分开数值的字符"
122
120
 
123
121
  msgid "Get list of possible endings"
124
122
  msgstr "获取可能结尾的列表"
@@ -126,19 +124,19 @@ msgstr "获取可能结尾的列表"
126
124
  msgid ""
127
125
  "Legacy configuration of modules detected. Check section about configuration in"
128
126
  " user manual"
129
- msgstr "探测到模块继承配置。请在用户手册中查看有关配置的章节。"
127
+ msgstr "探测到遗留的模块配置。请在用户手册中查看有关配置一节。"
130
128
 
131
129
  msgid "Warning: An error occured while loading module %s"
132
130
  msgstr "警告:载入模块 %s 时出错"
133
131
 
134
132
  msgid "Error: Some of the required modules are disabled in configuration: %s "
135
- msgstr ""
133
+ msgstr "错误:在配置中禁用了一些要求的模块:%s"
136
134
 
137
135
  msgid "Comma-separated list of key=value."
138
136
  msgstr "用逗号分开的 key=value 列表。"
139
137
 
140
138
  msgid "value must be defined as a comma-separated list of key=value"
141
- msgstr "必须使用逗号分开的 key=value 定义该值"
139
+ msgstr "必须使用以逗号分开的 key=value 列表定义数值"
142
140
 
143
141
  msgid "Comma separated list of values."
144
142
  msgstr "逗号分开的数值列表。"
@@ -147,10 +145,10 @@ msgid "numeric value is required"
147
145
  msgstr ""
148
146
 
149
147
  msgid "One of true/false, yes/no, 1/0."
150
- msgstr "true/false、yes/no、1/0 之一。"
148
+ msgstr "true/false、yes/no、1/0 中选择一组。"
151
149
 
152
150
  msgid "value must be one of true/false, yes/no, 1/0"
153
- msgstr "选项值必须是 true/false、yes/no、1/0 之一"
151
+ msgstr "数值必须是 true/false、yes/no、1/0 中的一个"
154
152
 
155
153
  msgid "Unable to parse JSON input"
156
154
  msgstr "无法解析 JSON 输入"
@@ -160,11 +158,11 @@ msgstr ""
160
158
 
161
159
  #, fuzzy
162
160
  msgid "value must be %s"
163
- msgstr "选项值必须是 '%s' 之一 "
161
+ msgstr "数值必须是 '%s' 中的一个"
164
162
 
165
163
  #, fuzzy
166
164
  msgid "value must be one of %s"
167
- msgstr "选项值必须是 '%s' 之一 "
165
+ msgstr "数值必须是 '%s' 中的一个"
168
166
 
169
167
  msgid "Date and time in YYYY-MM-DD HH:MM:SS or ISO 8601 format"
170
168
  msgstr "日期和时间格式为 YYYY-MM-DD HH:MM:SS 或者 ISO 8601 格式"
@@ -173,45 +171,51 @@ msgid "'%s' is not a valid date"
173
171
  msgstr "'%s' 不是有效日期"
174
172
 
175
173
  msgid "Any combination (comma separated list) of '%s'"
176
- msgstr "'%s' 的任意组合(逗号分开的列表)"
174
+ msgstr "'%s' 的任意组合(用逗号分开的列表)"
177
175
 
178
176
  msgid "value must be a combination of '%s'"
179
- msgstr "选项值必须是 '%s' 组合之一"
177
+ msgstr "数值必须为 '%s' 之一"
180
178
 
181
179
  msgid "\"Warning: Option #{switch} is deprecated. %s\""
182
180
  msgstr ""
183
181
 
184
182
  msgid "Can be specified multiple times. "
185
- msgstr "可多次指定。"
183
+ msgstr "无法多次指定。"
186
184
 
187
185
  msgid ", or "
188
186
  msgstr ",或者"
189
187
 
188
+ # translation auto-copied from project control-center, version 3.8.6, document gnome-control-center-2.0
190
189
  msgid "Default: "
191
190
  msgstr "默认:"
192
191
 
192
+ # translation auto-copied from project webkitgtk3, version 2.0.3, document webkitgtk3, author Leah Liu
193
193
  msgid "Message"
194
194
  msgstr "信息"
195
195
 
196
+ # translation auto-copied from project libvirt, version 1.1.1, document libvirt
196
197
  msgid "Id"
197
198
  msgstr "Id"
198
199
 
200
+ # translation auto-copied from project nm-applet, version 0.8.1, document nm-applet
199
201
  msgid "Name"
200
202
  msgstr "名称"
201
203
 
204
+ # translation auto-copied from project firstboot, version 19.6, document firstboot, author Leah Liu
202
205
  msgid "no"
203
206
  msgstr "否"
204
207
 
208
+ # translation auto-copied from project NetworkManager, version 0.9.9.0, document NetworkManager
205
209
  msgid "yes"
206
210
  msgstr "是"
207
211
 
208
212
  msgid ""
209
213
  "Warning: location hammer.modules.d is deprecated, move your module configurati"
210
214
  "ons to cli.modules.d"
211
- msgstr "警告:位置 hammer.modules.d 失效,请将模块配置转移到 cli.modules.d。"
215
+ msgstr "警告:位置 hammer.modules.d 已启用,请将您的模块配置移至 cli.modules.d。"
212
216
 
213
217
  msgid "Print help for commands"
214
- msgstr "打印命令帮助信息"
218
+ msgstr "输出命令帮助信息"
215
219
 
216
220
  msgid "Exit interactive shell"
217
221
  msgstr "退出互动 shell"
@@ -220,7 +224,7 @@ msgid "Welcome to the hammer interactive shell"
220
224
  msgstr "欢迎使用 hammer 互动 shell"
221
225
 
222
226
  msgid "Type 'help' for usage information"
223
- msgstr "输入‘help’查看用法信息"
227
+ msgstr "输入 ‘help’ 获取用法信息"
224
228
 
225
229
  msgid "Interactive shell"
226
230
  msgstr "互动 shell"
@@ -228,19 +232,19 @@ msgstr "互动 shell"
228
232
  msgid ""
229
233
  "can't replace subcommand %<name>s (%<existing_class>s) with %<name>s (%<new_cl"
230
234
  "ass>s)"
231
- msgstr ""
235
+ msgstr "无法使用 %<name>s(%<new_class>s)替换子命令 %<name>s(%<existing_class>s)"
232
236
 
233
237
  msgid "Unknown option name '%s'"
234
238
  msgstr "未知选项名称 '%s'"
235
239
 
236
240
  msgid "You can't set all options %s at one time"
237
- msgstr "您无法一次设置所有选项 %s"
241
+ msgstr "无法一次设置所有选项 %s"
238
242
 
239
243
  msgid "Options %s are required"
240
- msgstr "必须提供选项 %s"
244
+ msgstr "需要选项 %s"
241
245
 
242
246
  msgid "You can't set any of options %s"
243
- msgstr "您无法设置任意选项 %s"
247
+ msgstr "无法设置任意选项 %s"
244
248
 
245
249
  msgid "At least one of options %s is required"
246
- msgstr "至少需要一个选项 %s"
250
+ msgstr "至少需要选项 %s 中的一个"
Binary file
@@ -9,9 +9,9 @@ msgstr ""
9
9
  "Project-Id-Version: Foreman\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2014-12-10 13:50+0100\n"
12
- "PO-Revision-Date: 2015-03-09 14:42+0000\n"
13
- "Last-Translator: Lukáš Zapletal\n"
14
- "Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/foreman/language/zh_TW/)\n"
12
+ "PO-Revision-Date: 2015-09-16 12:51+0000\n"
13
+ "Last-Translator: mbacovsky <martin.bacovsky@gmail.com>\n"
14
+ "Language-Team: Chinese (Taiwan) (http://www.transifex.com/foreman/foreman/language/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"
@@ -132,7 +132,7 @@ msgstr "顯示除錯輸出"
132
132
 
133
133
  #: lib/hammer_cli/main.rb:9
134
134
  msgid "force reload of Apipie cache"
135
- msgstr ""
135
+ msgstr "強制重新載入 Apipie 快取"
136
136
 
137
137
  #: lib/hammer_cli/main.rb:11
138
138
  msgid "path to custom config file"
@@ -196,7 +196,7 @@ msgstr "警告:載入 %s 模組時發生了錯誤"
196
196
 
197
197
  #: lib/hammer_cli/modules.rb:87
198
198
  msgid "Error: Some of the required modules are disabled in configuration: %s "
199
- msgstr ""
199
+ msgstr "錯誤:某些必要的模組在配置中已停用:%s "
200
200
 
201
201
  #: lib/hammer_cli/exception_handler.rb:62
202
202
  msgid "Error: %s"
@@ -204,11 +204,11 @@ msgstr "錯誤:%s"
204
204
 
205
205
  #: lib/hammer_cli/exception_handler.rb:68
206
206
  msgid "Error: %{message}"
207
- msgstr ""
207
+ msgstr "錯誤:%{message}"
208
208
 
209
209
  #: lib/hammer_cli/exception_handler.rb:69
210
210
  msgid "See: '%{path} --help'"
211
- msgstr ""
211
+ msgstr "請參閱:'%{path} --help'"
212
212
 
213
213
  #: lib/hammer_cli/exception_handler.rb:86
214
214
  msgid "Invalid username or password"
@@ -216,21 +216,21 @@ msgstr "無效的使用者名稱或密碼"
216
216
 
217
217
  #: lib/hammer_cli/exception_handler.rb:93
218
218
  msgid "Could not load the API description from the server"
219
- msgstr ""
219
+ msgstr "無法從伺服器載入 API 描述"
220
220
 
221
221
  #: lib/hammer_cli/exception_handler.rb:94
222
222
  msgid "is the server down?"
223
- msgstr ""
223
+ msgstr "伺服器是否沒有在運作?"
224
224
 
225
225
  #: lib/hammer_cli/exception_handler.rb:95
226
226
  msgid ""
227
227
  "was '%s' run on the server when using apipie cache? (typical production "
228
228
  "settings)"
229
- msgstr ""
229
+ msgstr "使用 apipie 快取時 '%s' 是否有在伺服器上運作?(典型的生產設定)"
230
230
 
231
231
  #: lib/hammer_cli/exception_handler.rb:101
232
232
  msgid "Missing arguments for %s"
233
- msgstr ""
233
+ msgstr "%s 缺少了引數"
234
234
 
235
235
  #: lib/hammer_cli/validator.rb:41
236
236
  msgid "Unknown option name '%s'"
@@ -296,4 +296,4 @@ msgstr "互動式 shell"
296
296
  msgid ""
297
297
  "can't replace subcommand %<name>s (%<existing_class>s) with %<name>s "
298
298
  "(%<new_class>s)"
299
- msgstr ""
299
+ msgstr "無法將次指令 %<name>s (%<existing_class>s) 替換為 %<name>s (%<new_class>s)"
@@ -4,19 +4,21 @@
4
4
  #
5
5
  # Translators:
6
6
  # Automatically generated, 2014
7
+ # tchuang <tchuang@redhat.com>, 2015. #zanata
7
8
  msgid ""
8
9
  msgstr ""
9
- "Project-Id-Version: hammer-cli 0.3.0\n"
10
+ "Project-Id-Version: hammer-cli 0.4.0\n"
10
11
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2014-09-16 13:21+0000\n"
12
- "Last-Translator: Dominic Cleal <dcleal@redhat.com>\n"
12
+ "PO-Revision-Date: 2015-04-28 05:21+0000\n"
13
+ "Last-Translator: tchuang <tchuang@redhat.com>\n"
13
14
  "Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/foreman/l"
14
15
  "anguage/zh_TW/)\n"
16
+ "Language: zh-TW\n"
15
17
  "MIME-Version: 1.0\n"
16
18
  "Content-Type: text/plain; charset=UTF-8\n"
17
19
  "Content-Transfer-Encoding: 8bit\n"
18
- "Language: zh_TW\n"
19
20
  "Plural-Forms: nplurals=1; plural=0;\n"
21
+ "X-Generator: Zanata 3.6.0\n"
20
22
 
21
23
  msgid "too many arguments"
22
24
  msgstr "引數過多"
@@ -49,27 +51,27 @@ msgid "Error: %s"
49
51
  msgstr "錯誤:%s"
50
52
 
51
53
  msgid "Error: %{message}"
52
- msgstr ""
54
+ msgstr "錯誤:%{message}"
53
55
 
54
56
  msgid "See: '%{path} --help'"
55
- msgstr ""
57
+ msgstr "請參閱:'%{path} --help'"
56
58
 
57
59
  msgid "Invalid username or password"
58
60
  msgstr "無效的使用者名稱或密碼"
59
61
 
60
62
  msgid "Could not load the API description from the server"
61
- msgstr ""
63
+ msgstr "無法從伺服器載入 API 描述"
62
64
 
63
65
  msgid "is the server down?"
64
- msgstr ""
66
+ msgstr "伺服器是否沒有在運作?"
65
67
 
66
68
  msgid ""
67
69
  "was '%s' run on the server when using apipie cache? (typical production settin"
68
70
  "gs)"
69
- msgstr ""
71
+ msgstr "使用 apipie 快取時 '%s' 是否有在伺服器上運作?(典型的生產設定)"
70
72
 
71
73
  msgid "Missing arguments for %s"
72
- msgstr ""
74
+ msgstr "%s 缺少了引數"
73
75
 
74
76
  msgid "No permissions to create log dir %s"
75
77
  msgstr "沒有建立日誌目錄 %s 的權限"
@@ -84,7 +86,7 @@ msgid "show debugging output "
84
86
  msgstr "顯示除錯輸出"
85
87
 
86
88
  msgid "force reload of Apipie cache"
87
- msgstr ""
89
+ msgstr "強制重新載入 Apipie 快取"
88
90
 
89
91
  msgid "path to custom config file"
90
92
  msgstr "自訂配置檔案的路徑"
@@ -101,9 +103,8 @@ msgstr "遠端系統位址"
101
103
  msgid "show version"
102
104
  msgstr "顯示版本"
103
105
 
104
- #, fuzzy
105
106
  msgid "unknown version"
106
- msgstr "顯示版本"
107
+ msgstr "不明的版本"
107
108
 
108
109
  msgid "Show ids of associated resources"
109
110
  msgstr "顯示相聯資源的 id"
@@ -132,7 +133,7 @@ msgid "Warning: An error occured while loading module %s"
132
133
  msgstr "警告:載入 %s 模組時發生了錯誤"
133
134
 
134
135
  msgid "Error: Some of the required modules are disabled in configuration: %s "
135
- msgstr ""
136
+ msgstr "錯誤:某些必要的模組在配置中已停用:%s "
136
137
 
137
138
  msgid "Comma-separated list of key=value."
138
139
  msgstr "逗號區隔開的一列 key=value。"
@@ -228,7 +229,7 @@ msgstr "互動式 shell"
228
229
  msgid ""
229
230
  "can't replace subcommand %<name>s (%<existing_class>s) with %<name>s (%<new_cl"
230
231
  "ass>s)"
231
- msgstr ""
232
+ msgstr "無法將次指令 %<name>s (%<existing_class>s) 替換為 %<name>s (%<new_class>s)"
232
233
 
233
234
  msgid "Unknown option name '%s'"
234
235
  msgstr "不明選項名稱「%s」"
@@ -86,6 +86,8 @@ describe HammerCLI::AbstractCommand do
86
86
  context "logging" do
87
87
 
88
88
  before :each do
89
+ HammerCLI::Settings.clear
90
+ HammerCLI::Settings.load(:watch_plain => false)
89
91
  @log_output = Logging::Appenders['__test__']
90
92
  @log_output.reset
91
93
  end
@@ -96,13 +98,6 @@ describe HammerCLI::AbstractCommand do
96
98
  @log_output.readline.strip.must_equal "INFO HammerCLI::AbstractCommand : Called with options: {}"
97
99
  end
98
100
 
99
- it "password should be hidden in logs" do
100
- test_command_class = Class.new(HammerCLI::AbstractCommand)
101
- test_command_class.option(['--password'], 'PASSWORD', 'Password')
102
- test_command = test_command_class.new("")
103
- test_command.run ['--password=pass']
104
- @log_output.readline.strip.must_equal "INFO HammerCLI::AbstractCommand : Called with options: {\"option_password\"=>\"***\"}"
105
- end
106
101
 
107
102
  class TestLogCmd < HammerCLI::AbstractCommand
108
103
  def execute
@@ -170,6 +165,29 @@ describe HammerCLI::AbstractCommand do
170
165
  test_command.run []
171
166
  @log_output.read.must_include "DEBUG TestLogCmd5 : Test\n{\n :a => \"a\"\n}"
172
167
  end
168
+
169
+ class TestLogCmd6 < HammerCLI::AbstractCommand
170
+ def execute
171
+ logger.watch "Test", { :password => 'password', "password" => "password" }
172
+ 0
173
+ end
174
+ end
175
+
176
+ it "censors passwords from the debug logs" do
177
+ test_command = Class.new(TestLogCmd6).new("")
178
+ HammerCLI::Settings.clear
179
+ HammerCLI::Settings.load(:watch_plain => true)
180
+ test_command.run []
181
+ @log_output.read.must_include "DEBUG TestLogCmd6 : Test\n{\n :password => \"***\",\n \"password\" => \"***\"\n}"
182
+ end
183
+
184
+ it "password parameters should be hidden in logs" do
185
+ test_command_class = Class.new(HammerCLI::AbstractCommand)
186
+ test_command_class.option(['--password'], 'PASSWORD', 'Password')
187
+ test_command = test_command_class.new("")
188
+ test_command.run ['--password=pass']
189
+ @log_output.readline.strip.must_equal "INFO HammerCLI::AbstractCommand : Called with options: {\"option_password\"=>\"***\"}"
190
+ end
173
191
  end
174
192
 
175
193
  context "subcommand behavior" do
@@ -0,0 +1,18 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+ require 'tempfile'
3
+
4
+ describe Logging::LogEvent do
5
+ context "filtering" do
6
+ before :each do
7
+ @log_output = Logging::Appenders['__test__']
8
+ @log_output.reset
9
+ end
10
+
11
+ it "can filter log data" do
12
+ Logging::LogEvent.add_data_filter(/pat/, 'mat')
13
+ Logging.logger.root.debug "pat"
14
+ Logging::LogEvent.data_filters.pop # clean the last filter
15
+ @log_output.read.must_include 'mat'
16
+ end
17
+ end
18
+ end
@@ -91,7 +91,7 @@ describe HammerCLI::Settings do
91
91
  end
92
92
 
93
93
  it "loads settings from file" do
94
- settings.load_from_paths [config2.path, config1.path]
94
+ [config1.path, config2.path].each { |config| settings.load_from_file config }
95
95
  settings.get(:host).must_equal 'https://localhost.localdomain/'
96
96
  settings.get(:username).must_equal 'admin'
97
97
  end
@@ -103,7 +103,7 @@ describe HammerCLI::Settings do
103
103
  end
104
104
 
105
105
  it "store config path history" do
106
- settings.load_from_paths [config2.path, config1.path]
106
+ [config1.path, config2.path].each { |config| settings.load_from_file config }
107
107
  settings.path_history.must_equal [config1.path, config2.path]
108
108
  end
109
109
 
@@ -120,7 +120,8 @@ describe HammerCLI::Settings do
120
120
  f.write(" :param2: 'value2'\n")
121
121
  end
122
122
 
123
- settings.load_from_paths [config1.path, dir]
123
+ settings.load_from_paths [dir]
124
+ settings.load_from_file config1.path
124
125
 
125
126
  settings.get(:host).must_equal 'https://localhost/'
126
127
  settings.get(:username).must_equal 'admin'
@@ -8,13 +8,13 @@ SimpleCov.start do
8
8
  end
9
9
  SimpleCov.root Pathname.new(File.dirname(__FILE__) + "../../../")
10
10
 
11
-
12
11
  require 'minitest/autorun'
13
12
  require 'minitest/spec'
14
13
  require "minitest-spec-context"
15
14
  require "mocha/setup"
16
15
 
17
16
  require 'hammer_cli'
17
+ require 'hammer_cli/logger'
18
18
 
19
19
  Logging.logger.root.appenders = Logging::Appenders['__test__'] || Logging::Appenders::StringIo.new('__test__')
20
20