elm-compiler 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/elm-package.json +3 -3
- data/lib/elm/compiler.rb +9 -7
- data/lib/elm/compiler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e604d6187008d8edbe57c58f5c50b0ae6a161e1
|
4
|
+
data.tar.gz: 8006d7cc87b27a3c96e996ad20ec09543f697ab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02ae3eeeeaaf8531cd45aceaec1f3a3b114b34bbeea855df3630cac43c1d6443e0e447213a9a31416a09df857e8512640c70ea7e8ad399ee3aa7006cec8d2060
|
7
|
+
data.tar.gz: 3320a10a805fc847cf128a73c0e84a47b86aa3b0372474777ab0d5ff6b2c1682f5a1b30426463b61ac9517de8197781f91f301859f584d89013585aa103e9a5a
|
data/.travis.yml
CHANGED
data/elm-package.json
CHANGED
@@ -8,8 +8,8 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "
|
12
|
-
"elm-lang/html": "
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
12
|
+
"elm-lang/html": "2.0.0 <= v < 3.0.0"
|
13
13
|
},
|
14
|
-
"elm-version": "0.
|
14
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
15
15
|
}
|
data/lib/elm/compiler.rb
CHANGED
@@ -5,13 +5,13 @@ require 'tempfile'
|
|
5
5
|
module Elm
|
6
6
|
class Compiler
|
7
7
|
class << self
|
8
|
-
def compile(elm_files, output_path: nil, elm_make_path: "elm-make")
|
8
|
+
def compile(elm_files, output_path: nil, elm_make_path: "elm-make", debug: false)
|
9
9
|
fail ExecutableNotFound unless elm_executable_exists?(elm_make_path)
|
10
10
|
|
11
11
|
if output_path
|
12
|
-
elm_make(elm_make_path, elm_files, output_path)
|
12
|
+
elm_make(elm_make_path, elm_files, output_path, debug)
|
13
13
|
else
|
14
|
-
compile_to_string(elm_make_path, elm_files)
|
14
|
+
compile_to_string(elm_make_path, elm_files, debug)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -23,15 +23,17 @@ module Elm
|
|
23
23
|
false
|
24
24
|
end
|
25
25
|
|
26
|
-
def compile_to_string(elm_make_path, elm_files)
|
26
|
+
def compile_to_string(elm_make_path, elm_files, debug)
|
27
27
|
Tempfile.open(['elm', '.js']) do |tempfile|
|
28
|
-
elm_make(elm_make_path, elm_files, tempfile.path)
|
28
|
+
elm_make(elm_make_path, elm_files, tempfile.path, debug)
|
29
29
|
return File.read tempfile.path
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def elm_make(elm_make_path, elm_files, output_path)
|
34
|
-
|
33
|
+
def elm_make(elm_make_path, elm_files, output_path, debug)
|
34
|
+
args = [{"LANG" => "en_US.UTF8" }, elm_make_path, *elm_files, '--yes', '--output', output_path]
|
35
|
+
args << "--debug" if debug
|
36
|
+
Open3.popen3(*args) do |_stdin, _stdout, stderr, wait_thr|
|
35
37
|
fail CompileError, stderr.gets(nil) if wait_thr.value.exitstatus != 0
|
36
38
|
end
|
37
39
|
end
|
data/lib/elm/compiler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elm-compiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Bonetti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.5.1
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Ruby wrapper for the Elm compiler
|