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:
- 1560 Bytes
1 | require 'sass/tree/node' |
2 | |
3 | module Sass::Tree |
4 | # A dynamic node representing a Sass `@if` statement. |
5 | # |
6 | # {IfNode}s are a little odd, in that they also represent `@else` and `@else if`s. |
7 | # This is done as a linked list: |
8 | # each {IfNode} has a link (\{#else}) to the next {IfNode}. |
9 | # |
10 | # @see Sass::Tree |
11 | class IfNode < Node |
12 | # The next {IfNode} in the if-else list, or `nil`. |
13 | # |
14 | # @return [IfNode] |
15 | attr_accessor :else |
16 | |
17 | # @param expr [Script::Expr] The conditional expression. |
18 | # If this is nil, this is an `@else` node, not an `@else if` |
19 | def initialize(expr) |
20 | @expr = expr |
21 | @last_else = self |
22 | super() |
23 | end |
24 | |
25 | # Append an `@else` node to the end of the list. |
26 | # |
27 | # @param node [IfNode] The `@else` node to append |
28 | def add_else(node) |
29 | @last_else.else = node |
30 | @last_else = node |
31 | end |
32 | |
33 | # @see Node#options= |
34 | def options=(options) |
35 | super |
36 | self.else.options = options if self.else |
37 | end |
38 | |
39 | protected |
40 | |
41 | # Runs the child nodes if the conditional expression is true; |
42 | # otherwise, tries the \{#else} nodes. |
43 | # |
44 | # @param environment [Sass::Environment] The lexical environment containing |
45 | # variable and mixin values |
46 | # @return [Array<Tree::Node>] The resulting static nodes |
47 | # @see Sass::Tree |
48 | def _perform(environment) |
49 | environment = Sass::Environment.new(environment) |
50 | return perform_children(environment) if @expr.nil? || @expr.perform(environment).to_bool |
51 | return @else.perform(environment) if @else |
52 | [] |
53 | end |
54 | end |
55 | end |