ruby-elm 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elm/compiler.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dca5811a16c26814915e18ece649c317225c7c38
|
4
|
+
data.tar.gz: 9f7fa319c3f2d9b6f9e6a1f55bfe59220e76527c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 526c718a0eac10dfc22ed76b393f3d4f4d2722c3ff29c7155ccbaec262785ccb5d28fe3e78decb8c93f0b08d2543fd194a4198e1e582d88bc12effa9a6bfca8d
|
7
|
+
data.tar.gz: 9b183da7f8139edb2c4fb87e9e8481ff6a8a4ef33bdae218721aacc2aadff41ab066dd2b4c11b4e9e5b6da4d2c83c8b63c9b96e4849bece88b09a353e447b00b
|
data/lib/elm/compiler.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'contracts'
|
2
|
+
require 'tempfile'
|
2
3
|
require 'elm/runnable'
|
3
4
|
require 'elm/files'
|
4
5
|
|
@@ -29,6 +30,25 @@ module Elm
|
|
29
30
|
end
|
30
31
|
# rubocop:enable Lint/DuplicateMethods
|
31
32
|
|
33
|
+
Contract String, KeywordArgs[with_options: Optional[Elm::Options]] => Files # rubocop:disable Metrics/LineLength
|
34
|
+
def content(data, with_options: Elm::Options.new)
|
35
|
+
Tempfile.open(['elm', '.elm']) do |tempfile|
|
36
|
+
tempfile.write data
|
37
|
+
files [tempfile.path], with_options: with_options
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# rubocop:disable Lint/DuplicateMethods
|
42
|
+
Contract String, KeywordArgs[with_options: { output: Maybe[String],
|
43
|
+
yes: Maybe[Bool],
|
44
|
+
report: Maybe[Symbol],
|
45
|
+
warn: Maybe[Bool],
|
46
|
+
docs: Maybe[String] }] => Files # rubocop:disable Metrics/LineLength
|
47
|
+
def content(data, with_options: {})
|
48
|
+
content data, with_options: Elm::Options.with(with_options)
|
49
|
+
end
|
50
|
+
# rubocop:enable Lint/DuplicateMethods
|
51
|
+
|
32
52
|
private
|
33
53
|
|
34
54
|
Contract Elm::Runnable => Elm::Compiler
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-elm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yves Brissaud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|