rss_creator 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rss_creator.rb +21 -9
- metadata +23 -3
- metadata.gz.sig +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ac919571f3831de60a4c8676dcdf45af09e2dc7
|
4
|
+
data.tar.gz: 44b8059e3d1a43a6faab58429d55b14136c97282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa22913858581fcd3069801a084bb58278f8fb5b2e27b909fb87981c36f6a60ac89bc95a6d83cff1a6b5d806f43c5ea1a130d0298b0a79fcce4ed84b129dd410
|
7
|
+
data.tar.gz: d2ce5c53712e5c36d8a9939550156183aaa1a392431cc618d54ec9a047e876290c58a43691f8215e0f6f213e6276bf44c4bcd2fc67fc1705e31e736f95dd8400
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rss_creator.rb
CHANGED
@@ -3,20 +3,32 @@
|
|
3
3
|
# file: rss_creator.rb
|
4
4
|
|
5
5
|
require 'dynarex'
|
6
|
+
require 'rss_to_dynarex'
|
6
7
|
|
7
8
|
|
8
9
|
class RSScreator
|
9
10
|
|
10
|
-
attr_accessor :title, :
|
11
|
+
attr_accessor :title, :description, :limit
|
11
12
|
|
12
13
|
def initialize(filepath=nil)
|
13
14
|
|
14
15
|
@filepathpath = filepath
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
if filepath then
|
18
|
+
|
19
|
+
rtd = RSStoDynarex.new filepath
|
20
|
+
@dx = rtd.to_dynarex
|
21
|
+
@title = @dx.title
|
22
|
+
@description = @dx.description
|
23
|
+
|
24
|
+
else
|
25
|
+
@dx = Dynarex.new 'channel[title,description]/item(title, link, description, created_at)'
|
26
|
+
@dx.order = 'descending'
|
27
|
+
end
|
28
|
+
|
29
|
+
@dx.xslt_schema = 'channel[title:title,description:description]/' \
|
18
30
|
+ 'item(title:title,description:description,link:link,pubDate:created_at)'
|
19
|
-
|
31
|
+
|
20
32
|
|
21
33
|
# maxium number of items saved in the RSS feed
|
22
34
|
@limit = 11
|
@@ -30,7 +42,7 @@ class RSScreator
|
|
30
42
|
@dx.create record
|
31
43
|
end
|
32
44
|
|
33
|
-
def save(new_filepath)
|
45
|
+
def save(new_filepath=nil)
|
34
46
|
|
35
47
|
filepath = new_filepath ? new_filepath : @filepath
|
36
48
|
File.write filepath, print_rss
|
@@ -48,11 +60,11 @@ class RSScreator
|
|
48
60
|
|
49
61
|
def print_rss()
|
50
62
|
|
51
|
-
if @title.nil? or @
|
52
|
-
raise 'RSScreator: title, or
|
63
|
+
if @title.nil? or @description.nil? then
|
64
|
+
raise 'RSScreator: title, or description can\'t be blank'
|
53
65
|
end
|
54
66
|
|
55
|
-
@dx.title, @dx.
|
67
|
+
@dx.title, @dx.description = @title, @description
|
56
68
|
@dx.to_rss({limit: @limit})
|
57
69
|
|
58
70
|
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.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
9HFHvRHJvHbKI5qIF3G+KkFUx2ZXkSCaRP6NDkkPo0IY6vJ34w4pDwdSH4jHpld9
|
32
32
|
4pCsHtS+NYWg/g==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-10-
|
34
|
+
date: 2015-10-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
@@ -53,6 +53,26 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 1.5.38
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rss_to_dynarex
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.1'
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.1.7
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0.1'
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.7
|
56
76
|
description:
|
57
77
|
email: james@r0bertson.co.uk
|
58
78
|
executables: []
|
@@ -80,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
100
|
version: '0'
|
81
101
|
requirements: []
|
82
102
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
103
|
+
rubygems_version: 2.4.8
|
84
104
|
signing_key:
|
85
105
|
specification_version: 4
|
86
106
|
summary: A gem for creating RSS feeds
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
��g��%�SQ��m���6k��bc���2������L]^�Q�L�ƊW�Do�6'`�2���>�$�Ӣ��g�Y
|
2
|
+
�n�MH��ul/�(�z�SIO`�l����+�O�Z
|
3
|
+
��#���������2Ғ!�Ձ�q�l����U_��<���,xN�3��a�/���@<ρ|��\�ʞ1I=����.�ƲGF�!{˗K��6w���M��/�&Z��6�JTM��GOD-.IJ�_9.�:C�I�9A�H��SK��b*
|