Skip to content

Techmind/jeanny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Jeanny

Библиотека для сокращения имён css классов.

##Пример использования

#!/usr/bin/env ruby

require 'rubygems'
require 'jeanny'

include Jeanny::Sugar

analyze('serp/css/_*.css', :compare_with => 'classes.saved') and save

group :html, :title => 'replacing in template files' do
    replace :in => 'serp/static/*.html'
end

group :css, :title => 'replacing in stylesheets' do
    replace :include => ['serp/css/_*.css', 'serp/block/*/*.css']
end

group :js, :title => 'replacing in scripts' do
    replace :in => 'serp/js/_serp.js'
end

##Ещё один пример #!/usr/bin/env ruby

require 'rubygems'
require 'jeanny'

j = Jeanny::Engine.new
j.analyze '.l-head { ... } .l-head__l, .l-head__r { ... } .z-colors { ololo } .z-colors__text { blah-blah-blah... }'

data = '<div class = "l-head"><div class = "l-head__l">Left</div><div class = "l-head__r">Right</div></div><div class = "z-colors"><div class = "z-colors__text">Colors Wizard</div></div>'
puts j.replace data, :html

# На выходе будет:
# => <div class="a"><div class="d">Left</div><div class="e">Right</div></div><div class="b"><div class="f">Colors Wizard</div></div>

##Установка sudo gem sources -a http://gemcutter.org && sudo gem install jeanny

About

Library for shortening CSS class names

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages