theworkinggroup-active_link_helper 0.0.1 → 1.0.0
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/CHANGELOG +21 -0
- data/README.rdoc +6 -4
- data/Rakefile +7 -7
- data/active_link_helper.gemspec +7 -7
- data/lib/active_link_helper.rb +1 -2
- metadata +7 -5
data/CHANGELOG
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- November 07, 2008
|
|
2
|
+
* Added is_active_link? method. Takes same parameters as any other
|
|
3
|
+
active_link method and returns true or false
|
|
4
|
+
* Added ability to pass controller => action(s) pairs.
|
|
5
|
+
For example, this will make link active when we are viewing user create
|
|
6
|
+
form and even when the form submission fails:
|
|
7
|
+
active_link 'Label', link_path, 'users' => ['new', 'create']
|
|
8
|
+
Alternatively:
|
|
9
|
+
active_link 'Label', link_path, {
|
|
10
|
+
'users' => ['new', 'create'],
|
|
11
|
+
'books' => 'edit',
|
|
12
|
+
'trees' => ['edit', 'update']
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
-- October 13, 2008
|
|
16
|
+
* Added ability to pass booleans instead of regex or predefined options.
|
|
17
|
+
Example:
|
|
18
|
+
active_link 'Open tab', tab_path, is_this_tab_open?(current_tab)
|
|
19
|
+
|
|
20
|
+
-- BC (before changelog)
|
|
21
|
+
* Active Link Helper was birthed
|
data/README.rdoc
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
ActiveLinkHelper
|
|
2
|
+
================
|
|
2
3
|
|
|
3
4
|
A step closer to managing 'currenty selected links'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
--------------
|
|
7
|
+
Sample usage:
|
|
8
|
+
--------------
|
|
7
9
|
|
|
8
10
|
1. active_link('Link', '/some_controller/action', :self_only)
|
|
9
11
|
Will create a link marked as active for that page only:
|
|
@@ -33,4 +35,4 @@ A step closer to managing 'currenty selected links'
|
|
|
33
35
|
Returns only the string 'active' using the same rules as in active_link
|
|
34
36
|
Usefull when you need to activate other elements.
|
|
35
37
|
|
|
36
|
-
<li class="active">
|
|
38
|
+
<li class="active">
|
data/Rakefile
CHANGED
|
@@ -2,13 +2,13 @@ require 'rubygems'
|
|
|
2
2
|
require 'rake'
|
|
3
3
|
require 'echoe'
|
|
4
4
|
|
|
5
|
-
Echoe.new('active_link_helper', '0.0
|
|
6
|
-
p.description =
|
|
7
|
-
p.url =
|
|
8
|
-
p.author =
|
|
9
|
-
p.email =
|
|
10
|
-
p.ignore_pattern = [
|
|
5
|
+
Echoe.new('active_link_helper', '1.0.0') do |p|
|
|
6
|
+
p.description = 'A helper that deals with currently active navigational links'
|
|
7
|
+
p.url = 'http://github.com/theworkinggroup/active_link_helper'
|
|
8
|
+
p.author = 'Oleg Khabarov'
|
|
9
|
+
p.email = 'oleg@theworkinggroup.ca'
|
|
10
|
+
p.ignore_pattern = ['tmp/*', 'script/*']
|
|
11
11
|
p.development_dependencies = []
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each{|ext| load ext}
|
|
14
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each{ |ext| load ext }
|
data/active_link_helper.gemspec
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{active_link_helper}
|
|
5
|
-
s.version = "0.0
|
|
5
|
+
s.version = "1.0.0"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["Oleg Khabarov"]
|
|
9
|
-
s.date = %q{2009-
|
|
10
|
-
s.description = %q{
|
|
9
|
+
s.date = %q{2009-01-27}
|
|
10
|
+
s.description = %q{A helper that deals with currently active navigational links}
|
|
11
11
|
s.email = %q{oleg@theworkinggroup.ca}
|
|
12
|
-
s.extra_rdoc_files = ["lib/active_link_helper.rb", "README.rdoc"]
|
|
13
|
-
s.files = ["lib/active_link_helper.rb", "Rakefile", "README.rdoc", "Manifest", "active_link_helper.gemspec"]
|
|
12
|
+
s.extra_rdoc_files = ["CHANGELOG", "lib/active_link_helper.rb", "README.rdoc"]
|
|
13
|
+
s.files = ["CHANGELOG", "lib/active_link_helper.rb", "Rakefile", "README.rdoc", "Manifest", "active_link_helper.gemspec"]
|
|
14
14
|
s.has_rdoc = true
|
|
15
|
-
s.homepage = %q{http://theworkinggroup
|
|
15
|
+
s.homepage = %q{http://github.com/theworkinggroup/active_link_helper}
|
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Active_link_helper", "--main", "README.rdoc"]
|
|
17
17
|
s.require_paths = ["lib"]
|
|
18
18
|
s.rubyforge_project = %q{active_link_helper}
|
|
19
19
|
s.rubygems_version = %q{1.3.1}
|
|
20
|
-
s.summary = %q{
|
|
20
|
+
s.summary = %q{A helper that deals with currently active navigational links}
|
|
21
21
|
|
|
22
22
|
if s.respond_to? :specification_version then
|
|
23
23
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
data/lib/active_link_helper.rb
CHANGED
|
@@ -8,7 +8,6 @@ module ActiveLinkHelper
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def is_active_link?(link, value = nil)
|
|
11
|
-
link.gsub!(/^(https?:\/\/).*?\//, '/')
|
|
12
11
|
link = link.to_s.split('?').first.to_s
|
|
13
12
|
case value
|
|
14
13
|
when :self:
|
|
@@ -25,7 +24,7 @@ module ActiveLinkHelper
|
|
|
25
24
|
end
|
|
26
25
|
return false
|
|
27
26
|
end
|
|
28
|
-
|
|
27
|
+
|
|
29
28
|
if (regex and request.request_uri.match(regex))
|
|
30
29
|
return true
|
|
31
30
|
else
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: theworkinggroup-active_link_helper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oleg Khabarov
|
|
@@ -9,27 +9,29 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-01-27 00:00:00 -08:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
16
|
-
description:
|
|
16
|
+
description: A helper that deals with currently active navigational links
|
|
17
17
|
email: oleg@theworkinggroup.ca
|
|
18
18
|
executables: []
|
|
19
19
|
|
|
20
20
|
extensions: []
|
|
21
21
|
|
|
22
22
|
extra_rdoc_files:
|
|
23
|
+
- CHANGELOG
|
|
23
24
|
- lib/active_link_helper.rb
|
|
24
25
|
- README.rdoc
|
|
25
26
|
files:
|
|
27
|
+
- CHANGELOG
|
|
26
28
|
- lib/active_link_helper.rb
|
|
27
29
|
- Rakefile
|
|
28
30
|
- README.rdoc
|
|
29
31
|
- Manifest
|
|
30
32
|
- active_link_helper.gemspec
|
|
31
33
|
has_rdoc: true
|
|
32
|
-
homepage: http://theworkinggroup
|
|
34
|
+
homepage: http://github.com/theworkinggroup/active_link_helper
|
|
33
35
|
post_install_message:
|
|
34
36
|
rdoc_options:
|
|
35
37
|
- --line-numbers
|
|
@@ -58,6 +60,6 @@ rubyforge_project: active_link_helper
|
|
|
58
60
|
rubygems_version: 1.2.0
|
|
59
61
|
signing_key:
|
|
60
62
|
specification_version: 2
|
|
61
|
-
summary:
|
|
63
|
+
summary: A helper that deals with currently active navigational links
|
|
62
64
|
test_files: []
|
|
63
65
|
|