fuji 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fuji (0.2.1)
4
+ fuji (0.2.2)
5
5
  compass
6
6
  sass
7
7
 
@@ -15,9 +15,9 @@ class Fuji
15
15
  DEFAULTS = {
16
16
  logo_text: "heroku",
17
17
  logo_subtext: "",
18
- logo_url: "https://www.heroku.com",
18
+ logo_url: "https://www.heroku.com/",
19
19
  }
20
-
20
+
21
21
  class << self
22
22
 
23
23
  def options= options
@@ -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
- <a class='fuji-logo' href='#{Fuji.options[:logo_url]}'>
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>
@@ -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
- "<li><a href='#{url}' class='#{css_class.join(" ")}'>#{@label}</a></li>"
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
@@ -1,3 +1,3 @@
1
1
  class Fuji
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -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 class='fuji-logo' href='#{link}'"
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.1
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-24 00:00:00.000000000 Z
14
+ date: 2013-04-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec