navlinks 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  = Simple navigation (HOWTO)
4
4
 
5
+ === Install
6
+
7
+ gem install navlinks --source http://gemcutter.org
8
+
9
+
5
10
  === First add navigation areas to the layout
6
11
 
7
12
  ==== app/views/layouts/application.html.erb
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ Jeweler::Tasks.new do |gem|
6
6
  gem.summary = "Very light-weight navigation"
7
7
 
8
8
  gem.email = "ratnikov@gmail.com"
9
- gem.homepage = "http://github.com/thoughtbot/clearance"
9
+ gem.homepage = "http://github.com/ratnikov/navlinks"
10
10
  gem.authors = [ "Dmitry Ratnikov" ]
11
11
  gem.files = FileList["[A-Z]*", "{lib}/**/*"]
12
12
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -1,21 +1,23 @@
1
1
  # Methods added to this helper will be available to all templates in the application.
2
- module Navlinks::Helper
3
- attr_accessor :nav_area
2
+ module Navlinks
3
+ module Helper
4
+ attr_accessor :nav_area
4
5
 
5
- def nav_link_to area, path, options = nil
6
- label = translate(area, :scope => 'navigation', :default => area.to_s)
7
- current_label = translate([ area, 'current' ].join('_'), :scope => 'navigation', :default => label)
6
+ def nav_link_to area, path, options = nil
7
+ label = translate(area, :scope => 'navigation', :default => area.to_s)
8
+ current_label = translate([ area, 'current' ].join('_'), :scope => 'navigation', :default => label)
8
9
 
9
- if nav_area == area
10
- link_to(decorate_current(current_label), path, :class => 'current')
11
- else
12
- link_to(label, path)
10
+ if nav_area == area
11
+ link_to(decorate_current(current_label), path, :class => 'current')
12
+ else
13
+ link_to(label, path)
14
+ end
13
15
  end
14
- end
15
16
 
16
- private
17
+ private
17
18
 
18
- def decorate_current( current_label )
19
- "[ #{current_label} ]"
19
+ def decorate_current( current_label )
20
+ "[ #{current_label} ]"
21
+ end
20
22
  end
21
23
  end
data/lib/navlinks.rb CHANGED
@@ -1,3 +1,6 @@
1
1
  require 'navlinks/helper'
2
2
 
3
- ApplicationHelper.send :include, Navlinks::Helper
3
+ module Navlinks
4
+ end
5
+
6
+ ActionController::Base.helper Navlinks::Helper
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: navlinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Ratnikov
@@ -28,7 +28,7 @@ files:
28
28
  - lib/navlinks.rb
29
29
  - lib/navlinks/helper.rb
30
30
  has_rdoc: true
31
- homepage: http://github.com/thoughtbot/clearance
31
+ homepage: http://github.com/ratnikov/navlinks
32
32
  licenses: []
33
33
 
34
34
  post_install_message: