flutter_analyze_parser 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/flutter_analyze_parser.rb +17 -17
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ef8a62122f17504429e24b5a5c661d73a41e805b
4
- data.tar.gz: f2038fa50c7ffbd4b00d2a86b33183f84cc6191d
2
+ SHA256:
3
+ metadata.gz: 2620b4f6e1fc97234a1f14b48e2b7c114a818611319396b139d6536628db85cc
4
+ data.tar.gz: c6a54c975719fca3872a81b075dc67978a30aab6a8a3659368f4a515206a97b6
5
5
  SHA512:
6
- metadata.gz: 37200a586877e01da3a7c23416afbab9d7da09faba293c9efb10a8a0cb14b2eecef1dee8133e1059cdeb5600728823a0799a1244e8d9f486fd35cf9e71d77ef4
7
- data.tar.gz: 94960b3e11b2d90c19e3b6eccce2a1f67cba3b16de168d3ca0331a9bd22ec33990c79974b01b3dbd9362627670f5fbe9c7eedc91dc97a0b174f05d2cf55d6e65
6
+ metadata.gz: 4ae28e14315deecb745ea777619d35da6916d1ddabd640c3e2e63998a7f4ee5ee2c30943341e87ed33eb8582c1da4c2149dfd8e80421eab70e7f0d339025e1c8
7
+ data.tar.gz: 67e8f1016d83d5ac0b1248e9167dc5469593d1c60de06c65762436e50d3561a7f48aea103cde918e08380f9c9c0c009459b7857bb4f396ce5c2174dbf6746efd
@@ -1,30 +1,30 @@
1
1
  FlutterViolation = Struct.new(:rule, :description, :file, :line)
2
2
 
3
3
  class FlutterAnalyzeParser
4
- def self.violations(input)
5
- filtered_input = filtered_input(input)
4
+ class << self
5
+ def violations(input)
6
+ filtered_input = filter_input(input)
6
7
 
7
- if filtered_input.detect { |element| element.include? "No issues found!" }
8
- return []
9
- else
10
- violations = []
8
+ return [] if filtered_input.detect { |element| element.include? "No issues found!" }
11
9
 
12
10
  filtered_input
13
11
  .select { |line| line.start_with? "info" }
14
- .each do |line|
15
- _, description, file_with_line_number, rule = line.split(" • ")
16
- file, line = file_with_line_number.split(":")
12
+ .map(&method(:parse_line))
13
+ end
17
14
 
18
- violations << FlutterViolation.new(rule, description, file, line.to_i)
19
- end
15
+ private
20
16
 
21
- return violations
17
+ def filter_input(input)
18
+ input.each_line
19
+ .map(&:strip)
20
+ .reject(&:empty?)
22
21
  end
23
- end
24
22
 
25
- def self.filtered_input(input)
26
- input.each_line
27
- .reject { |line| line.strip.empty? }
28
- .map(&:strip)
23
+ def parse_line(line)
24
+ _, description, file_with_line_number, rule = line.split(" • ")
25
+ file, line = file_with_line_number.split(":")
26
+
27
+ FlutterViolation.new(rule, description, file, line.to_i)
28
+ end
29
29
  end
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flutter_analyze_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Szklarek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-12 00:00:00.000000000 Z
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard-rspec
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.6.13
138
+ rubygems_version: 3.0.1
140
139
  signing_key:
141
140
  specification_version: 4
142
141
  summary: Parser for flutter analyze output