Class: Fontcustom::Base
- Inherits:
-
Object
- Object
- Fontcustom::Base
- Includes:
- Utility
- Defined in:
- lib/fontcustom/base.rb
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(raw_options) ⇒ Base
constructor
A new instance of Base.
Methods included from Utility
#behavior, #destination_root, #line_break, #methodize_hash, #options, #project_root, #say_changed, #say_message, #say_status, #shell, shell, #source_paths, #symbolize_hash, #write_file
Constructor Details
#initialize(raw_options) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 13 14 |
# File 'lib/fontcustom/base.rb', line 7 def initialize() check_fontforge check_woff2 manifest = '.fontcustom-manifest.json' [:manifest] = manifest @options = Fontcustom::Options.new(). @manifest = Fontcustom::Manifest.new(manifest, @options) end |
Instance Method Details
#compile ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fontcustom/base.rb', line 16 def compile current = checksum previous = @manifest.get(:checksum)[:previous] :status, "Forcing compile." if @options[:force] if @options[:force] || current != previous @manifest.set :checksum, {:previous => previous, :current => current} start_generators @manifest.reload @manifest.set :checksum, {:previous => current, :current => current} else :status, "No changes detected. Skipping compile." end end |