lws 6.1.3 → 6.1.4

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
  SHA1:
3
- metadata.gz: e6267aca741594637c3e7b0ddae082ac3cc98b41
4
- data.tar.gz: b7eb1f7e0125fe0cbc5684f571090f90b81fe99b
3
+ metadata.gz: f30071c15667079a8cf84888f5259e3ead55071c
4
+ data.tar.gz: e85e421087a695a3f37c95ff07f5a570b79a380a
5
5
  SHA512:
6
- metadata.gz: c8bab2ce1b6a0b03332e5e159ddbd9adf134ae386e0886bed568020b8b02ac919fb2c3c7d75692bd67e927805828a5aecc3db02a9eca125732de8d207e957f65
7
- data.tar.gz: c4e2ebb8bd41a53c6fee1df9cdba2ab89c4363a60a0ae91496d57fe050eba5c189f6dc512c442b1a51cfc5122bc562551fdbe0ad12f82e7b51de7b6620d5120a
6
+ metadata.gz: b8422afa62c6f038824aa10d0c92a41b7c43ba516ee4e8684f480e5cfb6efa0bbae61ff1ee9e8c85edb8c2a6b5070c28d484601824828c7aecc537624120cbc9
7
+ data.tar.gz: 8ff70bddabe627aa3e4f14f5f5562ffee150aeb936322f3af460e73e5601598a9caba77087ba1800ae613dce0b2e8584dfcee65763bd31e1fcf8d6e4bf7c4c13
@@ -4,6 +4,16 @@ Up until v6.1.0, we used the standard Gem version numbering starting at v0.0.1.
4
4
  From v6.1.0 on the version will follow the API version of LWS in the major/minor
5
5
  part of te version.
6
6
 
7
+ ## v6.1.4
8
+
9
+ * Fix LWS Console environment command-line parameter not overriding the config
10
+ * Print LWS setup on LWS Console start
11
+
12
+ ### Apps
13
+
14
+ * Add some fields to the DigitalSignage app (closes: #12001)
15
+ * Fix some relations in the Auth app (closes: #12026)
16
+
7
17
  ## v6.1.3
8
18
 
9
19
  * Fix `#find` on has many-associations not working
@@ -16,6 +16,7 @@ USER_CONFIG_FILE = "#{ENV['HOME']}/.config/LeftClick/lws.yml"
16
16
 
17
17
  # Parse the command-line arguments
18
18
  PROG_NAME = File.basename($0)
19
+ APP_NAME = "LWS Console"
19
20
  @options = {}
20
21
  opt_parser = OptionParser.new do |opts|
21
22
  opts.banner = <<EOB
@@ -45,7 +46,7 @@ EOB
45
46
  exit
46
47
  end
47
48
  opts.on("--version", "display the LWS library version and exit") do
48
- puts "LWS Console v#{LWS::VERSION}"
49
+ puts "#{APP_NAME} v#{LWS::VERSION}"
49
50
  exit
50
51
  end
51
52
  end
@@ -78,7 +79,6 @@ logger.formatter =
78
79
  begin
79
80
  LWS.setup do |config|
80
81
  config.api_token = @options[:token] if @options[:token]
81
- config.environment = @options[:environment] if @options[:environment]
82
82
  config.endpoints = @endpoints
83
83
  config.http_debug = @options[:debug]
84
84
  config.json_debug = @options[:debug]
@@ -92,6 +92,8 @@ begin
92
92
  config.load_config_file(GLOBAL_CONFIG_FILE)
93
93
  config.load_config_file(USER_CONFIG_FILE)
94
94
  end
95
+
96
+ config.environment = @options[:environment] if @options[:environment]
95
97
  end
96
98
  if @options[:app]
97
99
  @app_module = LWS.app_module(@options[:app].downcase)
@@ -135,5 +137,27 @@ FileUtils.mkdir_p("#{ENV['HOME']}/.local/share/LeftClick")
135
137
  Pry.config.history.file = "#{ENV['HOME']}/.local/share/LeftClick/lws_history"
136
138
  Pry.config.prompt_name = PROG_NAME
137
139
 
140
+ # Print an LWS setup summary
141
+ puts "#{APP_NAME} v#{LWS::VERSION} started!"
142
+ puts
143
+ puts "- Environment: #{LWS.config.environment}"
144
+ puts "- API token: #{LWS.config.api_token[0...-4].gsub(/\w/, '*')}#{LWS.config.api_token[-4..-1]}"
145
+ if @app_module
146
+ puts "- App endpoint: #{@app_module.api.url_prefix}"
147
+ end
148
+ debug_outputs = []
149
+ if LWS.config.http_debug
150
+ if LWS.config.http_debug_headers
151
+ debug_outputs << "HTTP (with headers)"
152
+ else
153
+ debug_outputs << "HTTP"
154
+ end
155
+ end
156
+ debug_outputs << "JSON" if LWS.config.json_debug
157
+ unless debug_outputs.present?
158
+ puts "- Debug output: #{debug_outputs.join(', ')}"
159
+ end
160
+ puts
161
+
138
162
  # Use the LWS module or the selected app module as the default namespace
139
163
  (@app_module || LWS).pry
@@ -76,7 +76,9 @@ module LWS::Auth
76
76
 
77
77
  # @!attribute start_app
78
78
  # @return [App, nil] the app to start with/open when logging in
79
- belongs_to :start_app, class_name: "LWS::Auth::App"
79
+ belongs_to :start_app, class_name: "LWS::Auth::App",
80
+ foreign_key: :start_app_id,
81
+ uri: "apps/:id"
80
82
 
81
83
  # @!attribute start_app_id
82
84
  # @return [Fixnum, nil] the ID of the app to start with/open when logging in
@@ -196,7 +198,7 @@ module LWS::Auth
196
198
 
197
199
  # @!attribute contracts
198
200
  # @return [Array<Contract>] the contracts of the company
199
- has_many :contracts
201
+ has_many :contracts, uri: "companies/:company_id/contracts/(:id)"
200
202
 
201
203
  # @!attribute country
202
204
  # @return [String] the country of the company
@@ -210,7 +212,7 @@ module LWS::Auth
210
212
 
211
213
  # @!attribute licenses
212
214
  # @return [Array<License>] the licenses of the company
213
- has_many :licenses
215
+ has_many :licenses, uri: "companies/:company_id/licenses/(:id)"
214
216
 
215
217
  # @!attribute name
216
218
  # @return [String] the name of the company
@@ -240,7 +242,7 @@ module LWS::Auth
240
242
  # @!attribute usage_reports
241
243
  # @return [Array<UsageReport>] the usage reports available/generated
242
244
  # for the company
243
- has_many :usage_reports, uri: "company/:company_id/reports/(:id)"
245
+ has_many :usage_reports, uri: "companies/:company_id/reports/(:id)"
244
246
 
245
247
  # @!attribute uuid
246
248
  # @return [String] the UUID of the company
@@ -263,6 +265,7 @@ module LWS::Auth
263
265
  # = The contract class
264
266
  class Contract < LWS::Generic::Model
265
267
  use_api LWS::Auth.api
268
+ uri "companies/:company_id/contracts/(:id)"
266
269
 
267
270
  # @!attribute id [r]
268
271
  # @return [Fixnum] the (unique) ID of the contract
@@ -333,6 +336,7 @@ module LWS::Auth
333
336
  # = The license class
334
337
  class License < LWS::Generic::Model
335
338
  use_api LWS::Auth.api
339
+ uri "companies/:company_id/licenses/(:id)"
336
340
 
337
341
  # @!attribute id [r]
338
342
  # @return [Fixnum] the (unique) ID of the license
@@ -465,6 +469,7 @@ module LWS::Auth
465
469
  # = The usage report class
466
470
  class UsageReport < LWS::Generic::Model
467
471
  use_api LWS::Auth.api
472
+ uri "companies/:company_id/reports/(:id)"
468
473
 
469
474
  # @!attribute id [r]
470
475
  # @return [Fixnum] the (unique) ID of the usage report
@@ -43,6 +43,10 @@ module LWS::DigitalSignage
43
43
  # @return [Fixnum] the (unique) ID of the channel
44
44
  attribute :id
45
45
 
46
+ # @!attribute bandwidth
47
+ # @return [Fixnum] the bandwidth limit for the channel (bytes per second)
48
+ attribute :bandwidth
49
+
46
50
  # @!attribute company
47
51
  # @return [LWS::Auth::Company] the company the channel belongs to
48
52
  belongs_to :company, class_name: "LWS::Auth::Company"
@@ -51,6 +55,10 @@ module LWS::DigitalSignage
51
55
  # @return [Fixnum] the ID of the company the channel belongs to
52
56
  attribute :company_id
53
57
 
58
+ # @!attribute daily_reboot_time
59
+ # @return [String] the daily reboot time of the channel
60
+ attribute :daily_reboot_time
61
+
54
62
  # @!attribute display
55
63
  # @return [Display] the display of the channel
56
64
  belongs_to :display, class_name: "LWS::DigitalSignage::Display"
@@ -78,10 +86,19 @@ module LWS::DigitalSignage
78
86
  # the channel
79
87
  attribute :orientation
80
88
 
89
+ # @!attribute persistent_connection
90
+ # @return [Boolean] whether the channel is considered to have a persistent
91
+ # network connection
92
+ attribute :persistent_connection
93
+
81
94
  # @!attribute players
82
95
  # @return [Array<Player>] the players linked to the channel
83
96
  has_many :players, class_name: "LWS::DigitalSignage::Player"
84
97
 
98
+ # @!attribute remote_control
99
+ # @return [Boolean] whether remote control is enabled for the channel
100
+ attribute :remote_control
101
+
85
102
  # @!attribute tags
86
103
  # @return [Array<Channel::Tag>] the tags of the channel
87
104
  has_many :tags, class_name: "LWS::DigitalSignage::Channel::Tag"
@@ -104,6 +121,10 @@ module LWS::DigitalSignage
104
121
  # @return [String] the time zone for the channel
105
122
  attribute :time_zone
106
123
 
124
+ # @!attribute volume
125
+ # @return [Fixnum] the audio volume setting of the channel (percentage)
126
+ attribute :volume
127
+
107
128
  # @!attribute created_at [r]
108
129
  # @return [String] the timestamp of when the channel was created
109
130
  attribute :created_at
@@ -85,7 +85,7 @@ module LWS
85
85
  #
86
86
  # The configuration file can optionally have a "default" section with
87
87
  # an environment key that selects the default environment (unless
88
- # overriden by the +LC_LWS_ENV+ environment variable.
88
+ # overriden by the +LC_LWS_ENV+ environment variable).
89
89
  #
90
90
  # @example A elaborate configuration that sets the development environment as default, enables debugging and overrides an endpoint
91
91
  # default:
@@ -13,6 +13,6 @@ module LWS
13
13
 
14
14
  # The LWS library version.
15
15
  # @note The major and minor version parts match the LWS API version!
16
- VERSION = '6.1.3'.freeze
16
+ VERSION = '6.1.4'.freeze
17
17
 
18
18
  end
@@ -34,8 +34,7 @@ class TestAuthAccount < MiniTest::Test
34
34
  if @account.devices.present?
35
35
  assert_instance_of(Device, @account.devices.first)
36
36
  end
37
- # FIXME: Doesn't work
38
- #assert_instance_of(App, @account.start_app)
37
+ assert_instance_of(App, @account.start_app)
39
38
  end
40
39
 
41
40
  end
@@ -82,39 +81,36 @@ class TestAuthCompany < MiniTest::Test
82
81
  assert_instance_of(Account, @company.accounts.first)
83
82
  assert_instance_of(App, @company.apps.first)
84
83
  assert_instance_of(Account, @company.contact_person)
85
- # FIXME: Doesn't work
86
- #assert_instance_of(Contract, @company.contracts.first)
84
+ assert_instance_of(Contract, @company.contracts.first)
87
85
  assert_instance_of(License, @company.licenses.first)
88
86
  assert_instance_of(Company, @child_company.parent)
89
- # FIXME: Doesn't work
90
- #assert_instance_of(UsageReport, @company.usage_reports.first)
87
+ assert_instance_of(UsageReport, @company.usage_reports.first)
91
88
  end
92
89
 
93
90
  end
94
91
 
95
- # FIXME: Can't get a contract to test
96
- #class TestAuthContract < MiniTest::Test
97
- #
98
- # include LWS::Auth
99
- #
100
- # def setup
101
- # @company = Company.find(1)
102
- # # Contracts only exist as child objects of companies
103
- # @contract = @company.contracts.first
104
- # end
105
- #
106
- # def test_valid
107
- # refute_nil(@contract)
108
- # assert_instance_of(Contract, @contract)
109
- # refute_nil(@contract.id)
110
- # end
111
- #
112
- # def test_valid_associations
113
- # assert_instance_of(Company, @contract.company)
114
- # assert_equal(@company, @contract.company)
115
- # end
116
- #
117
- #end
92
+ class TestAuthContract < MiniTest::Test
93
+
94
+ include LWS::Auth
95
+
96
+ def setup
97
+ @company = Company.find(1)
98
+ # Contracts only exist as child objects of companies
99
+ @contract = @company.contracts.first
100
+ end
101
+
102
+ def test_valid
103
+ refute_nil(@contract)
104
+ assert_instance_of(Contract, @contract)
105
+ refute_nil(@contract.id)
106
+ end
107
+
108
+ def test_valid_associations
109
+ assert_instance_of(Company, @contract.company)
110
+ assert_equal(@company, @contract.company)
111
+ end
112
+
113
+ end
118
114
 
119
115
  class TestAuthLicense < MiniTest::Test
120
116
 
@@ -170,25 +166,25 @@ class TestAuthToken < MiniTest::Test
170
166
 
171
167
  end
172
168
 
173
- # FIXME: Can't get a usage report to test
174
- #class TestAuthUsageReport < MiniTest::Test
175
- #
176
- # include LWS::Auth
177
- #
178
- # def setup
179
- # @company = Company.find(1)
180
- # @usage_report = @company.usage_reports.first
181
- # end
182
- #
183
- # def test_valid
184
- # refute_nil(@usage_report)
185
- # assert_instance_of(UsageReport, @usage_report)
186
- # refute_nil(@usage_report.id)
187
- # end
188
- #
189
- # def test_valid_associations
190
- # assert_instance_of(Company, @usage_report.company)
191
- # assert_equal(@company, @usagee_report.company)
192
- # end
193
- #
194
- #end
169
+ class TestAuthUsageReport < MiniTest::Test
170
+
171
+ include LWS::Auth
172
+
173
+ def setup
174
+ @company = Company.find(1)
175
+ # Contracts only exist as child objects of companies
176
+ @usage_report = @company.usage_reports.first
177
+ end
178
+
179
+ def test_valid
180
+ refute_nil(@usage_report)
181
+ assert_instance_of(UsageReport, @usage_report)
182
+ refute_nil(@usage_report.id)
183
+ end
184
+
185
+ def test_valid_associations
186
+ assert_instance_of(Company, @usage_report.company)
187
+ assert_equal(@company, @usage_report.company)
188
+ end
189
+
190
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lws
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.3
4
+ version: 6.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeftClick B.V.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-05 00:00:00.000000000 Z
11
+ date: 2018-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware