rss_timeline 0.1.0 → 0.1.1

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: 08e236c5c78beb3593d44089b3684f6368f6c9c9
4
- data.tar.gz: 3c457c9b1fd5346d66434982e050ffc2ee7d0f7b
3
+ metadata.gz: 78b6ee7b72a4c481309b8f1e1b6b7a56b60997c5
4
+ data.tar.gz: a81f4af619cede1f6d62f378e72f8cb48f50c36f
5
5
  SHA512:
6
- metadata.gz: 2cc2c32f70a4b74e45d9e308aa6e6a4d1aba9d9327de0c82baaa0019ef3419dd6afa4d9544f08c904199d93ae4918e57a76bfcef79f36ec5b70bb01f273c746f
7
- data.tar.gz: 9df2ceeab9c4c290e476bbb61804e0f5c66f532a9a584b2460eeb5937023b6db6c1af68c341a355ebb05b8432f5fd06d3ecdd51a72554b69910df33704f5af73
6
+ metadata.gz: a8a30dbc8688c7d882234eb9754a31717d44f005305751d83f0df3bc50774d538f13256ba32089a5c5d527233f6a01153687184b06199e86180cf2cb6de6b878
7
+ data.tar.gz: afde0fb47dd468536fb74f0cf5a1b742dc332c574b5780d01f2096802c978028c1a42417f9e978cc0d96e923523ef09af36423113e7ed74ac1043ac53a44535c
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -23,9 +23,8 @@ class RSStimeline
23
23
  @timeline = RSScreator.new rssfile
24
24
  else
25
25
  @timeline = RSScreator.new
26
- @timeline.title = @title || 'My RSStimeline feed'
27
- @timeline.description = @description || \
28
- 'Generated using the RSStimeline gem'
26
+ self.title = 'My RSStimeline feed'
27
+ self.description = 'Generated using the RSStimeline gem'
29
28
  end
30
29
 
31
30
  @rssfile = rssfile
@@ -50,8 +49,10 @@ class RSStimeline
50
49
  if File.exists? rssfile then
51
50
 
52
51
  rss_cache = SimpleRSS.parse File.read(rssfile)
53
- new_rss_items = rss.items - rss_cache.items
52
+
53
+ new_rss_items = rss.items - rss_cache.items
54
54
  new_rss_items.each {|item| add_new item}
55
+ File.write rssfile, rss.source if new_rss_items.any?
55
56
 
56
57
  else
57
58
 
@@ -60,13 +61,33 @@ class RSStimeline
60
61
 
61
62
  end
62
63
  end
64
+
65
+ save()
63
66
 
64
- if @newupdate then
65
- on_update()
66
- @newupdate = false
67
- end
68
-
69
- @timeline.save @rssfile
67
+ end
68
+
69
+ def description()
70
+ @timeline.description
71
+ end
72
+
73
+ def description=(val)
74
+ @timeline.description = val
75
+ end
76
+
77
+ def link(val)
78
+ @timeline.link
79
+ end
80
+
81
+ def link=(val)
82
+ @timeline = val
83
+ end
84
+
85
+ def title()
86
+ @timeline.title
87
+ end
88
+
89
+ def title=(val)
90
+ @timeline.title = val
70
91
  end
71
92
 
72
93
  protected
@@ -85,7 +106,7 @@ class RSStimeline
85
106
 
86
107
  def add_new(item)
87
108
 
88
- @timeline.add new_item(item)
109
+ @timeline.add new_item(item), id: nil
89
110
  @newupdate = true
90
111
  on_new_item(item)
91
112
 
@@ -102,4 +123,15 @@ class RSStimeline
102
123
 
103
124
  end
104
125
 
105
- end
126
+ def save()
127
+
128
+ return unless @newupdate
129
+
130
+ on_update()
131
+ @newupdate = false
132
+
133
+ @timeline.save @rssfile
134
+
135
+ end
136
+
137
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rss_timeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  26qxA73KaDd6nfVQPejofU2jI+U/vMx42ra5PUEsN7+k5XRLYmswW6g6jLHoqvDn
32
32
  IUYo7zgQ2bCoWg==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-10-25 00:00:00.000000000 Z
34
+ date: 2015-11-06 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simple-rss
metadata.gz.sig CHANGED
Binary file