middleman-automatic-clowncar 4.0.3 → 4.0.5

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
  SHA256:
3
- metadata.gz: 6cb5f4a1d2d056c1cbb78aeaa7e7664cda1ccf635d2e59f3f212cd3a86120292
4
- data.tar.gz: 64efd1a0055266e1b1088168549cff7235012bba8cccfbcc98ff55c476ef36b5
3
+ metadata.gz: 68e29324f8f705c8c2fd332fa85c7ec674d0b356ebf36bd076248d67b53e9f73
4
+ data.tar.gz: 99ae9b947e2948c86ac43c533e0d777cac2bc8511f44119dc9b8c4a13ca2e818
5
5
  SHA512:
6
- metadata.gz: 39a2c5954571df7fe5bd6cdefb17310ce5e89f10ee7433b47baa134b186820c77deb21d292719fde649536a9549de78182a2dfedcd2b74108325dc8222f280ca
7
- data.tar.gz: 8f0d69e6ec729802644bbbfbb4a31ad48c6fc23e13221a6afef149171fe4b0c225969b6f69a4e18a32117c251bff088d47ec347458ed80889b319760912e4287
6
+ metadata.gz: 7b348d9d9a8cfe81b70d2187086b54cc61c72f7ae0747e049d4c7919de852ab2f8bcd80f05c2847193cb96537430ae8cd25a38b5f93bbb405b9cb717fb4bbdf4
7
+ data.tar.gz: 8a8b2b280f1a6e56b21f0e08a5a71487b1801df9862fb465ee858f42467d6fe9d28a8e552d266f946f493d33e19ece6844bb5dd725bfac7ad6967c81f74dda88
@@ -175,6 +175,6 @@ Feature: Generating SVG clowncars during preview mode
175
175
  And the file "testfile.html" should contain "@media%20screen%20and%20(max-width:200px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/test-image-small.jpg);%7D%7D"
176
176
  And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:201px)%20and%20(max-width:400px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/test-image-medium.jpg);%7D%7D"
177
177
  And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:401px)%20and%20(max-width:600px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/test-image-large.jpg);%7D%7D"
178
- And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:601px)%7Bsvg%7Bbackground-image:url(/photos/test-image/../test-image.jpg);%7D%7D"
178
+ And the file "testfile.html" should contain "@media%20screen%20and%20(min-width:601px)%7Bsvg%7Bbackground-image:url(http://localhost:4567/photos/test-image/../test-image.jpg);%7D%7D"
179
179
 
180
180
 
@@ -75,7 +75,6 @@ module Middleman
75
75
  if uri.host
76
76
  path
77
77
  else
78
-
79
78
  svg_path = File.join(File.dirname(name),File.basename(name,".*"), path)
80
79
 
81
80
  if is_relative
@@ -158,8 +157,6 @@ module Middleman
158
157
 
159
158
 
160
159
  def generate_svg(name, is_relative, options)
161
- #puts "name for generate_svg = #{name}"
162
- #puts "options for generate_svg = #{options}"
163
160
  sizes, width, height = get_image_sizes(name, options)
164
161
 
165
162
  fallback_host = false
@@ -168,8 +165,10 @@ module Middleman
168
165
  if is_relative_url?(test_path)
169
166
  if options.has_key?(:host)
170
167
  fallback_host = options[:host]
171
- elsif app.config[:asset_host]
168
+ elsif app.config[:asset_host] # this is for middleman 2 & 3, (and maybe early 4?)
172
169
  fallback_host = app.config[:asset_host]
170
+ elsif app.extensions[:asset_host] # this is for middleman 4+
171
+ fallback_host = app.extensions[:asset_host].options.host
173
172
  else
174
173
  warn "WARNING: Inline clowncar images require absolute paths. Please set a :host value"
175
174
  end
@@ -236,8 +235,6 @@ module Middleman
236
235
  %Q{<object type="image/svg+xml" style="#{object_style}" data-aspect-ratio="#{width.to_f/height.to_f}" data="#{url}">#{internal}</object>}
237
236
  else
238
237
  data = extensions[:automatic_clowncar].generate_svg(name, true, options)
239
- puts "data ==============="
240
- puts data
241
238
  %Q{<object type="image/svg+xml" style="#{object_style}" data-aspect-ratio="#{width.to_f/height.to_f}" data="data:image/svg+xml,#{automatic_clowncar_escape(data)}">#{internal}</object>}
242
239
  end
243
240
  end
@@ -26,7 +26,7 @@ module Middleman
26
26
  resources = resources - default_resource
27
27
  end
28
28
  dest_path = File.join(@app.root_path,'build', spec[:name])
29
- source = File.exists?(dest_path) ? dest_path : file
29
+ source = File.exist?(dest_path) ? dest_path : file
30
30
  resource_list << Middleman::AutomaticClowncar::ThumbnailResource.new(@app.sitemap,spec[:name],spec[:dimensions],file,@app.root_path,'build',@app.source_dir)
31
31
  #resource_list << Middleman::Sitemap::Resource.new(@app.sitemap, spec[:name], source) unless name == :original
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module MiddlemanAutomaticClowncar
2
- VERSION = "4.0.3"
2
+ VERSION = "4.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-automatic-clowncar
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-27 00:00:00.000000000 Z
11
+ date: 2024-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core