roku_builder 4.22.5 → 4.22.9

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: ff75b5fd7976aa19af20672846c724440f9c00cfdfddcf516e3c9fc736df31b3
4
- data.tar.gz: a7dc6e1bbd189831f75c87ea616d92164c58e2271aca276fd881760a0a3d72c0
3
+ metadata.gz: 914ac6d549694894942d8d6904f65a24b83f146841191dcd04a7c367e04902f7
4
+ data.tar.gz: b2fa7a6ddfdb98276d2a34f15eba26b385c8b1b5e5c72ba635cd589434252bbb
5
5
  SHA512:
6
- metadata.gz: 0f80b706f07170642bb5fb2a754ecccd42d66e672ff355c94c353480edfb75b18aca8a78e3c13e40835bb6160a9622984aea331794a37e4fb75fbf70abd1345d
7
- data.tar.gz: 4f6f9697af2923ddac05ccb67d1f4f17f095730a87126acb0d61325ef0bca2fe7a1a38a34b480da85cac8c0b5b149df692f94489cb85a5ced588d53c714e7478
6
+ metadata.gz: 35c1dc3f99d5761397b924e38473424fd302c52a5dd0111b3c326e247358d3a4a2c16aefde7cab6377ecccdf0bef3447ad46e09f69916b35fb62e4a18a97d0d3
7
+ data.tar.gz: 3bc352f2204af791ddfc8d0a7ca7993ab97a0da684f8bc54e70a07a5190913cd1294181d9b0cf5ddf22d0edb664b8fcae6deef6fa893b46085facddc51a52e85
@@ -64,7 +64,7 @@ module RokuBuilder
64
64
 
65
65
  def run_sca_tool(path:, ssai:)
66
66
  if OS.unix?
67
- command = "export JAVA_HOME='JDK 11'; " + File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd")
67
+ command = File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd")
68
68
  else
69
69
  command = File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd.bat")
70
70
  end
@@ -96,6 +96,11 @@ module RokuBuilder
96
96
  if ssai and /SetAdUrl\(\) method is missing/.match(@sca_warning[:message])
97
97
  return false
98
98
  end
99
+ libraries = @config.project[:libraries]
100
+ libraries ||= []
101
+ if @sca_warning[:path] and libraries.any_is_start?(@sca_warning[:path].gsub(/pkg:/, "")) and not @options[:include_libraries]
102
+ return false
103
+ end
99
104
  return true
100
105
  end
101
106
  return false
@@ -75,8 +75,9 @@ module RokuBuilder
75
75
  parser.on("--debug", "Print Debug messages") do
76
76
  options[:debug] = true
77
77
  end
78
- parser.on("-h", "--help", "Show this message") do
79
- puts parser
78
+ parser.on("-h", "--help [PLUGIN]", "Show help") do |h|
79
+ help_text = self.get_help_text(parser: parser, options: options, plugin_name: h)
80
+ puts help_text
80
81
  exit
81
82
  end
82
83
  parser.on("-v", "--version", "Show version") do
@@ -112,6 +113,30 @@ module RokuBuilder
112
113
  def dounstage(options:)
113
114
  Stager.new(config: @config, options: options).unstage
114
115
  end
116
+
117
+ def self.get_help_text(parser:, options:, plugin_name:)
118
+ plugin = self.get_plugin_by_name(plugin_name)
119
+ if nil == plugin
120
+ return parser.to_s
121
+ else
122
+ pluginParser = OptionParser.new
123
+ pluginParser.separator ""
124
+ pluginParser.separator "Options for #{plugin}:"
125
+ plugin.parse_options(parser: pluginParser, options: options)
126
+ return pluginParser.to_s
127
+ end
128
+ end
129
+
130
+ def self.get_plugin_by_name(name)
131
+ if name.nil?
132
+ return nil
133
+ end
134
+ pluginIndex = RokuBuilder.plugins.map{|pluginClass| pluginClass.name.split('::').last().downcase}.index(name.downcase)
135
+ if !pluginIndex.nil?
136
+ plugin = RokuBuilder.plugins[pluginIndex]
137
+ return plugin
138
+ end
139
+ end
115
140
  end
116
141
  RokuBuilder.register_plugin(Core)
117
142
  end
@@ -55,6 +55,8 @@ module RokuBuilder
55
55
  end
56
56
  elsif @prev_line =~ /^\s*\bfor\b|^\s*\bwhile\b/i
57
57
  @ind += @count
58
+ elsif @prev_line =~ /^\s*\btry\b|^\s*\bcatch\b/i
59
+ @ind += @count
58
60
  end
59
61
  end
60
62
  if line =~ /^\'/ or line =~ /\'indent-ignore/
@@ -62,11 +64,13 @@ module RokuBuilder
62
64
  elsif line =~ /^\s*[\}\]\)]/
63
65
  @ind -= @count
64
66
  elsif line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
65
- @ind -= 0
67
+ # Don't change indentation
66
68
  elsif line =~ /^\s*:?\s*#?end\b|^\s*#?endif\b|^\s*endfor\b|^\s*\bnext\b/i
67
69
  @ind -= @count
68
70
  elsif line =~ /^\s*#?else\b|^\s*elseif\b/i
69
71
  @ind -= @count
72
+ elsif line =~ /^\s*#?catch\b/i
73
+ @ind -= @count
70
74
  end
71
75
  end
72
76
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.22.5"
5
+ VERSION = "4.22.9"
6
6
  end
@@ -108,6 +108,25 @@ module RokuBuilder
108
108
  core.dounstage(options: options)
109
109
  end
110
110
  end
111
+ def test_core_help
112
+ parser = OptionParser.new
113
+ options = {}
114
+ help_text = Core.get_help_text(parser: parser, options: options, plugin_name: nil)
115
+ assert help_text
116
+ end
117
+ def test_core_help_plugin
118
+ parser = OptionParser.new
119
+ options = {}
120
+ help_text = Core.get_help_text(parser: parser, options: options, plugin_name: "Loader")
121
+ assert help_text
122
+ end
123
+ def test_core_get_plugin_by_name
124
+ parser = OptionParser.new
125
+ options = {}
126
+ plugin_name = Core.get_plugin_by_name("loader")
127
+ assert plugin_name
128
+ assert_match "RokuBuilder::Loader", plugin_name.to_s
129
+ end
111
130
  end
112
131
  end
113
132
 
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.22.5
4
+ version: 4.22.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-11 00:00:00.000000000 Z
11
+ date: 2021-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip