js-routes 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dabca1d4d4731f75724629d65370356f60a85ff2
4
- data.tar.gz: c70302650e0525bfc7d26b59c15dd524afd11fdc
3
+ metadata.gz: 55daff16f999cf2dfd6cfdbbe241e6c2cbbb7fbf
4
+ data.tar.gz: c6e9c73edbaf8f95667565114d844b7fc92788c4
5
5
  SHA512:
6
- metadata.gz: 5106846103e15a73320b239924f492d02be47e5ff10d12d0de386829ae7ef22b3c6367c94d7fe1e1cdd7dcbff364e35f77c9d8b09f3cd69236b2f383f33301fd
7
- data.tar.gz: 46533e90e0ec292657c2db70323b2643b681800942bd89e0735d880a7a99bb2fd4cfa9a0e72411b00ed84d885a9dc04abd795d2a03cc94666e16e99bc098d402
6
+ metadata.gz: 50876af1368b52bdabdd1cb4b2f6f85a2c1121c98f24aa0d6f415152edeadf127981f804d6cf2d3b72eff7d8f9cbff3056caa6529b5f3dfd435638fc1ac564c1
7
+ data.tar.gz: 6dfded8fd06823e2140020c541ce138525bde7c2e7fe6bdfd6b00d2f891069ecc94421fc2a283a8e21cd56e834febbdbb639a7a8afaaebc936274887da39a57c
@@ -1,5 +1,14 @@
1
1
  ## master
2
2
 
3
+ ## v1.2.3
4
+
5
+ * Sprockets ~= 3.0 support
6
+
7
+ ## v1.2.2
8
+
9
+ * Sprockets ~= 3.0 support
10
+ * Support default parameters specified in route.rb file
11
+
3
12
  ## v1.2.1
4
13
 
5
14
  * Fixes for Rails 5
@@ -1,3 +1,3 @@
1
1
  <%# encoding: UTF-8 %>
2
- <% depend_on "file://#{Rails.root.join 'config', 'routes.rb'}" if JsRoutes::SPROCKETS3 %>
2
+ <% depend_on "#{Rails.root.join 'config', 'routes.rb'}" if JsRoutes::SPROCKETS3 %>
3
3
  <%= JsRoutes.assert_usable_configuration! && JsRoutes.generate %>
@@ -4,10 +4,10 @@ class JsRoutes
4
4
  SPROCKETS3 = Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new('3.0.0')
5
5
  class Engine < ::Rails::Engine
6
6
 
7
- config.after_initialize do
8
- routes = Rails.root.join('config', 'routes.rb').to_s
7
+ initializer 'js-routes.dependent_on_routes', after: "sprockets.environment" do
9
8
 
10
9
  if Rails.application.assets.respond_to?(:register_preprocessor)
10
+ routes = Rails.root.join('config', 'routes.rb').to_s
11
11
  Rails.application.assets.register_preprocessor 'application/javascript', :'js-routes_dependent_on_routes' do |ctx,data|
12
12
  ctx.depend_on(routes) if ctx.logical_path == 'js-routes'
13
13
  data
@@ -1,3 +1,3 @@
1
1
  class JsRoutes
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -76,7 +76,7 @@ describe JsRoutes do
76
76
 
77
77
  describe "compiled javascript asset" do
78
78
  if JsRoutes::SPROCKETS3
79
- let(:routes_path){ "file://#{Rails.root.join 'config', 'routes.rb'}" }
79
+ let(:routes_path){ "#{Rails.root.join 'config', 'routes.rb'}" }
80
80
  before { expect(self).to receive(:depend_on).with routes_path }
81
81
  end
82
82
  subject { ERB.new(File.read("app/assets/javascripts/js-routes.js.erb")).result(binding) }
@@ -58,7 +58,6 @@ describe "after Rails initialization" do
58
58
  context "the preprocessor" do
59
59
  before(:each) do
60
60
  path = Rails.root.join('config','routes.rb').to_s
61
- path = "file://#{path}" if JsRoutes::SPROCKETS3
62
61
  if sprockets_v3?
63
62
  expect_any_instance_of(Sprockets::Context).to receive(:depend_on).with(path)
64
63
  else
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.2
4
+ version: 1.2.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: 2016-01-12 00:00:00.000000000 Z
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties