rails-pwa 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: d8581d3545b70371f9fe94f866bb8e56b49b3045358e27c9b63e54ee84e1c803
4
- data.tar.gz: a1909235a41e830701e06aa1c4df72ed51ea099e8b7d354be39a907aa03fc8cf
3
+ metadata.gz: f802072a313cd5f6d47633bfabf0c44f7c2ef1e8621acb56bff5b0c9b7c78057
4
+ data.tar.gz: 11f39b91c90a15c6b9fc5790086119cdac01b34ee493373fea40778c28689109
5
5
  SHA512:
6
- metadata.gz: 8aa9c5da1c29ffb37ef21e566533e8611075102e1678a9358549d952647da3cca90c0cf30799de33085418438346220da7e47ccc7591448cf050fe67f1b306bf
7
- data.tar.gz: 17363f16ec7a6d64d4cfcbad5246a3e208b5a2c92c09f825139f64c4de94062945ee8664fef596b7302e8c90708537d044f933a37463dbc2cd0ff3790b12ef90
6
+ metadata.gz: e62ad9f797ad72186ee3f7e771eae0f320e7213fc4690a26bd4f71e08281ffc9652fa5f8ab355e1cad6d7e4802f6c24030fc5f4a321ac8a0478f0d00198d6311
7
+ data.tar.gz: 7d912172bda4f5008d49c29d843f986069b3e7a2494f851be284cc9160a00b217ffa78bd2054228fc373d91af48ad4841e8b5c572505a27334b03d59450060d6
@@ -3,10 +3,10 @@ module Rails
3
3
  class Interceptor
4
4
  attr_reader :app, :server, :scripts
5
5
 
6
- def initialize(app, options = {})
7
- @app = app
8
- @server = ::Rack::File.new(Rails.root + "public")
9
- @scripts = { "/worker.js" => "worker.js" }
6
+ def initialize(app, scripts:, **options)
7
+ @app = app
8
+ @server = ::Rack::File.new(Rails.root + "public")
9
+ @scripts = scripts.dup
10
10
  end
11
11
 
12
12
  def call(env)
@@ -1,7 +1,12 @@
1
1
  require 'rails/pwa/interceptor'
2
2
 
3
3
  class Rails::PWA::Railtie < ::Rails::Railtie
4
+ config.pwa = ActiveSupport::OrderedOptions.new
5
+ config.pwa.scripts = {
6
+ "/worker.js" => "worker.js"
7
+ }
8
+
4
9
  initializer "rails-pwa.middleware" do |app|
5
- app.config.app_middleware.use Rails::PWA::Interceptor
10
+ app.config.app_middleware.use Rails::PWA::Interceptor, scripts: app.config.pwa.scripts
6
11
  end
7
12
  end
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module PWA
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
data/lib/rails/pwa.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "rails/pwa/railtie"
2
2
 
3
3
  module Rails
4
- module Pwa
5
- # Your code goes here...
4
+ module PWA
6
5
  end
7
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pwa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Ward
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-27 00:00:00.000000000 Z
11
+ date: 2019-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails