rss_watcher 0.1.1 → 0.1.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: 94b2b6ef86513054d4efe4a6417ade9da7e039cea4e5e42e62125de1b839ba5e
4
- data.tar.gz: c58fba31efed4b4b8a40eed0ce5ba23e7a08315781794964dd50ec712553da4e
3
+ metadata.gz: a8a392f2b60824f13208dca90b367442fc0deecfeebfc1ffa9b81c74a629f562
4
+ data.tar.gz: 35367aefae2f6764c4dba351042c4d075cd6df6ac326e861a35c2d705ba3d238
5
5
  SHA512:
6
- metadata.gz: 1d36ec2bd2d94012cce47cce619de49384dc94303f2a4f1916496df19de15050bcb77b9b32b4aeacc7a7f4b7f098c247ee604e1a84012c34f743f9455572b816
7
- data.tar.gz: '068c4c7fb855e2f49d26c8569b5593ad9e76b468b379fd6e9a6d148d79a7d29ba0bd5122371c72eeb5d2b2bfe3b8650e11881cd1f3cab06e4390a904ab1625aa'
6
+ metadata.gz: e517afda6abe648cf9efd125c2155d1b5c7476f384e0d0508a8d09dc1b667ae5486292f127301a38164d60cc867a09691b2fb321373145ae85224e9e475c5e02
7
+ data.tar.gz: 72bce0cb4e1a5027cf6d33f0cde259a59759110f19a2aebc5ca086a02a22b1cc4aac8cde3b1e7c782d69976386cfb823ad13dedcd9c55b929dad5597e63448e6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rss_watcher (0.1.1)
4
+ rss_watcher (0.1.2)
5
5
  rss (~> 0.2.8)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # RssWatcher
2
- [![Gem Version](https://badge.fury.io/rb/rss_watcher.svg)](https://badge.fury.io/rb/rss_watcher) [![Gem](https://img.shields.io/gem/dt/rss_watcher.svg?colorB=brightgreen&maxAge=3600)](https://badge.fury.io/rb/rss_watcher)
2
+ [![Gem Version](https://badge.fury.io/rb/rss_watcher.svg)](https://badge.fury.io/rb/rss_watcher) [![Gem](https://img.shields.io/gem/dt/rss_watcher.svg?colorB=brightgreen&maxAge=3600)](https://badge.fury.io/rb/rss_watcher)
3
+
3
4
  A Ruby Gem For Watching RSS Feeds
4
5
 
5
6
  ## Installation
@@ -11,7 +11,7 @@ module RssWatcher
11
11
  #updated_interval - Seconds to wait for between checking for updates to the RSS feed
12
12
  #cache_file - Path to a file that this gem uses internally for remembering the last seen item
13
13
  while true
14
- open(url) do |rss|
14
+ open(url, {"Cache-Control" => "no-cache", "Pragma" => "no-cache"}) do |rss|
15
15
  feed = RSS::Parser.parse(rss)
16
16
  RssWatcher::FeedManager.new(cache_file).get_new_feed_items(feed.items).each do |item|
17
17
  yield item if block_given?
@@ -1,3 +1,5 @@
1
+ require 'yaml'
2
+
1
3
  module RssWatcher
2
4
  class FeedManager
3
5
  def initialize cache_file_path
@@ -36,7 +38,7 @@ module RssWatcher
36
38
 
37
39
  def load_cache
38
40
  if File.exists? @cache_file_path
39
- @cache = Marshal.load File.read(@cache_file_path)
41
+ @cache = YAML.load File.read(@cache_file_path)
40
42
  else
41
43
  @cache = {time: Time.now.to_i, items_title: []}
42
44
  end
@@ -50,9 +52,7 @@ module RssWatcher
50
52
  end
51
53
 
52
54
  def dump_cache
53
- File.open(@cache_file_path, 'w') do |file|
54
- file.write Marshal.dump(@cache)
55
- end
55
+ File.write(@cache_file_path, YAML.dump(@cache))
56
56
  end
57
57
  end
58
58
  end
@@ -1,3 +1,3 @@
1
1
  module RssWatcher
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rss_watcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owais