pwa 1.0.0 → 1.1.0

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
  SHA256:
3
- metadata.gz: b7b6a1ba7a840009d8ff9cfd2d05199587fc08c0641bd3187c2ff4d9a6a74f47
4
- data.tar.gz: 245d7d74734b5c6b80c1c2388de4224b283b7a2f7dcaf34f60991a2d2daf60d8
3
+ metadata.gz: a5ad268d8a098b5d4c50110230c9234f40e443287e1855b0b2d5572e52c8a3fd
4
+ data.tar.gz: ab8d6373ab6ddd6960c375ade411a5d0685625fc44a1eabc50b523a161a885be
5
5
  SHA512:
6
- metadata.gz: 95367870f106bcd063e895b8791b38c9750593841c8981094c5e0c0f70813d7f6ad68ff671f624648237c85ba032aa82836018c318df87481996513e000edbcd
7
- data.tar.gz: 70625d53a80f4290f2591ed9cfddeb197590888576178fdec71348b4ef76a1aff64ba5286ee10674c4bccca5c3f0cb8c832235e318974078aebab5e6ed5da6d6
6
+ metadata.gz: 43f80bfa22035d90619a47223e3fb3336c20f338f49d4008447fa7fe72405cecd61add2789890c9af11681746b5b6ecdb8bfc0a0a8ed0429530ef087be1c5be6
7
+ data.tar.gz: b055f9a6f858d820e5113ca665463622e90ab460fba87edf3638d7096446a5aecd6c4705e2c8cbad99b72b98a3310d03998de76d7c1b7ad8dd2213db84d25cf6
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 1.1.0 - 2018/01/17
8
+
9
+ * features
10
+ * generate a `manifest.json` file by running the generator
11
+
7
12
  ### 1.0.0 - 2018/01/14
8
13
 
9
14
  * initial release
data/README.md CHANGED
@@ -23,6 +23,8 @@ If a PWA is not enough and you want to bring your Web App into the store - check
23
23
 
24
24
  * [Installation](#installation)
25
25
  * [Usage](#usage)
26
+ * [Manifest](#manifest)
27
+ * [Service worker](#service-worker)
26
28
  * [To Do](#to-do)
27
29
  * [Contributing](#contributing)
28
30
  * [Contributors](#contributors)
@@ -75,7 +77,21 @@ mount Pwa::Engine, at: '/pwa'
75
77
 
76
78
  ## Usage
77
79
 
78
- ...
80
+ ### Manifest
81
+
82
+ The generator generates a `manifest.json` file located in the `public` directory. You can customize it to your liking.
83
+
84
+ ### Service worker
85
+
86
+ The generator also generates a service worker which caches visited pages to the local storage so they can get accessed even if the device has no network connection.
87
+
88
+ You can customize the page that shows up when a requested page has not been cached by editing the contents of `app/views/pwa/offline/index.html.erb`
89
+
90
+ **Note:** When using Progressive Web Apps for Rails with a service worker provided by a third party service like OneSignal, remove the require statement from `app/assets/javascripts/application.js` and manually import your apps service worker in the third party script:
91
+
92
+ ```js
93
+ importScripts('https://example.com/pwa-sw.js');
94
+ ```
79
95
 
80
96
  ---
81
97
 
@@ -12,6 +12,10 @@ class PwaGenerator < Rails::Generators::Base
12
12
  template 'view.html.erb', 'app/views/pwa/offline/index.html.erb'
13
13
  end
14
14
 
15
+ def create_manifest
16
+ template 'manifest.json', 'public/manifest.json'
17
+ end
18
+
15
19
  def create_service_worker
16
20
  template 'service_worker.js', 'public/pwa-sw.js'
17
21
  end
@@ -0,0 +1,22 @@
1
+ {
2
+ "short_name": "",
3
+ "name": "",
4
+ "start_url": "/",
5
+ "scope": "/",
6
+ "display": "standalone",
7
+ "background_color": "#FFFFFF",
8
+ "description": "",
9
+ "theme_color": "#000000",
10
+ "orientation": "portrait",
11
+ "dir": "rtl",
12
+ "lang": "en-US",
13
+ "icons": [{
14
+ "src": "/70x70.png",
15
+ "sizes": "70x70",
16
+ "type": "image/png"
17
+ }, {
18
+ "src": "/192x192.png",
19
+ "sizes": "192x192",
20
+ "type": "image/png"
21
+ }]
22
+ }
data/lib/pwa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Pwa
2
2
 
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Hübotter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-14 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.52'
55
- description: Progressive Web Apps for Rails.
55
+ description: Progressive Web Apps for Rails
56
56
  email: me@jonhue.me
57
57
  executables: []
58
58
  extensions: []
@@ -64,6 +64,7 @@ files:
64
64
  - app/controllers/pwa/offline_controller.rb
65
65
  - config/routes.rb
66
66
  - lib/generators/pwa_generator.rb
67
+ - lib/generators/templates/manifest.json
67
68
  - lib/generators/templates/service_worker.js
68
69
  - lib/generators/templates/view.html.erb
69
70
  - lib/pwa.rb