tzispa_helpers 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30121bc329422fd4c34a6afdd1c4e9f5d3f6945e
4
- data.tar.gz: 05cced3ec1799403953d1de06ca4477e61926ac9
3
+ metadata.gz: 4b0fc323e00048896dd7009d0e3fb7040d8c1be1
4
+ data.tar.gz: ba19ebb8064586b367d1eddb773c40d82c28f8f9
5
5
  SHA512:
6
- metadata.gz: a170f6651ac38df50b28aca2585a0d04a7dddd30e1466a9f95426fe0b690719144ea1ebe529a6c077f1c4d90b4a8aff3e986da7e2b8bf7a41c6a59b42ba99500
7
- data.tar.gz: ecd6a45dbd37662bc2f72fe64d5260cbe46d6a602f17fd4c3dff5bd3754ad5f7a1d104091e4302db6552508339781846c9ff135edd7c083308655620d4f3b1d5
6
+ metadata.gz: e84ae15bb7a7e3c68414f998ea9d0eb7435dbbb615b20d050c21b3cd93d5e4a60ac284848715670e854ceabc656b20f5dba1ba0d6675f24f72520c839f8a98d0
7
+ data.tar.gz: 033e013f827239d879df01b2da1701b341726780308f3a180dd71a9413bf94c5b513e0443e1c0fc6b6879c1b01195c454f719d33f3a6fc8ea12ab050ff550309
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  Tzispa Helpers
2
2
 
3
+ ## v0.3.2
4
+ - added begore / after hook helpers
5
+
3
6
  ## v0.3.1
4
7
  - added json fields support to request_data_object
5
8
  - added yesno_list builder method
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tzispa
4
+ module Helpers
5
+ module Hooks
6
+ module After
7
+
8
+ def self.included(base)
9
+ base.extend(ClassMethods)
10
+ end
11
+
12
+ def do_after
13
+ self.class.after.each { |hook| send hook }
14
+ end
15
+
16
+ module ClassMethods
17
+ def after(*args)
18
+ (@after_chain ||= []).tap do |bef|
19
+ args&.each do |s|
20
+ s = s.to_sym
21
+ bef << s unless bef.include?(s)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tzispa
4
+ module Helpers
5
+ module Hooks
6
+ module Before
7
+
8
+ def self.included(base)
9
+ base.extend(ClassMethods)
10
+ end
11
+
12
+ def do_before
13
+ self.class.before.each { |hook| send hook }
14
+ end
15
+
16
+ module ClassMethods
17
+ def before(*args)
18
+ (@before_chain ||= []).tap do |bef|
19
+ args&.each do |s|
20
+ s = s.to_sym
21
+ bef << s unless bef.include?(s)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -3,7 +3,7 @@
3
3
  module Tzispa
4
4
  module Helpers
5
5
 
6
- VERSION = '0.3.1'
6
+ VERSION = '0.3.2'
7
7
  NAME = 'Tzispa Helpers'
8
8
  GEM_NAME = 'tzispa_helpers'
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzispa_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Antonio Piñero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-21 00:00:00.000000000 Z
11
+ date: 2017-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -64,6 +64,8 @@ files:
64
64
  - lib/tzispa/helpers.rb
65
65
  - lib/tzispa/helpers/date_time.rb
66
66
  - lib/tzispa/helpers/error_view.rb
67
+ - lib/tzispa/helpers/hooks/after.rb
68
+ - lib/tzispa/helpers/hooks/before.rb
67
69
  - lib/tzispa/helpers/html.rb
68
70
  - lib/tzispa/helpers/mime.rb
69
71
  - lib/tzispa/helpers/pattern.rb