wcc-media-client 0.4.10 → 0.4.15

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
- SHA1:
3
- metadata.gz: 7acce9b696288c4c5a1a7f1d6f6c0a0f20331a1a
4
- data.tar.gz: 1f498be5b915ebcf9de02d9c4ac02ccabb700c11
2
+ SHA256:
3
+ metadata.gz: eea13cbea09893a593ee0c45bbab686663cbd1f8232a29e670af1d55a2241b0a
4
+ data.tar.gz: 9bb78c414774998a11d36848811506c3565b31b1b20e3d224e59f42c3586161c
5
5
  SHA512:
6
- metadata.gz: b30e2fec462e1b75e064328cee511d560299d05456a69ad3c5f9539a16813c60a7f827b7ff84477c30477d2527d6a7265e1a77bfbb2ae6ab6af7522d077bd0d2
7
- data.tar.gz: 9ab9fe2f4296aa73178cff5c6eabced2e82e674da361ae36838e610ce7c74f0d8d7a8ccf778b2bcb4c8bb46cc77c5b03978b22d45903c5805c728bb7879b9546
6
+ metadata.gz: dd5641649e7006a85b86a4c7ba0b48a9fe11cbbe6ae37e8ea48691612556d1d5770eb9c2f4f0848dd51ac1d65af44fb20a248325bcc9aab4d5dc16f4a7c9dcd1
7
+ data.tar.gz: 96a6b2cf6470c3a1c87e4e541234cbcfd047b3c970525ece8182fc28ecfe68b4c0930cf96f43e9895f657769306efb1ceb494d8f1c4a9fb3023bacc26f261964
data/.rubocop.yml CHANGED
@@ -10,3 +10,6 @@ Style/ClassAndModuleChildren:
10
10
  Style/MultilineBlockChain:
11
11
  Exclude:
12
12
  - 'spec/**/*'
13
+
14
+ Rails/TimeZone:
15
+ Enabled: false
@@ -10,6 +10,15 @@ module WCC
10
10
  @cache_key = "#{self.class.name}/#{key}"
11
11
  end
12
12
 
13
+ def last_modified
14
+ return @last_modified if @last_modified
15
+
16
+ last_modified =
17
+ (headers&.fetch('Last-Modified', nil) if respond_to?(:headers))
18
+ @last_modified = Time.parse(last_modified) if last_modified && /\S/.match(last_modified)
19
+ end
20
+ alias_method :updated_at, :last_modified
21
+
13
22
  def self.hash_cache_key(hash)
14
23
  Digest::SHA1.hexdigest(Marshal.dump(hash))
15
24
  end
@@ -62,8 +62,8 @@ class WCC::Media::Engine < ::Rails::Engine
62
62
  ::Toot.config.callback_url ||=
63
63
  begin
64
64
  Rails.application.routes.url_helpers.wcc_media_url + '/callbacks'
65
- rescue ArgumentError => ex
66
- raise unless ex.message =~ /^Missing host to link to/
65
+ rescue ArgumentError => e
66
+ raise unless e.message =~ /^Missing host to link to/
67
67
  end
68
68
 
69
69
  if ::Toot.config.callback_url.nil?
@@ -89,6 +89,8 @@ class WCC::Media::Engine < ::Rails::Engine
89
89
  _handle_error(e)
90
90
  rescue Faraday::TimeoutError => e
91
91
  _handle_error(e)
92
+ rescue Faraday::SSLError => e
93
+ _handle_error(e)
92
94
  rescue Toot::RegisterSubscriptionFailure => e
93
95
  raise unless e.status == 503
94
96
 
@@ -14,6 +14,7 @@ class WCC::Media::Message < WCC::Media::Base
14
14
  series_id
15
15
  title_like
16
16
  legacy_id
17
+ hide_from_internal_search
17
18
  ].freeze
18
19
  end
19
20
 
@@ -28,12 +29,17 @@ class WCC::Media::Message < WCC::Media::Base
28
29
  campus_names
29
30
  topic
30
31
  topics
32
+ hide_from_internal_search
31
33
  ].each do |att|
32
34
  define_method att do
33
35
  raw[att]
34
36
  end
35
37
  end
36
38
 
39
+ def hide_from_internal_search
40
+ raw['flags']['hide_from_internal_search'] || false
41
+ end
42
+
37
43
  def speakers
38
44
  (raw['speakers'] || []).map { |val| WCC::Media::Speaker.new(val) }
39
45
  end
@@ -62,6 +68,7 @@ class WCC::Media::Message < WCC::Media::Base
62
68
  %w[
63
69
  meta
64
70
  embeds
71
+ flags
65
72
  assets
66
73
  images
67
74
  external_urls
@@ -91,7 +98,11 @@ class WCC::Media::Message < WCC::Media::Base
91
98
  end
92
99
 
93
100
  WCC::Media::TagGroup.all.each do |tag_group|
94
- define_method(tag_group.name.downcase) do
101
+ method_name = tag_group.name.downcase.to_sym
102
+ # except :meta (different definition above)
103
+ next if instance_methods.include?(method_name)
104
+
105
+ define_method(method_name) do
95
106
  tags.select { |t| t.tag_group == tag_group }
96
107
  end
97
108
  end
@@ -29,6 +29,7 @@ class WCC::Media::Series < WCC::Media::Base
29
29
 
30
30
  %w[
31
31
  images
32
+ series_type
32
33
  ].each do |att|
33
34
  define_method att do
34
35
  OpenStruct.new(raw[att]) if raw[att]
@@ -1,5 +1,5 @@
1
1
  module WCC
2
2
  module Media
3
- VERSION = '0.4.10'.freeze
3
+ VERSION = '0.4.15'.freeze
4
4
  end
5
5
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.require_paths = ['lib']
26
26
 
27
- spec.add_runtime_dependency 'wcc-api', '~> 0.3.1'
27
+ spec.add_runtime_dependency 'wcc-api', '>= 0.3.1'
28
28
  spec.add_runtime_dependency 'wcc-auth'
29
29
  spec.add_runtime_dependency 'wcc-base', '~> 0.3.1'
30
30
  spec.add_runtime_dependency 'wcc-data', '~> 0.3.3'
@@ -32,9 +32,11 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'byebug', '~> 11.0.1'
33
33
  spec.add_development_dependency 'guard', '~> 2.15'
34
34
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
35
- spec.add_development_dependency 'guard-rubocop', '~> 1.3'
35
+ spec.add_development_dependency 'guard-rubocop', '1.3.0'
36
36
  spec.add_development_dependency 'http', '> 1.0', '< 3.0'
37
37
  spec.add_development_dependency 'httplog', '~> 1.0'
38
+ spec.add_development_dependency 'nio4r', '2.5.2'
39
+ spec.add_development_dependency 'parallel', '~> 1.19.0'
38
40
  spec.add_development_dependency 'rails', '~> 5.0'
39
41
  spec.add_development_dependency 'rake', '~> 12.3'
40
42
  spec.add_development_dependency 'responders', '< 3.0'
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-media-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-06 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wcc-api
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.3.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.3.1
27
27
  - !ruby/object:Gem::Dependency
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: guard-rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: '1.3'
117
+ version: 1.3.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: '1.3'
124
+ version: 1.3.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: http
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,34 @@ dependencies:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
158
  version: '1.0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: nio4r
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - '='
164
+ - !ruby/object:Gem::Version
165
+ version: 2.5.2
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - '='
171
+ - !ruby/object:Gem::Version
172
+ version: 2.5.2
173
+ - !ruby/object:Gem::Dependency
174
+ name: parallel
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: 1.19.0
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: 1.19.0
159
187
  - !ruby/object:Gem::Dependency
160
188
  name: rails
161
189
  requirement: !ruby/object:Gem::Requirement
@@ -372,7 +400,7 @@ homepage: https://github.com/watermarkchurch/media/wcc-media-client
372
400
  licenses:
373
401
  - MIT
374
402
  metadata: {}
375
- post_install_message:
403
+ post_install_message:
376
404
  rdoc_options: []
377
405
  require_paths:
378
406
  - lib
@@ -387,9 +415,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
387
415
  - !ruby/object:Gem::Version
388
416
  version: '0'
389
417
  requirements: []
390
- rubyforge_project:
391
- rubygems_version: 2.5.2
392
- signing_key:
418
+ rubygems_version: 3.0.3
419
+ signing_key:
393
420
  specification_version: 4
394
421
  summary: ''
395
422
  test_files: []