roku_builder 4.15.2 → 4.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG +8 -0
- data/lib/roku_builder.rb +7 -0
- data/lib/roku_builder/plugin.rb +4 -0
- data/lib/roku_builder/plugins/indentation_inspector.rb +2 -0
- data/lib/roku_builder/plugins/performance_config.json +1 -1
- data/lib/roku_builder/version.rb +1 -1
- data/test/roku_builder/test_plugin.rb +11 -0
- data/test/roku_builder/test_roku_builder.rb +19 -0
- 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: b6a3e4bd8c77f11f513140b9429bf590bd7d61a1
|
|
4
|
+
data.tar.gz: 0b816aab48e6ffe5303ba740b068b1cf55416682
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5eede887d08c2505cdde41e30839795a61b07b7f98a50ffcdf7521169f76e367fa58364dc94503a2f59a55606854d07a6e4cd2871cf994111135167272ee411a
|
|
7
|
+
data.tar.gz: b62a5ded206dd32074409f89f4f52126b2b9d6b091a808f7723f702fe61e01a9bf64ee3076ba6d1a5d4ba5d15089411206932a48f14150fec781c28d0227c778
|
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
data/lib/roku_builder.rb
CHANGED
|
@@ -87,6 +87,7 @@ module RokuBuilder
|
|
|
87
87
|
def self.setup_plugins
|
|
88
88
|
load_plugins
|
|
89
89
|
process_plugins
|
|
90
|
+
validate_plugins
|
|
90
91
|
end
|
|
91
92
|
|
|
92
93
|
def self.load_plugins
|
|
@@ -145,6 +146,12 @@ module RokuBuilder
|
|
|
145
146
|
end
|
|
146
147
|
end
|
|
147
148
|
|
|
149
|
+
def self.validate_plugins
|
|
150
|
+
@@plugins.each do |plugin|
|
|
151
|
+
plugin.validate
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
148
155
|
def self.initialize_logger
|
|
149
156
|
if @@options[:debug]
|
|
150
157
|
Logger.set_debug
|
data/lib/roku_builder/plugin.rb
CHANGED
|
@@ -42,6 +42,8 @@ module RokuBuilder
|
|
|
42
42
|
# Don't change indentation
|
|
43
43
|
elsif @prev_line =~ /[\{\[\(:]$/
|
|
44
44
|
@ind += @count
|
|
45
|
+
elsif @prev_line =~ /:\s*\bfunction\b|:\s*\bsub\b/i
|
|
46
|
+
@ind += @count
|
|
45
47
|
elsif @prev_line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
|
|
46
48
|
@ind += @count
|
|
47
49
|
elsif @prev_line =~ /^\s*#?if\b|^\s*#?else\b/i
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"regex": "\\sas\\s(Object|Boolean|String|Integer|LongInteger|Double|Float|Function|Dynamic)",
|
|
3
|
+
"regex": "\\sas\\s+(Object|Boolean|String|Integer|LongInteger|Double|Float|Function|Dynamic)",
|
|
4
4
|
"severity": "warning",
|
|
5
5
|
"message": "Found function return type. Consider removing"
|
|
6
6
|
} ,
|
data/lib/roku_builder/version.rb
CHANGED
|
@@ -30,6 +30,14 @@ module RokuBuilder
|
|
|
30
30
|
assert_equal Array, TestClass2.dependencies.class
|
|
31
31
|
assert_equal TestClass, TestClass2.dependencies[0]
|
|
32
32
|
end
|
|
33
|
+
def test_module_validate_none
|
|
34
|
+
TestClass.validate
|
|
35
|
+
end
|
|
36
|
+
def test_module_validate_failure
|
|
37
|
+
assert_raises InvalidConfig do
|
|
38
|
+
TestClass2.validate
|
|
39
|
+
end
|
|
40
|
+
end
|
|
33
41
|
end
|
|
34
42
|
class TestClass
|
|
35
43
|
extend Plugin
|
|
@@ -43,6 +51,9 @@ module RokuBuilder
|
|
|
43
51
|
def self.dependencies
|
|
44
52
|
[TestClass]
|
|
45
53
|
end
|
|
54
|
+
def self.validate
|
|
55
|
+
raise InvalidConfig
|
|
56
|
+
end
|
|
46
57
|
end
|
|
47
58
|
end
|
|
48
59
|
|
|
@@ -210,6 +210,16 @@ module RokuBuilder
|
|
|
210
210
|
end
|
|
211
211
|
config.verify
|
|
212
212
|
end
|
|
213
|
+
def test_roku_builder_validate_success
|
|
214
|
+
RokuBuilder.register_plugin(TestPlugin)
|
|
215
|
+
RokuBuilder.validate_plugins
|
|
216
|
+
end
|
|
217
|
+
def test_roku_builder_validate_failure
|
|
218
|
+
RokuBuilder.register_plugin(TestPlugin5)
|
|
219
|
+
assert_raises InvalidConfig do
|
|
220
|
+
RokuBuilder.validate_plugins
|
|
221
|
+
end
|
|
222
|
+
end
|
|
213
223
|
end
|
|
214
224
|
class TestPlugin
|
|
215
225
|
extend Plugin
|
|
@@ -235,5 +245,14 @@ module RokuBuilder
|
|
|
235
245
|
{test: {}}
|
|
236
246
|
end
|
|
237
247
|
end
|
|
248
|
+
class TestPlugin5
|
|
249
|
+
extend Plugin
|
|
250
|
+
def self.commands
|
|
251
|
+
{}
|
|
252
|
+
end
|
|
253
|
+
def self.validate
|
|
254
|
+
raise InvalidConfig
|
|
255
|
+
end
|
|
256
|
+
end
|
|
238
257
|
end
|
|
239
258
|
|
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.
|
|
4
|
+
version: 4.16.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- greeneca
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-02-
|
|
11
|
+
date: 2019-02-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubyzip
|