js-routes 1.2.4 → 1.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 046e707196e0c13cd982a9e9dcd870afc3b3e6f2
4
- data.tar.gz: 9a34cad3a2622ce8dd590d0db547a68bf1cdaee0
3
+ metadata.gz: 7eea4ced1f8ac4696d7203ac13d2037055a1283d
4
+ data.tar.gz: bbe6a004e246ca056ac0f0ec1a48562a6c20f5cb
5
5
  SHA512:
6
- metadata.gz: a568765f78c991e9c7f9e17de6bdf11555b8a8213ab64b31943ae9dceb133461c10f3536ce407858377fd43126858ef5fb7f3459b3405478502df4e6f40dbd66
7
- data.tar.gz: 7c7cc193b4f509c7f2896c4718276f4681c52e8ec92c74a5c5c50be94f7699a262d60bd12b560ab99113bc771cc474f334f9f21f85b921d87bd075201036f3b6
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(&:to_s).flat_map do |_, route|
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|
@@ -1,3 +1,3 @@
1
1
  class JsRoutes
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
@@ -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
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-02-13 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties