Class: Syntaxer::Runner

Inherits:
Object
  • Object
show all
Includes:
Open3
Defined in:
lib/syntaxer/runner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exec_rule = nil) ⇒ Runner

Returns a new instance of Runner



9
10
11
# File 'lib/syntaxer/runner.rb', line 9

def initialize exec_rule = nil
  @exec_rule = exec_rule
end

Instance Attribute Details

#exec_ruleObject

Returns the value of attribute exec_rule



7
8
9
# File 'lib/syntaxer/runner.rb', line 7

def exec_rule
  @exec_rule
end

#languageObject

Returns the value of attribute language



7
8
9
# File 'lib/syntaxer/runner.rb', line 7

def language
  @language
end

Class Method Details

.default(exec_rule) ⇒ Object



23
24
25
26
27
# File 'lib/syntaxer/runner.rb', line 23

def default exec_rule
  c = self.new(exec_rule)
  c.extend(Runners::Default)
  c
end

.javascriptObject



14
15
16
17
18
19
20
21
# File 'lib/syntaxer/runner.rb', line 14

def javascript
  lambda do
    c = Syntaxer::Runner.new
    c.language = 'javascript' # it is using for backward compatibility
    c.extend(Runners::Javascript)
    c
  end
end