middleman-imgix 1.0.2 → 1.0.3

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: 40e02fb17c11022299d5772a0f4ed95798f75113
4
- data.tar.gz: 2ea22cee448d890cf52708fca022f64fdc5beb69
3
+ metadata.gz: e28537d7bdee27d307e39b030c870ab175e4fc7f
4
+ data.tar.gz: 3f1308da8cb157c5d1ac715b3ad2d668100ad782
5
5
  SHA512:
6
- metadata.gz: eb8b1efec59bb40c2ddf376d7ab7e81338954190dec756f2998242e724c390178c7e63eab8f9a75db3800bda70b1a922882c682b86058415d82ffe910f9abcba
7
- data.tar.gz: 8451d2a1a9e9ca5127e83058399be6bab909f175a2f0559c991e03c9e095a549d5510992edc4c8b205caa38d4bacdb913aa64c326070b8a97f6f2c06b5ad5a57
6
+ metadata.gz: ba713e7d78f80f4ac21ce861f272fe962573433b3384dacc9625b5c888acc6c9765769b8c90f73a86afe3a9845d13dd15eaaffaa4a556075bd5b9ddbc244f3d0
7
+ data.tar.gz: 49ba3ab2a4d4278ff04edcb061086eb24eb41bb99ff70e9ce3cbbff437e30238c827575de46863810e076de28effa84338206e32d6f7c654bfe40e4d466ca580
@@ -46,7 +46,7 @@ class Middleman::Imgix < ::Middleman::Extension
46
46
  def image_tag(path, params={})
47
47
  if imgix_options.imgix_js_version && imgix_image?(path)
48
48
  version = imgix_options.imgix_js_version.to_i
49
- params[:class] = 'imgix-fluid' if version == 2
49
+ params[:class] ||= 'imgix-fluid' if version == 2
50
50
  src = version == 2 ? 'data-src=' : 'ix-src='
51
51
  super(path, params).gsub('src=', src)
52
52
  else
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'middleman-imgix'
5
- gem.version = '1.0.2'
5
+ gem.version = '1.0.3'
6
6
  gem.licenses = ['MIT']
7
7
  gem.authors = ['Big Cartel']
8
8
  gem.email = ['dev@bigcartel.com']
@@ -90,14 +90,20 @@ describe "middleman-imgix", type: :feature do
90
90
  expect(page.body).to include(%{<img src="https://images.example.com/images/test.png?ixlib=rb-1.1.0&auto=format" alt="Test" />})
91
91
  end
92
92
 
93
+ it "should support imgix.js v3" do
94
+ visit_app('host: "images.example.com", imgix_js_version: 3')
95
+ expect(page.body).to include(%{<img ix-src="https://images.example.com/images/test.png?ixlib=rb-1.1.0&auto=format" alt="Test" />})
96
+ end
97
+
93
98
  it "should support imgix.js v2" do
94
99
  visit_app('host: "images.example.com", imgix_js_version: 2')
95
100
  expect(page.body).to include(%{<img data-src="https://images.example.com/images/test.png?ixlib=rb-1.1.0&auto=format" class="imgix-fluid" alt="Test" />})
96
101
  end
97
102
 
98
- it "should support imgix.js v3" do
99
- visit_app('host: "images.example.com", imgix_js_version: 3')
100
- expect(page.body).to include(%{<img ix-src="https://images.example.com/images/test.png?ixlib=rb-1.1.0&auto=format" alt="Test" />})
103
+ it "should support imgix.js v2 with a custom class" do
104
+ app("activate :imgix, host: 'images.example.com', imgix_js_version: 2")
105
+ visit '/imgix_js_2_class.html'
106
+ expect(page.body).to include(%{<img data-src="https://images.example.com/images/test.png?ixlib=rb-1.1.0&auto=format" class="myclass imgix-fluid imgix-fluid-bg" alt="Test" />})
101
107
  end
102
108
  end
103
109
 
@@ -0,0 +1 @@
1
+ <%= image_tag 'test.png', class: 'myclass imgix-fluid imgix-fluid-bg' %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-imgix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
@@ -59,6 +59,7 @@ files:
59
59
  - spec/fixtures/app/source/images/test.jpg
60
60
  - spec/fixtures/app/source/images/test.png
61
61
  - spec/fixtures/app/source/imgix.html.erb
62
+ - spec/fixtures/app/source/imgix_js_2_class.html.erb
62
63
  - spec/spec_helper.rb
63
64
  homepage: https://github.com/bigcartel/middleman-imgix
64
65
  licenses: