Class: JsDuck::Web::Css

Inherits:
Object
  • Object
show all
Defined in:
lib/jsduck/web/css.rb

Overview

Writes the CSS gathered from Tag classes and –css option into given file. Then Renames the file so it contains an MD5 hash inside it, returning the resulting fingerprinted name.

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Css

Returns a new instance of Css.



13
14
15
# File 'lib/jsduck/web/css.rb', line 13

def initialize(opts)
  @opts = opts
end

Instance Method Details

#write(filename) ⇒ Object



17
18
19
20
# File 'lib/jsduck/web/css.rb', line 17

def write(filename)
  File.open(filename, 'w') {|f| f.write(all_css) }
  Util::MD5.rename(filename)
end