spyke 1.1.0 → 1.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
  SHA1:
3
- metadata.gz: 454a7844a87f1ba6d9797d519a754a02b0ea6da0
4
- data.tar.gz: 454dcbda6c25ccc881169c2c0e57bf0498add944
3
+ metadata.gz: fe31d061e32e3c43bbbd1f2ab65af081fd82d967
4
+ data.tar.gz: 388748ebaf5ab22e1ffae4ec9007559fc4ac127d
5
5
  SHA512:
6
- metadata.gz: b5edf38fa1f17dbf4eac1daad618622b7e0bdfb451e6871a3087f2ee8b32bad74fc9ad06bbeb606136c10da059b5f08ad54b29bc537af38f1010cdf5550809b3
7
- data.tar.gz: 4a5f406bcb26f80e40e9cfd341af96c0e2ee334add9c3db2f067ecb6a25a327e8a4af0abc64be5595c51a606ee0d2b8adac6410639d18ba20a0198f43fbe2cb2
6
+ metadata.gz: 31f2734a11911f1149701b338482ce5faa379e415d3a745bd9d50615557018be61e934c3939215289a92a4ef3e638634fa469796900b7fb61e5fd41c96d0e82c
7
+ data.tar.gz: 2bf2903f8dab9d3ab41ce19b876ee4ca077bfa72b0af133b840a0d6b3d18d62912b774461f3ac63aafd7a33d5e7fb76aaff49c767ec9c614edb69360e8e7db2b
data/README.md CHANGED
@@ -95,6 +95,13 @@ Spyke comes with Faraday middleware for Rails that will output helpful
95
95
  ActiveRecord-like output to the main log as well as keep a record of
96
96
  request/responses in `/log/faraday.log`.
97
97
 
98
+ ```bash
99
+ Started GET "/posts" for 127.0.0.1 at 2014-12-01 14:31:20 +0000
100
+ Processing by PostsController#index as HTML
101
+ Parameters: {}
102
+ GET http://api.com/posts [200]
103
+ ```
104
+
98
105
  To use it, simply add it to the stack of middleware:
99
106
 
100
107
  ```ruby
data/lib/spyke/orm.rb CHANGED
@@ -23,6 +23,7 @@ module Spyke
23
23
  end
24
24
 
25
25
  def find(id)
26
+ raise ResourceNotFound if id.blank?
26
27
  id = strip_slug(id)
27
28
  where(id: id).find_one || raise(ResourceNotFound)
28
29
  end
data/lib/spyke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spyke
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
data/test/orm_test.rb CHANGED
@@ -34,9 +34,9 @@ module Spyke
34
34
  def test_404
35
35
  stub_request(:get, 'http://sushi.com/recipes/1').to_return(status: 404, body: { message: 'Not found' }.to_json)
36
36
 
37
- assert_raises ResourceNotFound do
38
- Recipe.find(1)
39
- end
37
+ assert_raises(ResourceNotFound) { Recipe.find(1) }
38
+ assert_raises(ResourceNotFound) { Recipe.find(nil) }
39
+ assert_raises(ResourceNotFound) { Recipe.find('') }
40
40
  end
41
41
 
42
42
  def test_save_new_record
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyke
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-01 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport