corn_starch 1.9.33 → 1.9.34
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aaa293c4d5ab907eac1271668003a376d99c58c
|
4
|
+
data.tar.gz: 55343a0f12c2df0430ded42918cdba1206804c59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 123290fe02a36801e17799030b0a102cadb5e8bad64ae78b01be4feb77bccbf8f93d0100f01533378275434706683e38730b1252481eb93cc1cb89c9c8e1509d
|
7
|
+
data.tar.gz: 9efce69c28ebaa7e1ecd8a6c46ff20a4b67412b965d62d845538df651f7b558e34047649f32bafa3894bc85706e2fa6aa8c579f695ebe32672bade205244bfb9
|
@@ -240,19 +240,14 @@ module CornStarch
|
|
240
240
|
ename = entity ? entity.display_name : ''
|
241
241
|
|
242
242
|
# Acquire Errors
|
243
|
-
errors = entity
|
243
|
+
errors = notify_errors entity
|
244
244
|
|
245
245
|
# Switch on Action
|
246
246
|
case action
|
247
247
|
|
248
248
|
# Session Control
|
249
|
-
when :login
|
250
|
-
|
251
|
-
pass: { head: t('gen_msg.login.pass.head'), body: t('gen_msg.login.pass.body', name: uname) },
|
252
|
-
fail: { head: t('gen_msg.login.fail.head'), body: t('gen_msg.login.fail.body') }
|
253
|
-
}[result_or_name]
|
254
|
-
when :logout
|
255
|
-
{ head: t('gen_msg.logout.head'), body: t('gen_msg.logout.body') }
|
249
|
+
when :login then notify_res 'gen_msg.login', result_or_name, name: uname
|
250
|
+
when :logout then notify 'gen_msg.logout'
|
256
251
|
|
257
252
|
# Generic Resources
|
258
253
|
when :create
|
@@ -283,5 +278,10 @@ module CornStarch
|
|
283
278
|
def notify key, head_hash = nil, body_hash = nil
|
284
279
|
{ head: t("#{key}.head", head_hash), body: t("#{key}.body", body_hash) }
|
285
280
|
end
|
281
|
+
|
282
|
+
# Build Pass / Fail Notification
|
283
|
+
def notify_res key, res, head_hash = nil, body_hash = nil
|
284
|
+
Hash[[:pass, :fail].map { |r| notify "#{key}.#{r}", head_hash, body_hash }][res]
|
285
|
+
end
|
286
286
|
end
|
287
287
|
end
|
data/lib/corn_starch/version.rb
CHANGED