sprite 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/sprite/builder.rb +3 -2
- data/lib/sprite/image_writer.rb +3 -3
- data/sprite.gemspec +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/lib/sprite/builder.rb
CHANGED
@@ -145,7 +145,7 @@ module Sprite
|
|
145
145
|
|
146
146
|
# if no image configs are detected, set some intelligent defaults
|
147
147
|
def default_images
|
148
|
-
sprites_path = image_source_path("sprites")
|
148
|
+
sprites_path = File.expand_path(image_source_path("sprites"))
|
149
149
|
collection = []
|
150
150
|
|
151
151
|
if File.exists?(sprites_path)
|
@@ -165,6 +165,7 @@ module Sprite
|
|
165
165
|
}
|
166
166
|
end
|
167
167
|
end
|
168
|
+
|
168
169
|
collection
|
169
170
|
end
|
170
171
|
|
@@ -174,7 +175,7 @@ module Sprite
|
|
174
175
|
@images.each do |image|
|
175
176
|
# expand out all the globs
|
176
177
|
image['sources'] = image['sources'].to_a.map{ |source|
|
177
|
-
Dir.glob(image_source_path(source))
|
178
|
+
Dir.glob(File.expand_path(image_source_path(source)))
|
178
179
|
}.flatten.compact
|
179
180
|
end
|
180
181
|
end
|
data/lib/sprite/image_writer.rb
CHANGED
@@ -3,19 +3,19 @@ module Sprite
|
|
3
3
|
def initialize(config)
|
4
4
|
@config = config
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
def write(image, name, format, quality = nil, background_color = nil)
|
8
8
|
# set up path
|
9
9
|
path = image_output_path(name, format)
|
10
10
|
FileUtils.mkdir_p(File.dirname(path))
|
11
|
-
|
11
|
+
|
12
12
|
# write sprite image file to disk
|
13
13
|
image.write(path) {
|
14
14
|
self.quality = quality unless quality.nil?
|
15
15
|
self.background_color = background_color unless background_color.nil?
|
16
16
|
}
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
# get the disk path for a location within the image output folder
|
20
20
|
def image_output_path(name, format, relative = false)
|
21
21
|
path_parts = []
|
data/sprite.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-12-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash:
|
130
|
+
hash: 1703190802677343372
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
none: false
|
133
133
|
requirements:
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
segments:
|
138
138
|
- 0
|
139
|
-
hash:
|
139
|
+
hash: 1703190802677343372
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project: none
|
142
142
|
rubygems_version: 1.8.21
|