spritely 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spritely/sass_functions.rb +18 -7
- data/lib/spritely/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae40c9a7ce9d7836c6b37b3b3ccc626b65145525
|
4
|
+
data.tar.gz: 5749341869e454dfc773f11bc5bfb56a46b8c26c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7ff4dff485cc7469d0aeecf8d403a392318993adb7bbd33d30f50c850b7dd4c56bbac761b5818861469a675550bfb2c9a34ffa85678e3e88941660a9fccebd5
|
7
|
+
data.tar.gz: 1d159336eaaaa280286f94b87bcc029a58bf1d61af3faf44d060975eee901490178eb0c6d45785902ccf18809497d90a01734bea77766938eaa538cb9d6f93be
|
@@ -5,7 +5,7 @@ module Spritely
|
|
5
5
|
def spritely_url(sprite_name)
|
6
6
|
sprockets_context.link_asset("sprites/#{sprite_name.value}.png")
|
7
7
|
|
8
|
-
asset_url(Sass::Script::String.new("sprites/#{sprite_name.value}.png"))
|
8
|
+
asset_url(Sass::Script::Value::String.new("sprites/#{sprite_name.value}.png"))
|
9
9
|
end
|
10
10
|
|
11
11
|
::Sass::Script::Functions.declare :spritely_url, [:sprite_name]
|
@@ -13,16 +13,16 @@ module Spritely
|
|
13
13
|
def spritely_position(sprite_name, image_name)
|
14
14
|
image = find_image(sprite_name, image_name)
|
15
15
|
|
16
|
-
x = Sass::Script::Number.new(-image.left, image.left == 0 ? [] : ['px'])
|
17
|
-
y = Sass::Script::Number.new(-image.top, image.top == 0 ? [] : ['px'])
|
16
|
+
x = Sass::Script::Value::Number.new(-image.left, image.left == 0 ? [] : ['px'])
|
17
|
+
y = Sass::Script::Value::Number.new(-image.top, image.top == 0 ? [] : ['px'])
|
18
18
|
|
19
|
-
|
19
|
+
sass_space_separated_list([x, y])
|
20
20
|
end
|
21
21
|
|
22
22
|
::Sass::Script::Functions.declare :spritely_position, [:sprite_name, :image_name]
|
23
23
|
|
24
24
|
def spritely_background(sprite_name, image_name)
|
25
|
-
|
25
|
+
sass_space_separated_list([spritely_url(sprite_name), spritely_position(sprite_name, image_name)])
|
26
26
|
end
|
27
27
|
|
28
28
|
::Sass::Script::Functions.declare :spritely_background, [:sprite_name, :image_name]
|
@@ -34,7 +34,7 @@ module Spritely
|
|
34
34
|
find_sprite_map(sprite_name)
|
35
35
|
end
|
36
36
|
|
37
|
-
Sass::Script::Number.new(image.width, ['px'])
|
37
|
+
Sass::Script::Value::Number.new(image.width, ['px'])
|
38
38
|
end
|
39
39
|
|
40
40
|
::Sass::Script::Functions.declare :spritely_width, [:sprite_name, :image_name]
|
@@ -46,7 +46,7 @@ module Spritely
|
|
46
46
|
find_sprite_map(sprite_name)
|
47
47
|
end
|
48
48
|
|
49
|
-
Sass::Script::Number.new(image.height, ['px'])
|
49
|
+
Sass::Script::Value::Number.new(image.height, ['px'])
|
50
50
|
end
|
51
51
|
|
52
52
|
::Sass::Script::Functions.declare :spritely_height, [:sprite_name, :image_name]
|
@@ -72,6 +72,17 @@ module Spritely
|
|
72
72
|
def sprite_maps
|
73
73
|
@sprite_maps ||= {}
|
74
74
|
end
|
75
|
+
|
76
|
+
def sass_space_separated_list(value)
|
77
|
+
# Sass 3.5 introduced support for bracketed lists (sass/sass@be02da0), which changed the
|
78
|
+
# method signature of `Sass::Script::Value::List#initialize` to accept the `separator` as a
|
79
|
+
# keyword argument rather than as the second positional argument.
|
80
|
+
if Gem::Version.new(Sass.version[:number]) < Gem::Version.new("3.5")
|
81
|
+
Sass::Script::Value::List.new(value, :space)
|
82
|
+
else
|
83
|
+
Sass::Script::Value::List.new(value, separator: :space)
|
84
|
+
end
|
85
|
+
end
|
75
86
|
end
|
76
87
|
end
|
77
88
|
|
data/lib/spritely/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spritely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Robbin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chunky_png
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
33
|
+
version: '3.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
40
|
+
version: '3.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sprockets
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,7 +227,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
227
227
|
requirements:
|
228
228
|
- - ">="
|
229
229
|
- !ruby/object:Gem::Version
|
230
|
-
version: 2.
|
230
|
+
version: 2.2.0
|
231
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
233
|
- - ">="
|
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
237
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.
|
238
|
+
rubygems_version: 2.6.11
|
239
239
|
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: Hooks into the Sprockets asset packaging system to allow you to easily generate
|