lib/fontrobot/generator.rb in fontrobot-0.1.7 vs lib/fontrobot/generator.rb in fontrobot-0.1.8
- old
+ new
@@ -10,10 +10,11 @@
desc 'Generates webfonts from given directory of vectors.'
argument :input, :type => :string
class_option :output, :aliases => '-o'
class_option :name, :aliases => '-n'
+ class_option :prefix, :aliases => '-p' # css prefix, default icon
class_option :font_path, :aliases => '-f'
class_option :order, :aliases => '-r' # 'Specify font order in css @font-face. Default: "eot,ttf,woff,svg"'
class_option :inline, :aliases => '-i' # 'Inline font as data-uri in @font-face. Default: none. Format: "eot,ttf,woff,svg"'
class_option :nohash, :type => :boolean, :default => false
class_option :debug, :type => :boolean, :default => false
@@ -133,9 +134,10 @@
def create_stylesheet
say_status(:create, 'creating stylesheet')
extension = (options.scss) ? '.scss' : '.css'
files = Dir[File.join(input, '*.{svg,eps}')]
@classes = files.map {|file| File.basename(file)[0..-5].gsub(/\W/, '-').downcase }
+ @prefix = (options.prefix) ? options.prefix : 'icon'
template('templates/fontrobot.css', File.join(@output, "fontrobot#{extension}"))
template('templates/fontrobot-ie7.css', File.join(@output, "fontrobot-ie7#{extension}"))
template('templates/test.html', File.join(@output, 'test.html')) if options.html
end