gloss 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -4
- data/gloss.gemspec +3 -2
- data/lib/gloss/config.rb +2 -1
- data/lib/gloss/prog_loader.rb +20 -16
- data/lib/gloss/version.rb +1 -1
- data/lib/gloss/writer.rb +3 -0
- data/src/lib/gloss/config.gl +2 -1
- data/src/lib/gloss/prog_loader.gl +3 -1
- data/src/lib/gloss/version.gl +1 -1
- data/src/lib/gloss/writer.gl +3 -0
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 622926d0bd44e5bd9b93cfa75ea54dc67d976a63c91a5a60f17c859987ee2fce
|
4
|
+
data.tar.gz: 789917be6b264be0108cb03371b797c4ebc865e01fcb7218589808ccd68bdf83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5fe3cf7f37aa5eec834b806c1f80083dde5be4b15000f18ae4807cb0d2ee5e3f378eaa271ffe3cb4d61b58feb98c3ac0586ab65da5ef2bb3df5dad1e4a02b2e
|
7
|
+
data.tar.gz: b2f55defed2e6ba5d3dec55dd7b6795a3f3ff54fa1e94532bc0bda6d91f099200d5ec40926c6c3b001a27809477016bdd8a59d24a6472419b0958647df6b5c00
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gloss (0.1.
|
4
|
+
gloss (0.1.5)
|
5
5
|
fast_blank
|
6
6
|
listen
|
7
|
-
rbs (
|
8
|
-
steep (
|
7
|
+
rbs (= 1.0.4)
|
8
|
+
steep (= 0.41.0)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
rb-fsevent (0.10.4)
|
50
50
|
rb-inotify (0.10.1)
|
51
51
|
ffi (~> 1.0)
|
52
|
-
rbs (1.0.
|
52
|
+
rbs (1.0.4)
|
53
53
|
regexp_parser (2.0.3)
|
54
54
|
rexml (3.2.4)
|
55
55
|
rspec (3.10.0)
|
@@ -77,6 +77,7 @@ GEM
|
|
77
77
|
rubocop-ast (1.4.0)
|
78
78
|
parser (>= 2.7.1.5)
|
79
79
|
ruby-progressbar (1.11.0)
|
80
|
+
rufo (0.12.0)
|
80
81
|
steep (0.41.0)
|
81
82
|
activesupport (>= 5.1)
|
82
83
|
ast_utils (>= 0.4.0)
|
@@ -99,6 +100,7 @@ DEPENDENCIES
|
|
99
100
|
rake-compiler
|
100
101
|
rspec
|
101
102
|
rubocop
|
103
|
+
rufo
|
102
104
|
|
103
105
|
BUNDLED WITH
|
104
106
|
2.2.3
|
data/gloss.gemspec
CHANGED
@@ -17,11 +17,12 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.add_runtime_dependency "fast_blank"
|
19
19
|
s.add_runtime_dependency "listen"
|
20
|
-
s.add_runtime_dependency "rbs", "
|
21
|
-
s.add_runtime_dependency "steep", "
|
20
|
+
s.add_runtime_dependency "rbs", "1.0.4"
|
21
|
+
s.add_runtime_dependency "steep", "0.41.0"
|
22
22
|
|
23
23
|
s.add_development_dependency "pry-byebug"
|
24
24
|
s.add_development_dependency "rake-compiler"
|
25
25
|
s.add_development_dependency "rspec"
|
26
26
|
s.add_development_dependency "rubocop"
|
27
|
+
s.add_development_dependency "rufo"
|
27
28
|
end
|
data/lib/gloss/config.rb
CHANGED
@@ -11,7 +11,8 @@ module Gloss
|
|
11
11
|
:src_dir => "src",
|
12
12
|
:entrypoint => nil,
|
13
13
|
:strict_require => false,
|
14
|
-
:type_checking_strictness => "strict"
|
14
|
+
:type_checking_strictness => "strict",
|
15
|
+
:prettify_output_executable_path => nil}.freeze)
|
15
16
|
def self.load_config()
|
16
17
|
user_config = (if File.exist?(File.absolute_path(File.join(Dir.pwd, CONFIG_PATH)))
|
17
18
|
YAML.safe_load(File.read(CONFIG_PATH))
|
data/lib/gloss/prog_loader.rb
CHANGED
@@ -19,27 +19,31 @@ module Gloss
|
|
19
19
|
end
|
20
20
|
def run()
|
21
21
|
@files_to_process.each() { |path_string|
|
22
|
-
|
23
|
-
|
22
|
+
(if path_string.end_with?(".rbs")
|
23
|
+
@type_checker.load_sig_path(path_string)
|
24
|
+
else
|
25
|
+
(if !@processed_files.member?(path_string) || !OUTPUT_BY_PATH.[](path_string)
|
26
|
+
Gloss.logger
|
24
27
|
.debug("Loading #{path_string}")
|
25
|
-
|
26
|
-
|
28
|
+
path = Utils.absolute_path(path_string)
|
29
|
+
file_contents = File.open(path)
|
27
30
|
.read
|
28
|
-
|
31
|
+
contents_tree = Parser.new(file_contents)
|
29
32
|
.run
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
on_new_file_referenced = proc() { |ps, relative|
|
34
|
+
ps.each() { |pa|
|
35
|
+
(if relative
|
36
|
+
handle_require_relative(pa, path_string)
|
37
|
+
else
|
38
|
+
handle_require(pa)
|
39
|
+
end)
|
40
|
+
}
|
37
41
|
}
|
38
|
-
|
39
|
-
OUTPUT_BY_PATH.[]=(path_string, Visitor.new(contents_tree, @type_checker, on_new_file_referenced)
|
42
|
+
OUTPUT_BY_PATH.[]=(path_string, Visitor.new(contents_tree, @type_checker, on_new_file_referenced)
|
40
43
|
.run)
|
41
|
-
|
42
|
-
|
44
|
+
@processed_files.add(path_string)
|
45
|
+
end)
|
46
|
+
end)
|
43
47
|
}
|
44
48
|
@type_checker
|
45
49
|
end
|
data/lib/gloss/version.rb
CHANGED
data/lib/gloss/writer.rb
CHANGED
data/src/lib/gloss/config.gl
CHANGED
@@ -23,7 +23,9 @@ module Gloss
|
|
23
23
|
def run
|
24
24
|
@files_to_process.each do |path_string|
|
25
25
|
# currently steep would give an `unexpected jump` if next was used
|
26
|
-
|
26
|
+
if path_string.end_with? ".rbs"
|
27
|
+
@type_checker.load_sig_path path_string
|
28
|
+
elsif !@processed_files.member?(path_string) || !OUTPUT_BY_PATH.[](path_string)
|
27
29
|
Gloss.logger.debug "Loading #{path_string}"
|
28
30
|
path = Utils.absolute_path(path_string)
|
29
31
|
file_contents = File.open(path).read
|
data/src/lib/gloss/version.gl
CHANGED
data/src/lib/gloss/writer.gl
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gloss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- johansenja
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fast_blank
|
@@ -42,28 +42,28 @@ dependencies:
|
|
42
42
|
name: rbs
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.0.4
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.0.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: steep
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.41.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.41.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rufo
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
description: A rich language which compiles to ruby. Including type annotations, type
|
126
140
|
checking, macros, annotations, enums and more
|
127
141
|
email:
|
@@ -217,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
231
|
- !ruby/object:Gem::Version
|
218
232
|
version: '0'
|
219
233
|
requirements: []
|
220
|
-
rubygems_version: 3.
|
234
|
+
rubygems_version: 3.2.3
|
221
235
|
signing_key:
|
222
236
|
specification_version: 4
|
223
237
|
summary: A superset of ruby
|