roku_builder 4.22.8 → 4.22.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '095541972d5f6044a4ce8f7764a2001fdc20e0095fc00823a59b046c2543a6cc'
4
- data.tar.gz: 04fe333f5912595ac824c18e4af9fb0d4d1e00224b87473be666a897cbc0b1a8
3
+ metadata.gz: 914ac6d549694894942d8d6904f65a24b83f146841191dcd04a7c367e04902f7
4
+ data.tar.gz: b2fa7a6ddfdb98276d2a34f15eba26b385c8b1b5e5c72ba635cd589434252bbb
5
5
  SHA512:
6
- metadata.gz: 6eb9b8667f9eb6ab5568955d2033a859c34ed6b9da1a5291db531eceb72d6404d39db09fef702f5b50d5871d5e9838f6b69278ab0dd3a9f0507d1f794f6a73ed
7
- data.tar.gz: a20fee6d540ad890bcb224370f303ec3b0571e01c241b277e4d5965ebe4297f3505e662ed6a79f5a615d60652921b239289cd5b4a2885b595904034698114ad4
6
+ metadata.gz: 35c1dc3f99d5761397b924e38473424fd302c52a5dd0111b3c326e247358d3a4a2c16aefde7cab6377ecccdf0bef3447ad46e09f69916b35fb62e4a18a97d0d3
7
+ data.tar.gz: 3bc352f2204af791ddfc8d0a7ca7993ab97a0da684f8bc54e70a07a5190913cd1294181d9b0cf5ddf22d0edb664b8fcae6deef6fa893b46085facddc51a52e85
@@ -98,7 +98,7 @@ module RokuBuilder
98
98
  end
99
99
  libraries = @config.project[:libraries]
100
100
  libraries ||= []
101
- if libraries.any_is_start?(@sca_warning[:path].gsub(/pkg:/, "")) and not @options[:include_libraries]
101
+ if @sca_warning[:path] and libraries.any_is_start?(@sca_warning[:path].gsub(/pkg:/, "")) and not @options[:include_libraries]
102
102
  return false
103
103
  end
104
104
  return true
@@ -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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.22.8"
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.8
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-23 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