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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/tzispa/helpers/hooks/after.rb +29 -0
- data/lib/tzispa/helpers/hooks/before.rb +29 -0
- data/lib/tzispa/helpers/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b0fc323e00048896dd7009d0e3fb7040d8c1be1
|
4
|
+
data.tar.gz: ba19ebb8064586b367d1eddb773c40d82c28f8f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e84ae15bb7a7e3c68414f998ea9d0eb7435dbbb615b20d050c21b3cd93d5e4a60ac284848715670e854ceabc656b20f5dba1ba0d6675f24f72520c839f8a98d0
|
7
|
+
data.tar.gz: 033e013f827239d879df01b2da1701b341726780308f3a180dd71a9413bf94c5b513e0443e1c0fc6b6879c1b01195c454f719d33f3a6fc8ea12ab050ff550309
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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.
|
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-
|
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
|