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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e28537d7bdee27d307e39b030c870ab175e4fc7f
|
4
|
+
data.tar.gz: 3f1308da8cb157c5d1ac715b3ad2d668100ad782
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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]
|
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
|
data/middleman-imgix.gemspec
CHANGED
data/spec/features/imgix_spec.rb
CHANGED
@@ -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
|
99
|
-
|
100
|
-
|
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.
|
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:
|