compass-magick 0.1.5 → 0.1.6
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.
- data/lib/magick.rb +1 -1
- data/lib/magick/canvas.rb +7 -3
- data/lib/magick/functions/canvas.rb +1 -1
- data/lib/magick/functions/sprites.rb +2 -2
- data/lib/plugins/phantom.rb +1 -1
- metadata +6 -6
data/lib/magick.rb
CHANGED
@@ -32,7 +32,7 @@ module Compass::Magick
|
|
32
32
|
# The current version of Compass Magick. This value is updated manually on
|
33
33
|
# release. If you are using a Git clone, the version will always end with
|
34
34
|
# '.git'.
|
35
|
-
VERSION = '0.1.
|
35
|
+
VERSION = '0.1.6'
|
36
36
|
|
37
37
|
# The locations where plug-ins are located. These paths are scanned for
|
38
38
|
# *.rb files and loaded in order.
|
data/lib/magick/canvas.rb
CHANGED
@@ -34,7 +34,7 @@ module Compass::Magick
|
|
34
34
|
# the Canvas instance.
|
35
35
|
# @overload initialize(path, *commands)
|
36
36
|
# @param [Sass::Script::String] path The path to the image, relative to
|
37
|
-
# the configured <tt>
|
37
|
+
# the configured <tt>generated_images_path</tt> or <tt>images_path</tt>.
|
38
38
|
# @param [Array<Command>] commands The list of commands to execute on
|
39
39
|
# the Canvas instance.
|
40
40
|
# @overload initialize(width, height, *commands)
|
@@ -118,8 +118,12 @@ module Compass::Magick
|
|
118
118
|
canvas = ChunkyPNG::Canvas.from_file(path)
|
119
119
|
end
|
120
120
|
else
|
121
|
-
|
122
|
-
|
121
|
+
basename = source.value.split('?').shift()
|
122
|
+
path = File.join(Compass.configuration.generated_images_path, basename)
|
123
|
+
if not File.exists?(path)
|
124
|
+
path = File.join(Compass.configuration.images_path, basename)
|
125
|
+
end
|
126
|
+
canvas = ChunkyPNG::Canvas.from_file(path)
|
123
127
|
end
|
124
128
|
inherit canvas, false
|
125
129
|
else
|
@@ -21,7 +21,7 @@ module Compass::Magick
|
|
21
21
|
# the Canvas instance.
|
22
22
|
# @overload magick_canvas(path, *commands)
|
23
23
|
# @param [Sass::Script::String] path The path to the image, relative
|
24
|
-
# to the configured <tt>
|
24
|
+
# to the configured <tt>generated_images_path</tt> or <tt>images_path</tt>.
|
25
25
|
# @param [Array<Command>] commands The list of commands to execute on
|
26
26
|
# the Canvas instance.
|
27
27
|
# @overload magick_canvas(width, height, *commands)
|
@@ -18,10 +18,10 @@ module Compass::Magick
|
|
18
18
|
Compass::Magick::Utils.assert_type 'canvas', canvas, ChunkyPNG::Canvas
|
19
19
|
extension = '.png'
|
20
20
|
filename = basename.value.chomp(extension) + extension
|
21
|
-
filepath = File.join(Compass.configuration.
|
21
|
+
filepath = File.join(Compass.configuration.generated_images_path, filename)
|
22
22
|
FileUtils.mkpath(File.dirname(filepath))
|
23
23
|
canvas.save(filepath, :best_compression)
|
24
|
-
|
24
|
+
generated_image_url(Sass::Script::String.new(filename))
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/plugins/phantom.rb
CHANGED
@@ -93,7 +93,7 @@ module Compass::Magick
|
|
93
93
|
elements.push(instructions.join('; '))
|
94
94
|
end
|
95
95
|
basename = "~magick-phantom-#{ rand(36**8).to_s(36) }.png"
|
96
|
-
filename = File.join(Compass.configuration.
|
96
|
+
filename = File.join(Compass.configuration.generated_images_path, basename)
|
97
97
|
command = [Compass.configuration.phantom_executable, Compass.configuration.phantom_script]
|
98
98
|
command = command.concat([width.to_s, height.to_s])
|
99
99
|
command = command.concat(elements)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-magick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 6
|
10
|
+
version: 0.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stan Angeloff
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-04
|
18
|
+
date: 2012-07-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: compass
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash: -
|
28
|
+
hash: -3214850198
|
29
29
|
segments:
|
30
30
|
- 0
|
31
31
|
- 11
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
requirements: []
|
135
135
|
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 1.8.
|
137
|
+
rubygems_version: 1.8.21
|
138
138
|
signing_key:
|
139
139
|
specification_version: 3
|
140
140
|
summary: Dynamic image generation for Compass using ChunkyPNG/PhantomJS.
|