excalibur 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/excalibur/decorator.rb +1 -3
- data/lib/excalibur/version.rb +1 -1
- data/lib/excalibur/view_helpers.rb +11 -12
- data/spec/lib/excalibur/view_helper_spec.rb +5 -5
- 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: b5f074fac5a564e6a17457bd53ea8fffee50a827
|
4
|
+
data.tar.gz: d5fdd647e9aa77ec0303bf2a68bbd956de41d77d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48d2ca4506c4db5a711f9fbbbd7cbb1fcc814333248de43192a7774ae0479f12a5cb07486b84b78bca44ec2ebdb5bba8178e78bb8328d847d9ecbe2e638591f2
|
7
|
+
data.tar.gz: a1ebdfe72c23fd43539d429f13ccc15f47d36bb6d13badb4b80ff417ef0094318b8578085e6e7fc1396f200fd14fea9a05794ea4c1bcb229d1b19d347372cfd4
|
data/lib/excalibur/decorator.rb
CHANGED
data/lib/excalibur/version.rb
CHANGED
@@ -8,14 +8,14 @@ module Excalibur
|
|
8
8
|
|
9
9
|
def quick_set(type, *args)
|
10
10
|
case type
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
when :title, :description
|
12
|
+
section = args.shift
|
13
|
+
excalibur_subject.configuration.send(type).send(
|
14
|
+
"update_#{section}",
|
15
|
+
*args
|
16
|
+
)
|
17
|
+
when :meta_tag
|
18
|
+
excalibur_subject.configuration.set_meta_tag(*args)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -66,15 +66,14 @@ module Excalibur
|
|
66
66
|
def excalibur_decorate_subject(object, options = {})
|
67
67
|
class_name = if options.key?(:class_name)
|
68
68
|
options.delete(:class_name)
|
69
|
-
elsif object.is_a?(Draper::Decorator)
|
69
|
+
elsif object.is_a?(::Draper::Decorator)
|
70
70
|
object.object.class.name
|
71
71
|
else
|
72
72
|
object.class.name
|
73
73
|
end
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
).decorate(object, options)
|
75
|
+
"::Excalibur::#{class_name}Decorator".constantize.decorate(
|
76
|
+
object, options)
|
78
77
|
end
|
79
78
|
end
|
80
79
|
end
|
@@ -17,7 +17,7 @@ module Excalibur
|
|
17
17
|
|
18
18
|
describe '#entitle' do
|
19
19
|
context 'when dealing with a blank object' do
|
20
|
-
let(:obj) { Dummy.new }
|
20
|
+
let(:obj) { ::Dummy.new }
|
21
21
|
|
22
22
|
it 'should try and decorate an object' do
|
23
23
|
expect(DummyDecorator).to receive(:decorate).with(obj, {})
|
@@ -39,7 +39,7 @@ module Excalibur
|
|
39
39
|
it 'should try and decorate an object from a class' do
|
40
40
|
expect(DummyDecorator).to receive(:decorate).with(obj, {})
|
41
41
|
|
42
|
-
helpers.entitle(obj, class_name: Dummy)
|
42
|
+
helpers.entitle(obj, class_name: ::Dummy)
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'should try and decorate an object from a string' do
|
@@ -50,7 +50,7 @@ module Excalibur
|
|
50
50
|
end
|
51
51
|
|
52
52
|
context 'when dealing with a decorated object' do
|
53
|
-
let(:origin) { Dummy.new }
|
53
|
+
let(:origin) { ::Dummy.new }
|
54
54
|
let(:obj) { OtherDecorator.decorate(origin) }
|
55
55
|
|
56
56
|
it 'should try and decorate an object' do
|
@@ -109,7 +109,7 @@ module Excalibur
|
|
109
109
|
DummyDecorator.excalibur_set_title_content :body, 'New custom title'
|
110
110
|
DummyDecorator.excalibur_set_title_content :prefix, '()==|::::::> '
|
111
111
|
|
112
|
-
helpers.entitle(Dummy.new)
|
112
|
+
helpers.entitle(::Dummy.new)
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'should return a title tag with the custom title content' do
|
@@ -134,7 +134,7 @@ module Excalibur
|
|
134
134
|
DummyDecorator.excalibur_set_meta_tag :foo, :proc, proc { |obj| obj.class.to_s }
|
135
135
|
DummyDecorator.excalibur_set_meta_tag :foo, :nil, nil
|
136
136
|
|
137
|
-
helpers.entitle(Dummy.new)
|
137
|
+
helpers.entitle(::Dummy.new)
|
138
138
|
end
|
139
139
|
|
140
140
|
it 'should return a title tag with the custom title content' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excalibur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joost Elfering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|