rss_creator 0.6.1 → 0.6.2

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
  SHA256:
3
- metadata.gz: 6d8273cee98cf1c57f43cca58ce9d2742f8c30abe5ae21c32ecc439dcccbb305
4
- data.tar.gz: 03ba208ffbba59b52e6d505a23bc080cf3ccdb69f61b58e02c97788a12103592
3
+ metadata.gz: d890a1bcc638ec87c774f46359b683f5c7ca08ce0375bae028988116f852c2fb
4
+ data.tar.gz: 2b031457ab6c1df794fad2dcf09043828262fc6d1855a3d1eb7501056ad55e6b
5
5
  SHA512:
6
- metadata.gz: bc13a9d7c9190002a9df32c8121afb26bf48a3fa7c5afddea9cb64afd52b50e9fd4878fe798a0068e4532429763f71c352ff39e1b201a22126d08d7d307672d0
7
- data.tar.gz: 472941429205c0a266f530b1f0e97186a119f7ef3c834a88e003a36575093f970e123351b6e80224f7e34799013076ad334806c54a250eb72787d45d05b2d4a1
6
+ metadata.gz: ad334d57682511fe7b6e2fa358dcb5335fbc8c947a0b750838db3be45bd4ede7fb05d733bdc006df341f49752bff67df9aabfdeada8fd312bee816b933bc9ad9
7
+ data.tar.gz: dc9751cd4badb902e31f4c67edfe68a9e85c27ee53b3819dcc3b4d9def54dfecc4264fb9d974a31d160d9f4a044850956220653834339629fea57c58c22834b7
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rss_creator.rb CHANGED
@@ -12,21 +12,27 @@ class RSScreator
12
12
  attr_accessor :title, :description, :link, :limit, :xslt, :image_url,
13
13
  :image_target_url
14
14
 
15
- def initialize(filepath='rss.xml', dx_xslt: nil, dx_filename: 'list.xml',
16
- custom_fields: [], limit: 10, log: nil, debug: false)
15
+ def initialize(filepath='rss.xml', dx_xslt: nil, dx_filename: nil,
16
+ custom_fields: [], limit: 10, log: nil, title: 'Untitled',
17
+ description: 'Description goes here', debug: false)
17
18
 
18
19
 
19
20
  @filepath, @log, @debug = filepath, log, debug
20
21
 
21
- dxfilepath = File.join(File.dirname(filepath), dx_filename)
22
+ if dx_filename then
23
+
24
+ dxfilepath = File.join(File.dirname(filepath), dx_filename)
22
25
 
23
- if filepath and FileX.exists? dxfilepath then
26
+ if filepath and FileX.exists? dxfilepath then
24
27
 
25
- @dx = Dynarex.new dxfilepath, debug: debug
26
- @title, @description, @link = @dx.title, @dx.description, @dx.link
27
- @image_url = @dx.image
28
+ @dx = Dynarex.new dxfilepath, debug: debug
29
+ @title, @description, @link = @dx.title, @dx.description, @dx.link
30
+ @image_url = @dx.image
31
+
32
+ end
28
33
 
29
34
  else
35
+
30
36
  if filepath and FileX.exists? filepath
31
37
 
32
38
  rtd = RSStoDynarex.new filepath
@@ -43,7 +49,8 @@ class RSScreator
43
49
  'item(title, link, description, date'
44
50
  schema += ', ' + custom_fields.join(', ') if custom_fields.any?
45
51
  schema += ')'
46
-
52
+ @title, @description = title, description
53
+
47
54
  @dx = Dynarex.new schema
48
55
  end
49
56
 
@@ -143,10 +150,6 @@ class RSScreator
143
150
 
144
151
  return @rss unless @dirty
145
152
 
146
- if @title.nil? or @description.nil? then
147
- raise 'RSScreator: title or description can\'t be blank'
148
- end
149
-
150
153
  @dx.title, @dx.description, @dx.link = @title, @description, @link || ''
151
154
  @dx.image = @image_url if @dx.respond_to? :image
152
155
 
data.tar.gz.sig CHANGED
Binary file
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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -36,7 +36,7 @@ cert_chain:
36
36
  cvt0iXma+gx/Ov53QNTxxB3QbNEEFdeEjg0+lO4JPFlhgtITILe804ZJCWi+hgxp
37
37
  gIx/INLAIB0o7xvs4rvitJ+wC8T5u20Ubss=
38
38
  -----END CERTIFICATE-----
39
- date: 2023-03-02 00:00:00.000000000 Z
39
+ date: 2023-03-03 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rss_to_dynarex
metadata.gz.sig CHANGED
Binary file