Class: Elm::Compiler

Inherits:
Object
  • Object
show all
Includes:
Contracts::Builtin, Contracts::Core
Defined in:
lib/elm/compiler.rb

Overview

Compile a set of elm files with options

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.with(runnable) ⇒ Object



13
14
15
# File 'lib/elm/compiler.rb', line 13

def self.with(runnable)
  Compiler.new runnable
end

Instance Method Details

#content(data, with_options: {}) ⇒ Object



34
35
36
37
38
39
# File 'lib/elm/compiler.rb', line 34

def content(data, with_options: Elm::Options.new)
  Tempfile.open(['elm', '.elm']) do |tempfile|
    tempfile.write data
    files [tempfile.path], with_options: with_options
  end
end

#files(files_list, with_options: {}) ⇒ Object



18
19
20
# File 'lib/elm/compiler.rb', line 18

def files(files_list, with_options: Elm::Options.new)
  Files.new @make, files_list, with_options
end