crumpet 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/crumpet.rb +0 -8
- data/lib/crumpet/controller_additions.rb +4 -6
- data/lib/crumpet/railtie.rb +0 -2
- data/lib/crumpet/renderer.rb +7 -6
- data/lib/crumpet/repository.rb +4 -0
- data/lib/crumpet/version.rb +1 -1
- data/lib/crumpet/view_helpers.rb +2 -2
- 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: 59d37a419c3172f9d87c9cc0d8e3e1cdfd8dd976
|
4
|
+
data.tar.gz: f48df2474a52c8bf85227f49d259e93be8d4c28f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4249776a9c9e2c132cb8a0fbb934f5709c0f1554358707dd22e7ab0276523b295d4d067f436291e6e8966df1f936284a39ebf778ec3c78ca533c9d46b3bf7483
|
7
|
+
data.tar.gz: d272a0c303001814baa0b4be1a3ecb1f486475820788cdc5a8f8278680eead8b0c2f39c2d13d468a0533531014487d4951a768bc163026ec6fe17ddd76934528
|
data/lib/crumpet.rb
CHANGED
@@ -12,14 +12,6 @@ module Crumpet
|
|
12
12
|
@config ||= Crumpet::Configuration.new
|
13
13
|
end
|
14
14
|
|
15
|
-
module_function def crumbs
|
16
|
-
@crumbs ||= Crumpet::Repository.new
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.render(options = {})
|
20
|
-
Crumpet::Renderer.new(options).render
|
21
|
-
end
|
22
|
-
|
23
15
|
def self.configure
|
24
16
|
yield config
|
25
17
|
end
|
@@ -5,16 +5,15 @@ module Crumpet
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def add_crumb(*args)
|
8
|
-
|
8
|
+
crumbs.add_crumb(*args)
|
9
9
|
end
|
10
10
|
|
11
11
|
def clear_crumbs
|
12
|
-
|
12
|
+
crumbs.clear
|
13
13
|
end
|
14
14
|
|
15
15
|
def crumbs(&block)
|
16
|
-
|
17
|
-
Crumpet.crumbs
|
16
|
+
@_crumbs ||= Crumpet::Repository.new
|
18
17
|
end
|
19
18
|
|
20
19
|
module ClassMethods
|
@@ -26,10 +25,9 @@ module Crumpet
|
|
26
25
|
if block_given?
|
27
26
|
options = args.present? ? { only: args } : {}
|
28
27
|
before_action(options) do |instance|
|
29
|
-
instance.instance_exec(
|
28
|
+
instance.instance_exec(&block)
|
30
29
|
end
|
31
30
|
end
|
32
|
-
Crumpet.crumbs
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
data/lib/crumpet/railtie.rb
CHANGED
data/lib/crumpet/renderer.rb
CHANGED
@@ -3,9 +3,14 @@ module Crumpet
|
|
3
3
|
include ActionView::Helpers::UrlHelper
|
4
4
|
include ERB::Util
|
5
5
|
|
6
|
-
attr_reader :options
|
6
|
+
attr_reader :crumbs, :options
|
7
7
|
|
8
|
-
def
|
8
|
+
def self.render(crumbs, options = {})
|
9
|
+
new(crumbs, options).render
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(crumbs, options = {})
|
13
|
+
@crumbs = crumbs
|
9
14
|
@options = options
|
10
15
|
end
|
11
16
|
|
@@ -30,10 +35,6 @@ module Crumpet
|
|
30
35
|
|
31
36
|
private
|
32
37
|
|
33
|
-
def crumbs
|
34
|
-
Crumpet.crumbs
|
35
|
-
end
|
36
|
-
|
37
38
|
def render_html(crumb)
|
38
39
|
name = render_name(crumb)
|
39
40
|
item_options = build_html_options(crumb)
|
data/lib/crumpet/repository.rb
CHANGED
data/lib/crumpet/version.rb
CHANGED
data/lib/crumpet/view_helpers.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crumpet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Colegate
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|