Method: Sass::Plugin::Rack#call

Defined in:
lib/sass/plugin/rack.rb

#call(env) ⇒ (#to_i, {String => String}, Object)

Process a request, checking the Sass stylesheets for changes and updating them if necessary.

Parameters:

  • env

    The Rack request environment

Returns:

  • ((#to_i, {String => String}, Object))

    The Rack response



49
50
51
52
53
54
55
# File 'lib/sass/plugin/rack.rb', line 49

def call(env)
  if @dwell.nil? || Time.now.to_f > @check_after
    Sass::Plugin.check_for_updates
    @check_after = Time.now.to_f + @dwell if @dwell
  end
  @app.call(env)
end