amikula-sprite 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -22,7 +22,7 @@ or via installer: http://github.com/maddox/magick-installer/tree/master
22
22
  Install the `sprite` gem from gemcutter
23
23
 
24
24
  gem sources -a http://gemcutter.org
25
- gem install sprite
25
+ gem install amikula-sprite
26
26
 
27
27
  ## USAGE ##
28
28
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.1.11
data/bin/sprite CHANGED
File without changes
@@ -1,10 +1,27 @@
1
1
  module Sprite
2
2
  module Sass
3
3
  module Extensions
4
+ def self.asset_id(&block)
5
+ @asset_id = block if block
6
+ end
7
+
8
+ def self.query_string_for(asset)
9
+ if @asset_id
10
+ "?#{@asset_id.call(asset)}"
11
+ else
12
+ ''
13
+ end
14
+ end
15
+
16
+ def sprite_path(group)
17
+ path = sprite_builder.image_path(group.value)
18
+ "#{path}#{Sprite::Sass::Extensions.query_string_for(path)}"
19
+ end
20
+
4
21
  def sprite_background(group, image)
5
22
  sprite = sprite_data(group, image)
6
23
  if sprite
7
- sprite_path = sprite_builder.image_path(group.value)
24
+ sprite_path = sprite_path(group)
8
25
  ::Sass::Script::String.new "url('#{sprite_path}') no-repeat #{sprite[:x]}px #{sprite[:y]}px"
9
26
  else
10
27
  ::Sass::Script::String.new ""
@@ -28,11 +45,11 @@ module Sprite
28
45
  end
29
46
 
30
47
  def sprite_image(group)
31
- ::Sass::Script::String.new sprite_builder.image_path(group.value)
48
+ ::Sass::Script::String.new sprite_path(group)
32
49
  end
33
50
 
34
51
  def sprite_url(group)
35
- ::Sass::Script::String.new "url('#{sprite_image(group)}')"
52
+ ::Sass::Script::String.new "url('#{sprite_path(group)}')"
36
53
  end
37
54
 
38
55
  ##
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amikula-sprite
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 13
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 10
9
- version: 0.1.10
9
+ - 11
10
+ version: 0.1.11
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jacques Crocker
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-05-13 00:00:00 -07:00
19
+ date: 2010-11-04 00:00:00 -07:00
19
20
  default_executable: sprite
20
21
  dependencies: []
21
22
 
@@ -61,23 +62,27 @@ rdoc_options:
61
62
  require_paths:
62
63
  - lib
63
64
  required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
64
66
  requirements:
65
67
  - - ">="
66
68
  - !ruby/object:Gem::Version
69
+ hash: 3
67
70
  segments:
68
71
  - 0
69
72
  version: "0"
70
73
  required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
71
75
  requirements:
72
76
  - - ">="
73
77
  - !ruby/object:Gem::Version
78
+ hash: 3
74
79
  segments:
75
80
  - 0
76
81
  version: "0"
77
82
  requirements: []
78
83
 
79
84
  rubyforge_project:
80
- rubygems_version: 1.3.6
85
+ rubygems_version: 1.3.7
81
86
  signing_key:
82
87
  specification_version: 3
83
88
  summary: generate your css sprites automagically