Sha256: 57af8e3671a4391377c664c1f10a5c4530f68c7125d5ba14aa18b313f1a7328d

Contents?: true

Size: 1.68 KB

Versions: 7

Compression:

Stored size: 1.68 KB

Contents

require 'thor'
require 'fontrobot'

module Fontrobot
  class CLI < Thor
    # duplicated from Fontrobot::Generator so as to also appear under `fontrobot help` command
    class_option :output,     :aliases => '-o', :desc => 'Specify an output directory. Default: $DIR/fontrobot'
    class_option :name,       :aliases => '-n', :desc => 'Specify a font name. This will be used in the generated fonts and CSS. Default: fontrobot'
    class_option :font_path,  :aliases => '-f', :desc => 'Specify a path for fonts in css @font-face declaration. Default: none'

    class_option :order,      :aliases => '-r', :desc => 'Specify font order in css @font-face. Default: "eot,ttf,woff,svg"'
    class_option :inline,     :aliases => '-i', :desc => 'Inline font as data-uri in @font-face. Default: none. Format: "eot,ttf,woff,svg"'

    class_option :nohash,     :type => :boolean, :default => false, :desc => 'Disable filename hashes. Default: false'
    class_option :debug,      :type => :boolean, :default => false, :desc => 'Display debug messages. Default: false'
    class_option :html,       :type => :boolean, :default => false, :desc => 'Generate html page with icons'
    class_option :scss,       :type => :boolean, :default => false, :desc => 'Output .scss files'

    desc 'compile DIR [options]', 'Generates webfonts and CSS from *.svg and *.eps files in DIR.'
    def compile(*args)
      # workaround to pass arguments from one Thor class to another
      ARGV.shift
      Fontrobot.compile(*ARGV)
    end

    desc 'watch DIR [options]', 'Watches DIR for changes and regenerates webfonts and CSS automatically. Ctrl + C to stop.'
    def watch(*args)
      ARGV.shift
      Fontrobot.watch(*ARGV)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fontrobot-0.1.7 lib/fontrobot/cli.rb
fontrobot-0.1.6 lib/fontrobot/cli.rb
fontrobot-0.1.5 lib/fontrobot/cli.rb
fontrobot-0.1.4 lib/fontrobot/cli.rb
fontrobot-0.1.3 lib/fontrobot/cli.rb
fontrobot-0.1.2 lib/fontrobot/cli.rb
fontrobot-0.1 lib/fontrobot/cli.rb