forked from huacnlee/social-share-button
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
28 lines (25 loc) · 922 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require "bundler/gem_tasks"
require 'sprite_factory'
ROOT_PATH = File.dirname(__FILE__)
namespace :assets do
desc 'recreate sprite images and css'
task :resprite do
SpriteFactory.library = :chunkypng
SpriteFactory.csspath = "image-path('sprites/$IMAGE')"
dirs = Dir.glob("#{ROOT_PATH}/app/assets/images/sprites/*/")
dirs.each do |path|
dir_name = path.split("/").last
SpriteFactory.run!("app/assets/images/sprites/#{dir_name}",
:layout => :packed,
:output_style => "app/assets/stylesheets/#{dir_name}.scss",
:nocomments => true,
:selector => ".#{dir_name}-") do |images|
result = []
images.each do |img|
result << ".social-share-button-#{img[0]} { display:inline-block; #{img[1][:style]} }"
end
result.join("\n")
end
end
end
end