sprite-factory 1.5.0 → 1.5.1

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.
@@ -1,3 +1,7 @@
1
+ (unreleased) - v1.5.1
2
+ ---------------------
3
+ * added a new `:return => :images` option for callers that want access to the detailed `images` hash instead of the generated css content
4
+
1
5
  May 10th 2012 - v1.5.0
2
6
  ----------------------
3
7
  * @halida added a new `margin` option to (optionally) separate images in generated spritesheet to avoid 'bleeding' when browser scales the sprite (e.g. when user increases text size)
@@ -2,7 +2,7 @@ module SpriteFactory
2
2
 
3
3
  #----------------------------------------------------------------------------
4
4
 
5
- VERSION = "1.5.0"
5
+ VERSION = "1.5.1"
6
6
  SUMMARY = "Automatic CSS sprite generator"
7
7
  DESCRIPTION = "Combines individual images from a directory into a single sprite image file and creates an appropriate CSS stylesheet"
8
8
  LIB = File.dirname(__FILE__)
@@ -61,7 +61,11 @@ module SpriteFactory
61
61
  css_file.close
62
62
  end
63
63
 
64
- css # return generated CSS to caller in string form
64
+ if config[:return] == :images
65
+ images # if caller explicitly asked for detailed images hash instead of generated CSS
66
+ else
67
+ css # otherwise, default is to return the generated CSS to caller in string form
68
+ end
65
69
 
66
70
  end
67
71
 
@@ -53,6 +53,8 @@ module SpriteFactory
53
53
  "height: #{image[:cssh]}px",
54
54
  "background: url(#{path}) #{-image[:cssx]}px #{-image[:cssy]}px no-repeat"
55
55
  ]
56
+ image[:path] = path
57
+ image[:selector] = selector
56
58
  image[:style] = send("#{style_name}_style", attr) # make pure style available for (optional) custom rule generators (see usage of yield inside Runner#style)
57
59
  styles << send(style_name, selector, image[:name], attr)
58
60
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 0
9
- version: 1.5.0
8
+ - 1
9
+ version: 1.5.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jake Gordon
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-05-10 00:00:00 -07:00
17
+ date: 2012-06-11 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency