ariane 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +8 -0
- data/lib/ariane/render/html.rb +2 -2
- data/lib/ariane/render/html_list.rb +2 -2
- data/lib/ariane/version.rb +1 -1
- data/spec/ariane/render/html_list_spec.rb +14 -0
- data/spec/ariane/render/html_spec.rb +14 -0
- metadata +10 -9
data/CHANGELOG.md
ADDED
data/lib/ariane/render/html.rb
CHANGED
@@ -43,7 +43,7 @@ module Ariane
|
|
43
43
|
|
44
44
|
def item(crumb, active=false)
|
45
45
|
out = link(crumb, active)
|
46
|
-
out << divider if divider && !active
|
46
|
+
out << options[:divider] if options[:divider] && !active
|
47
47
|
out
|
48
48
|
end
|
49
49
|
|
@@ -61,7 +61,7 @@ module Ariane
|
|
61
61
|
else
|
62
62
|
link = crumb.text
|
63
63
|
end
|
64
|
-
link
|
64
|
+
link.html_safe
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -28,7 +28,7 @@ module Ariane
|
|
28
28
|
|
29
29
|
content_tag(:li, class: classes) do
|
30
30
|
out = link(crumb, active)
|
31
|
-
out << divider if divider && !active
|
31
|
+
out << options[:divider] if options[:divider] && !active
|
32
32
|
out
|
33
33
|
end
|
34
34
|
end
|
@@ -40,7 +40,7 @@ module Ariane
|
|
40
40
|
else
|
41
41
|
link = crumb.text
|
42
42
|
end
|
43
|
-
link
|
43
|
+
link.html_safe
|
44
44
|
end
|
45
45
|
|
46
46
|
def divider
|
data/lib/ariane/version.rb
CHANGED
@@ -52,6 +52,11 @@ module Ariane
|
|
52
52
|
it "does not append the divider if the crumb is active" do
|
53
53
|
@html_list.item(@crumb, true).should_not =~ %r[<span class="divider">/</span></li>$]
|
54
54
|
end
|
55
|
+
|
56
|
+
it "uses the divider from options, not the divider method" do
|
57
|
+
@html_list.options[:divider] = 'custom'
|
58
|
+
@html_list.item(@crumb).should =~ /custom/
|
59
|
+
end
|
55
60
|
end
|
56
61
|
|
57
62
|
describe "#link" do
|
@@ -86,6 +91,15 @@ module Ariane
|
|
86
91
|
it "returns crumb's text if the crumb is active and link_active is false" do
|
87
92
|
@html_list.link(@crumb, true).should == @crumb.text
|
88
93
|
end
|
94
|
+
|
95
|
+
it "returns an html_safe string when it returns a link" do
|
96
|
+
@html_list.link(@crumb).html_safe?.should be_true
|
97
|
+
end
|
98
|
+
|
99
|
+
it "returns an html_safe string when it returns text" do
|
100
|
+
@crumb.url = nil
|
101
|
+
@html_list.link(@crumb).html_safe?.should be_true
|
102
|
+
end
|
89
103
|
end
|
90
104
|
|
91
105
|
describe "#divider" do
|
@@ -82,6 +82,11 @@ module Ariane
|
|
82
82
|
it "does not append the divider if the crumb is active" do
|
83
83
|
@html.item(@crumb, true).should_not =~ %r[ / $]
|
84
84
|
end
|
85
|
+
|
86
|
+
it "uses the divider from options, not the divider method" do
|
87
|
+
@html.options[:divider] = 'custom'
|
88
|
+
@html.item(@crumb).should =~ /custom/
|
89
|
+
end
|
85
90
|
end
|
86
91
|
|
87
92
|
describe "#link" do
|
@@ -121,6 +126,15 @@ module Ariane
|
|
121
126
|
it "returns crumb's text if the crumb is active and link_active is false" do
|
122
127
|
@html.link(@crumb, true).should == @crumb.text
|
123
128
|
end
|
129
|
+
|
130
|
+
it "returns an html_safe string when it returns a link" do
|
131
|
+
@html.link(@crumb).html_safe?.should be_true
|
132
|
+
end
|
133
|
+
|
134
|
+
it "returns an html_safe string when it returns text" do
|
135
|
+
@crumb.url = nil
|
136
|
+
@html.link(@crumb).html_safe?.should be_true
|
137
|
+
end
|
124
138
|
end
|
125
139
|
end
|
126
140
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ariane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
16
|
-
requirement: &
|
16
|
+
requirement: &70206894458820 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70206894458820
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &70206894473580 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.3.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70206894473580
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70206894472540 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70206894472540
|
47
47
|
description: Ariane is a flexible breadcrumb system for Rails. It is fully compatible
|
48
48
|
with the Twitter Bootstrap and can be adapted to any kind of output.
|
49
49
|
email:
|
@@ -53,6 +53,7 @@ extensions: []
|
|
53
53
|
extra_rdoc_files: []
|
54
54
|
files:
|
55
55
|
- .gitignore
|
56
|
+
- CHANGELOG.md
|
56
57
|
- COPYING
|
57
58
|
- Gemfile
|
58
59
|
- README.md
|
@@ -95,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
96
|
version: '0'
|
96
97
|
requirements: []
|
97
98
|
rubyforge_project:
|
98
|
-
rubygems_version: 1.8.
|
99
|
+
rubygems_version: 1.8.15
|
99
100
|
signing_key:
|
100
101
|
specification_version: 3
|
101
102
|
summary: A flexible breadcrumb system for Rails, fully compatible with the Twitter
|