rss_creator 0.3.9 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -1
- data/lib/rss_creator.rb +41 -8
- 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: 964177968b7e65dc668fb908dc49dcb2b22a4832938d97e953b2e14134ac063b
|
4
|
+
data.tar.gz: 6f4fc2255ebb1f6aeddb9960ea9f374fe3d78b681c84daeb775e4f88164ac832
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea214c5015341d577e860471405e51dc367809fbf2aa2c93e692f8c39510f015dfa07656b0b9b57890f7ed2cf82bbda56204074f323cde01838fc1a612889489
|
7
|
+
data.tar.gz: a30c5a086500b4a9c12915c7e4b719f0489f48853604cf0474c601ddcc8f3e192d2ea364c607c397891f77a555ab857f8e1a6f51e87b958985a6ef274cbaa14a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
��o�fE�������;�K�L���ጭI��HH9�C6��&�>�]�̉���H{�E�нh�|0W W�9��'�1u�4�ėgc(��%��E.��c#�v
|
2
|
+
��7Y��m���Ԯ1��3ڧ���s�F���2��ϭ�I��%�a���H�t�A��^e鬩G��D���'��k��4DOb��.b�MJ���^�L���j��C�&U�b_�3m�@y@���lyL!r���y����Z#�y)O3�x�.��;�d�{P09���Ͳs��?�,bH�������w �U�w��3i5�ia��X_�VW�;��H
|
3
|
+
&������z'�<����V5���i����B�g;=H�G0��(w/y��^4�
|
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
|
|
@@ -22,6 +23,7 @@ class RSScreator
|
|
22
23
|
|
23
24
|
@dx = Dynarex.new dxfilepath
|
24
25
|
@title, @description, @link = @dx.title, @dx.description, @dx.link
|
26
|
+
@image_url = @dx.image
|
25
27
|
|
26
28
|
else
|
27
29
|
if filepath and File.exists? filepath
|
@@ -30,11 +32,13 @@ class RSScreator
|
|
30
32
|
@dx = rtd.to_dynarex
|
31
33
|
|
32
34
|
@title, @description, @link = @dx.title, @dx.description, @dx.link
|
35
|
+
@image_url = @dx.image if @dx.image and @dx.image.length > 1
|
36
|
+
@image_target_url = @link if @link and @link.length > 1
|
33
37
|
|
34
38
|
else
|
35
39
|
|
36
40
|
|
37
|
-
schema = 'channel[title, description, link]/' + \
|
41
|
+
schema = 'channel[title, description, link, image]/' + \
|
38
42
|
'item(title, link, description, date'
|
39
43
|
schema += ', ' + custom_fields.join(', ') if custom_fields.any?
|
40
44
|
schema += ')'
|
@@ -53,7 +57,7 @@ class RSScreator
|
|
53
57
|
'link:link]/item(title:title,description:description,' + \
|
54
58
|
'link:link,pubDate:date)'
|
55
59
|
# maxium number of items saved in the RSS feed
|
56
|
-
@dx.limit = @limit =
|
60
|
+
@dx.limit = @limit = limit
|
57
61
|
|
58
62
|
|
59
63
|
@dirty = true
|
@@ -85,6 +89,10 @@ class RSScreator
|
|
85
89
|
@description = val
|
86
90
|
@dirty = true
|
87
91
|
end
|
92
|
+
|
93
|
+
def delete(id)
|
94
|
+
@dx.delete id.to_s
|
95
|
+
end
|
88
96
|
|
89
97
|
alias desc= description=
|
90
98
|
alias desc description
|
@@ -92,6 +100,18 @@ class RSScreator
|
|
92
100
|
def dynarex()
|
93
101
|
@dx
|
94
102
|
end
|
103
|
+
|
104
|
+
def image_url=(val)
|
105
|
+
@image_url = val
|
106
|
+
@dirty = true
|
107
|
+
end
|
108
|
+
|
109
|
+
alias image= image_url=
|
110
|
+
|
111
|
+
def image_target_url=(val)
|
112
|
+
@image_target_url = val
|
113
|
+
@dirty = true
|
114
|
+
end
|
95
115
|
|
96
116
|
def link=(val)
|
97
117
|
@link = val
|
@@ -118,6 +138,7 @@ class RSScreator
|
|
118
138
|
end
|
119
139
|
|
120
140
|
@dx.title, @dx.description, @dx.link = @title, @description, @link || ''
|
141
|
+
@dx.image = @image_url if @dx.respond_to? :image
|
121
142
|
|
122
143
|
@rss = if @xslt then
|
123
144
|
|
@@ -130,7 +151,19 @@ class RSScreator
|
|
130
151
|
|
131
152
|
else
|
132
153
|
|
133
|
-
@dx.to_rss({limit: @limit})
|
154
|
+
@dx.to_rss({limit: @limit}) do |doc|
|
155
|
+
|
156
|
+
if @image_url then
|
157
|
+
|
158
|
+
img = Rexle::Element.new('image')
|
159
|
+
img.add Rexle::Element.new('url').add_text @image_url
|
160
|
+
img.add Rexle::Element.new('link').add_text @image_target_url
|
161
|
+
|
162
|
+
doc.root.element('channel/item').insert_before img
|
163
|
+
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
134
167
|
|
135
168
|
end
|
136
169
|
|
@@ -139,4 +172,4 @@ class RSScreator
|
|
139
172
|
|
140
173
|
end
|
141
174
|
|
142
|
-
end
|
175
|
+
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjEwMjI0MTEzNTE4WhcN
|
15
|
+
MjIwMjI0MTEzNTE4WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC/EdPv
|
17
|
+
Z9PmSgZQ31H8hgTyVkC5Ww2VyrxJbX9LA2xX++xTEMm2LvLs4G9vGeNWiUpLdSZt
|
18
|
+
EkPMLX58IhDJoETYMF4UpAw/tOPMlvzrmM9vFTdsZXKXwTwS3blbWahUgRAlXWpV
|
19
|
+
pbNj+SQlnIZklZ8FR/rvXE98wAFO4IIldQcyuUi9ehrYfazpS6fOg3f3Yg6ffPMs
|
20
|
+
xWUmhF4zQs+J6utjoJeWyVHWwHFpcmzMIEcLbnGOsn6JHdPmDaCTyAWjbrTsbMRn
|
21
|
+
o4BHS81Mn9ao3FDOR+Rj/zxZJNwEoEdWtQXCqCRFtBNehODqjSGNEBlYQmG0gQJ1
|
22
|
+
2PiXAf8lcqVo2KJPMVPjMSwKDQKdfMf8/EqZjwH+OrrH38AjrjJgOXH7/amVutBb
|
23
|
+
gCyoseuD+sB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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
|