theworkinggroup-active_link_helper 1.0.0 → 1.0.1
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 +4 -6
- data/Rakefile +7 -7
- data/active_link_helper.gemspec +6 -6
- data/init.rb +1 -0
- data/lib/active_link_helper.rb +2 -1
- metadata +8 -7
data/README.rdoc
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
ActiveLinkHelper
|
|
2
|
-
================
|
|
1
|
+
= ActiveLinkHelper
|
|
3
2
|
|
|
4
3
|
A step closer to managing 'currenty selected links'
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
--------------
|
|
5
|
+
|
|
6
|
+
== Usage
|
|
9
7
|
|
|
10
8
|
1. active_link('Link', '/some_controller/action', :self_only)
|
|
11
9
|
Will create a link marked as active for that page only:
|
|
@@ -35,4 +33,4 @@ Sample usage:
|
|
|
35
33
|
Returns only the string 'active' using the same rules as in active_link
|
|
36
34
|
Usefull when you need to activate other elements.
|
|
37
35
|
|
|
38
|
-
<li class="active">
|
|
36
|
+
<li class="active">ng of currently active elements
|
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', '1.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.1') do |p|
|
|
6
|
+
p.description = "Easily manage currently active links"
|
|
7
|
+
p.url = "http://theworkinggroup.ca"
|
|
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{
|
|
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 = "1.0.
|
|
5
|
+
s.version = "1.0.1"
|
|
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-03-18}
|
|
10
|
+
s.description = %q{Easily manage currently active links}
|
|
11
11
|
s.email = %q{oleg@theworkinggroup.ca}
|
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "lib/active_link_helper.rb", "README.rdoc"]
|
|
13
|
-
s.files = ["CHANGELOG", "
|
|
13
|
+
s.files = ["active_link_helper.gemspec", "CHANGELOG", "init.rb", "lib/active_link_helper.rb", "Manifest", "Rakefile", "README.rdoc"]
|
|
14
14
|
s.has_rdoc = true
|
|
15
|
-
s.homepage = %q{http://
|
|
15
|
+
s.homepage = %q{http://theworkinggroup.ca}
|
|
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{Easily manage currently active links}
|
|
21
21
|
|
|
22
22
|
if s.respond_to? :specification_version then
|
|
23
23
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
data/init.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'active_link_helper'
|
data/lib/active_link_helper.rb
CHANGED
|
@@ -8,6 +8,7 @@ module ActiveLinkHelper
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def is_active_link?(link, value = nil)
|
|
11
|
+
link.gsub!(/^(https?:\/\/).*?\//, '/')
|
|
11
12
|
link = link.to_s.split('?').first.to_s
|
|
12
13
|
case value
|
|
13
14
|
when :self:
|
|
@@ -24,7 +25,7 @@ module ActiveLinkHelper
|
|
|
24
25
|
end
|
|
25
26
|
return false
|
|
26
27
|
end
|
|
27
|
-
|
|
28
|
+
|
|
28
29
|
if (regex and request.request_uri.match(regex))
|
|
29
30
|
return true
|
|
30
31
|
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: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oleg Khabarov
|
|
@@ -9,11 +9,11 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-03-18 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
16
|
-
description:
|
|
16
|
+
description: Easily manage currently active links
|
|
17
17
|
email: oleg@theworkinggroup.ca
|
|
18
18
|
executables: []
|
|
19
19
|
|
|
@@ -24,14 +24,15 @@ extra_rdoc_files:
|
|
|
24
24
|
- lib/active_link_helper.rb
|
|
25
25
|
- README.rdoc
|
|
26
26
|
files:
|
|
27
|
+
- active_link_helper.gemspec
|
|
27
28
|
- CHANGELOG
|
|
29
|
+
- init.rb
|
|
28
30
|
- lib/active_link_helper.rb
|
|
31
|
+
- Manifest
|
|
29
32
|
- Rakefile
|
|
30
33
|
- README.rdoc
|
|
31
|
-
- Manifest
|
|
32
|
-
- active_link_helper.gemspec
|
|
33
34
|
has_rdoc: true
|
|
34
|
-
homepage: http://
|
|
35
|
+
homepage: http://theworkinggroup.ca
|
|
35
36
|
post_install_message:
|
|
36
37
|
rdoc_options:
|
|
37
38
|
- --line-numbers
|
|
@@ -60,6 +61,6 @@ rubyforge_project: active_link_helper
|
|
|
60
61
|
rubygems_version: 1.2.0
|
|
61
62
|
signing_key:
|
|
62
63
|
specification_version: 2
|
|
63
|
-
summary:
|
|
64
|
+
summary: Easily manage currently active links
|
|
64
65
|
test_files: []
|
|
65
66
|
|