gloss 0.0.1 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +3 -0
- data/.github/workflows/crystal_specs.yml +26 -0
- data/.github/workflows/ruby_specs.yml +33 -0
- data/.gitignore +2 -1
- data/.rspec +1 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +26 -34
- data/LICENSE +21 -0
- data/README.md +59 -7
- data/Rakefile +4 -0
- data/exe/gloss +15 -1
- data/ext/gloss/Makefile +27 -5
- data/ext/gloss/extconf.rb +3 -25
- data/ext/gloss/{src/lib → lib}/cr_ruby.cr +0 -0
- data/ext/gloss/lib/rbs_types.cr +3 -0
- data/ext/gloss/spec/parser_spec.cr +124 -0
- data/ext/gloss/spec/spec_helper.cr +2 -0
- data/ext/gloss/src/cr_ast.cr +129 -31
- data/ext/gloss/src/gloss.cr +12 -18
- data/ext/gloss/src/lexer.cr +59 -1
- data/ext/gloss/src/parser.cr +548 -254
- data/ext/gloss/src/rb_ast.cr +153 -27
- data/gloss.gemspec +1 -0
- data/lib/gloss.rb +4 -1
- data/lib/gloss/builder.rb +607 -409
- data/lib/gloss/cli.rb +64 -24
- data/lib/gloss/config.rb +16 -10
- data/lib/gloss/errors.rb +13 -7
- data/lib/gloss/initializer.rb +11 -6
- data/lib/gloss/logger.rb +34 -0
- data/lib/gloss/parser.rb +35 -0
- data/lib/gloss/scope.rb +8 -3
- data/lib/gloss/source.rb +18 -15
- data/lib/gloss/type_checker.rb +96 -0
- data/lib/gloss/version.rb +6 -1
- data/lib/gloss/watcher.rb +63 -19
- data/lib/gloss/writer.rb +18 -12
- data/sig/gloss.rbs +3 -0
- data/sig/listen.rbs +1 -0
- data/src/lib/gloss/builder.gl +546 -0
- data/src/lib/gloss/cli.gl +55 -0
- data/src/lib/gloss/config.gl +21 -0
- data/src/lib/gloss/errors.gl +11 -0
- data/src/lib/gloss/initializer.gl +20 -0
- data/src/lib/gloss/logger.gl +26 -0
- data/src/lib/gloss/parser.gl +31 -0
- data/src/lib/gloss/scope.gl +9 -0
- data/src/lib/gloss/source.gl +32 -0
- data/src/lib/gloss/type_checker.gl +101 -0
- data/src/lib/gloss/version.gl +3 -0
- data/src/lib/gloss/watcher.gl +67 -0
- data/src/lib/gloss/writer.gl +33 -0
- metadata +42 -6
- data/lib/gloss.bundle.dwarf +0 -0
- data/src/lib/hrb/initializer.gl +0 -22
- data/src/lib/hrb/watcher.gl +0 -32
data/lib/gloss.bundle.dwarf
DELETED
Binary file
|
data/src/lib/hrb/initializer.gl
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "yaml"
|
4
|
-
|
5
|
-
module Gloss
|
6
|
-
class Initializer
|
7
|
-
def initialize(@force)
|
8
|
-
end
|
9
|
-
|
10
|
-
def run
|
11
|
-
if File.exist?(".gloss.yml") && !@force
|
12
|
-
abort ".gloss.yml file already exists - aborting. Use --force to override."
|
13
|
-
end
|
14
|
-
|
15
|
-
File.open(".gloss.yml", "wb") do |file|
|
16
|
-
file.puts Config.default_config.transform_keys(&:to_s).to_yaml
|
17
|
-
end
|
18
|
-
|
19
|
-
puts "Created .gloss.yml with default preferences"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/src/lib/hrb/watcher.gl
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "listen"
|
4
|
-
|
5
|
-
module Gloss
|
6
|
-
class Watcher
|
7
|
-
def initialize
|
8
|
-
@paths = %w[src/]
|
9
|
-
end
|
10
|
-
|
11
|
-
def watch
|
12
|
-
puts "=====> Now listening for changes in #{@paths.join(', ')}"
|
13
|
-
listener = Listen.to(*@paths, latency: 2) do |modified, added, removed|
|
14
|
-
(modified + added).each do |f|
|
15
|
-
content = File.read(f)
|
16
|
-
Writer.new(Builder.new(content).run, f).run
|
17
|
-
end
|
18
|
-
removed.each do |f|
|
19
|
-
out_path = Utils.src_path_to_output_path(f)
|
20
|
-
File.delete out_path if File.exist? out_path
|
21
|
-
end
|
22
|
-
end
|
23
|
-
listener.start
|
24
|
-
begin
|
25
|
-
loop { sleep 10 }
|
26
|
-
rescue Interrupt
|
27
|
-
puts "=====> Interrupt signal received, shutting down"
|
28
|
-
exit 0
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|