yarss 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/lib/yarss/attribute.rb +2 -2
- data/lib/yarss/feed.rb +28 -0
- data/lib/yarss/item.rb +42 -0
- data/lib/yarss/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: fc0dfd0adff083176c44262ea275f200e4566d26
|
4
|
+
data.tar.gz: 25f309a4612f77c4707682974bc599ee2bb4d9b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ba2fe7dedafc8b4119ffd10a18579a46ee0ab16d79ada7ff686b525557a687838700e3861164d1da32e5d29babe223d841592145baeb97fec4c016d462675e8
|
7
|
+
data.tar.gz: 09abd702209f127c807c28db014f03ffcc53288d0445abdf3e37e8be3e1202e62d05b0c5bd9bdb6933fd49c51b23eb5c71cf7aa2729d696119a50b7dd15a8b5a
|
data/.travis.yml
CHANGED
data/lib/yarss/attribute.rb
CHANGED
@@ -80,8 +80,8 @@ module Yarss
|
|
80
80
|
when Array
|
81
81
|
item = value.find { |l| l.is_a?(String) } ||
|
82
82
|
value.find { |l| l['rel'] && l['rel'] == 'alternate' } ||
|
83
|
-
value.find { |l| l['rel'].nil? }
|
84
|
-
|
83
|
+
value.find { |l| l['rel'].nil? } ||
|
84
|
+
''
|
85
85
|
link_value(item)
|
86
86
|
when String
|
87
87
|
value.strip
|
data/lib/yarss/feed.rb
CHANGED
@@ -44,5 +44,33 @@ module Yarss
|
|
44
44
|
description == other.description &&
|
45
45
|
items == other.items
|
46
46
|
end
|
47
|
+
|
48
|
+
# Is the title present?
|
49
|
+
#
|
50
|
+
# @return [Bool]
|
51
|
+
def title?
|
52
|
+
!title.nil? && !title.empty?
|
53
|
+
end
|
54
|
+
|
55
|
+
# Is the URL to the related Web page present?
|
56
|
+
#
|
57
|
+
# @return [Bool]
|
58
|
+
def link?
|
59
|
+
!link.nil? && !link.empty?
|
60
|
+
end
|
61
|
+
|
62
|
+
# Is the description present?
|
63
|
+
#
|
64
|
+
# @return [Bool]
|
65
|
+
def description?
|
66
|
+
!description.nil? && !description.empty?
|
67
|
+
end
|
68
|
+
|
69
|
+
# Are the feed items present?
|
70
|
+
#
|
71
|
+
# @return [Bool]
|
72
|
+
def items?
|
73
|
+
!items.nil? && !items.empty?
|
74
|
+
end
|
47
75
|
end
|
48
76
|
end
|
data/lib/yarss/item.rb
CHANGED
@@ -56,5 +56,47 @@ module Yarss
|
|
56
56
|
author == other.author &&
|
57
57
|
content == other.content
|
58
58
|
end
|
59
|
+
|
60
|
+
# Is the ID present?
|
61
|
+
#
|
62
|
+
# @return [Bool]
|
63
|
+
def id?
|
64
|
+
!id.nil? && !id.empty?
|
65
|
+
end
|
66
|
+
|
67
|
+
# Is the title present?
|
68
|
+
#
|
69
|
+
# @return [Bool]
|
70
|
+
def title?
|
71
|
+
!title.nil? && !title.empty?
|
72
|
+
end
|
73
|
+
|
74
|
+
# Is the date and time of the last modification present?
|
75
|
+
#
|
76
|
+
# @return [Bool]
|
77
|
+
def updated_at?
|
78
|
+
!updated_at.nil?
|
79
|
+
end
|
80
|
+
|
81
|
+
# Is the URL to the related Web page present?
|
82
|
+
#
|
83
|
+
# @return [Bool]
|
84
|
+
def link?
|
85
|
+
!link.nil? && !link.empty?
|
86
|
+
end
|
87
|
+
|
88
|
+
# Is the author present?
|
89
|
+
#
|
90
|
+
# @return [Bool]
|
91
|
+
def author?
|
92
|
+
!author.nil? && !author.empty?
|
93
|
+
end
|
94
|
+
|
95
|
+
# Is the content present?
|
96
|
+
#
|
97
|
+
# @return [Bool]
|
98
|
+
def content?
|
99
|
+
!content.nil? && !content.empty?
|
100
|
+
end
|
59
101
|
end
|
60
102
|
end
|
data/lib/yarss/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yarss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oldrich Vetesnik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|