Skip to content

Commit

Permalink
release 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
7even committed Mar 5, 2013
1 parent 7669931 commit 9048330
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012 Vsevolod Romashov
Copyright (c) 2012-2013 Vsevolod Romashov

MIT License

Expand All @@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A simple Faraday middleware that parses JSON responses. It is identical to `Fara

``` ruby
# Gemfile
gem 'faraday_middleware-parse_oj'
gem 'faraday_middleware-parse_oj', '~> 0.2'
```

or
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RSpec::Core::RakeTask.new do |t|
t.rspec_opts = '--color --format doc'
end

task :default => :spec
task default: :spec
6 changes: 3 additions & 3 deletions lib/faraday_middleware/parse_oj.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ class ParseOj < ResponseMiddleware
dependency 'oj'

define_parser do |body|
Oj.load(body) unless body.strip.empty?
Oj.load(body, mode: :compat) unless body.strip.empty?
end

VERSION = '0.1'
VERSION = '0.2'
end
end

Faraday.register_middleware :response, :oj => FaradayMiddleware::ParseOj
Faraday.register_middleware :response, oj: FaradayMiddleware::ParseOj
2 changes: 1 addition & 1 deletion spec/parse_oj_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end

it "parses the response body with Oj.load" do
Oj.should_receive(:load).with(@body).and_return(@parsed_body)
Oj.should_receive(:load).with(@body, mode: :compat).and_return(@parsed_body)
@connection.get('/url').body.should == @parsed_body
end
end

0 comments on commit 9048330

Please sign in to comment.