rpr 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rpr.rb +12 -2
- data/lib/rpr/parser/rubocop.rb +12 -0
- data/lib/rpr/parser/sexp.rb +11 -0
- data/lib/rpr/parser/tokenize.rb +11 -0
- data/lib/rpr/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11c20c5522404b3b60be41e241af6217eaf62c42
|
4
|
+
data.tar.gz: 231f5492051917eea2053c8ace3f4f7f0f347544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4bc03ce715ef74b54eca008b2387f282f75a513d435b2ccae20aa82f13ff5b6ffe17464c06befa5a6fa3579606987b1bf1be6aa994b7906d3197f79edb4c7f2
|
7
|
+
data.tar.gz: 52a747b0910491ab8ad23c1098d664a71fc61497c34b19f8217893b591ffe52130cbafe8f85d0055f3c80a8af72ebdb543a19228b58c8cbabe6a57d40a997e3d
|
data/lib/rpr.rb
CHANGED
@@ -16,9 +16,10 @@ module Rpr
|
|
16
16
|
end
|
17
17
|
|
18
18
|
formatter = find_formatter(options[:formatter])
|
19
|
-
|
19
|
+
parser = find_parser(options[:method])
|
20
|
+
args.each do |fname|
|
20
21
|
code = File.read(fname)
|
21
|
-
res =
|
22
|
+
res = parser.parse(code)
|
22
23
|
|
23
24
|
formatter.print(res)
|
24
25
|
end
|
@@ -35,6 +36,15 @@ module Rpr
|
|
35
36
|
raise "#{name} is unknown formatter."
|
36
37
|
end
|
37
38
|
|
39
|
+
# @param [String] name
|
40
|
+
# @return [Module]
|
41
|
+
def find_parser(name)
|
42
|
+
require "rpr/parser/#{name}"
|
43
|
+
Parser.const_get(:"#{name[0].upcase}#{name[1..-1]}")
|
44
|
+
rescue LoadError
|
45
|
+
raise "#{name} is unknown parser."
|
46
|
+
end
|
47
|
+
|
38
48
|
# @param [Array<String>] args
|
39
49
|
def parse_args(args)
|
40
50
|
res = {
|
data/lib/rpr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.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: 2016-05-
|
11
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -160,6 +160,9 @@ files:
|
|
160
160
|
- lib/rpr/formatter/json.rb
|
161
161
|
- lib/rpr/formatter/pp.rb
|
162
162
|
- lib/rpr/formatter/pry.rb
|
163
|
+
- lib/rpr/parser/rubocop.rb
|
164
|
+
- lib/rpr/parser/sexp.rb
|
165
|
+
- lib/rpr/parser/tokenize.rb
|
163
166
|
- lib/rpr/version.rb
|
164
167
|
- rpr.gemspec
|
165
168
|
homepage: https://github.com/pocke/rpr
|