page_navigation 0.1 → 0.2

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 CHANGED
@@ -1,2 +1,5 @@
1
+ === Version 0.2 / 2012-1-25
2
+ * Fixed minor issue when module is included in module that is included in Class
3
+
1
4
  === Version 0.1 / 2013-1-25
2
5
  * This is the initial release of this gem
@@ -1,6 +1,9 @@
1
1
  module PageNavigation
2
2
  module Routes
3
- attr_accessor :routes
3
+
4
+ def routes
5
+ @routes
6
+ end
4
7
 
5
8
  def routes=(routes)
6
9
  raise("You must provide a :default route") unless routes[:default]
@@ -1,3 +1,3 @@
1
1
  module PageNavigation
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
@@ -25,8 +25,12 @@ module PageNavigation
25
25
 
26
26
  def self.included(cls)
27
27
  cls.extend PageNavigation::Routes
28
+ @cls = cls
28
29
  end
29
30
 
31
+ def self.cls
32
+ @cls
33
+ end
30
34
 
31
35
  #
32
36
  # Navigate to a specific page following a predefined path.
@@ -79,7 +83,7 @@ module PageNavigation
79
83
  private
80
84
 
81
85
  def path_for(how)
82
- path = self.class.routes[how[:using]]
86
+ path = PageNavigation.cls.routes[how[:using]]
83
87
  fail("PageFactory route :#{how[:using].to_s} not found") unless path
84
88
  path
85
89
  end
@@ -97,7 +101,4 @@ module PageNavigation
97
101
  path.find_index { |each| each[0] == item}
98
102
  end
99
103
 
100
- def self.included(cls)
101
- cls.extend PageNavigation::Routes
102
- end
103
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page_navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  segments:
65
65
  - 0
66
- hash: 2015481616432211171
66
+ hash: 1381246942640339342
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  version: '0'
73
73
  segments:
74
74
  - 0
75
- hash: 2015481616432211171
75
+ hash: 1381246942640339342
76
76
  requirements: []
77
77
  rubyforge_project: page_naigation
78
78
  rubygems_version: 1.8.24