js-routes 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/js_routes.rb +2 -2
- data/lib/js_routes/version.rb +1 -1
- data/spec/js_routes/rails_routes_compatibility_spec.rb +4 -0
- data/spec/spec_helper.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eea4ced1f8ac4696d7203ac13d2037055a1283d
|
4
|
+
data.tar.gz: bbe6a004e246ca056ac0f0ec1a48562a6c20f5cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaead3fa492158178fc38c904142129862c698e4f58547915e8ed139d398971ad396ba5bdf4b609a267dd7498062ea7abcc714a80046cdfadd879780a26abd44
|
7
|
+
data.tar.gz: ff5e478c5a8c4791fd4f967b790698799d04cbaf424886c40d923ee94a742d98266480c8e9df1902d7b84c921d4e5306fb19c56d65bfbb4327e7962a00753560
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
## master
|
2
2
|
|
3
|
+
## v1.2.5
|
4
|
+
|
5
|
+
* Bugfix subdomain default parameter in routes #184
|
6
|
+
* Bugfix infinite recursion in some specific route sets #183
|
7
|
+
|
8
|
+
## v1.2.4
|
9
|
+
|
10
|
+
* Additional bugfixes to support all versions of Sprockets: 2.x and 3.x
|
11
|
+
|
3
12
|
## v1.2.3
|
4
13
|
|
5
14
|
* Sprockets ~= 3.0 support
|
data/lib/js_routes.rb
CHANGED
@@ -35,7 +35,7 @@ class JsRoutes
|
|
35
35
|
}
|
36
36
|
|
37
37
|
LAST_OPTIONS_KEY = "options".freeze
|
38
|
-
FILTERED_DEFAULT_PARTS = [:controller, :action]
|
38
|
+
FILTERED_DEFAULT_PARTS = [:controller, :action, :subdomain]
|
39
39
|
|
40
40
|
class Options < Struct.new(*DEFAULTS.keys)
|
41
41
|
def to_hash
|
@@ -150,7 +150,7 @@ class JsRoutes
|
|
150
150
|
protected
|
151
151
|
|
152
152
|
def js_routes
|
153
|
-
js_routes = Rails.application.routes.named_routes.to_a.sort_by(&:
|
153
|
+
js_routes = Rails.application.routes.named_routes.to_a.sort_by(&:first).flat_map do |_, route|
|
154
154
|
rails_engine_app = get_app_from_route(route)
|
155
155
|
if rails_engine_app.respond_to?(:superclass) && rails_engine_app.superclass == Rails::Engine && !route.path.anchored
|
156
156
|
rails_engine_app.routes.named_routes.map do |_, engine_route|
|
data/lib/js_routes/version.rb
CHANGED
@@ -66,6 +66,10 @@ describe JsRoutes, "compatibility with Rails" do
|
|
66
66
|
expect(evaljs("Routes.api_purchases_path()")).to eq(routes.api_purchases_path)
|
67
67
|
end
|
68
68
|
|
69
|
+
it 'should support route default subdomain' do
|
70
|
+
expect(evaljs("Routes.backend_root_path()")).to eq(routes.backend_root_path)
|
71
|
+
end
|
72
|
+
|
69
73
|
it "should support default format override" do
|
70
74
|
expect(evaljs("Routes.api_purchases_path({format: 'xml'})")).to eq(routes.api_purchases_path(format: 'xml'))
|
71
75
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -116,7 +116,7 @@ def draw_routes
|
|
116
116
|
|
117
117
|
get '/привет' => "foo#foo", :as => :hello
|
118
118
|
get '(/o/:organization)/search/:q' => "foo#foo", as: :search
|
119
|
-
|
119
|
+
|
120
120
|
resources :sessions, :only => [:new, :create, :destroy], :protocol => 'https'
|
121
121
|
|
122
122
|
get '/' => 'sso#login', host: 'sso.example.com', as: :sso
|
@@ -131,6 +131,10 @@ def draw_routes
|
|
131
131
|
get "descendents"
|
132
132
|
end
|
133
133
|
|
134
|
+
namespace :backend, path: '', constraints: {subdomain: 'backend'} do
|
135
|
+
root to: 'backend#index'
|
136
|
+
end
|
137
|
+
|
134
138
|
end
|
135
139
|
|
136
140
|
end
|
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: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Gusiev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|