rails_amp 0.2.1 → 0.2.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c9eda5090bae1acecd02f009630c245fb9776c1
|
|
4
|
+
data.tar.gz: a771a2e7dc3fb38d2bd7dd34f78496c907433238
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 09f90ca198c68fb19457b767a5c63230ae441c04a037d788f46f44c793b47f26a561c1869afff05c694f4c14a7186a344d72222af8559b7ec1c26d8fbcfca002
|
|
7
|
+
data.tar.gz: 1f51bb6bc2188567cc615b6511d8f413209ff584f3dbce9c88fd874e8a02a1e1a12879f1e2afebf0daad218c05a0b36cdba4de5edf54208fc20f00465f1e5691
|
data/lib/rails_amp/version.rb
CHANGED
|
@@ -4,9 +4,11 @@ module RailsAmp
|
|
|
4
4
|
module ViewHelpers
|
|
5
5
|
module ImageTagHelper
|
|
6
6
|
# ref: https://www.ampproject.org/docs/reference/components/amp-img
|
|
7
|
-
AMP_IMG_PERMITTED_ATTRIBUTES = %w
|
|
8
|
-
src srcset alt attribution height width
|
|
9
|
-
|
|
7
|
+
AMP_IMG_PERMITTED_ATTRIBUTES = %w[
|
|
8
|
+
src srcset alt attribution height width
|
|
9
|
+
fallback heights layout media noloading on placeholder sizes
|
|
10
|
+
class
|
|
11
|
+
].freeze
|
|
10
12
|
|
|
11
13
|
# ref: https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/asset_tag_helper.rb#L228
|
|
12
14
|
def amp_image_tag(source, options={})
|
|
@@ -229,8 +229,8 @@ describe Admin::UsersController do
|
|
|
229
229
|
|
|
230
230
|
it 'has amp-img tag' do
|
|
231
231
|
get 'index', format: RailsAmp.default_format.to_s
|
|
232
|
-
expect(image_tag('rails.png', size: '30x20', border: '0')).to match(
|
|
233
|
-
%r{(<amp-img src="/(images|assets)/rails-?\w*?.png" alt="Rails" width="30" height="20" layout="fixed" /></amp-img>)|(<amp-img alt="Rails" height="20" layout="fixed" src="/(images|assets)/rails-?\w*?.png" width="30" /></amp-img>)}
|
|
232
|
+
expect(image_tag('rails.png', size: '30x20', border: '0', class: 'a_class')).to match(
|
|
233
|
+
%r{(<amp-img class="a_class" src="/(images|assets)/rails-?\w*?.png" alt="Rails" width="30" height="20" layout="fixed" /></amp-img>)|(<amp-img alt="Rails" class="a_class" height="20" layout="fixed" src="/(images|assets)/rails-?\w*?.png" width="30" /></amp-img>)}
|
|
234
234
|
)
|
|
235
235
|
expect(image_tag('rails.png')).to match(
|
|
236
236
|
%r{(<amp-img src="/(images|assets)/rails-?\w*?.png" alt="Rails" width="50" height="64" layout="fixed" /></amp-img>)|(<amp-img alt="Rails" height="64" layout="fixed" src="/(images|assets)/rails-?\w*?.png" width="50" /></amp-img>)}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_amp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Takafumi Yamano
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|