Class Sass::Repl
In: lib/sass/repl.rb
Parent: Object

Runs a SassScript read-eval-print loop. It presents a prompt on the terminal, reads in SassScript expressions, evaluates them, and prints the result.

Methods

new   run  

Public Class methods

@param options [{Symbol => Object}] An options hash.

[Source]

    # File lib/sass/repl.rb, line 11
11:     def initialize(options = {})
12:       @options = options
13:     end

Public Instance methods

Starts the read-eval-print loop.

[Source]

    # File lib/sass/repl.rb, line 16
16:     def run
17:       environment = Environment.new
18:       environment.set_var('important', Script::String.new('!important'))
19:       @line = 0
20:       loop do
21:         @line += 1
22:         unless text = Readline.readline('>> ')
23:           puts
24:           return
25:         end
26: 
27:         Readline::HISTORY << text
28:         parse_input(environment, text)
29:       end
30:     end

[Validate]