sprite-factory-custom 1.6.4.1 → 1.6.4.2

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
  SHA1:
3
- metadata.gz: 4a42eab2aa620a1afc021ee985aeb85d1e1850cf
4
- data.tar.gz: 7cb579feff9af1c37d6b5aa00f8c79d4b6d633da
3
+ metadata.gz: acdd506066ca2481fb68d44b9559fb608f28cec6
4
+ data.tar.gz: 153e91bc54d8fc96976fbcfe393e902d8c2b2987
5
5
  SHA512:
6
- metadata.gz: 45bb5dce76022a25d45c385767bc9a3b96b4ac201eb47bee8d35e6b31b2c319a85d50633a11fd4cb9854f6b0a7fcf782d90c45e2800074954a75082a16c99387
7
- data.tar.gz: 499e3ed275775a16fe1c90e21696c909ea28dda7149384ec0d30b7cb15bf48b35c30938c2370ac2f8ac82e515ecef1894f168d5663ff6e98483d9867c54df7ae
6
+ metadata.gz: 30b1edcf0f19fecbb19e710f2fb51b824a4d3dea76ec60241e6b0bfc21af98ea129e932d938db05336d40602ca633d093dd592529946f6c1b76b955989835313
7
+ data.tar.gz: 7c8cf62d283d5130721c2b6bda41abf6fbd67ea47f3a3f24ac9c2a4cc37a8af9901f23ef7fd7562d000d2fe14000e66d32db2d6a43c9824f2cb30bd58386528a
data/bin/sf CHANGED
@@ -33,6 +33,7 @@ nocomments_help = "suppress comments in generated stylesheet"
33
33
  custom_styles_help = "Add custom styles for each sprites (E.g.: --custom-styles='display: inline-block;'"
34
34
  retina_help = "create 50% smaller images & css as well"
35
35
  media_query_help = "wrap generated css with media query css selector"
36
+ prevent_caching_help = "Add timestamp to image url to prevent caching"
36
37
 
37
38
  op.on("--layout [ORIENTATION]", layout_help) {|value| options[:layout] = value }
38
39
  op.on("--style [STYLE]", style_help) {|value| options[:style] = value }
@@ -48,6 +49,7 @@ op.on("--margin [PIXELS]", margin_help) {|value| options[:margi
48
49
  op.on("--nocomments", nocomments_help) {|value| options[:nocomments] = true }
49
50
  op.on("--retina", retina_help) {|value| options[:retina] = true }
50
51
  op.on("--media_query", media_query_help) {|value| options[:media_query] = true }
52
+ op.on("--prevent_caching", prevent_caching_help) {|value| options[:prevent_caching_help] = true }
51
53
 
52
54
  begin
53
55
  op.parse!(ARGV)
@@ -2,7 +2,7 @@ module SpriteFactory
2
2
 
3
3
  #----------------------------------------------------------------------------
4
4
 
5
- VERSION = "1.6.4.1"
5
+ VERSION = "1.6.4.2"
6
6
  SUMMARY = "Automatic CSS sprite generator"
7
7
  DESCRIPTION = "[tam-vo/sprite-factory v#{VERSION}] Combines individual images from a directory into a single sprite image file and creates an appropriate CSS stylesheet"
8
8
  LIB = File.dirname(__FILE__)
@@ -83,6 +83,10 @@ module SpriteFactory
83
83
 
84
84
  private
85
85
 
86
+ def prevent_caching?
87
+ config[:prevent_caching]
88
+ end
89
+
86
90
  def media_query?
87
91
  config[:media_query]
88
92
  end
@@ -59,6 +59,7 @@ only screen and (min-device-pixel-ratio: 1.5) {"
59
59
  def self.generate(style_name, selector, url, images, custom_styles, config, max)
60
60
  styles = []
61
61
  divider = config[:retina] ? 2 : 1
62
+ url = "#{url}?t=#{Time.now.to_i}" if config[:prevent_caching]
62
63
  images.each do |image|
63
64
  attr = [
64
65
  "width: #{image[:cssw] / divider}px",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprite-factory-custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.4.1
4
+ version: 1.6.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Gordon
@@ -39,7 +39,7 @@ dependencies:
39
39
  - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
- description: '[tam-vo/sprite-factory v1.6.4.1] Combines individual images from a directory
42
+ description: '[tam-vo/sprite-factory v1.6.4.2] Combines individual images from a directory
43
43
  into a single sprite image file and creates an appropriate CSS stylesheet'
44
44
  email:
45
45
  - jake@codeincomplete.com