makandra-navy 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,5 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .idea
6
+
data/lib/navy/renderer.rb CHANGED
@@ -9,6 +9,7 @@ module Navy
9
9
  @html_to_append = []
10
10
  @id_counter = 0
11
11
  @collapse = options[:collapse]
12
+ @name = options[:name]
12
13
  end
13
14
 
14
15
  def next_id
@@ -17,7 +18,8 @@ module Navy
17
18
 
18
19
 
19
20
  def render_navigation(navigation)
20
- div_tag(:id => "navy-#{navigation.name}-navigation", :class => 'navy-navigation') do
21
+ name = @name || navigation.name
22
+ div_tag(:id => "navy-#{name}-navigation", :class => 'navy-navigation') do
21
23
  html = ''.html_safe
22
24
  html << render_section_container(navigation, 1)
23
25
  @html_to_append.each do |append|
@@ -85,7 +87,7 @@ module Navy
85
87
  end
86
88
  end
87
89
  label << section.label
88
- link_to(label, section.url, :class => link_classes.join(' '), :"data-navy-opens" => id)
90
+ link_to(label, section.url, :class => link_classes.join(' '), :"data-navy-opens" => id, 'data-navy-section' => section.name)
89
91
  end
90
92
 
91
93
 
@@ -4,7 +4,7 @@ module Navy
4
4
  def self.included(base)
5
5
  base.send :extend, ClassMethods
6
6
  base.send :include, InstanceMethods
7
- base.helper_method :section_active?
7
+ base.helper_method :section_active? if base.respond_to?(:helper_method)
8
8
  end
9
9
 
10
10
  module ClassMethods
data/lib/navy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Navy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/navy.rb CHANGED
@@ -9,4 +9,5 @@ require 'navy/section_parser'
9
9
  require 'navy/renderer_helper'
10
10
 
11
11
  ActionView::Base.send :include, Navy::RendererHelper
12
+ ActionView::Base.send :include, Navy::SectionActivator
12
13
  ActionController::Base.send :include, Navy::SectionActivator
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makandra-navy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Kraze
@@ -16,7 +16,8 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-04-20 00:00:00 Z
19
+ date: 2012-05-08 00:00:00 +02:00
20
+ default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
23
  name: actionpack
@@ -61,6 +62,7 @@ files:
61
62
  - lib/navy/section_parser.rb
62
63
  - lib/navy/version.rb
63
64
  - navy.gemspec
65
+ has_rdoc: true
64
66
  homepage: ""
65
67
  licenses: []
66
68
 
@@ -90,10 +92,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
92
  requirements: []
91
93
 
92
94
  rubyforge_project: navy
93
- rubygems_version: 1.8.10
95
+ rubygems_version: 1.3.9.4
94
96
  signing_key:
95
97
  specification_version: 3
96
98
  summary: Comprehensive solution for multi-level horizontal navigation bars.
97
99
  test_files: []
98
100
 
99
- has_rdoc: