sextant 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ ## 0.1.3
2
+
3
+ * Helper for mounting sextant in cases of catch all routes (via @menkel)
4
+
1
5
  ## 0.1.2
2
6
 
3
7
  * Remove dependency on ApplicationController existance
data/README.md CHANGED
@@ -30,6 +30,15 @@ end
30
30
 
31
31
  Then run `bundle install` and you're ready to start
32
32
 
33
+ ### Optional for user of catch-all route in routes.rb:
34
+
35
+ Add sextant to your routes (config/routes.rb) before catch-all routes
36
+
37
+ ```ruby
38
+ mount_sextant
39
+ match '*not_found' => 'errors#handle404'
40
+ match "*path" => 'errors#handle404'
41
+ ```
33
42
 
34
43
  ## Use
35
44
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -1,9 +1,7 @@
1
1
  Rails.application.routes.draw do
2
- namespace :rails do
3
- resources :routes, :only => [:index, :show]
4
- end
2
+ mount_sextant
5
3
  end
6
4
 
7
5
  # RouteInspector::Engine.routes.draw do
8
- #
6
+ #
9
7
  # end
@@ -0,0 +1,11 @@
1
+ module ActionDispatch::Routing
2
+ class Mapper
3
+ # Includes mount_sextant method for routes. This method is responsible to
4
+ # generate all needed routes for sextant
5
+ def mount_sextant
6
+ namespace :rails do
7
+ resources :routes, :only => [:index, :show]
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,6 @@
1
1
  require 'rails/application/route_inspector'
2
2
  require 'sextant/engine'
3
+ require 'rails/routes'
3
4
 
4
5
  module Sextant
5
6
  def self.format_routes(routes = all_routes)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sextant"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["schneems"]
@@ -28,12 +28,16 @@ Gem::Specification.new do |s|
28
28
  "app/views/layouts/rails/routes.html.erb",
29
29
  "app/views/rails/routes/index.html.erb",
30
30
  "config/routes.rb",
31
+ "lib/rails/routes.rb",
31
32
  "lib/sextant.rb",
32
33
  "lib/sextant/engine.rb",
33
34
  "sextant.gemspec",
34
35
  "test/dummy/Rakefile",
35
36
  "test/dummy/app/controllers/application_controller.rb",
37
+ "test/dummy/app/controllers/foo_controller.rb",
38
+ "test/dummy/app/foo_controller.rb",
36
39
  "test/dummy/app/helpers/application_helper.rb",
40
+ "test/dummy/app/views/foo/index.html",
37
41
  "test/dummy/app/views/layouts/application.html.erb",
38
42
  "test/dummy/config.ru",
39
43
  "test/dummy/config/application.rb",
@@ -0,0 +1,4 @@
1
+ class FooController < ApplicationController
2
+ def index
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class FooController < ApplicationController
2
+ def index
3
+ end
4
+ end
File without changes
@@ -2,6 +2,9 @@ Dummy::Application.routes.draw do
2
2
  resources :foo
3
3
  resources :bar
4
4
 
5
+ # mount_sextant
6
+
7
+ # match '*a', :to => 'foo#index'
5
8
  # The priority is based upon order of creation:
6
9
  # first created -> highest priority.
7
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sextant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-01 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70174851854640 !ruby/object:Gem::Requirement
16
+ requirement: &70254073682540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70174851854640
24
+ version_requirements: *70254073682540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rails
27
- requirement: &70174851854060 !ruby/object:Gem::Requirement
27
+ requirement: &70254073681720 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.2'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70174851854060
35
+ version_requirements: *70254073681720
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70174851853380 !ruby/object:Gem::Requirement
38
+ requirement: &70254073680980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70174851853380
46
+ version_requirements: *70254073680980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &70174851852760 !ruby/object:Gem::Requirement
49
+ requirement: &70254073680360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70174851852760
57
+ version_requirements: *70254073680360
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: capybara
60
- requirement: &70174851852160 !ruby/object:Gem::Requirement
60
+ requirement: &70254073679660 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.4.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70174851852160
68
+ version_requirements: *70254073679660
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
- requirement: &70174851851460 !ruby/object:Gem::Requirement
71
+ requirement: &70254073679040 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70174851851460
79
+ version_requirements: *70254073679040
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: launchy
82
- requirement: &70174851850740 !ruby/object:Gem::Requirement
82
+ requirement: &70254073651460 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.1.0
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70174851850740
90
+ version_requirements: *70254073651460
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rcov
93
- requirement: &70174851849940 !ruby/object:Gem::Requirement
93
+ requirement: &70254073650940 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70174851849940
101
+ version_requirements: *70254073650940
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: simplecov
104
- requirement: &70174851849220 !ruby/object:Gem::Requirement
104
+ requirement: &70254073650460 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70174851849220
112
+ version_requirements: *70254073650460
113
113
  description: Sextant is a Rails engine that quickly shows the routes available
114
114
  email: richard.schneeman@gmail.com
115
115
  executables: []
@@ -129,12 +129,16 @@ files:
129
129
  - app/views/layouts/rails/routes.html.erb
130
130
  - app/views/rails/routes/index.html.erb
131
131
  - config/routes.rb
132
+ - lib/rails/routes.rb
132
133
  - lib/sextant.rb
133
134
  - lib/sextant/engine.rb
134
135
  - sextant.gemspec
135
136
  - test/dummy/Rakefile
136
137
  - test/dummy/app/controllers/application_controller.rb
138
+ - test/dummy/app/controllers/foo_controller.rb
139
+ - test/dummy/app/foo_controller.rb
137
140
  - test/dummy/app/helpers/application_helper.rb
141
+ - test/dummy/app/views/foo/index.html
138
142
  - test/dummy/app/views/layouts/application.html.erb
139
143
  - test/dummy/config.ru
140
144
  - test/dummy/config/application.rb
@@ -183,7 +187,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
187
  version: '0'
184
188
  segments:
185
189
  - 0
186
- hash: 2108765618129128309
190
+ hash: -4159701652236955647
187
191
  required_rubygems_version: !ruby/object:Gem::Requirement
188
192
  none: false
189
193
  requirements: