sprite-factory 1.0.0

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.
Files changed (71) hide show
  1. data/LICENSE +20 -0
  2. data/README.md +207 -0
  3. data/Rakefile +67 -0
  4. data/bin/sf +46 -0
  5. data/lib/sprite_factory.rb +51 -0
  6. data/lib/sprite_factory/layout.rb +89 -0
  7. data/lib/sprite_factory/library/chunky_png.rb +31 -0
  8. data/lib/sprite_factory/library/rmagick.rb +32 -0
  9. data/lib/sprite_factory/runner.rb +204 -0
  10. data/lib/sprite_factory/style.rb +58 -0
  11. data/sprite_factory.gemspec +24 -0
  12. data/test/images/custom/custom.css +4 -0
  13. data/test/images/custom/running.png +0 -0
  14. data/test/images/custom/stopped.png +0 -0
  15. data/test/images/empty/readme.txt +1 -0
  16. data/test/images/formats/alice.gif +0 -0
  17. data/test/images/formats/monkey.gif +0 -0
  18. data/test/images/formats/spies.jpg +0 -0
  19. data/test/images/formats/thief.png +0 -0
  20. data/test/images/irregular/irregular1.png +0 -0
  21. data/test/images/irregular/irregular2.png +0 -0
  22. data/test/images/irregular/irregular3.png +0 -0
  23. data/test/images/irregular/irregular4.png +0 -0
  24. data/test/images/irregular/irregular5.png +0 -0
  25. data/test/images/irregular/readme.txt +2 -0
  26. data/test/images/reference/custom.css +22 -0
  27. data/test/images/reference/custom.png +0 -0
  28. data/test/images/reference/formats.css +22 -0
  29. data/test/images/reference/formats.png +0 -0
  30. data/test/images/reference/index.html +135 -0
  31. data/test/images/reference/irregular.css +24 -0
  32. data/test/images/reference/irregular.fixed.css +24 -0
  33. data/test/images/reference/irregular.fixed.png +0 -0
  34. data/test/images/reference/irregular.horizontal.css +24 -0
  35. data/test/images/reference/irregular.horizontal.png +0 -0
  36. data/test/images/reference/irregular.padded.css +24 -0
  37. data/test/images/reference/irregular.padded.png +0 -0
  38. data/test/images/reference/irregular.png +0 -0
  39. data/test/images/reference/irregular.sassy.css +38 -0
  40. data/test/images/reference/irregular.sassy.png +0 -0
  41. data/test/images/reference/irregular.sassy.sass +40 -0
  42. data/test/images/reference/irregular.vertical.css +24 -0
  43. data/test/images/reference/irregular.vertical.png +0 -0
  44. data/test/images/reference/regular.css +24 -0
  45. data/test/images/reference/regular.custom.css +24 -0
  46. data/test/images/reference/regular.custom.png +0 -0
  47. data/test/images/reference/regular.fixed.css +24 -0
  48. data/test/images/reference/regular.fixed.png +0 -0
  49. data/test/images/reference/regular.horizontal.css +24 -0
  50. data/test/images/reference/regular.horizontal.png +0 -0
  51. data/test/images/reference/regular.padded.css +24 -0
  52. data/test/images/reference/regular.padded.png +0 -0
  53. data/test/images/reference/regular.png +0 -0
  54. data/test/images/reference/regular.sassy.css +38 -0
  55. data/test/images/reference/regular.sassy.png +0 -0
  56. data/test/images/reference/regular.sassy.sass +40 -0
  57. data/test/images/reference/regular.vertical.css +24 -0
  58. data/test/images/reference/regular.vertical.png +0 -0
  59. data/test/images/reference/s.gif +0 -0
  60. data/test/images/regular/regular1.png +0 -0
  61. data/test/images/regular/regular2.png +0 -0
  62. data/test/images/regular/regular3.png +0 -0
  63. data/test/images/regular/regular4.png +0 -0
  64. data/test/images/regular/regular5.png +0 -0
  65. data/test/integration_test.rb +100 -0
  66. data/test/layout_test.rb +228 -0
  67. data/test/library_test.rb +57 -0
  68. data/test/runner_test.rb +156 -0
  69. data/test/style_test.rb +64 -0
  70. data/test/test_case.rb +127 -0
  71. metadata +159 -0
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/irregular/irregular1.png (60x60)
6
+ test/images/irregular/irregular2.png (16x16)
7
+ test/images/irregular/irregular3.png (48x48)
8
+ test/images/irregular/irregular4.png (34x14)
9
+ test/images/irregular/irregular5.png (46x25)
10
+
11
+ Output files:
12
+ test/images/irregular.png
13
+ test/images/irregular.css
14
+
15
+ Output size:
16
+ 204x60
17
+
18
+
19
+ */
20
+ img.irregular1 { width: 60px; height: 60px; background: url(irregular.png) 0px 0px no-repeat; }
21
+ img.irregular2 { width: 16px; height: 16px; background: url(irregular.png) -60px -22px no-repeat; }
22
+ img.irregular3 { width: 48px; height: 48px; background: url(irregular.png) -76px -6px no-repeat; }
23
+ img.irregular4 { width: 34px; height: 14px; background: url(irregular.png) -124px -23px no-repeat; }
24
+ img.irregular5 { width: 46px; height: 25px; background: url(irregular.png) -158px -17px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/irregular/irregular1.png (60x60)
6
+ test/images/irregular/irregular2.png (16x16)
7
+ test/images/irregular/irregular3.png (48x48)
8
+ test/images/irregular/irregular4.png (34x14)
9
+ test/images/irregular/irregular5.png (46x25)
10
+
11
+ Output files:
12
+ test/images/irregular.fixed.png
13
+ test/images/irregular.fixed.css
14
+
15
+ Output size:
16
+ 500x100
17
+
18
+
19
+ */
20
+ img.fixed_irregular1 { width: 100px; height: 100px; background: url(irregular.fixed.png) 0px 0px no-repeat; }
21
+ img.fixed_irregular2 { width: 100px; height: 100px; background: url(irregular.fixed.png) -100px 0px no-repeat; }
22
+ img.fixed_irregular3 { width: 100px; height: 100px; background: url(irregular.fixed.png) -200px 0px no-repeat; }
23
+ img.fixed_irregular4 { width: 100px; height: 100px; background: url(irregular.fixed.png) -300px 0px no-repeat; }
24
+ img.fixed_irregular5 { width: 100px; height: 100px; background: url(irregular.fixed.png) -400px 0px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/irregular/irregular1.png (60x60)
6
+ test/images/irregular/irregular2.png (16x16)
7
+ test/images/irregular/irregular3.png (48x48)
8
+ test/images/irregular/irregular4.png (34x14)
9
+ test/images/irregular/irregular5.png (46x25)
10
+
11
+ Output files:
12
+ test/images/irregular.horizontal.png
13
+ test/images/irregular.horizontal.css
14
+
15
+ Output size:
16
+ 204x60
17
+
18
+
19
+ */
20
+ img.horizontal_irregular1 { width: 60px; height: 60px; background: url(irregular.horizontal.png) 0px 0px no-repeat; }
21
+ img.horizontal_irregular2 { width: 16px; height: 16px; background: url(irregular.horizontal.png) -60px -22px no-repeat; }
22
+ img.horizontal_irregular3 { width: 48px; height: 48px; background: url(irregular.horizontal.png) -76px -6px no-repeat; }
23
+ img.horizontal_irregular4 { width: 34px; height: 14px; background: url(irregular.horizontal.png) -124px -23px no-repeat; }
24
+ img.horizontal_irregular5 { width: 46px; height: 25px; background: url(irregular.horizontal.png) -158px -17px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/irregular/irregular1.png (60x60)
6
+ test/images/irregular/irregular2.png (16x16)
7
+ test/images/irregular/irregular3.png (48x48)
8
+ test/images/irregular/irregular4.png (34x14)
9
+ test/images/irregular/irregular5.png (46x25)
10
+
11
+ Output files:
12
+ test/images/irregular.padded.png
13
+ test/images/irregular.padded.css
14
+
15
+ Output size:
16
+ 304x80
17
+
18
+
19
+ */
20
+ img.padded_irregular1 { width: 80px; height: 80px; background: url(irregular.padded.png) 0px 0px no-repeat; }
21
+ img.padded_irregular2 { width: 36px; height: 36px; background: url(irregular.padded.png) -80px -22px no-repeat; }
22
+ img.padded_irregular3 { width: 68px; height: 68px; background: url(irregular.padded.png) -116px -6px no-repeat; }
23
+ img.padded_irregular4 { width: 54px; height: 34px; background: url(irregular.padded.png) -184px -23px no-repeat; }
24
+ img.padded_irregular5 { width: 66px; height: 45px; background: url(irregular.padded.png) -238px -17px no-repeat; }
@@ -0,0 +1,38 @@
1
+ /* Creating a sprite from following images:
2
+ *
3
+ * test/images/irregular/irregular1.png (60x60)
4
+ * test/images/irregular/irregular2.png (16x16)
5
+ * test/images/irregular/irregular3.png (48x48)
6
+ * test/images/irregular/irregular4.png (34x14)
7
+ * test/images/irregular/irregular5.png (46x25)
8
+ *
9
+ * Output files:
10
+ * test/images/irregular.sassy.png
11
+ * test/images/irregular.sassy.sass
12
+ *
13
+ * Output size:
14
+ * 204x60 */
15
+ img.sassy_irregular1 {
16
+ width: 60px;
17
+ height: 60px;
18
+ background: url(irregular.sassy.png) 0px 0px no-repeat; }
19
+
20
+ img.sassy_irregular2 {
21
+ width: 16px;
22
+ height: 16px;
23
+ background: url(irregular.sassy.png) -60px -22px no-repeat; }
24
+
25
+ img.sassy_irregular3 {
26
+ width: 48px;
27
+ height: 48px;
28
+ background: url(irregular.sassy.png) -76px -6px no-repeat; }
29
+
30
+ img.sassy_irregular4 {
31
+ width: 34px;
32
+ height: 14px;
33
+ background: url(irregular.sassy.png) -124px -23px no-repeat; }
34
+
35
+ img.sassy_irregular5 {
36
+ width: 46px;
37
+ height: 25px;
38
+ background: url(irregular.sassy.png) -158px -17px no-repeat; }
@@ -0,0 +1,40 @@
1
+ /*
2
+ Creating a sprite from following images:
3
+
4
+ test/images/irregular/irregular1.png (60x60)
5
+ test/images/irregular/irregular2.png (16x16)
6
+ test/images/irregular/irregular3.png (48x48)
7
+ test/images/irregular/irregular4.png (34x14)
8
+ test/images/irregular/irregular5.png (46x25)
9
+
10
+ Output files:
11
+ test/images/irregular.sassy.png
12
+ test/images/irregular.sassy.sass
13
+
14
+ Output size:
15
+ 204x60 */
16
+ img.sassy_irregular1
17
+ width: 60px
18
+ height: 60px
19
+ background: url(irregular.sassy.png) 0px 0px no-repeat
20
+
21
+ img.sassy_irregular2
22
+ width: 16px
23
+ height: 16px
24
+ background: url(irregular.sassy.png) -60px -22px no-repeat
25
+
26
+ img.sassy_irregular3
27
+ width: 48px
28
+ height: 48px
29
+ background: url(irregular.sassy.png) -76px -6px no-repeat
30
+
31
+ img.sassy_irregular4
32
+ width: 34px
33
+ height: 14px
34
+ background: url(irregular.sassy.png) -124px -23px no-repeat
35
+
36
+ img.sassy_irregular5
37
+ width: 46px
38
+ height: 25px
39
+ background: url(irregular.sassy.png) -158px -17px no-repeat
40
+
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/irregular/irregular1.png (60x60)
6
+ test/images/irregular/irregular2.png (16x16)
7
+ test/images/irregular/irregular3.png (48x48)
8
+ test/images/irregular/irregular4.png (34x14)
9
+ test/images/irregular/irregular5.png (46x25)
10
+
11
+ Output files:
12
+ test/images/irregular.vertical.png
13
+ test/images/irregular.vertical.css
14
+
15
+ Output size:
16
+ 60x163
17
+
18
+
19
+ */
20
+ img.vertical_irregular1 { width: 60px; height: 60px; background: url(irregular.vertical.png) 0px 0px no-repeat; }
21
+ img.vertical_irregular2 { width: 16px; height: 16px; background: url(irregular.vertical.png) -22px -60px no-repeat; }
22
+ img.vertical_irregular3 { width: 48px; height: 48px; background: url(irregular.vertical.png) -6px -76px no-repeat; }
23
+ img.vertical_irregular4 { width: 34px; height: 14px; background: url(irregular.vertical.png) -13px -124px no-repeat; }
24
+ img.vertical_irregular5 { width: 46px; height: 25px; background: url(irregular.vertical.png) -7px -138px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/regular/regular1.png (64x64)
6
+ test/images/regular/regular2.png (64x64)
7
+ test/images/regular/regular3.png (64x64)
8
+ test/images/regular/regular4.png (64x64)
9
+ test/images/regular/regular5.png (64x64)
10
+
11
+ Output files:
12
+ test/images/regular.png
13
+ test/images/regular.css
14
+
15
+ Output size:
16
+ 320x64
17
+
18
+
19
+ */
20
+ img.regular1 { width: 64px; height: 64px; background: url(regular.png) 0px 0px no-repeat; }
21
+ img.regular2 { width: 64px; height: 64px; background: url(regular.png) -64px 0px no-repeat; }
22
+ img.regular3 { width: 64px; height: 64px; background: url(regular.png) -128px 0px no-repeat; }
23
+ img.regular4 { width: 64px; height: 64px; background: url(regular.png) -192px 0px no-repeat; }
24
+ img.regular5 { width: 64px; height: 64px; background: url(regular.png) -256px 0px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/regular/regular1.png (64x64)
6
+ test/images/regular/regular2.png (64x64)
7
+ test/images/regular/regular3.png (64x64)
8
+ test/images/regular/regular4.png (64x64)
9
+ test/images/regular/regular5.png (64x64)
10
+
11
+ Output files:
12
+ test/images/regular.custom.png
13
+ test/images/regular.custom.css
14
+
15
+ Output size:
16
+ 320x64
17
+
18
+
19
+ */
20
+ span.custom_regular1 { border: 4px solid green; display: inline-block; width: 64px; height: 64px; background: url(regular.custom.png) 0px 0px no-repeat; }
21
+ span.custom_regular2 { border: 4px solid blue; display: inline-block; width: 64px; height: 64px; background: url(regular.custom.png) -64px 0px no-repeat; }
22
+ span.custom_regular3 { border: 4px solid red; display: inline-block; width: 64px; height: 64px; background: url(regular.custom.png) -128px 0px no-repeat; }
23
+ span.custom_regular4 { border: 4px solid yellow; display: inline-block; width: 64px; height: 64px; background: url(regular.custom.png) -192px 0px no-repeat; }
24
+ span.custom_regular5 { border: 4px solid pink; display: inline-block; width: 64px; height: 64px; background: url(regular.custom.png) -256px 0px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/regular/regular1.png (64x64)
6
+ test/images/regular/regular2.png (64x64)
7
+ test/images/regular/regular3.png (64x64)
8
+ test/images/regular/regular4.png (64x64)
9
+ test/images/regular/regular5.png (64x64)
10
+
11
+ Output files:
12
+ test/images/regular.fixed.png
13
+ test/images/regular.fixed.css
14
+
15
+ Output size:
16
+ 500x100
17
+
18
+
19
+ */
20
+ img.fixed_regular1 { width: 100px; height: 100px; background: url(regular.fixed.png) 0px 0px no-repeat; }
21
+ img.fixed_regular2 { width: 100px; height: 100px; background: url(regular.fixed.png) -100px 0px no-repeat; }
22
+ img.fixed_regular3 { width: 100px; height: 100px; background: url(regular.fixed.png) -200px 0px no-repeat; }
23
+ img.fixed_regular4 { width: 100px; height: 100px; background: url(regular.fixed.png) -300px 0px no-repeat; }
24
+ img.fixed_regular5 { width: 100px; height: 100px; background: url(regular.fixed.png) -400px 0px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/regular/regular1.png (64x64)
6
+ test/images/regular/regular2.png (64x64)
7
+ test/images/regular/regular3.png (64x64)
8
+ test/images/regular/regular4.png (64x64)
9
+ test/images/regular/regular5.png (64x64)
10
+
11
+ Output files:
12
+ test/images/regular.horizontal.png
13
+ test/images/regular.horizontal.css
14
+
15
+ Output size:
16
+ 320x64
17
+
18
+
19
+ */
20
+ img.horizontal_regular1 { width: 64px; height: 64px; background: url(regular.horizontal.png) 0px 0px no-repeat; }
21
+ img.horizontal_regular2 { width: 64px; height: 64px; background: url(regular.horizontal.png) -64px 0px no-repeat; }
22
+ img.horizontal_regular3 { width: 64px; height: 64px; background: url(regular.horizontal.png) -128px 0px no-repeat; }
23
+ img.horizontal_regular4 { width: 64px; height: 64px; background: url(regular.horizontal.png) -192px 0px no-repeat; }
24
+ img.horizontal_regular5 { width: 64px; height: 64px; background: url(regular.horizontal.png) -256px 0px no-repeat; }
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/regular/regular1.png (64x64)
6
+ test/images/regular/regular2.png (64x64)
7
+ test/images/regular/regular3.png (64x64)
8
+ test/images/regular/regular4.png (64x64)
9
+ test/images/regular/regular5.png (64x64)
10
+
11
+ Output files:
12
+ test/images/regular.padded.png
13
+ test/images/regular.padded.css
14
+
15
+ Output size:
16
+ 420x84
17
+
18
+
19
+ */
20
+ img.padded_regular1 { width: 84px; height: 84px; background: url(regular.padded.png) 0px 0px no-repeat; }
21
+ img.padded_regular2 { width: 84px; height: 84px; background: url(regular.padded.png) -84px 0px no-repeat; }
22
+ img.padded_regular3 { width: 84px; height: 84px; background: url(regular.padded.png) -168px 0px no-repeat; }
23
+ img.padded_regular4 { width: 84px; height: 84px; background: url(regular.padded.png) -252px 0px no-repeat; }
24
+ img.padded_regular5 { width: 84px; height: 84px; background: url(regular.padded.png) -336px 0px no-repeat; }
@@ -0,0 +1,38 @@
1
+ /* Creating a sprite from following images:
2
+ *
3
+ * test/images/regular/regular1.png (64x64)
4
+ * test/images/regular/regular2.png (64x64)
5
+ * test/images/regular/regular3.png (64x64)
6
+ * test/images/regular/regular4.png (64x64)
7
+ * test/images/regular/regular5.png (64x64)
8
+ *
9
+ * Output files:
10
+ * test/images/regular.sassy.png
11
+ * test/images/regular.sassy.sass
12
+ *
13
+ * Output size:
14
+ * 320x64 */
15
+ img.sassy_regular1 {
16
+ width: 64px;
17
+ height: 64px;
18
+ background: url(regular.sassy.png) 0px 0px no-repeat; }
19
+
20
+ img.sassy_regular2 {
21
+ width: 64px;
22
+ height: 64px;
23
+ background: url(regular.sassy.png) -64px 0px no-repeat; }
24
+
25
+ img.sassy_regular3 {
26
+ width: 64px;
27
+ height: 64px;
28
+ background: url(regular.sassy.png) -128px 0px no-repeat; }
29
+
30
+ img.sassy_regular4 {
31
+ width: 64px;
32
+ height: 64px;
33
+ background: url(regular.sassy.png) -192px 0px no-repeat; }
34
+
35
+ img.sassy_regular5 {
36
+ width: 64px;
37
+ height: 64px;
38
+ background: url(regular.sassy.png) -256px 0px no-repeat; }
@@ -0,0 +1,40 @@
1
+ /*
2
+ Creating a sprite from following images:
3
+
4
+ test/images/regular/regular1.png (64x64)
5
+ test/images/regular/regular2.png (64x64)
6
+ test/images/regular/regular3.png (64x64)
7
+ test/images/regular/regular4.png (64x64)
8
+ test/images/regular/regular5.png (64x64)
9
+
10
+ Output files:
11
+ test/images/regular.sassy.png
12
+ test/images/regular.sassy.sass
13
+
14
+ Output size:
15
+ 320x64 */
16
+ img.sassy_regular1
17
+ width: 64px
18
+ height: 64px
19
+ background: url(regular.sassy.png) 0px 0px no-repeat
20
+
21
+ img.sassy_regular2
22
+ width: 64px
23
+ height: 64px
24
+ background: url(regular.sassy.png) -64px 0px no-repeat
25
+
26
+ img.sassy_regular3
27
+ width: 64px
28
+ height: 64px
29
+ background: url(regular.sassy.png) -128px 0px no-repeat
30
+
31
+ img.sassy_regular4
32
+ width: 64px
33
+ height: 64px
34
+ background: url(regular.sassy.png) -192px 0px no-repeat
35
+
36
+ img.sassy_regular5
37
+ width: 64px
38
+ height: 64px
39
+ background: url(regular.sassy.png) -256px 0px no-repeat
40
+
@@ -0,0 +1,24 @@
1
+ /*
2
+
3
+ Creating a sprite from following images:
4
+
5
+ test/images/regular/regular1.png (64x64)
6
+ test/images/regular/regular2.png (64x64)
7
+ test/images/regular/regular3.png (64x64)
8
+ test/images/regular/regular4.png (64x64)
9
+ test/images/regular/regular5.png (64x64)
10
+
11
+ Output files:
12
+ test/images/regular.vertical.png
13
+ test/images/regular.vertical.css
14
+
15
+ Output size:
16
+ 64x320
17
+
18
+
19
+ */
20
+ img.vertical_regular1 { width: 64px; height: 64px; background: url(regular.vertical.png) 0px 0px no-repeat; }
21
+ img.vertical_regular2 { width: 64px; height: 64px; background: url(regular.vertical.png) 0px -64px no-repeat; }
22
+ img.vertical_regular3 { width: 64px; height: 64px; background: url(regular.vertical.png) 0px -128px no-repeat; }
23
+ img.vertical_regular4 { width: 64px; height: 64px; background: url(regular.vertical.png) 0px -192px no-repeat; }
24
+ img.vertical_regular5 { width: 64px; height: 64px; background: url(regular.vertical.png) 0px -256px no-repeat; }