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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b0e4bf84730068b1f033b41b52fd1693d9df816
4
- data.tar.gz: c72c1fd2c9dc8197bef7ab3fdb9e56eab0072af2
3
+ metadata.gz: 3c321ea208ca11d4f51f7f14b78860240c552691
4
+ data.tar.gz: 9c6f4ed8b8f77ff80f33db6bfb129c11a78e0a3e
5
5
  SHA512:
6
- metadata.gz: 5bbadd69965194fb4c9be51bc4e3c5ffa40e82c3352747aaca96980df98204901af58188a477b1e5d2fcb1878fbc93301f70cd028841ee4425946df412b3a4dd
7
- data.tar.gz: 1f6c3018c3505f7c6b7c4e7acc81cb5cd0db5f06efaf9a2fb6734369bb08db8481298de0781de51e4627f284b81ad5618539ff55d516a4f6d67dc96e5027c80f
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
- # TODO configuration options
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
@@ -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"].each {|file| require_dependency file }
17
+ Dir["#{Rails.root}/app/models/page/*.rb"].
18
+ each {|file| require_dependency file }
17
19
  end
18
20
  end
@@ -1,3 +1,3 @@
1
1
  module Simplec
2
- VERSION = '0.4.4'
2
+ VERSION = '0.5.0'
3
3
  end
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.4
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-08-30 00:00:00.000000000 Z
11
+ date: 2017-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails