navGATE 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75bfae6a68b290373587be91e83178deabafb639
4
- data.tar.gz: 41a5167fc956a2c2be7ac00aa908123ce0f0df5a
3
+ metadata.gz: 40c426cea708d1e3f35edfdf8c516cea62d6761a
4
+ data.tar.gz: dbabb9a4f1b658f771923fd1d83c781bb9eb8298
5
5
  SHA512:
6
- metadata.gz: 2c13b3accfe0897c0dbd362c52a47680510ecd5a3ea43474f7009b622588d2d11d9882d088b653707cc0f683647c3bb8c1f1123525e998b977a06f35242b10e2
7
- data.tar.gz: 1db9f9b64b41732f5edd3f3140345a7162d18671b2facf6b9bc65f70a6d1cc7bef56e22062fa046abf8124a8bfbd2dae454d7334ed34149d0a0a5d84142e6871
6
+ metadata.gz: 0a97de027736363a02273a3add6ec14103dfabec2e1d8fdba0e00bb8ea646b3bfdea13157f74b0b1b052e318742add0c9d94f4576a06c163963492b0a82c1d7b
7
+ data.tar.gz: fb83fbe23438f7bb79d20016964b135a03fede0d4b5106ffe597e88d063dbb78d7fa32cee3659f4308faa7dd7c441793b8cda9f8a854534d6907f2b8c14bfcff
data/Manifest CHANGED
@@ -4,7 +4,7 @@ config/build_menu.yml
4
4
  config/initializers/build_menu.rb
5
5
  init.rb
6
6
  lib/navgate.rb
7
- lib/navgate/application_controller.rb
8
7
  lib/navgate/base.rb
8
+ lib/navgate/navgatehelpers.rb
9
9
  lib/readme.rdoc
10
10
  navGATE.gemspec
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake'
3
3
  require 'echoe'
4
4
 
5
5
 
6
- Echoe.new('navGATE','0.1.16') do |p|
6
+ Echoe.new('navGATE','0.1.17') 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"
@@ -1,26 +1,26 @@
1
- require 'navgate'
2
- building menu object from scratch
3
- NAVGATE = Navgate.new do |build|
4
- build.navs = [ Navgate::Builder.new do |options|
5
- options[:selection] = %w(selection site_settings users images misc)
6
- options[:namespace] = 'admin'
7
- options[:controller] = 'admin_panel'
8
- end
9
- ]
10
- end
1
+ # require 'navgate'
2
+ # building menu object from scratch
3
+ # NAVGATE = Navgate.new do |build|
4
+ # build.navs = [ Navgate::Builder.new do |options|
5
+ # options[:selection] = %w(selection site_settings users images misc)
6
+ # options[:namespace] = 'admin'
7
+ # options[:controller] = 'admin_panel'
8
+ # end
9
+ # ]
10
+ # end
11
11
 
12
- building menu object from database fields be sure to pass it as {Model_name: field}
13
- NAVGATE = Navgate.new do |build|
14
- build.navs = [ Navgate::Builder.new do |options|
15
- options[:selection] = {categories: :title }
16
- options[:prefix] = 'shop_category'
17
- options[:controller] = 'front_page'
18
- options[:by_id] = true
19
- end
20
- ]
21
- end
12
+ # building menu object from database fields be sure to pass it as {Model_name: field}
13
+ # NAVGATE = Navgate.new do |build|
14
+ # build.navs = [ Navgate::Builder.new do |options|
15
+ # options[:selection] = {categories: :title }
16
+ # options[:prefix] = 'shop_category'
17
+ # options[:controller] = 'front_page'
18
+ # options[:by_id] = true
19
+ # end
20
+ # ]
21
+ # end
22
22
 
23
- building from yaml file, look through the yaml file for an example
24
- NAVGATE = Navgate.new do |build|
25
- build.navs = "#{Rails.root}/config/build_menu.yml"
26
- end
23
+ # building from yaml file, look through the yaml file for an example
24
+ # NAVGATE = Navgate.new do |build|
25
+ # build.navs = "#{Rails.root}/config/build_menu.yml"
26
+ # end
data/lib/navgate.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'navgate/base'
2
- require 'navgate/application_controller'
2
+ require 'navgate/navgatehelpers'
3
3
  class Navgate
4
4
  class Builder < Base
5
5
 
@@ -8,9 +8,7 @@ class Navgate
8
8
  options[:class] = "'#{self.css_class}'" if self.css_class
9
9
  if options
10
10
  options.each do |key,value|
11
- ap value
12
11
  options_to_render += ("#{key}=#{value}" + " ") unless ignoring key
13
- ap options_to_render
14
12
  end
15
13
  end
16
14
  style = styling(options)
@@ -1,7 +1,4 @@
1
-
2
- class ApplicationController < ActionController::Base
3
- before_filter :make_menu
4
- helper_method :render_navigation
1
+ module NavGateHelpers
5
2
  def make_menu
6
3
  @navgate = NAVGATE
7
4
  @selected ||= @navgate.select(params) if params[:selection]
@@ -9,5 +6,6 @@ class ApplicationController < ActionController::Base
9
6
  def render_navigation options = nil
10
7
  @navgate.render_nav(params, options)
11
8
  end
9
+
12
10
  end
13
11
 
data/lib/readme.rdoc CHANGED
@@ -11,6 +11,18 @@ This gem was built with Rails in mind.
11
11
  note: this is my first gem.
12
12
 
13
13
  lastly the gem is up on rubygems.org
14
+
15
+ ==setup
16
+ in the Application controller you have to <tt> include NavGateHelpers </tt> first.
17
+
18
+ You next have to add a before_filter and helper method to the application controller
19
+
20
+ just add
21
+ helper_method :render_navigation
22
+ before_filter :make_menu
23
+
24
+ to your list of filters and helper methods in the application controller, thats it, you can now use the helper method and the gem to build the navigations
25
+
14
26
  ==Building the menus
15
27
 
16
28
  When building the menu there are multiple options available, building the menu is done in an initializer file in the configs directory.
@@ -106,6 +118,7 @@ The yaml file:
106
118
 
107
119
  ==Rendering the menu
108
120
 
121
+
109
122
  To render the menu use the provided helper <tt>render_navigation(options)</tt>;
110
123
  options is a hash that is used to build any html options you might want such as
111
124
  'class='some_css_class', it can also take two extra options, 'styling:' and 'wrap:'.
data/navGATE.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "navGATE"
5
- s.version = "0.1.16"
5
+ s.version = "0.1.17"
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-16"
9
+ s.date = "2013-10-17"
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
- s.extra_rdoc_files = ["lib/navgate.rb", "lib/navgate/application_controller.rb", "lib/navgate/base.rb", "lib/readme.rdoc"]
13
- s.files = ["Manifest", "Rakefile", "config/build_menu.yml", "config/initializers/build_menu.rb", "init.rb", "lib/navgate.rb", "lib/navgate/application_controller.rb", "lib/navgate/base.rb", "lib/readme.rdoc", "navGATE.gemspec"]
12
+ s.extra_rdoc_files = ["lib/navgate.rb", "lib/navgate/base.rb", "lib/navgate/navgatehelpers.rb", "lib/readme.rdoc"]
13
+ s.files = ["Manifest", "Rakefile", "config/build_menu.yml", "config/initializers/build_menu.rb", "init.rb", "lib/navgate.rb", "lib/navgate/base.rb", "lib/navgate/navgatehelpers.rb", "lib/readme.rdoc", "navGATE.gemspec"]
14
14
  s.homepage = "https://github.com/Thermatix/navGATE"
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "navGATE"]
16
16
  s.require_paths = ["lib"]
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.16
4
+ version: 0.1.17
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-16 00:00:00.000000000 Z
11
+ date: 2013-10-17 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
@@ -17,8 +17,8 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files:
19
19
  - lib/navgate.rb
20
- - lib/navgate/application_controller.rb
21
20
  - lib/navgate/base.rb
21
+ - lib/navgate/navgatehelpers.rb
22
22
  - lib/readme.rdoc
23
23
  files:
24
24
  - Manifest
@@ -27,8 +27,8 @@ files:
27
27
  - config/initializers/build_menu.rb
28
28
  - init.rb
29
29
  - lib/navgate.rb
30
- - lib/navgate/application_controller.rb
31
30
  - lib/navgate/base.rb
31
+ - lib/navgate/navgatehelpers.rb
32
32
  - lib/readme.rdoc
33
33
  - navGATE.gemspec
34
34
  homepage: https://github.com/Thermatix/navGATE