gry 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/gry/cli.rb +6 -0
- data/lib/gry/option.rb +3 -1
- data/lib/gry/version.rb +1 -1
- 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: c3213ccb72d60bbf5223c9fd63e15ca683ccaec0
|
4
|
+
data.tar.gz: 8f40bd76b18081ac8b189dc68d175ea2f58fba33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6607804a93edd5bf44b63465601036a7aa9bec0b1f04ad2274358b4e2ccd81f738de0148f0838899c8096e44cebcaf280c49e1609c47a8c46698d2cdbde01f8
|
7
|
+
data.tar.gz: 1889bd5270eaa078a266d60d55ae2e8f7936e7f133ee9b32b2813e0a4be3cb0b01a07d9f9230a2f67dd2533550c7aba5b3eecc46618a562704558e401fbce520
|
data/lib/gry/cli.rb
CHANGED
@@ -25,6 +25,10 @@ module Gry
|
|
25
25
|
save_cache(b, cops)
|
26
26
|
end
|
27
27
|
end
|
28
|
+
if opt.raw
|
29
|
+
writer.puts JSON.generate(bills)
|
30
|
+
return
|
31
|
+
end
|
28
32
|
|
29
33
|
congress = Congress.new(
|
30
34
|
max_count: opt.max_count,
|
@@ -39,6 +43,8 @@ module Gry
|
|
39
43
|
writer.puts fmt.format(laws)
|
40
44
|
end
|
41
45
|
|
46
|
+
private
|
47
|
+
|
42
48
|
def save_cache(bills, cops)
|
43
49
|
Dir.mkdir(CACHE_DIR) unless CACHE_DIR.exist?
|
44
50
|
cache = {
|
data/lib/gry/option.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Gry
|
2
2
|
class Option
|
3
|
-
attr_reader :args, :process, :version, :fast, :max_count, :min_difference, :display_disabled_cops, :metrics_percentile, :cache
|
3
|
+
attr_reader :args, :process, :version, :fast, :max_count, :min_difference, :display_disabled_cops, :metrics_percentile, :cache, :raw
|
4
4
|
|
5
5
|
def initialize(argv)
|
6
6
|
opt = OptionParser.new
|
@@ -12,6 +12,7 @@ module Gry
|
|
12
12
|
@display_disabled_cops = false
|
13
13
|
@metrics_percentile = 95
|
14
14
|
@cache = true
|
15
|
+
@raw = false
|
15
16
|
|
16
17
|
opt.banner = 'Usage: gry [options] [Cop1, Cop2, ...]'
|
17
18
|
|
@@ -24,6 +25,7 @@ module Gry
|
|
24
25
|
opt.on('--metrics-percentile=95', 'Percentile for allowed complex code') {|v| @metrics_percentile = v.to_i}
|
25
26
|
opt.on('--display-disabled-cops', 'Display disabled cops') {|v| @display_disabled_cops = v}
|
26
27
|
opt.on('--[no-]cache', 'Run gry with cache. Default: true') {|v| @cache = v}
|
28
|
+
opt.on('--raw', 'Display raw data(JSON). Default: false') {|v| @raw = v}
|
27
29
|
|
28
30
|
@args = opt.parse(argv)
|
29
31
|
end
|
data/lib/gry/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Kuwabara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|