Class: Coyote::Assets::Less

Inherits:
Base
  • Object
show all
Defined in:
lib/coyote/assets/less.rb

Instance Attribute Summary

Attributes inherited from Base

#contents, #dependencies, #path, #relative_path

Instance Method Summary collapse

Methods inherited from Base

#dependencies_have_changed?, #initialize, require_pattern, #update!

Constructor Details

This class inherits a constructor from Coyote::Assets::Base

Instance Method Details

#compile!Object



21
22
23
24
# File 'lib/coyote/assets/less.rb', line 21

def compile!
  @contents = `lessc #{@path}`
  self
end

#find_dependenciesObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/coyote/assets/less.rb', line 6

def find_dependencies
  super
  @dependencies.map! do |file|
    path = File.expand_path(File.join(File.dirname(@relative_path), file))
    if File.exists? path
      file
    elsif File.exists?(path + ".less")
      file + ".less"
    else
      nil
    end
  end.compact!
end