roku_builder 4.21.5 → 4.21.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a3ef1eb871ea4979ed73ece95c1211b2435f6651e118add52434b163268c5a8
4
- data.tar.gz: af458ef520e7d7cfb1a93a7d2df1df4c6b885aebc338ddd624100afe8c90aca1
3
+ metadata.gz: bcd83884e0acc2164d90915b4949c8a8b8334ee072ed45ca3c82e1f823b77d3f
4
+ data.tar.gz: 8f48403dd9bba7982c0cde10a2667f85d3da88244401fa17fd4b1d8675cb4709
5
5
  SHA512:
6
- metadata.gz: c3ba492b2dcb170dba88e48e77022b537cd1b36c5d98da91788fb4f6d8e8dfce92b706bf57197bc1639f5501c617750b8ba541796b456252c3f8133c645b69ad
7
- data.tar.gz: 8ee571d3ee816221ba12c9a2b2e59456f420a6ab09c7de5de6e9ab8ac70ca0e431dba3d7be13b8d21db492cf4876a25599605fa1547c11844c3330e6d864a072
6
+ metadata.gz: e5397243a045a1d8bac3dbc06381513e7a34b5e74bdb00d7e8cfd2eaf4bb89f520e8b01c1c25bae531551d1cce2a1273dec0b7d84f5877b2b61741e54e59f1a8
7
+ data.tar.gz: d368e046903392039969c8a3ba0b339755fd6a707126f792403143c8b2d835dfa4156f8464d19bf733e6ff76241ccf4b1efe695a85bd745f2126bfa1abf54af5
@@ -13,38 +13,49 @@ module RokuBuilder
13
13
  File.open(file_path) do |file|
14
14
  in_xml_comment = false
15
15
  indent_inspector = IndentationInspector.new(rules: @indent_config, path: file_path) if @indent_config
16
+ full_file = []
17
+ file_no_comments = []
18
+ lines_to_ignore = []
16
19
  file.readlines.each_with_index do |line, line_number|
17
20
  full_line = line.dup
18
- line = line.partition("'").first if file_path.end_with?(".brs")
21
+ line.gsub!(/'.*/, "") if file_path.end_with?(".brs")
19
22
  if file_path.end_with?(".xml")
20
23
  if in_xml_comment
21
24
  if line.gsub!(/.*-->/, "")
22
25
  in_xml_comment = false
23
26
  else
24
- line = ""
27
+ line = "\n"
25
28
  end
26
29
  end
27
30
  line.gsub!(/<!--.*-->/, "")
28
31
  in_xml_comment = true if line.gsub!(/<!--.*/, "")
29
32
  end
30
33
  indent_inspector.check_line(line: full_line, number: line_number, comment: in_xml_comment) if indent_inspector
31
- @inspector_config.each do |line_inspector|
32
- line_to_check = line
33
- line_to_check = full_line if line_inspector[:include_comments]
34
- match = nil
35
- if line_inspector[:case_sensitive]
36
- match = /#{line_inspector[:regex]}/.match(line_to_check)
37
- else
38
- match = /#{line_inspector[:regex]}/i.match(line_to_check)
39
- end
40
- if match
41
- unless /'.*ignore-warning/i.match(full_line)
42
- add_warning(inspector: line_inspector, file: file_path, line: line_number, match: match)
43
- end
44
- end
34
+ if /'.*ignore-warning/i.match(full_line)
35
+ lines_to_ignore.push line_number
45
36
  end
37
+ full_file.push(full_line)
38
+ file_no_comments.push(line)
46
39
  end
47
40
  @warnings += indent_inspector.warnings if indent_inspector
41
+ no_comments = file_no_comments.join("")
42
+ file = full_file.join("")
43
+ @inspector_config.each do |line_inspector|
44
+ to_check = no_comments
45
+ to_check = file if line_inspector[:include_comments]
46
+ match = nil
47
+ if line_inspector[:case_sensitive]
48
+ match = /#{line_inspector[:regex]}/.match(to_check)
49
+ else
50
+ match = /#{line_inspector[:regex]}/i.match(to_check)
51
+ end
52
+ if match
53
+ line_number = to_check[0..match.begin(0)].split("\n", -1).count - 1
54
+ unless lines_to_ignore.include?(line_number)
55
+ add_warning(inspector: line_inspector, file: file_path, line: line_number, match: match)
56
+ end
57
+ end
58
+ end
48
59
  end
49
60
  @warnings
50
61
  end
@@ -10,7 +10,7 @@
10
10
  "message": "Found DoesExist check. Try using invalid check on dot reference"
11
11
  },
12
12
  {
13
- "regex": "[^\\s]+\\[\"[^\"]+\"\\]",
13
+ "regex": "\\w+\\[\"[^\"]+\"\\]",
14
14
  "severity": "warning",
15
15
  "message": "Found AA String reference. Try switching to dot reference"
16
16
  },
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.21.5"
5
+ VERSION = "4.21.6"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roku_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.21.5
4
+ version: 4.21.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-27 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip