gelauto 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gelauto +19 -1
- data/lib/gelauto.rb +2 -1
- data/lib/gelauto/null_logger.rb +15 -0
- data/lib/gelauto/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f30fb13511510689896025318cf0e8ab0683858b6de8dc842ed4a208e25b707
|
4
|
+
data.tar.gz: 84a29515b428bdef7ea874bb50ab965dcaf82ad57b7b1f69cfd6925e727f70ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2396eeba2dc4c3249df90c1b6e5f9f7532573dd9eaaffb13e16f2e3422a6f92f4b01bfbef6c536f6130331fb35ce4853754700340c0a021253cd81bbe8c4c9e7
|
7
|
+
data.tar.gz: 8dcf58d657ddf118d8f21f0b041490168dd7df11e99e25eafc9a28d9fac6990fb5768fdfed4625c6bf9378aee4c90801c2222b458756c45de59737e887e78331
|
data/bin/gelauto
CHANGED
@@ -15,12 +15,20 @@ module Gelauto
|
|
15
15
|
subcommand_option_handling :normal
|
16
16
|
default_command :run
|
17
17
|
|
18
|
+
desc 'Silence log output.'
|
19
|
+
default_value false
|
20
|
+
switch [:s, :silent]
|
21
|
+
|
18
22
|
desc 'Run the given command with Gelauto and optionally annotate files.'
|
19
23
|
command :run do |c|
|
20
24
|
c.desc 'Write discovered type signatures into Ruby files.'
|
21
25
|
c.default_value false
|
22
26
|
c.switch [:a, :annotate]
|
23
27
|
|
28
|
+
c.desc 'Print type signatures to STDOUT in RBI format. Ignores --silent.'
|
29
|
+
c.default_value false
|
30
|
+
c.switch [:r, :rbi]
|
31
|
+
|
24
32
|
c.action do |global_options, options, args|
|
25
33
|
paths, _, cmd = args.chunk_while { |arg1, arg2| arg1 != '--' && arg2 != '--' }.to_a
|
26
34
|
Gelauto.paths += paths
|
@@ -45,12 +53,22 @@ module Gelauto
|
|
45
53
|
Gelauto.annotate_file(path)
|
46
54
|
Gelauto::Logger.info("Annotated #{path}")
|
47
55
|
end
|
48
|
-
|
56
|
+
end
|
57
|
+
|
58
|
+
if options[:rbi]
|
49
59
|
puts Gelauto::Rbi.new(Gelauto.method_index).to_s
|
50
60
|
end
|
51
61
|
end
|
52
62
|
end
|
53
63
|
end
|
64
|
+
|
65
|
+
pre do |global_options, _command, _options, _args|
|
66
|
+
if global_options[:silent]
|
67
|
+
Gelauto.logger = Gelauto::NullLogger.new
|
68
|
+
end
|
69
|
+
|
70
|
+
true
|
71
|
+
end
|
54
72
|
end
|
55
73
|
end
|
56
74
|
|
data/lib/gelauto.rb
CHANGED
@@ -12,6 +12,7 @@ module Gelauto
|
|
12
12
|
autoload :MethodDef, 'gelauto/method_def'
|
13
13
|
autoload :MethodIndex, 'gelauto/method_index'
|
14
14
|
autoload :Namespace, 'gelauto/namespace'
|
15
|
+
autoload :NullLogger, 'gelauto/null_logger'
|
15
16
|
autoload :Rbi, 'gelauto/rbi'
|
16
17
|
autoload :Type, 'gelauto/type'
|
17
18
|
autoload :TypeSet, 'gelauto/type_set'
|
@@ -68,7 +69,7 @@ module Gelauto
|
|
68
69
|
end
|
69
70
|
|
70
71
|
def logger
|
71
|
-
@logger ||= ::Logger.new(
|
72
|
+
@logger ||= ::Logger.new(STDERR)
|
72
73
|
end
|
73
74
|
|
74
75
|
private
|
data/lib/gelauto/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gelauto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- lib/gelauto/method_def.rb
|
63
63
|
- lib/gelauto/method_index.rb
|
64
64
|
- lib/gelauto/namespace.rb
|
65
|
+
- lib/gelauto/null_logger.rb
|
65
66
|
- lib/gelauto/rbi.rb
|
66
67
|
- lib/gelauto/rspec.rb
|
67
68
|
- lib/gelauto/type.rb
|