Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1387 Bytes
1 | require 'readline' |
2 | |
3 | module Sass |
4 | # Runs a SassScript read-eval-print loop. |
5 | # It presents a prompt on the terminal, |
6 | # reads in SassScript expressions, |
7 | # evaluates them, |
8 | # and prints the result. |
9 | class Repl |
10 | # @param options [{Symbol => Object}] An options hash. |
11 | def initialize(options = {}) |
12 | @options = options |
13 | end |
14 | |
15 | # Starts the read-eval-print loop. |
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 |
31 | |
32 | private |
33 | |
34 | def parse_input(environment, text) |
35 | case text |
36 | when Script::MATCH |
37 | name = $1 |
38 | guarded = $2 == '||=' |
39 | val = Script::Parser.parse($3, @line, text.size - $3.size) |
40 | |
41 | unless guarded && environment.var(name) |
42 | environment.set_var(name, val.perform(environment)) |
43 | end |
44 | |
45 | p environment.var(name) |
46 | else |
47 | p Script::Parser.parse(text, @line, 0).perform(environment) |
48 | end |
49 | rescue Sass::SyntaxError => e |
50 | puts "SyntaxError: #{e.message}" |
51 | if @options[:trace] |
52 | e.backtrace.each do |e| |
53 | puts "\tfrom #{e}" |
54 | end |
55 | end |
56 | end |
57 | end |
58 | end |