amikula-sprite 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.11
1
+ 0.1.12
@@ -15,7 +15,7 @@ module Sprite
15
15
  f.puts ".#{@builder.config['sprites_class']}"
16
16
  @level += 1
17
17
  end
18
-
18
+
19
19
  sprite_files.each do |sprite_file, sprites|
20
20
  sprites.each do |sprite|
21
21
  f.puts sass_line("&.#{sprite[:group]}#{@builder.config['class_separator']}#{sprite[:name]}")
@@ -29,15 +29,15 @@ module Sprite
29
29
  end
30
30
  end
31
31
  end
32
-
32
+
33
33
  # write sass output with correct tab spaces prepended
34
34
  def sass_line(sass)
35
35
  "#{' '*@level}#{sass}"
36
36
  end
37
-
37
+
38
38
  def extension
39
39
  "sass"
40
40
  end
41
41
  end
42
42
  end
43
- end
43
+ end
@@ -5,30 +5,30 @@ module Sprite
5
5
  def initialize(builder)
6
6
  @builder = builder
7
7
  end
8
-
9
- def write(path, sprite_files)
8
+
9
+ def write(path, sprite_files)
10
10
  # write the sass mixins to disk
11
11
  File.open(File.join(Sprite.root, path), 'w') do |f|
12
12
  add_else = false
13
13
 
14
- f.puts "= sprite(!group_name, !image_name, !offset=0)"
14
+ f.puts "@mixin sprite($group_name, $image_name, $offset: 0)"
15
15
  sprite_files.each do |sprite_file, sprites|
16
16
  sprites.each do |sprite|
17
-
17
+
18
18
  f << " @"
19
19
  if add_else
20
20
  f << "else "
21
21
  end
22
22
  add_else = true
23
23
  #{sprite[:x]}px #{sprite[:y]}px
24
-
24
+
25
25
  if sprite[:align] == 'horizontal'
26
- background_offset = "\#{#{sprite[:x]}+!offset}px #{sprite[:y]}px"
26
+ background_offset = "\#{#{sprite[:x]}+$offset}px #{sprite[:y]}px"
27
27
  else
28
- background_offset = "#{sprite[:x]}px \#{#{sprite[:y]}+!offset}px"
28
+ background_offset = "#{sprite[:x]}px \#{#{sprite[:y]}+$offset}px"
29
29
  end
30
-
31
- f.puts %{if !group_name == "#{sprite[:group]}" and !image_name == "#{sprite[:name]}"}
30
+
31
+ f.puts %{if $group_name == "#{sprite[:group]}" and $image_name == "#{sprite[:name]}"}
32
32
  f.puts " background: url('/#{@builder.config['image_output_path']}#{sprite_file}') no-repeat #{background_offset}"
33
33
  f.puts " width: #{sprite[:width]}px"
34
34
  f.puts " height: #{sprite[:height]}px"
@@ -40,7 +40,7 @@ module Sprite
40
40
  def extension
41
41
  "sass"
42
42
  end
43
-
43
+
44
44
  end
45
45
  end
46
- end
46
+ end
@@ -16,13 +16,12 @@ module Sprite
16
16
 
17
17
  # write the sass mixins to disk
18
18
  File.open(File.join(Sprite.root, sass_path), 'w') do |f|
19
- f.puts "!sprite_data = '#{path}'"
20
- f.puts ""
21
- f.puts "= sprite(!group_name, !image_name)"
22
- f.puts " background= sprite_background(!group_name, !image_name)"
23
- f.puts " width= sprite_width(!group_name, !image_name)"
24
- f.puts " height= sprite_height(!group_name, !image_name)"
19
+ f.puts "$sprite_data: '#{path}'"
25
20
  f.puts ""
21
+ f.puts "@mixin sprite($group_name, $image_name)"
22
+ f.puts " background: sprite_background($group_name, $image_name)"
23
+ f.puts " width: sprite_width($group_name, $image_name)"
24
+ f.puts " height: sprite_height($group_name, $image_name)"
26
25
  end
27
26
  end
28
27
 
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amikula-sprite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 11
10
- version: 0.1.11
4
+ prerelease:
5
+ version: 0.1.12
11
6
  platform: ruby
12
7
  authors:
13
8
  - Jacques Crocker
@@ -16,8 +11,7 @@ autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
13
 
19
- date: 2010-11-04 00:00:00 -07:00
20
- default_executable: sprite
14
+ date: 2011-11-04 00:00:00 Z
21
15
  dependencies: []
22
16
 
23
17
  description: sprite is a rails/merb plugin that generates sprites for css, sass
@@ -52,13 +46,12 @@ files:
52
46
  - lib/sprite/styles/templated_css_generator.rb
53
47
  - rails/init.rb
54
48
  - tasks/sprite_tasks.rake
55
- has_rdoc: true
56
49
  homepage: http://github.com/amikula/sprite
57
50
  licenses: []
58
51
 
59
52
  post_install_message:
60
- rdoc_options:
61
- - --charset=UTF-8
53
+ rdoc_options: []
54
+
62
55
  require_paths:
63
56
  - lib
64
57
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -66,23 +59,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
59
  requirements:
67
60
  - - ">="
68
61
  - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
62
  version: "0"
73
63
  required_rubygems_version: !ruby/object:Gem::Requirement
74
64
  none: false
75
65
  requirements:
76
66
  - - ">="
77
67
  - !ruby/object:Gem::Version
78
- hash: 3
79
- segments:
80
- - 0
81
68
  version: "0"
82
69
  requirements: []
83
70
 
84
71
  rubyforge_project:
85
- rubygems_version: 1.3.7
72
+ rubygems_version: 1.8.11
86
73
  signing_key:
87
74
  specification_version: 3
88
75
  summary: generate your css sprites automagically