README.md in redd-0.1.4 vs README.md in redd-0.1.5
- old
+ new
@@ -1,9 +1,9 @@
<p align="center">
<img src="github/redd.png?raw=true" alt="redd"><br>
<a href="http://badge.fury.io/rb/redd"><img src="https://badge.fury.io/rb/redd.svg" alt="Gem Version" height="18"></a>
- <a href="https://gemnasium.com/avidw/redd"><img src="https://gemnasium.com/avidw/redd.svg" alt="Dependency Status"></a>
+ <a href="https://travis-ci.org/avidw/redd"><img src="https://travis-ci.org/avidw/redd.svg?branch=master" alt="Build Status"></a>
</p>
**redd** is an API wrapper for [reddit](http://reddit.com/dev/api) written in ruby that focuses on being *simple and extensible*.
---
@@ -66,11 +66,11 @@
time_left = e.time
sleep(time_left)
rescue Redd::Error => e
status = e.message.status
# 5-something errors are usually errors on reddit's end.
- raise e unless status.to_s.start_with? "5"
+ raise e unless (500...600).include?(status)
end
```
## Extending Redd
Extending any ruby library, including redd is incredibly easy. Let's try this out by adding a gilding extension. Reddit provides an api to be able to gild posts and comments, given that you have "creddits".
@@ -87,16 +87,13 @@
def gild(thing)
# Redd::Client::Unauthenticated::Utilities has some pretty helpful
# methods.
fullname = extract_fullname(thing)
- meth = :post
- path = "/api/v1/gold/gild/#{fullname}"
-
- # We're using send instead of object_from_response, because we don't
+ # We're using post instead of object_from_response, because we don't
# expect any object from the response.
- send(meth, path)
+ post "/api/v1/gold/gild/#{fullname}"
end
end
```
3. Let's add the method to the Authenticated client. You can also add it to the Unauthenticated client, but since unauthenticated users can't gild, there's no point.
@@ -118,10 +115,14 @@
Redd::Object::Submission.include(Gildable)
Redd::Object::Comment.include(Gildable)
```
## Supported Rubies
-TODO: Travis CI
+This gem aims to work on the following rubies:
+
+MRI: **1.9.3** - **2.1.2**
+JRuby: **1.7.x**
+Rubinius: **2.x.x**
## Copyright
Copyright (c) [Avinash Dwarapu](http://github.com/avidw) under the MIT License. See LICENSE.md for more details.
Some code has been used from [RedditKit.rb](http://github.com/samsymons/RedditKit.rb). See RedditKit.LICENSE.md for more details.