js-routes 2.0.2 → 2.0.3
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/CHANGELOG.md +4 -0
- data/lib/js_routes.rb +1 -1
- data/lib/js_routes/version.rb +1 -1
- data/spec/js_routes/rails_routes_compatibility_spec.rb +4 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/support/routes.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59b90f4f1eabd64f07f185e7fc3e26cc90ff44c0e705191543bfff3cb149e3ef
|
4
|
+
data.tar.gz: 3f10d123ffa344bf190f014e92796d51c4b3a63ea285ef4ee66376ce44adb7e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2211d6912507490776862a1f9a807b73ae2c77abaa247cfa71afcb8fbb87ec0c6f2fbb24d9219aff51a04e9eb8d47ab43c6e38ec0e598975bb3ccf5b2157b46
|
7
|
+
data.tar.gz: 8d2227c3bea7dec3fd3e92fd006752ce4af370f181f0e7115dc9870fb3b5f9d0ba4540398c6eae4de86096d1cf5a2b57de3396b08b63c2326191d0e1f0d5490a
|
data/CHANGELOG.md
CHANGED
data/lib/js_routes.rb
CHANGED
@@ -349,7 +349,7 @@ JS
|
|
349
349
|
return spec.tr(':*', '') if spec.is_a?(String)
|
350
350
|
|
351
351
|
result = serialize_spec(spec, parent_spec)
|
352
|
-
if parent_spec && result[1].is_a?(String)
|
352
|
+
if parent_spec && result[1].is_a?(String) && parent_spec.type != :SLASH
|
353
353
|
result = [
|
354
354
|
# We encode node symbols as integer
|
355
355
|
# to reduce the routes.js file size
|
data/lib/js_routes/version.rb
CHANGED
@@ -135,6 +135,10 @@ describe JsRoutes, "compatibility with Rails" do
|
|
135
135
|
it "should support single route mapping" do
|
136
136
|
expect(evaljs("Routes.support_path({page: 3})")).to eq(test_routes.support_path(:page => 3))
|
137
137
|
end
|
138
|
+
|
139
|
+
it 'works' do
|
140
|
+
expect(evaljs("Routes.planner_manage_path()")).to eq(planner_routes.manage_path)
|
141
|
+
end
|
138
142
|
end
|
139
143
|
|
140
144
|
it "shouldn't require the format" do
|
data/spec/spec_helper.rb
CHANGED
@@ -58,11 +58,21 @@ def blog_routes
|
|
58
58
|
BlogEngine::Engine.routes.url_helpers
|
59
59
|
end
|
60
60
|
|
61
|
+
def planner_routes
|
62
|
+
Planner::Engine.routes.url_helpers
|
63
|
+
end
|
64
|
+
|
61
65
|
ActiveSupport::Inflector.inflections do |inflect|
|
62
66
|
inflect.irregular "budgie", "budgies"
|
63
67
|
end
|
64
68
|
|
65
69
|
|
70
|
+
module Planner
|
71
|
+
class Engine < Rails::Engine
|
72
|
+
isolate_namespace Planner
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
66
76
|
module BlogEngine
|
67
77
|
class Engine < Rails::Engine
|
68
78
|
isolate_namespace BlogEngine
|
data/spec/support/routes.rb
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
def draw_routes
|
2
|
+
Planner::Engine.routes.draw do
|
3
|
+
get "/manage" => 'foo#foo', as: :manage
|
4
|
+
end
|
2
5
|
|
3
6
|
BlogEngine::Engine.routes.draw do
|
4
7
|
root to: "application#index"
|
5
|
-
resources :posts
|
8
|
+
resources :posts, only: [:show, :index]
|
6
9
|
end
|
7
10
|
App.routes.draw do
|
8
11
|
|
12
|
+
mount Planner::Engine, at: "/", as: :planner
|
13
|
+
|
14
|
+
mount BlogEngine::Engine => "/blog", as: :blog_app
|
9
15
|
get 'support(/page/:page)', to: BlogEngine::Engine, as: 'support'
|
10
16
|
|
11
17
|
resources :inboxes, only: [:index, :show] do
|
@@ -43,8 +49,6 @@ def draw_routes
|
|
43
49
|
get 'books/*section/:title' => 'books#show', :as => :book
|
44
50
|
get 'books/:title/*section' => 'books#show', :as => :book_title
|
45
51
|
|
46
|
-
mount BlogEngine::Engine => "/blog", :as => :blog_app
|
47
|
-
|
48
52
|
get '/no_format' => "foo#foo", :format => false, :as => :no_format
|
49
53
|
|
50
54
|
get '/json_only' => "foo#foo", :format => true, :constraints => {:format => /json/}, :as => :json_only
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js-routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Gusiev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|