rails_amp 0.2.1 → 0.2.2

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: bcd04bc01df2d7b818f2959a60e3469a2bf7451c
4
- data.tar.gz: e3a1e7c19991a40b6ad33537c7cb35c39e06e3e1
3
+ metadata.gz: 3c9eda5090bae1acecd02f009630c245fb9776c1
4
+ data.tar.gz: a771a2e7dc3fb38d2bd7dd34f78496c907433238
5
5
  SHA512:
6
- metadata.gz: 9f5319b36567dffe4dd387879acc16ca26dffa76e786c9deea22fbf40d035858e55926d4dea3807fd6658ddd8ddcfb64129e0b92ec5aa87c6aa6481325d491f1
7
- data.tar.gz: 4271f7f55e3d07f35bcc9e746191b8ae04cdd5527188cdf18bcc7d2b55db01a8ed0ecc9ce2b99bffe16a429bb1732a3752c69a948f9c39341b2924253dd0ef55
6
+ metadata.gz: 09f90ca198c68fb19457b767a5c63230ae441c04a037d788f46f44c793b47f26a561c1869afff05c694f4c14a7186a344d72222af8559b7ec1c26d8fbcfca002
7
+ data.tar.gz: 1f51bb6bc2188567cc615b6511d8f413209ff584f3dbce9c88fd874e8a02a1e1a12879f1e2afebf0daad218c05a0b36cdba4de5edf54208fc20f00465f1e5691
@@ -1,3 +1,3 @@
1
1
  module RailsAmp
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -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 fallback heights layout media noloading on placeholder sizes
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.1
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-03-25 00:00:00.000000000 Z
11
+ date: 2017-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails