navGATE 0.1.17 → 0.1.18
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.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/navgate.rb +17 -11
- data/lib/navgate/navgatehelpers.rb +1 -1
- data/navGATE.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ca97abca52aba21054660fff6be9290fc01ed6
|
4
|
+
data.tar.gz: 01d56b71610b89892c59aa85a9d9323c61342c94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1534caaf5ef23e63fae080d8d0a2d6fb5c3a67e1fec161441bc0811422724f2a4dd8e1f1e8d4473c4cc79d6db2cb351408763ec05277ae058b427fa8a9b86d23
|
7
|
+
data.tar.gz: d473eead02eb00d376cd475a2172e18220cf0a708717ff0bbfca9e0c9e82499f2745607d39ea0306e5e34c1c9860a98cb6c79a22b3971a16dd787df6f858c124
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rake'
|
|
3
3
|
require 'echoe'
|
4
4
|
|
5
5
|
|
6
|
-
Echoe.new('navGATE','0.1.
|
6
|
+
Echoe.new('navGATE','0.1.18') do |p|
|
7
7
|
p.summary = "Allows the easy creation of navigation with config files"
|
8
8
|
p.description = "Can create navigation from objects using the nav builder,from database tables or from a yaml file"
|
9
9
|
p.url = "https://github.com/Thermatix/navGATE"
|
data/lib/navgate.rb
CHANGED
@@ -100,24 +100,30 @@ class Navgate
|
|
100
100
|
|
101
101
|
|
102
102
|
def render_nav params, options
|
103
|
-
select_nav(params[:controller]).render_it_with(options).html_safe
|
103
|
+
nav = select_nav(params[:controller].split('/').last).render_it_with(options).html_safe
|
104
|
+
ap nav.inspect
|
105
|
+
nav
|
104
106
|
end
|
105
107
|
|
106
108
|
def select params
|
107
|
-
|
108
|
-
|
109
|
-
|
109
|
+
|
110
|
+
if params[:selection]
|
111
|
+
return params[:selection]
|
112
|
+
else
|
113
|
+
return select_nav(params[:controller]).default.to_s
|
114
|
+
end
|
110
115
|
end
|
111
116
|
private
|
112
117
|
def select_nav controller
|
113
118
|
self.navs.each do |nav|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
119
|
+
if nav.controller.is_a?(String)
|
120
|
+
ap nav.inspect
|
121
|
+
return nav if (nav.controller) == controller.split('/').last
|
122
|
+
elsif nav.controller.is_a?(Array)
|
123
|
+
return nav if nav.controller.include?(controller)
|
124
|
+
else
|
125
|
+
raise TypeError, "expecting nav.controller to be a String or an Array, got #{nav.controller.class} "
|
126
|
+
end
|
121
127
|
end
|
122
128
|
end
|
123
129
|
|
data/navGATE.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "navGATE"
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.18"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Martin Becker"]
|
9
|
-
s.date = "2013-10-
|
9
|
+
s.date = "2013-10-18"
|
10
10
|
s.description = "Can create navigation from objects using the nav builder,from database tables or from a yaml file"
|
11
11
|
s.email = "mbeckerwork@gmail.com"
|
12
12
|
s.extra_rdoc_files = ["lib/navgate.rb", "lib/navgate/base.rb", "lib/navgate/navgatehelpers.rb", "lib/readme.rdoc"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navGATE
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Can create navigation from objects using the nav builder,from database
|
14
14
|
tables or from a yaml file
|