apple-news 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apple-news/metadata.rb +2 -1
- data/lib/apple-news/properties.rb +3 -3
- data/lib/apple-news/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d92fd8859e0f642080cb1a999a9ba56f203eab
|
4
|
+
data.tar.gz: 25cf951c7c4146c42632a43ae3e565c1c69810bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4fa765d9ca726e30d88f08e34c00b1e7dc97cca19fa75853827b632bbbfe24bb045fd504696b848ffc992b0ff7d5fc75b4828d46f66059ba70289e2d0b9074b
|
7
|
+
data.tar.gz: 3fea399bf9c7c7a535d57e6b2bcd242744dc3ad65510b70bdf775c986bcd387d241553ebcc322b02de6ea9a02d8e5cf0321a8dd6be9c18ce798154daf97548c6
|
data/lib/apple-news/metadata.rb
CHANGED
@@ -3,7 +3,7 @@ module AppleNews
|
|
3
3
|
include Properties
|
4
4
|
optional_properties :authors, :campaign_data, :canonical_url, :date_created,
|
5
5
|
:date_modified, :date_published, :excerpt, :generator_identifier,
|
6
|
-
:keywords, :thumbnail_url
|
6
|
+
:keywords, :thumbnail_url, :video_url
|
7
7
|
|
8
8
|
optional_property :generator_name, "apple-news-rb"
|
9
9
|
optional_property :generator_version, AppleNews::VERSION
|
@@ -12,5 +12,6 @@ module AppleNews
|
|
12
12
|
|
13
13
|
property_inflection :canonical_url, 'canonicalURL'
|
14
14
|
property_inflection :thumbnail_url, 'thumbnailURL'
|
15
|
+
property_inflection :video_url, 'videoURL'
|
15
16
|
end
|
16
17
|
end
|
@@ -9,9 +9,9 @@ module AppleNews
|
|
9
9
|
def load_properties(opts)
|
10
10
|
opts = ActiveSupport::HashWithIndifferentAccess.new(opts || {})
|
11
11
|
self.class.properties.each do |prop, settings|
|
12
|
-
|
12
|
+
json_key = _property_inflection[prop] || prop.to_s.camelize(:lower)
|
13
13
|
val = if !settings[:klass].nil?
|
14
|
-
assigned_val = opts.fetch(
|
14
|
+
assigned_val = opts.fetch(json_key, settings[:default])
|
15
15
|
|
16
16
|
if settings[:default].is_a?(Array)
|
17
17
|
assigned_val.map { |v|
|
@@ -27,7 +27,7 @@ module AppleNews
|
|
27
27
|
assigned_val.nil? ? nil : settings[:klass].send(settings[:init_method], assigned_val)
|
28
28
|
end
|
29
29
|
else
|
30
|
-
opts.fetch(
|
30
|
+
opts.fetch(json_key, settings[:default])
|
31
31
|
end
|
32
32
|
|
33
33
|
instance_variable_set "@#{prop}", val
|
data/lib/apple-news/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple-news
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan LeFevre
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|