Class: Elm::Files
- Inherits:
-
Object
- Object
- Elm::Files
- Includes:
- Contracts::Builtin, Contracts::Core
- Defined in:
- lib/elm/files.rb
Overview
Elm files to be compiled
Instance Method Summary collapse
-
#initialize(make, files, options) ⇒ Files
constructor
A new instance of Files.
- #to_file ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(make, files, options) ⇒ Files
Returns a new instance of Files.
43 44 45 46 47 48 49 |
# File 'lib/elm/files.rb', line 43 def initialize(make, files, ) @make = make @files = files = .with_yes self end |
Instance Method Details
#to_file ⇒ Object
63 64 65 66 |
# File 'lib/elm/files.rb', line 63 def to_file run_status = compile CompileOutput.new .output, run_status end |
#to_s ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/elm/files.rb', line 52 def to_s content = '' run_status = nil Tempfile.open(['elm', '.js']) do |tempfile| run_status = compile .with_output(tempfile.path) content = File.read tempfile end CompileOutput.new content, run_status end |