rss_watcher 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffe62440dbb07c9f6dc0a8f3e92063d8830cb3beffb5c71e0db425d7acf599ec
4
- data.tar.gz: fcb086bbf67e619ef0aca722a9804e5306e1917e71b892ad707c7d80f94e4d09
3
+ metadata.gz: 94b2b6ef86513054d4efe4a6417ade9da7e039cea4e5e42e62125de1b839ba5e
4
+ data.tar.gz: c58fba31efed4b4b8a40eed0ce5ba23e7a08315781794964dd50ec712553da4e
5
5
  SHA512:
6
- metadata.gz: 7711af450ab72ab3409e8738099841722961f1303e87d38739c828ebba104f3f2f2d93b5927aa924e9198c4240f61ef9df7608e377afa247eb7da6ef9616520f
7
- data.tar.gz: ffe570172578bfc3e391c8e1af82de1554d7df7adf23fff593d34090e9cacbda25d55becdf7c76abeb5bbab40f3de99000ef73f42a62d49cb15fe7745f291eca
6
+ metadata.gz: 1d36ec2bd2d94012cce47cce619de49384dc94303f2a4f1916496df19de15050bcb77b9b32b4aeacc7a7f4b7f098c247ee604e1a84012c34f743f9455572b816
7
+ data.tar.gz: '068c4c7fb855e2f49d26c8569b5593ad9e76b468b379fd6e9a6d148d79a7d29ba0bd5122371c72eeb5d2b2bfe3b8650e11881cd1f3cab06e4390a904ab1625aa'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rss_watcher (0.1.0)
4
+ rss_watcher (0.1.1)
5
5
  rss (~> 0.2.8)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # RssWatcher
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rss_watcher`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
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
+ A Ruby Gem For Watching RSS Feeds
6
4
 
7
5
  ## Installation
8
6
 
@@ -20,10 +18,27 @@ Or install it yourself as:
20
18
 
21
19
  $ gem install rss_watcher
22
20
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
21
+ ## Usage Example
22
+ Whenever a new item is detected on the RSS feed, the given block is called with the item that was detected. ```item``` is an instance of a parsed RSS item using the [Ruby RSS library](https://github.com/ruby/rss). You should be able to access properties of the item using methods of the same name (e.g title, description, link, pubDate)
23
+ ```ruby
24
+ require "rss_watcher"
25
+ RssWatcher.watch(url: "http://lorem-rss.herokuapp.com/feed") do |item|
26
+ puts item.title
27
+ puts item.description
28
+ puts item.link
29
+ end
30
+ ```
31
+ ### Options
32
+ * url : URL of the RSS Feed to be watched (*Required | String*)
33
+ * update_interval: Time (**in seconds**) to wait between checking the url for updates (*Optional | Default: 10 | Integer*)
34
+ * cache_file: Path to a file that this gem uses internally for remembering the last seen item (*Optional | Default: ```"rss_watcher.cache"``` | String*)
35
+
36
+ ```ruby
37
+ RssWatcher.watch(url: "http://lorem-rss.herokuapp.com/feed", update_interval: 1, cache_file: "~/.tmp/rss_watcher_cache") do |item|
38
+ puts item.pubDate
39
+ puts item.link
40
+ end
41
+ ```
27
42
  ## Development
28
43
 
29
44
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,3 +1,3 @@
1
1
  module RssWatcher
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owais