rss_creator 0.3.8 → 0.4.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.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rss_creator.rb +44 -12
- metadata +36 -32
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: be68caea693cc6a981a77d424b4b075e215552a81d60b0e877bd15f5d8154433
|
|
4
|
+
data.tar.gz: 8c85c7865c96b934e40fabf8f564bcd22656b02c3e10696732d85c245a97ce5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 922a6a2b33d8e322d10a8e3bc622576b9019a9a67eccb1821aca512c4a9c47aaf756f2aa6938ba295fb1d8b6d1504fa36774dfa7121ab00377ca8c8122d0de31
|
|
7
|
+
data.tar.gz: e53397545a8c0953dd88d6e675df28c94683802136e6a8d00dbd1e92b4f1b2143a12c536b666062495810d7604f4a33f422ecffc47e7630e4c00c81a36591248
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/rss_creator.rb
CHANGED
|
@@ -8,13 +8,14 @@ require 'rss_to_dynarex'
|
|
|
8
8
|
|
|
9
9
|
class RSScreator
|
|
10
10
|
|
|
11
|
-
attr_accessor :title, :description, :link, :limit, :xslt
|
|
11
|
+
attr_accessor :title, :description, :link, :limit, :xslt, :image_url,
|
|
12
|
+
:image_target_url
|
|
12
13
|
|
|
13
|
-
def initialize(filepath='rss.xml', dx_xslt: nil,
|
|
14
|
-
|
|
14
|
+
def initialize(filepath='rss.xml', dx_xslt: nil, dx_filename: 'feed.xml',
|
|
15
|
+
custom_fields: [], limit: 10, debug: false)
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
@filepath = filepath
|
|
18
|
+
@filepath, @debug = filepath, debug
|
|
18
19
|
|
|
19
20
|
dxfilepath = File.join(File.dirname(filepath), dx_filename)
|
|
20
21
|
|
|
@@ -34,7 +35,7 @@ class RSScreator
|
|
|
34
35
|
else
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
schema = 'channel[title, description, link]/' + \
|
|
38
|
+
schema = 'channel[title, description, link, image]/' + \
|
|
38
39
|
'item(title, link, description, date'
|
|
39
40
|
schema += ', ' + custom_fields.join(', ') if custom_fields.any?
|
|
40
41
|
schema += ')'
|
|
@@ -45,13 +46,15 @@ class RSScreator
|
|
|
45
46
|
@dx.order = 'descending'
|
|
46
47
|
@dx.default_key = 'uid'
|
|
47
48
|
@dx.xslt = dx_xslt if dx_xslt
|
|
48
|
-
|
|
49
|
-
'link:link]/item(title:title,description:description,' + \
|
|
50
|
-
'link:link,pubDate:date)'
|
|
51
|
-
# maxium number of items saved in the RSS feed
|
|
52
|
-
@dx.limit = @limit = 10
|
|
49
|
+
|
|
53
50
|
|
|
54
51
|
end
|
|
52
|
+
|
|
53
|
+
@dx.xslt_schema = 'channel[title:title,description:description,' + \
|
|
54
|
+
'link:link]/item(title:title,description:description,' + \
|
|
55
|
+
'link:link,pubDate:date)'
|
|
56
|
+
# maxium number of items saved in the RSS feed
|
|
57
|
+
@dx.limit = @limit = limit
|
|
55
58
|
|
|
56
59
|
|
|
57
60
|
@dirty = true
|
|
@@ -83,6 +86,10 @@ class RSScreator
|
|
|
83
86
|
@description = val
|
|
84
87
|
@dirty = true
|
|
85
88
|
end
|
|
89
|
+
|
|
90
|
+
def delete(id)
|
|
91
|
+
@dx.delete id.to_s
|
|
92
|
+
end
|
|
86
93
|
|
|
87
94
|
alias desc= description=
|
|
88
95
|
alias desc description
|
|
@@ -90,6 +97,18 @@ class RSScreator
|
|
|
90
97
|
def dynarex()
|
|
91
98
|
@dx
|
|
92
99
|
end
|
|
100
|
+
|
|
101
|
+
def image_url=(val)
|
|
102
|
+
@image_url = val
|
|
103
|
+
@dirty = true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
alias image= image_url=
|
|
107
|
+
|
|
108
|
+
def image_target_url=(val)
|
|
109
|
+
@image_target_url = val
|
|
110
|
+
@dirty = true
|
|
111
|
+
end
|
|
93
112
|
|
|
94
113
|
def link=(val)
|
|
95
114
|
@link = val
|
|
@@ -116,6 +135,7 @@ class RSScreator
|
|
|
116
135
|
end
|
|
117
136
|
|
|
118
137
|
@dx.title, @dx.description, @dx.link = @title, @description, @link || ''
|
|
138
|
+
@dx.image = @image_url
|
|
119
139
|
|
|
120
140
|
@rss = if @xslt then
|
|
121
141
|
|
|
@@ -128,7 +148,19 @@ class RSScreator
|
|
|
128
148
|
|
|
129
149
|
else
|
|
130
150
|
|
|
131
|
-
@dx.to_rss({limit: @limit})
|
|
151
|
+
@dx.to_rss({limit: @limit}) do |doc|
|
|
152
|
+
|
|
153
|
+
if @image_url then
|
|
154
|
+
|
|
155
|
+
img = Rexle::Element.new('image')
|
|
156
|
+
img.add Rexle::Element.new('url').add_text @image_url
|
|
157
|
+
img.add Rexle::Element.new('link').add_text @image_target_url
|
|
158
|
+
|
|
159
|
+
doc.root.element('channel/item').insert_before img
|
|
160
|
+
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
132
164
|
|
|
133
165
|
end
|
|
134
166
|
|
|
@@ -137,4 +169,4 @@ class RSScreator
|
|
|
137
169
|
|
|
138
170
|
end
|
|
139
171
|
|
|
140
|
-
end
|
|
172
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rss_creator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robert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date: 2021-02-24 00:00:00.000000000 Z
|
|
35
39
|
dependencies:
|
|
36
40
|
- !ruby/object:Gem::Dependency
|
|
37
41
|
name: rss_to_dynarex
|
|
@@ -57,24 +61,24 @@ dependencies:
|
|
|
57
61
|
name: rss_sliml
|
|
58
62
|
requirement: !ruby/object:Gem::Requirement
|
|
59
63
|
requirements:
|
|
60
|
-
- - "~>"
|
|
61
|
-
- !ruby/object:Gem::Version
|
|
62
|
-
version: '0.1'
|
|
63
64
|
- - ">="
|
|
64
65
|
- !ruby/object:Gem::Version
|
|
65
|
-
version: 0.
|
|
66
|
+
version: 0.2.0
|
|
67
|
+
- - "~>"
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0.2'
|
|
66
70
|
type: :runtime
|
|
67
71
|
prerelease: false
|
|
68
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
69
73
|
requirements:
|
|
70
|
-
- - "~>"
|
|
71
|
-
- !ruby/object:Gem::Version
|
|
72
|
-
version: '0.1'
|
|
73
74
|
- - ">="
|
|
74
75
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 0.
|
|
76
|
+
version: 0.2.0
|
|
77
|
+
- - "~>"
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '0.2'
|
|
76
80
|
description:
|
|
77
|
-
email:
|
|
81
|
+
email: digital.robertson@gmail.com
|
|
78
82
|
executables: []
|
|
79
83
|
extensions: []
|
|
80
84
|
extra_rdoc_files: []
|
|
@@ -100,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
104
|
version: '0'
|
|
101
105
|
requirements: []
|
|
102
106
|
rubyforge_project:
|
|
103
|
-
rubygems_version: 2.
|
|
107
|
+
rubygems_version: 2.7.10
|
|
104
108
|
signing_key:
|
|
105
109
|
specification_version: 4
|
|
106
110
|
summary: A gem for creating RSS feeds
|
metadata.gz.sig
CHANGED
|
Binary file
|