roku_builder 4.30.0 → 4.30.2

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: a83d3f8dadf3d591574ab78a796d1493829f5d9e70fd711b38a259489cab9698
4
- data.tar.gz: fe9726c50b42c16fcaea595af4de34eaae69e6b4475e816a3f325e8b4f40753a
3
+ metadata.gz: d871e3265c4e99eb44d7e898cac907db092436392aaa2122e9604f6ef1dc9d97
4
+ data.tar.gz: 9f71d6ac3de1adbc170600f73aa5c51a01d75a96e66f131f4a60ebced26bff3f
5
5
  SHA512:
6
- metadata.gz: 1b9a7f32a3f82c82baad657d458440084c65943c6a462c8e6a742058082cb67f0538d406cc45d80608023ffe1679a749940aed41824d2a5b5ab4a0f94b0a6f94
7
- data.tar.gz: b8355e7a6a93b16e45f1e96ca699d22f0f32f9f7cde59a8cde50a1428310ee9b06823a4ef187f4da5c4c81e1a1327a4b823681ef900d9a3b4492daadd51a27ab
6
+ metadata.gz: 1c9181918890fbc93df02698d7b7f317d765485b368029ac344d299d1f66919ca5822426b94899c3eea7ce28eea5060db24816491ef47722324a6c1c197b85f5
7
+ data.tar.gz: 0352cc27c7bb4f728d4c66674b7b2032a5ac3cac0fddb1829c243e3cc645620c7428d2df6187bf2d8e385ef6e19d9088d5eb55b897682dbb100393fb654e8737
@@ -125,6 +125,9 @@ module RokuBuilder
125
125
  unless @parsed[:out][:folder]
126
126
  @parsed[:out][:folder] = Dir.tmpdir
127
127
  end
128
+ if @config[:default_file]
129
+ @parsed[:out][:default_file] = @config[:default_file]
130
+ end
128
131
  end
129
132
 
130
133
  def setup_project_config
@@ -152,6 +152,7 @@ module RokuBuilder
152
152
 
153
153
  def file_path(type)
154
154
  file = @config.send(type)[:file]
155
+ file ||= @config.send(type)[:default_file]
155
156
  file ||= Manifest.new(config: @config).build_version
156
157
  file ||= SecureRandom.uuid
157
158
  file = file+".zip" unless file.end_with?(".zip")
@@ -81,6 +81,7 @@ module RokuBuilder
81
81
  path = "/keypress/#{@commands[command]}"
82
82
  @logger.debug("Send Command: "+path)
83
83
  response = conn.post path
84
+ puts response.body
84
85
  raise ExecutionError, "Navigation Failed" unless response.success?
85
86
  end
86
87
  end
@@ -28,6 +28,13 @@ module RokuBuilder
28
28
  parser.on("--inspect-package", "Inspect package after packaging") do
29
29
  options[:inspect_package] = true
30
30
  end
31
+ parser.on("--password PASSWORD", "Password of the current key") do |password|
32
+ options[:package_password] = password
33
+ end
34
+ parser.on("--dev-id DEV_ID", "Dev ID of the current key") do |dev_id|
35
+ options[:package_dev_id] = dev_id
36
+ end
37
+
31
38
  end
32
39
 
33
40
  def self.dependencies
@@ -55,7 +62,11 @@ module RokuBuilder
55
62
  end
56
63
 
57
64
  def genkey(options:)
58
- password, dev_id = generate_new_key()
65
+ password = options[:package_password]
66
+ dev_id = options[:package_dev_id]
67
+ unless password and dev_id
68
+ password, dev_id = generate_new_key()
69
+ end
59
70
  @logger.unknown("Password: "+password)
60
71
  @logger.info("DevID: "+dev_id)
61
72
 
@@ -35,7 +35,10 @@ module RokuBuilder
35
35
  end
36
36
  parser.on("--no-publish", 'Prevent the channel from being automatically published when submitted') do
37
37
  options[:no_publish] = true
38
- end
38
+ end
39
+ parser.on("--minimum-firmware-version VERSION", 'The minimum firmware version to use for the channel') do |version|
40
+ options[:minimum_firmware_version] = version
41
+ end
39
42
  end
40
43
 
41
44
  def self.dependencies
@@ -44,6 +47,9 @@ module RokuBuilder
44
47
 
45
48
  def submit(options:)
46
49
  raise RokuBuilder::InvalidOptions, "Missing channel id" unless options[:channel_id]
50
+ raise RokuBuilder::InvalidOptions, "Missing api key" unless options[:api_key]
51
+ raise RokuBuilder::InvalidOptions, "Missing package" unless options[:in]
52
+ raise RokuBuilder::InvalidOptions, "Missing minimum firmware version" unless options[:minimum_firmware_version]
47
53
  @logger.info "Submit to channel #{options[:channel_id]}"
48
54
  @api_key = options[:api_key]
49
55
  @no_publish = !!options[:no_publish]
@@ -51,7 +57,7 @@ module RokuBuilder
51
57
  if response.first["channelState"] == "Unpublished"
52
58
  response = update_channel_version(options[:channel_id], get_package(options), response.last["id"])
53
59
  else
54
- response = create_channel_version(options[:channel_id], get_package(options))
60
+ response = create_channel_version(options[:channel_id], get_package(options), options[:minimum_firmware_version])
55
61
  end
56
62
  raise RokuBuilder::ExecutionError, "Request failed: #{response.reason_phrase}" unless response.success?
57
63
  JSON.parse(response.body)
@@ -59,6 +65,7 @@ module RokuBuilder
59
65
 
60
66
  def publish(options:)
61
67
  raise RokuBuilder::InvalidOptions, "Missing channel id" unless options[:channel_id]
68
+ raise RokuBuilder::INvalidOptions, "Missing api key" unless options[:api_key]
62
69
  @logger.info "Publish to channel #{options[:channel_id]}"
63
70
  @api_key = options[:api_key]
64
71
  response = get_channel_versions(options[:channel_id])
@@ -90,14 +97,15 @@ module RokuBuilder
90
97
  end
91
98
  sorted
92
99
  end
93
-
94
- def create_channel_version(channel, package)
100
+
101
+ def create_channel_version(channel, package, version)
95
102
  path = "/external/channels/#{channel}/versions"
103
+ body = {"minimumFirmwareVersionTextShort" => version}
96
104
  params = nil
97
105
  unless @no_publish
98
106
  params = {"state" => "Published"}
99
107
  end
100
- api_post(path, path, package, params)
108
+ api_post(path, path, package, params, body)
101
109
  end
102
110
 
103
111
  def update_channel_version(channel, package, version)
@@ -117,13 +125,14 @@ module RokuBuilder
117
125
  connection('GET', path, nil).get(api_path+path)
118
126
  end
119
127
 
120
- def api_post(path, token_path, package=nil, params = nil)
121
- body = {}.to_json
128
+ def api_post(path, token_path, package=nil, params = nil, body = nil)
129
+ body ||= {}
122
130
  if package
123
- body = {
131
+ body.merge!({
124
132
  "appFileBase64Encoded" => Base64.encode64(package.read)
125
- }.to_json
133
+ })
126
134
  end
135
+ body = body.to_json
127
136
  connection('POST', token_path, body, params).post(api_path+path) do |request|
128
137
  if params
129
138
  request.params = params
@@ -141,6 +150,7 @@ module RokuBuilder
141
150
  response = connection('PATCH', token_path, body).patch(api_path+path) do |request|
142
151
  request.body = body
143
152
  end
153
+ response
144
154
  end
145
155
 
146
156
  def connection(method, path, body, params = nil)
@@ -152,6 +162,7 @@ module RokuBuilder
152
162
  }) do |f|
153
163
  f.adapter Faraday.default_adapter
154
164
  end
165
+ connection
155
166
  end
156
167
 
157
168
  def get_jwt_token(api_key, service_urn, method, path, body = nil, params = nil)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.30.0"
5
+ VERSION = "4.30.2"
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.30.0
4
+ version: 4.30.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-13 00:00:00.000000000 Z
11
+ date: 2025-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip