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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c744cef7596827d02c2f4c1aa6267850df2f9786
4
- data.tar.gz: 21f9c9128dfe8b924814d29e5d7fbb799b684e5b
3
+ metadata.gz: 1ac919571f3831de60a4c8676dcdf45af09e2dc7
4
+ data.tar.gz: 44b8059e3d1a43a6faab58429d55b14136c97282
5
5
  SHA512:
6
- metadata.gz: db59fed0d65c18a8355c3a7ddff94fa4a62ad876aca775b0a255971473661bbcc1ee291f70f1ea6ff6ab8f59259a4cfbfa5c5f9822be0805380966f7464c9227
7
- data.tar.gz: ca1a2eeb755a0d91da0fce00d5514f36dc883d33ebc85884002dfcc6643d69295dacd8b27b895096a87703514d2f82707fce3b3d6289d1d6722605eb01b97b49
6
+ metadata.gz: aa22913858581fcd3069801a084bb58278f8fb5b2e27b909fb87981c36f6a60ac89bc95a6d83cff1a6b5d806f43c5ea1a130d0298b0a79fcce4ed84b129dd410
7
+ data.tar.gz: d2ce5c53712e5c36d8a9939550156183aaa1a392431cc618d54ec9a047e876290c58a43691f8215e0f6f213e6276bf44c4bcd2fc67fc1705e31e736f95dd8400
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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, :desc, :limit
11
+ attr_accessor :title, :description, :limit
11
12
 
12
13
  def initialize(filepath=nil)
13
14
 
14
15
  @filepathpath = filepath
15
- @dx = Dynarex.new 'channel[title,desc]/item(title, link, description, created_at)'
16
- @dx.order = 'descending'
17
- @dx.xslt_schema = 'channel[title:title,description:desc]/' \
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
- @dx.title, @dx.desc = '', ''
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 @desc.nil? then
52
- raise 'RSScreator: title, or desc can\'t be blank'
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.desc = @title, @desc
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.1.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-24 00:00:00.000000000 Z
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.2.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
- ��甫�-����Qъ����U����Ԙ��mF!�R��$�:!�D��-l�vj�n��MF5�夝%��hպ��?: ��= ��uZt�dz^+��O��O�aP2�児�;�L"AV
2
- nj��ȓ��"G��7;��,�.��5�����Õ�����ԫ�U
1
+ ��g��%�SQ��m���6k��bc���2������L]^�Q�L�ƊWDo6'`�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*