fuji 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/fuji.rb +2 -2
- data/lib/fuji/header.rb +7 -7
- data/lib/fuji/link.rb +6 -3
- data/lib/fuji/version.rb +1 -1
- data/spec/fuji_header_spec.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/fuji.rb
CHANGED
data/lib/fuji/header.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
class Fuji
|
2
2
|
class Header < Renderer
|
3
3
|
|
4
|
-
ADDONS = Link.new("Add-ons", "https://addons.heroku.com")
|
5
|
-
DOCUMENTATION = Link.new("Documentation", "https://devcenter.heroku.com")
|
6
|
-
HELP = Link.new("Help & Support", "https://help.heroku.com", {css: "help"})
|
4
|
+
ADDONS = Link.new("Add-ons", "https://addons.heroku.com/")
|
5
|
+
DOCUMENTATION = Link.new("Documentation", "https://devcenter.heroku.com/")
|
6
|
+
HELP = Link.new("Help & Support", "https://help.heroku.com/", {css: "help"})
|
7
7
|
|
8
8
|
LOGGED_IN = [
|
9
|
-
Link.new("Apps", "https://dashboard.heroku.com"),
|
9
|
+
Link.new("Apps", "https://dashboard.heroku.com/"),
|
10
10
|
ADDONS,
|
11
11
|
DOCUMENTATION,
|
12
12
|
HELP,
|
@@ -27,14 +27,14 @@ class Fuji
|
|
27
27
|
# Build HTML from link objects
|
28
28
|
link_html = links.map{|l| l.html(current_page) }.join("\n")
|
29
29
|
|
30
|
+
home = Link.new("#{Fuji.options[:logo_text]} <span class='fuji-logo-subtext'>#{Fuji.options[:logo_subtext]}</span>", Fuji.options[:logo_url], {css: "fuji-logo", skip_li: true})
|
31
|
+
|
30
32
|
# Build HTML wrapper
|
31
33
|
out = "
|
32
34
|
<div class='fuji #{css_class}'>
|
33
35
|
<div class='fuji-container'>
|
34
36
|
<h1 class='fuji-brand'>
|
35
|
-
|
36
|
-
#{Fuji.options[:logo_text]} <span class='fuji-logo-subtext'>#{Fuji.options[:logo_subtext]}</span>
|
37
|
-
</a>
|
37
|
+
#{home.html}
|
38
38
|
</h1>
|
39
39
|
|
40
40
|
<ul class='fuji-links'>#{link_html}</ul>
|
data/lib/fuji/link.rb
CHANGED
@@ -8,13 +8,16 @@ class Fuji
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def html current_page = nil
|
11
|
-
local = nil
|
12
11
|
url = mapping @url
|
13
12
|
|
14
13
|
@options[:css] ||= Fuji::Helper.dehumanize(@label)
|
15
14
|
css_class = [@options[:css]]
|
16
|
-
css_class << "active" if current_page && current_page?(url, current_page)
|
17
|
-
|
15
|
+
css_class << "active" if current_page && current_page?(url, current_page)
|
16
|
+
|
17
|
+
output = "<a href='#{url}' class='#{css_class.join(" ")}'>#{@label}</a>"
|
18
|
+
output = "<li>#{output}</li>" unless @options[:skip_li]
|
19
|
+
|
20
|
+
output
|
18
21
|
end
|
19
22
|
|
20
23
|
private
|
data/lib/fuji/version.rb
CHANGED
data/spec/fuji_header_spec.rb
CHANGED
@@ -31,7 +31,7 @@ describe Fuji::Header do
|
|
31
31
|
Fuji.options = {logo_url: link}
|
32
32
|
|
33
33
|
html = Fuji::Header.render OpenStruct.new
|
34
|
-
html.should match "a
|
34
|
+
html.should match "a href='#{link}' class='fuji-logo'"
|
35
35
|
end
|
36
36
|
|
37
37
|
it "renders the logo text from options" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-04-
|
14
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|