simplec 0.4.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simplec.rb +25 -1
- data/lib/simplec/engine.rb +3 -1
- data/lib/simplec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c321ea208ca11d4f51f7f14b78860240c552691
|
4
|
+
data.tar.gz: 9c6f4ed8b8f77ff80f33db6bfb129c11a78e0a3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cceb2399b420e69f3f04f8e39fdbc34b4a60884fe8caba37005b73a7ce22f7f85609e3e15b64d8dfa8763b17225dab6046bece6c5e713c9c06554aa5058ae7cb
|
7
|
+
data.tar.gz: d0bbce5fd5760a1dad808f12a07d2ed27497821879a1041c59b96ce69275acedf735489fcf816c66a3f4af209c9ca6a272497461ed452ab6a8f47c99ffd4dc05
|
data/lib/simplec.rb
CHANGED
@@ -9,5 +9,29 @@ require "simplec/page_action_helpers"
|
|
9
9
|
#
|
10
10
|
# @!visibility public
|
11
11
|
module Simplec
|
12
|
-
|
12
|
+
|
13
|
+
# Get application view helpers.
|
14
|
+
#
|
15
|
+
# @example append helper
|
16
|
+
# Simplec.helpers << ::ApplicationHelper
|
17
|
+
#
|
18
|
+
# @return [Array]
|
19
|
+
# of view helpers
|
20
|
+
def self.helpers
|
21
|
+
@helpers ||= Array.new
|
22
|
+
end
|
23
|
+
|
24
|
+
# Set the helpers to be included.
|
25
|
+
#
|
26
|
+
# @example set a single helper
|
27
|
+
# Simplec.helpers = ::ApplicationHelper
|
28
|
+
#
|
29
|
+
# @example append helpers
|
30
|
+
# Simplec.helpers += [::ApplicationHelper]
|
31
|
+
#
|
32
|
+
# @param helpers [Array, Class]
|
33
|
+
# either a single helper or an array of helpers
|
34
|
+
def self.helpers=(helpers)
|
35
|
+
@helpers = Array(helpers)
|
36
|
+
end
|
13
37
|
end
|
data/lib/simplec/engine.rb
CHANGED
@@ -7,12 +7,14 @@ module Simplec
|
|
7
7
|
include Simplec::ActionController::Extensions
|
8
8
|
prepend Simplec::PageActionHelpers
|
9
9
|
helper Simplec::ActionView::Helper
|
10
|
+
helper *Simplec.helpers
|
10
11
|
}
|
11
12
|
ActiveSupport.on_load(:active_record) { Simplec.load_pages }
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
16
|
def self.load_pages
|
16
|
-
Dir["#{Rails.root}/app/models/page/*.rb"].
|
17
|
+
Dir["#{Rails.root}/app/models/page/*.rb"].
|
18
|
+
each {|file| require_dependency file }
|
17
19
|
end
|
18
20
|
end
|
data/lib/simplec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|