Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sprite Factory (v1.7.1)
Sprite Factory (v1.7.3)
=======================

The sprite factory is a ruby library that can be used to generate
Expand Down
10 changes: 10 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
June 14th 2021 - v1.7.3
---------------------------

* removed deprecated method `has_rdoc` from gemspec. This method has no replacement and will be removed in Rubygems 4.

February 26th 2021 - v1.7.2
---------------------------

* replaced deprecated method `opacity`, so that this gem can be used with rmagick >= 4.0.0.

September 9th 2015 - v1.7.1
---------------------------

Expand Down
2 changes: 1 addition & 1 deletion lib/sprite_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module SpriteFactory

#----------------------------------------------------------------------------

VERSION = "1.7.1"
VERSION = "1.7.3"
SUMMARY = "Automatic CSS sprite generator"
DESCRIPTION = "Combines individual images from a directory into a single sprite image file and creates an appropriate CSS stylesheet"
LIB = File.dirname(__FILE__)
Expand Down
2 changes: 1 addition & 1 deletion lib/sprite_factory/library/rmagick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.load(files)

def self.create(filename, images, width, height)
target = Magick::Image.new(width,height)
target.opacity = Magick::QuantumRange
target.alpha(Magick::TransparentAlphaChannel)
images.each do |image|
target.composite!(image[:image], image[:x], image[:y], Magick::SrcOverCompositeOp)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sprite_factory/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def run!(&block)
css = []
css << style_comment(header) unless nocomments? # header comment
css << style(selector, css_url, images, &block) # generated styles
css << IO.read(custom_style_file) if File.exists?(custom_style_file) # custom styles
css << IO.read(custom_style_file) if File.exist?(custom_style_file) # custom styles
css = css.join("\n")

create_sprite(images, max[:width], max[:height])
Expand Down
1 change: 0 additions & 1 deletion sprite_factory.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rmagick'
s.add_development_dependency 'chunky_png'

s.has_rdoc = false
s.extra_rdoc_files = ["README.md"]
s.rdoc_options = ["--charset=UTF-8"]
s.files = `git ls-files `.split("\n")
Expand Down
8 changes: 4 additions & 4 deletions test/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ def test_generate_sprite_with_nocss
output = File.basename(REGULAR_PATH)
with_clean_output do

assert_equal(false, File.exists?(output_path(output + ".png")), "preconditions")
assert_equal(false, File.exists?(output_path(output + ".css")), "preconditions")
assert_equal(false, File.exist?(output_path(output + ".png")), "preconditions")
assert_equal(false, File.exist?(output_path(output + ".css")), "preconditions")

css = SpriteFactory.run!(REGULAR_PATH, {:nocss => true})

assert_equal(true, File.exists?(output_path(output + ".png")), "output sprite IMAGE should exist")
assert_equal(false, File.exists?(output_path(output + ".css")), "output sprite CSS should NOT exist")
assert_equal(true, File.exist?(output_path(output + ".png")), "output sprite IMAGE should exist")
assert_equal(false, File.exist?(output_path(output + ".css")), "output sprite CSS should NOT exist")
assert_equal(IO.read(reference_path(output+".css")), css, "expected return value from #run! to provide generated CSS content")

assert_reference_image(output + ".png")
Expand Down