amp-html 0.7.12 → 0.7.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -7
- data/lib/amp-html/components/docs/README.md +1 -1
- data/lib/amp-html/components/install.rb +5 -5
- data/lib/amp-html/configuration.rb +1 -1
- data/lib/amp-html/version.rb +1 -1
- data/lib/generators/templates/install/amphtml.yml.erb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 044ef67d3c0544122fd4ab014a6aa97a9a8e6d85
|
4
|
+
data.tar.gz: 3e20be0f58bc5e9fad74af020095b3d3a06cf142
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1aafe515c6b79b370ee06e5925e96f52d0fd92ec44b5df3a67fb9a6610a44b3f6d9a678c0ca1ce0e5d4dac42620fe0b1ac84e5dd1e60c8450a1175ded4c6b426
|
7
|
+
data.tar.gz: 643d77c41ef0c6f117d76c6b902855805410ee563d01de198253e386614ce265af2fe4a0f825e1c47e7be25e3c77826ef4930d8d2bf14b58a5a5e0894e5701f6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -37,7 +37,7 @@ Use the powerful features of AMP to make your Rails app consistently fast, beaut
|
|
37
37
|
|
38
38
|
### Quick info
|
39
39
|
|
40
|
-
#### Latest release: 0.7.
|
40
|
+
#### Latest release: 0.7.13 (Pre-release)
|
41
41
|
|
42
42
|
[**Changelog**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md), [Grab it from Rubygems](https://rubygems.org/gems/amp-html)
|
43
43
|
|
@@ -104,23 +104,23 @@ gem 'amp-html', github: 'https://github.com/slooob/amp-html.git'
|
|
104
104
|
|
105
105
|
AmpHtml comes with three different generators. If you want to bundle them execute:
|
106
106
|
|
107
|
-
$ rails g
|
107
|
+
$ rails g amp_html:bundle
|
108
108
|
|
109
109
|
That will generate all the files you need to create a universal AMP app (recommended).
|
110
110
|
|
111
111
|
If you want to use [SplitView](https://github.com/slooob/amp-html/wiki/Docs:-SplitView) to create views with and without AMP simultaneously, execute instead:
|
112
112
|
|
113
|
-
$ rails g
|
113
|
+
$ rails g amp_html:bundle --split
|
114
114
|
|
115
115
|
To add components ([List of components](https://github.com/slooob/amp-html/blob/master/lib/amp-html/components/docs/README.md)) to the generator simply include the component as an option:
|
116
116
|
|
117
|
-
$ rails g
|
117
|
+
$ rails g amp_html:bundle --analytics --notifications
|
118
118
|
|
119
119
|
You can also run the three generators independently:
|
120
120
|
|
121
|
-
$ rails g
|
122
|
-
$ rails g
|
123
|
-
$ rails g
|
121
|
+
$ rails g amp_html:install
|
122
|
+
$ rails g amp_html:helpers
|
123
|
+
$ rails g amp_html:views
|
124
124
|
|
125
125
|
*Each* of them supports the `--split || -s` option to use **both** regular views and AMP views.
|
126
126
|
To add components, you need to pass them as option to each generator.
|
@@ -6,8 +6,8 @@ module AmpHtml
|
|
6
6
|
class Install
|
7
7
|
|
8
8
|
def self.bundle
|
9
|
-
success1 = system "rails g
|
10
|
-
success2 = system "rails g
|
9
|
+
success1 = system "rails g amp_html:components#{ ' -s' if AmpHtml.split_view }#{ ' -f ' + AmpHtml.raw_format if AmpHtml.raw_format }#{ ' --analytics' if AmpHtml.components && AmpHtml.components.include?('analytics') || AmpHtml.components && AmpHtml.components.include?('notifications') }#{ ' --iframe' if AmpHtml.components && AmpHtml.components.include?('iframe') || AmpHtml.components && AmpHtml.components.include?('javascript') || AmpHtml.components && AmpHtml.components.include?('service_worker') }#{' --notifications' if AmpHtml.components && AmpHtml.components.include?('notifications') }#{ ' --anim' if AmpHtml.components && AmpHtml.components.include?('anim') }#{ ' --ad' if AmpHtml.components && AmpHtml.components.include?('ad') }#{ ' --social' if AmpHtml.components && AmpHtml.components.include?('social') }#{ ' --javascript' if (AmpHtml.components && AmpHtml.components.include?('javascript')) }#{ ' --service_worker' if (AmpHtml.components && AmpHtml.components.include?('service_worker')) }#{ ' --lists' if (AmpHtml.components && AmpHtml.components.include?('lists')) }"
|
10
|
+
success2 = system "rails g amp_html:install --only_initializer#{ ' --javascript' if (AmpHtml.components && AmpHtml.components.include?('javascript')) }"
|
11
11
|
if success1 && success2
|
12
12
|
puts IO.read File.join AmpHtml.root, 'amp-html', 'components', 'templates', 'README.md'
|
13
13
|
else
|
@@ -17,9 +17,9 @@ module AmpHtml
|
|
17
17
|
|
18
18
|
def self.install component
|
19
19
|
if COMPONENTS.include? component
|
20
|
-
success1 = system "rails g
|
21
|
-
success2 = system "rails g
|
22
|
-
success3 = system "rails g
|
20
|
+
success1 = system "rails g amp_html:install#{ ' -s' if AmpHtml.split_view }#{ ' -f ' + AmpHtml.raw_format if AmpHtml.raw_format }#{ ' --analytics' if (AmpHtml.components && AmpHtml.components.include?('analytics')) || AmpHtml.components && AmpHtml.components.include?('notifications') || component == 'analytics' || component == 'notifications' }#{ ' --iframe' if (AmpHtml.components && AmpHtml.components.include?('iframe')) || AmpHtml.components && AmpHtml.components.include?('javascript') || AmpHtml.components && AmpHtml.components.include?('service_worker') || component == 'iframe' || component == 'javascript' || component == 'service_worker' }#{' --notifications' if (AmpHtml.components && AmpHtml.components.include?('notifications')) || component == 'notifications' }#{ ' --anim' if (AmpHtml.components && AmpHtml.components.include?('anim')) || component == 'anim' }#{ ' --ad' if (AmpHtml.components && AmpHtml.components.include?('ad')) || component == 'ad' }#{ ' --social' if (AmpHtml.components && AmpHtml.components.include?('social')) || component == 'social' }#{ ' --javascript' if (AmpHtml.components && AmpHtml.components.include?('javascript')) || component == 'javascript' }#{ ' --service_worker' if (AmpHtml.components && AmpHtml.components.include?('service_worker')) || component == 'service_worker' }#{ ' --lists' if (AmpHtml.components && AmpHtml.components.include?('lists')) || component == 'lists' }"
|
21
|
+
success2 = system "rails g amp_html:components#{ ' -s' if AmpHtml.split_view }#{ ' -f ' + AmpHtml.raw_format if AmpHtml.raw_format }#{ ' --analytics' if (AmpHtml.components && AmpHtml.components.include?('analytics')) || AmpHtml.components && AmpHtml.components.include?('notifications') || component == 'analytics' || component == 'notifications' }#{ ' --iframe' if (AmpHtml.components && AmpHtml.components.include?('iframe')) || AmpHtml.components && AmpHtml.components.include?('javascript') || AmpHtml.components && AmpHtml.components.include?('service_worker') || component == 'iframe' || component == 'javascript' || component == 'service_worker' }#{' --notifications' if (AmpHtml.components && AmpHtml.components.include?('notifications')) || component == 'notifications' }#{ ' --anim' if (AmpHtml.components && AmpHtml.components.include?('anim')) || component == 'anim' }#{ ' --ad' if (AmpHtml.components && AmpHtml.components.include?('ad')) || component == 'ad' }#{ ' --social' if (AmpHtml.components && AmpHtml.components.include?('social')) || component == 'social' }#{ ' --javascript' if (AmpHtml.components && AmpHtml.components.include?('javascript')) || component == 'javascript' }#{ ' --service_worker' if (AmpHtml.components && AmpHtml.components.include?('service_worker')) || component == 'service_worker' }#{ ' --lists' if (AmpHtml.components && AmpHtml.components.include?('lists')) || component == 'lists' }"
|
22
|
+
success3 = system "rails g amp_html:views --only_resources#{ ' --javascript' if (AmpHtml.components && AmpHtml.components.include?('javascript')) || component == 'javascript' }"
|
23
23
|
if success1 && success2 && success3
|
24
24
|
puts "Successfully installed '#{component}' component!"
|
25
25
|
puts IO.read File.join AmpHtml.root, 'amp-html', 'components', 'templates', 'README.md'
|
@@ -162,7 +162,7 @@ module AmpHtml
|
|
162
162
|
begin
|
163
163
|
YAML.load_file 'config/amp-html.yml'
|
164
164
|
rescue Exception
|
165
|
-
warn 'WARNING (AMP): You need to run `rails g
|
165
|
+
warn 'WARNING (AMP): You need to run `rails g amp_html:bundle` first.'
|
166
166
|
exit
|
167
167
|
end
|
168
168
|
end
|
data/lib/amp-html/version.rb
CHANGED
@@ -27,11 +27,11 @@ default: &default
|
|
27
27
|
# ------------
|
28
28
|
|
29
29
|
<% if options[:split] %>
|
30
|
-
## To remove SplitView run `rails g
|
30
|
+
## To remove SplitView run `rails g amp_html:bundle`
|
31
31
|
## Defaults to `false`
|
32
32
|
split_view: true
|
33
33
|
<% else %>
|
34
|
-
# ## To enable SplitView run `rails g
|
34
|
+
# ## To enable SplitView run `rails g amp_html:bundle -s`
|
35
35
|
# ## Defaults to `false`
|
36
36
|
# split_view: true
|
37
37
|
<% end %>
|