redd 0.1.4 → 0.1.5

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: a5a75930163e7a981bfd393651e20addf1f12c81
4
- data.tar.gz: e96ea4f4250086a5ef52a37cc1e822a2ddf49819
3
+ metadata.gz: 68ca6da5f545b524f8b03e08e6b493b3df260202
4
+ data.tar.gz: 6358bd923e9c302160b7f4a9bb095d4691741d8b
5
5
  SHA512:
6
- metadata.gz: dac14d6136bb95431162a8f4e73639fc52e4f958c6b25df9a451bd880480c8e7d3437ba079d5a1135a3896cd76dd6eca89b205e57e64d5709facc8ab4ac61413
7
- data.tar.gz: 556829db6d338e259e1123d1b52cc3193df565e82026131fd1caf827e99b035405b4f16c272a02517c852e984f67b1bad232c6637a1028f618cdc1bb73278a2b
6
+ metadata.gz: 8bb2902ebe6c5e959e24fc8ba672be642acd35c90667ba3a35023e5fa69ec8336e3f51d6489133e9417377417012879f5954fe405580c17a422a5542bfee7adc
7
+ data.tar.gz: c7f7c8816778a0c26aa7a49a8ffc514a64dcb22d3e1bb755856cbedb1888e7d6ee3946a0b396167328d090328f90dfbc9e290aa797145d110d7b4e6f42260326
data/.travis.yml CHANGED
@@ -1,10 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - ruby-head
4
- - 2.1.0
3
+ - 2.1.2
5
4
  - 2.0.0
6
5
  - 1.9.3
7
- - 1.9.2
8
- - rbx
9
- before_install:
10
- - gem update bundler
6
+ - jruby-1.7
7
+ - rbx-2
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <p align="center">
2
2
  <img src="github/redd.png?raw=true" alt="redd"><br>
3
3
  <a href="http://badge.fury.io/rb/redd"><img src="https://badge.fury.io/rb/redd.svg" alt="Gem Version" height="18"></a>
4
- <a href="https://gemnasium.com/avidw/redd"><img src="https://gemnasium.com/avidw/redd.svg" alt="Dependency Status"></a>
4
+ <a href="https://travis-ci.org/avidw/redd"><img src="https://travis-ci.org/avidw/redd.svg?branch=master" alt="Build Status"></a>
5
5
  </p>
6
6
 
7
7
  **redd** is an API wrapper for [reddit](http://reddit.com/dev/api) written in ruby that focuses on being *simple and extensible*.
@@ -68,7 +68,7 @@ Ruby and redd make creating reddit bots accessible and fun. To demonstrate, let'
68
68
  rescue Redd::Error => e
69
69
  status = e.message.status
70
70
  # 5-something errors are usually errors on reddit's end.
71
- raise e unless status.to_s.start_with? "5"
71
+ raise e unless (500...600).include?(status)
72
72
  end
73
73
  ```
74
74
 
@@ -89,12 +89,9 @@ Extending any ruby library, including redd is incredibly easy. Let's try this ou
89
89
  # methods.
90
90
  fullname = extract_fullname(thing)
91
91
 
92
- meth = :post
93
- path = "/api/v1/gold/gild/#{fullname}"
94
-
95
- # We're using send instead of object_from_response, because we don't
92
+ # We're using post instead of object_from_response, because we don't
96
93
  # expect any object from the response.
97
- send(meth, path)
94
+ post "/api/v1/gold/gild/#{fullname}"
98
95
  end
99
96
  end
100
97
  ```
@@ -120,7 +117,11 @@ Extending any ruby library, including redd is incredibly easy. Let's try this ou
120
117
  ```
121
118
 
122
119
  ## Supported Rubies
123
- TODO: Travis CI
120
+ This gem aims to work on the following rubies:
121
+
122
+ MRI: **1.9.3** - **2.1.2**
123
+ JRuby: **1.7.x**
124
+ Rubinius: **2.x.x**
124
125
 
125
126
  ## Copyright
126
127
  Copyright (c) [Avinash Dwarapu](http://github.com/avidw) under the MIT License. See LICENSE.md for more details.
@@ -4,7 +4,7 @@ module Redd
4
4
  # Faraday Middleware that parses JSON using Oj.
5
5
  class ParseJson < Faraday::Middleware
6
6
  dependency do
7
- require "oj" unless defined?(::Oj)
7
+ require "multi_json" unless defined?(::MultiJson)
8
8
  end
9
9
 
10
10
  # Call the middleware.
@@ -22,8 +22,8 @@ module Redd
22
22
  # @param [String] body The JSON string to parse.
23
23
  # @return [Hash] A symbolized parsed JSON hash.
24
24
  def parse(body)
25
- Oj.load(body, symbol_keys: true)
26
- rescue Oj::ParseError
25
+ MultiJson.load(body, symbolize_keys: true)
26
+ rescue MultiJson::ParseError
27
27
  body
28
28
  end
29
29
  end
data/lib/redd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # The main Redd module.
2
2
  module Redd
3
3
  # The semantic version number for Redd.
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
data/redd.gemspec CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |s|
27
27
  s.add_development_dependency "webmock"
28
28
 
29
29
  s.add_dependency "faraday", "~> 0.9.0"
30
+ s.add_dependency "multi_json", "~> 1.10"
30
31
  s.add_dependency "memoizable"
31
- s.add_dependency "oj"
32
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avinash Dwarapu
@@ -123,21 +123,21 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.9.0
125
125
  - !ruby/object:Gem::Dependency
126
- name: memoizable
126
+ name: multi_json
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '1.10'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ~>
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '1.10'
139
139
  - !ruby/object:Gem::Dependency
140
- name: oj
140
+ name: memoizable
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '>='