Sha256: 42da20ad48c2010d56153fb47c4d58df13d8e7d5325b891b137f6b5e96563f61

Contents?: true

Size: 499 Bytes

Versions: 6

Compression:

Stored size: 499 Bytes

Contents

#
# Generic templates/stylesheets parsing engine
#
class UnderOs::Parser
  def self.parse(*args)
    @inst ||= new
    @inst.parse *args
  end

  def initialize
    @css  = CSS.new
    @html = HTML.new
  end

  def parse(filename)
    filepath = NSBundle.mainBundle.pathForResource(filename, ofType:nil)
    content  = filepath ? UnderOs::File.read(filepath) : ''

    case filename.split('.').pop
    when 'css'  then @css.parse(content)
    when 'html' then @html.parse(content)
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
under-os-ui-1.4.0 lib/under_os/parser.rb
under-os-1.3.0 lib/under_os/parser.rb
under-os-1.2.1 lib/under_os/parser.rb
under-os-1.2.0 lib/under_os/parser.rb
under-os-1.1.0 lib/under_os/parser.rb
under-os-1.0.0 lib/under_os/parser.rb