dynamic_menu 3.0.0.pre2 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynamic_menu/base.rb +9 -16
- data/lib/dynamic_menu/inheritable_menus.rb +10 -4
- data/lib/dynamic_menu/version.rb +1 -1
- data/lib/dynamic_menu.rb +1 -2
- data/lib/engine.rb +0 -1
- metadata +17 -8
- data/lib/dynamic_menu/user_grabber.rb +0 -9
data/lib/dynamic_menu/base.rb
CHANGED
@@ -1,26 +1,19 @@
|
|
1
1
|
module DynamicMenu
|
2
2
|
class Base
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
|
4
|
+
def initialize(parent)
|
5
|
+
@parent ||= parent
|
6
|
+
@menuLinks = build_menu
|
6
7
|
end
|
7
8
|
|
8
9
|
def get_menu_links
|
9
|
-
@
|
10
|
+
@menuLinks || Hash.new
|
10
11
|
end
|
11
|
-
private
|
12
12
|
|
13
|
-
def
|
14
|
-
@
|
15
|
-
|
16
|
-
|
17
|
-
def define_menu_links(args)
|
18
|
-
if @links.nil?
|
19
|
-
@links = args
|
20
|
-
else
|
21
|
-
@links.merge(args)
|
22
|
-
end
|
23
|
-
return @links
|
13
|
+
def method_missing(method, *args)
|
14
|
+
super unless @parent.methods.index method
|
15
|
+
@parent.send(method, *args)
|
24
16
|
end
|
17
|
+
|
25
18
|
end
|
26
19
|
end
|
@@ -1,11 +1,17 @@
|
|
1
1
|
module DynamicMenu
|
2
2
|
module InheritableMenus
|
3
|
+
mattr_accessor :menu
|
4
|
+
@@menu = Hash.new
|
5
|
+
|
6
|
+
|
3
7
|
def get_current_menu
|
4
8
|
path = Rails.root.join('app/menus')
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
+
full_path = path + "#{params[:controller]}/#{params[:action]}.rb"
|
10
|
+
if File.exists?(full_path)
|
11
|
+
load full_path
|
12
|
+
"#{params[:action]}Menu".classify.constantize.new(self)
|
13
|
+
end
|
9
14
|
end
|
15
|
+
|
10
16
|
end
|
11
17
|
end
|
data/lib/dynamic_menu/version.rb
CHANGED
data/lib/dynamic_menu.rb
CHANGED
data/lib/engine.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.rc1
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 4.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 4.0.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: sqlite3
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: Dynamic_menu is a gem aimed at making menus more DRY with inheritance
|
37
47
|
email:
|
38
48
|
- support@pessetto.com
|
@@ -42,7 +52,6 @@ extra_rdoc_files: []
|
|
42
52
|
files:
|
43
53
|
- lib/dynamic_menu/base.rb
|
44
54
|
- lib/dynamic_menu/inheritable_menus.rb
|
45
|
-
- lib/dynamic_menu/user_grabber.rb
|
46
55
|
- lib/dynamic_menu/version.rb
|
47
56
|
- lib/dynamic_menu.rb
|
48
57
|
- lib/engine.rb
|
@@ -133,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
142
|
version: 1.3.1
|
134
143
|
requirements: []
|
135
144
|
rubyforge_project:
|
136
|
-
rubygems_version: 1.8.
|
145
|
+
rubygems_version: 1.8.24
|
137
146
|
signing_key:
|
138
147
|
specification_version: 3
|
139
148
|
summary: Dynamic_menu is a gem aimed at making menus more DRY with inheritance.
|