lws 7.1.1 → 7.2.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.
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  # = The resource app module
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  # = The ticket app module
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -45,6 +45,15 @@ module LWS
45
45
  # (default: +:production+)
46
46
  property :environment, default: :production
47
47
 
48
+ #@!attribute http_caching
49
+ # @return [Boolean] whether HTTP caching is enabled
50
+ property :http_caching, default: true
51
+
52
+ #@!attribute http_caching_object
53
+ # @return [#read, #write, #delete] an object that caches results
54
+ # respecting HTTP expiration (instead of an in-memory hash)
55
+ property :http_caching_object, default: nil
56
+
48
57
  #@!attribute http_debug
49
58
  # @return [Boolean] whether to show HTTP debug messages (default: +false+)
50
59
  property :http_debug, default: false
@@ -107,11 +116,15 @@ module LWS
107
116
  # http_debug: true
108
117
  # json_debug: true
109
118
  #
119
+ # @param config_file [String] the path to the config file to load
120
+ # @param force_environment [Symbol, nil] the environment to enforce (if
121
+ # any)
110
122
  # @return [Boolean] whether the config file was used
111
- def load_config_file(config_file)
123
+ def load_config_file(config_file, force_environment = nil)
112
124
  return false unless File.exist? config_file
113
125
  config_data = YAML.load_file(config_file)
114
- environment = ENV["LC_LWS_ENV"] ||
126
+ environment = force_environment ||
127
+ ENV["LC_LWS_ENV"] ||
115
128
  config_data.dig("default", "environment") ||
116
129
  self.environment
117
130
  self.environment = environment.to_sym
@@ -122,20 +135,26 @@ module LWS
122
135
  raise "encountered an invalid config property \"#{key}\" " +
123
136
  "in config file #{config_file}!"
124
137
  end
138
+ configure(key, value)
139
+ end
140
+ true
141
+ end
125
142
 
126
- case key
127
- when "endpoints"
128
- if self.endpoints.empty?
129
- self.endpoints = value.inject({}) do |h, (k, v)|
130
- h[k.to_sym] = v
131
- h
132
- end
133
- end
134
- else
135
- self[key.to_sym] = value unless self[key.to_sym]
143
+ private
144
+
145
+ def configure(key, value)
146
+ case key
147
+ when "endpoints"
148
+ if self.endpoints.empty?
149
+ configure_endpoints(value)
136
150
  end
151
+ else
152
+ self[key.to_sym] ||= value
137
153
  end
138
- true
154
+ end
155
+
156
+ def configure_endpoints(endpoints)
157
+ self.endpoints = endpoints.transform_keys(&:to_sym)
139
158
  end
140
159
 
141
160
  end
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  module LWS
@@ -1,18 +1,18 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  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 = "7.1.1".freeze
16
+ VERSION = "7.2.1".freeze
17
17
 
18
18
  end
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  require "test_helper"
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  require "test_helper"
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  require "test_helper"
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  require "test_helper"
@@ -16,7 +16,7 @@ class TestCorporateWebsiteArticle < MiniTest::Test
16
16
  include LWS::CorporateWebsite
17
17
 
18
18
  def setup
19
- @page = Page.all.first
19
+ @page = Page.find(1)
20
20
  @article = @page.articles.first
21
21
  end
22
22
 
@@ -38,7 +38,7 @@ class TestCorporateWebsiteOfficeTime < MiniTest::Test
38
38
  include LWS::CorporateWebsite
39
39
 
40
40
  def setup
41
- @office_time = OfficeTime.all.first
41
+ @office_time = OfficeTime.find(1)
42
42
  end
43
43
 
44
44
  def test_valid
@@ -54,7 +54,7 @@ class TestCorporateWebsitePage < MiniTest::Test
54
54
  include LWS::CorporateWebsite
55
55
 
56
56
  def setup
57
- @page = Page.all.first
57
+ @page = Page.find(1)
58
58
  end
59
59
 
60
60
  def test_valid
@@ -75,7 +75,7 @@ end
75
75
  # include LWS::CorporateWebsite
76
76
  #
77
77
  # def setup
78
- # @social_page = SocialPage.all.first
78
+ # @social_page = SocialPage.find(1)
79
79
  # end
80
80
  #
81
81
  # def test_valid
@@ -96,7 +96,7 @@ class TestCorporateWebsiteSocialPost < MiniTest::Test
96
96
  include LWS::CorporateWebsite
97
97
 
98
98
  def setup
99
- @social_post = SocialPost.all.first
99
+ @social_post = SocialPost.find(1)
100
100
  end
101
101
 
102
102
  def test_valid
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  require "test_helper"
@@ -261,6 +261,7 @@ class TestDigitalSignageLayout < MiniTest::Test
261
261
  def test_valid_associations
262
262
  # FIXME: Missing endpoint in LWS
263
263
  #assert_instance_of(Layout::Category, @layout.categories.first)
264
+ assert_instance_of(LWS::Auth::Company, @layout.company_owner)
264
265
  # FIXME: Missing parent_id field in LWS
265
266
  #assert_instance_of(Layout, @layout.parent)
266
267
  # FIXME: Missing endpoint in LWS
@@ -950,6 +951,7 @@ class TestDigitalSignageSlide < MiniTest::Test
950
951
  assert_instance_of(Channel::Group, @slide.channel_groups.first)
951
952
  assert_instance_of(LWS::Auth::Company, @slide.company)
952
953
  assert_instance_of(Layout, @slide.layout)
954
+ assert_instance_of(Slide::Schedule, @slide.schedules.first)
953
955
  end
954
956
 
955
957
  end
@@ -961,20 +963,17 @@ class TestDigitalSignageSlideSchedule < MiniTest::Test
961
963
  def setup
962
964
  @slide = Slide.find(1)
963
965
  # Slide schedules only exist as decendant objects of players
964
- # FIXME: Endpoint is missing in LWS
965
966
  @slide_schedule = @slide.schedules.first
966
967
  end
967
968
 
968
- # FIXME: Endpoint is missing in LWS
969
- #def test_valid
970
- # refute_nil(@slide_schedule)
971
- # assert_instance_of(Slide::Schedule, @slide_schedule)
972
- # refute_nil(@slide_schedule.id)
973
- #end
969
+ def test_valid
970
+ refute_nil(@slide_schedule)
971
+ assert_instance_of(Slide::Schedule, @slide_schedule)
972
+ refute_nil(@slide_schedule.id)
973
+ end
974
974
 
975
- # FIXME: Endpoint is missing in LWS
976
975
  #def test_valid_associations
977
- # assert_instance_of(Slide, @slide_schedules.slides.first)
976
+ # assert_instance_of(Slide, @slide_schedule.slides.first)
978
977
  #end
979
978
 
980
979
  end
@@ -1,12 +1,12 @@
1
1
  #
2
- # Copyright © 2016 LeftClick B.V.
2
+ # Copyright © 2016–2020 LeftClick B.V.
3
3
  #
4
4
  # This software is property of LeftClick B.V. and cannot be redistributed
5
5
  # and/or modified without permission. The software or any of its parts
6
6
  # cannot be used for any other purposes than the LeftClick services and
7
7
  # only during a valid license subscription. For more information, please
8
- # contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
9
- # Netherlands, info@leftclick.eu, +31492-782120.
8
+ # contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
9
+ # Netherlands, info@leftclick.eu, +3185-4444-004.
10
10
 
11
11
 
12
12
  require "test_helper"
@@ -17,7 +17,7 @@ class TestGenericModel < MiniTest::Test
17
17
  include LWS::Auth
18
18
 
19
19
  def setup
20
- @configuration = Configuration.all.first
20
+ @configuration = Configuration.find(1)
21
21
  end
22
22
 
23
23
  def test_her_compatibility
@@ -128,7 +128,7 @@ class TestGenericConfiguration < MiniTest::Test
128
128
  include LWS::Auth
129
129
 
130
130
  def setup
131
- @configuration = Configuration.all.first
131
+ @configuration = Configuration.find(1)
132
132
  end
133
133
 
134
134
  def test_valid