Sha256: 804f8e370c7217ead9aaf73f8409910ccbc3d0e7276b7c9b62f9f0b5555c2da6

Contents?: true

Size: 663 Bytes

Versions: 190

Compression:

Stored size: 663 Bytes

Contents

require 'tilt/template'
require 'less'

module Tilt
  # Lessscss template implementation. See:
  # http://lesscss.org/
  #
  # Less templates do not support object scopes, locals, or yield.
  class LessTemplate < Template
    self.default_mime_type = 'text/css'

    def prepare
      if ::Less.const_defined? :Engine
        @engine = ::Less::Engine.new(data)
      else
        parser  = ::Less::Parser.new(options.merge :filename => eval_file, :line => line)
        @engine = parser.parse(data)
      end
    end

    def evaluate(scope, locals, &block)
      @output ||= @engine.to_css(options)
    end

    def allows_script?
      false
    end
  end
end

Version data entries

190 entries across 151 versions & 25 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/tilt-2.0.10/lib/tilt/less.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/tilt-2.0.10/lib/tilt/less.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/tilt-2.0.10/lib/tilt/less.rb
brakeman-6.1.2 bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/less.rb
brakeman-6.1.1 bundle/ruby/3.0.0/gems/tilt-2.0.11/lib/tilt/less.rb
brakeman-6.1.0 bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/less.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/less.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/less.rb
brakeman-6.0.1 bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/less.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/less.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/less.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/less.rb
brakeman-6.0.0 bundle/ruby/3.0.0/gems/tilt-2.0.11/lib/tilt/less.rb
brakeman-5.4.1 bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/less.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/less.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/less.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/less.rb
brakeman-5.4.0 bundle/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/less.rb
brakeman-5.3.1 bundle/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/less.rb
brakeman-5.3.0 bundle/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/less.rb