reviewed 0.5.0 → 0.6.0

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.
Files changed (55) hide show
  1. data/lib/faraday/cache.rb +47 -0
  2. data/lib/reviewed/client.rb +4 -6
  3. data/lib/reviewed/request.rb +39 -2
  4. data/lib/reviewed/version.rb +1 -1
  5. data/lib/reviewed.rb +1 -0
  6. data/reviewed.gemspec +1 -0
  7. data/spec/article_spec.rb +3 -5
  8. data/spec/client_spec.rb +4 -0
  9. data/spec/collection_spec.rb +2 -1
  10. data/spec/faraday/cache_spec.rb +59 -0
  11. data/spec/fixtures/vcr/Reviewed_Article/associations/attachments/assigns_attachments_to_the_correct_class.yml +296 -304
  12. data/spec/fixtures/vcr/Reviewed_Article/associations/attachments/does_not_has_many_attachments.yml +231 -204
  13. data/spec/fixtures/vcr/Reviewed_Article/associations/attachments/does_not_have_any_matching_attachments.yml +296 -246
  14. data/spec/fixtures/vcr/Reviewed_Article/associations/attachments/finds_attachments_by_tag.yml +346 -276
  15. data/spec/fixtures/vcr/Reviewed_Article/associations/attachments/gets_gallery_attachments.yml +320 -306
  16. data/spec/fixtures/vcr/Reviewed_Article/associations/deals/has_many_deals.yml +281 -234
  17. data/spec/fixtures/vcr/Reviewed_Article/associations/pages/has_many_pages.yml +231 -204
  18. data/spec/fixtures/vcr/Reviewed_Article/associations/products/has_many_products.yml +231 -204
  19. data/spec/fixtures/vcr/Reviewed_Article/associations/products/returns_products_of_the_correct_class.yml +231 -204
  20. data/spec/fixtures/vcr/Reviewed_Article/associations/related_articles/has_many_related_articles.yml +231 -204
  21. data/spec/fixtures/vcr/Reviewed_Article/fetches_when_a_tag_is_not_in_pre-loaded_set.yml +443 -25
  22. data/spec/fixtures/vcr/Reviewed_Article/find_page/finds_a_page_with_a_matching_slug.yml +360 -313
  23. data/spec/fixtures/vcr/Reviewed_Article/primary_product/returns_a_product_of_the_correct_class.yml +511 -437
  24. data/spec/fixtures/vcr/Reviewed_Article/primary_product/returns_nil_if_does_not_respond_to_products.yml +461 -407
  25. data/spec/fixtures/vcr/Reviewed_Article/primary_product/returns_the_primary_product.yml +461 -407
  26. data/spec/fixtures/vcr/Reviewed_Article/returns_local_attachments_when_available.yml +443 -87
  27. data/spec/fixtures/vcr/Reviewed_Collection/collection_data/fetches_the_first_page_by_default.yml +201 -71
  28. data/spec/fixtures/vcr/Reviewed_Collection/collection_data/is_enumerable.yml +201 -71
  29. data/spec/fixtures/vcr/Reviewed_Collection/next_page/fetches_the_next_page_of_results.yml +312 -77
  30. data/spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/indicates_if_the_page_number_is_out_of_bounds.yml +201 -71
  31. data/spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/indicates_whether_this_is_the_first_or_last_page.yml +151 -41
  32. data/spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/returns_the_limit_value_max_per_page_.yml +151 -41
  33. data/spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/returns_the_number_of_entries_on_the_current_page.yml +201 -71
  34. data/spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/returns_the_offset.yml +201 -71
  35. data/spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/returns_the_total_item_count.yml +151 -41
  36. data/spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/returns_the_total_number_of_pages.yml +201 -71
  37. data/spec/fixtures/vcr/Reviewed_Collection/previous_page/fetches_the_previous_page_of_results.yml +561 -176
  38. data/spec/fixtures/vcr/Reviewed_Collection/previous_page/returns_nil_if_there_is_no_previous_page.yml +151 -41
  39. data/spec/fixtures/vcr/Reviewed_Product/associations/attachments/does_not_have_any_matching_attachments.yml +168 -95
  40. data/spec/fixtures/vcr/Reviewed_Product/associations/attachments/matches_attachments_by_tag_properly.yml +103 -113
  41. data/spec/fixtures/vcr/Reviewed_Product/associations/attachments/no_longer_has_many_attachments.yml +103 -53
  42. data/spec/fixtures/vcr/Reviewed_Product/associations/attachments/returns_attachments_by_tag.yml +103 -113
  43. data/spec/fixtures/vcr/Reviewed_Product/associations/attachments/returns_attachments_of_the_correct_class.yml +118 -65
  44. data/spec/fixtures/vcr/Reviewed_Product/manufacturer_specs/has_many_manufacturer_specs.yml +102 -52
  45. data/spec/fixtures/vcr/Reviewed_Product/manufacturer_specs/returns_attachments_of_the_correct_class.yml +102 -52
  46. data/spec/product_spec.rb +2 -1
  47. data/spec/request_spec.rb +21 -0
  48. data/spec/spec_helper.rb +1 -0
  49. metadata +74 -39
  50. checksums.yaml +0 -7
  51. data/spec/fixtures/vcr/Reviewed_Article/does_not_request_for_an_attachment_if_it_can_be_found_in_attributes.yml +0 -387
  52. data/spec/fixtures/vcr/Reviewed_Article/fetches_all_attachments_when_no_tag_is_asked_for.yml +0 -195
  53. data/spec/fixtures/vcr/Reviewed_Article/fetches_attachments_when_non-existent.yml +0 -137
  54. data/spec/fixtures/vcr/Reviewed_Article/fetches_when_an_tag_is_not_in_pre-loaded_set.yml +0 -75
  55. data/spec/fixtures/vcr/Reviewed_Article/sets_DEFAULT_ATTACHMENTS.yml +0 -75
@@ -8,65 +8,115 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.8.7
11
+ - Faraday v0.8.6
12
12
  X-Reviewed-Authorization:
13
- - 38e397252ec670ec441733a95204f141
13
+ - 5bbeff36f992bbb2f6dcaf37f3e630d8
14
14
  Accept-Encoding:
15
15
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
16
  Accept:
17
- - '*/*'
17
+ - ! '*/*'
18
18
  response:
19
19
  status:
20
20
  code: 200
21
- message: OK
21
+ message: !binary |-
22
+ T0s=
22
23
  headers:
23
- Access-Control-Allow-Credentials:
24
- - 'true'
25
- Access-Control-Allow-Headers:
26
- - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
27
- x-skip-cache, Content-Type
28
- Access-Control-Allow-Methods:
29
- - OPTIONS, GET, POST, PUT, DELETE
30
- Access-Control-Allow-Origin:
31
- - '*'
32
- Access-Control-Max-Age:
33
- - '1000'
34
- Cache-Control:
35
- - no-cache, no-store
36
- Content-Type:
37
- - application/json; charset=utf-8
38
- Date:
39
- - Thu, 27 Jun 2013 15:42:53 GMT
40
- Etag:
41
- - '"e0aa021e21dddbd6d8cecec71e9cf564"'
42
- Status:
43
- - 200 OK
44
- Strict-Transport-Security:
45
- - max-age=31536000
46
- Vary:
47
- - Accept-Encoding
48
- X-Request-Id:
49
- - 7a64d54b1c1d1f2e2df318adc868c4a6
50
- X-Runtime:
51
- - '0.019178'
52
- X-Ua-Compatible:
53
- - IE=Edge,chrome=1
54
- Transfer-Encoding:
55
- - chunked
56
- Connection:
57
- - keep-alive
24
+ !binary "QWNjZXNzLUNvbnRyb2wtQWxsb3ctQ3JlZGVudGlhbHM=":
25
+ - !binary |-
26
+ dHJ1ZQ==
27
+ !binary "QWNjZXNzLUNvbnRyb2wtQWxsb3ctSGVhZGVycw==":
28
+ - !binary |-
29
+ eC1wYWdpbmF0aW9uLCB4LXJlcXVlc3RlZC13aXRoLCB4LXJlcXVlc3RlZC1i
30
+ eSwgeC1yZXZpZXdlZC1hdXRob3JpemF0aW9uLCB4LXNraXAtY2FjaGUsIENv
31
+ bnRlbnQtVHlwZQ==
32
+ !binary "QWNjZXNzLUNvbnRyb2wtQWxsb3ctTWV0aG9kcw==":
33
+ - !binary |-
34
+ T1BUSU9OUywgR0VULCBQT1NULCBQVVQsIERFTEVURQ==
35
+ !binary "QWNjZXNzLUNvbnRyb2wtQWxsb3ctT3JpZ2lu":
36
+ - !binary |-
37
+ Kg==
38
+ !binary "QWNjZXNzLUNvbnRyb2wtTWF4LUFnZQ==":
39
+ - !binary |-
40
+ MTAwMA==
41
+ !binary "Q2FjaGUtQ29udHJvbA==":
42
+ - !binary |-
43
+ bm8tY2FjaGUsIG5vLXN0b3Jl
44
+ !binary "Q29udGVudC1FbmNvZGluZw==":
45
+ - !binary |-
46
+ Z3ppcA==
47
+ !binary "Q29udGVudC1UeXBl":
48
+ - !binary |-
49
+ YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
50
+ !binary "RGF0ZQ==":
51
+ - !binary |-
52
+ V2VkLCAyNCBKdWwgMjAxMyAyMTowMzoyNiBHTVQ=
53
+ !binary "U3RhdHVz":
54
+ - !binary |-
55
+ MjAwIE9L
56
+ !binary "U3RyaWN0LVRyYW5zcG9ydC1TZWN1cml0eQ==":
57
+ - !binary |-
58
+ bWF4LWFnZT0zMTUzNjAwMA==
59
+ !binary "VmFyeQ==":
60
+ - !binary |-
61
+ QWNjZXB0LUVuY29kaW5n
62
+ !binary "WC1SYWNrLUNhY2hl":
63
+ - !binary |-
64
+ bWlzcw==
65
+ !binary "WC1SZXF1ZXN0LUlk":
66
+ - !binary |-
67
+ NWM0MjllYmRkYTUyNWZlZGEwZmE5NmNlNjA4NmYxNWM=
68
+ !binary "WC1SdW50aW1l":
69
+ - !binary |-
70
+ MC4xNTg2MDY=
71
+ !binary "WC1VYS1Db21wYXRpYmxl":
72
+ - !binary |-
73
+ SUU9RWRnZSxjaHJvbWU9MQ==
74
+ !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
75
+ - !binary |-
76
+ Y2h1bmtlZA==
77
+ !binary "Q29ubmVjdGlvbg==":
78
+ - !binary |-
79
+ a2VlcC1hbGl2ZQ==
58
80
  body:
59
- encoding: UTF-8
60
- string: '{"id":"50fa307696ab5860160c7a7e","created_at":"2012-05-15T21:12:15Z","updated_at":"2013-03-11T21:05:24Z","name":"Minden
61
- Master II","slug":"minden-master-ii","_type":"Home::Grills::Gas","types":["Propane"],"msrp":479.0,"article_ids":["50fb2e7bbd0286d555013653"],"website_ids":["50e669d7bd028648e0000023"],"publish_on":"2012-05-18T19:34:00+00:00","upc":null,"price_grabber_id":"","rubric_id":null,"brand_id":"50f9ed7cbd0286638e000272","model":"Master
62
- II","resource_uri":"/products/minden-master-ii","archive_state":"by_date","is_scoring_baseline":false,"archived":false,"product_rating":null,"ranking":{"total":null,"rank":null,"percentile":null},"rubric":{"name":"","permissions":{"read":true,"create":false,"update":false,"destroy":false},"api_links":{"collection":{"rel":"/api/v1/rubrics","href":"https://the-guide-staging.herokuapp.com/api/v1/rubrics"},"resource":{"rel":"/api/v1/rubrics","href":"https://the-guide-staging.herokuapp.com/api/v1/rubrics"}}},"websites":[{"id":"50e669d7bd028648e0000023","created_at":"2013-01-04T05:34:15Z","updated_at":"2013-01-19T06:42:05Z","name":"Grills","url":"grillsinfo.com","code":"GRI","category":null,"featured_video_id":null,"ad_campaign_group":{"id":"51377ab09f5e85f5a3000484","created_at":"2013-03-06T17:19:44Z","updated_at":"2013-03-06T17:19:44Z","website_id":"50e669d7bd028648e0000023","ad_campaigns":[],"permissions":{"read":false,"create":false,"update":false,"destroy":false},"api_links":{"collection":{"rel":"/api/v1/ad_campaign_groups","href":"https://the-guide-staging.herokuapp.com/api/v1/ad_campaign_groups"},"resource":{"rel":"/api/v1/ad_campaign_groups/51377ab09f5e85f5a3000484","href":"https://the-guide-staging.herokuapp.com/api/v1/ad_campaign_groups/51377ab09f5e85f5a3000484"}}},"permissions":{"read":true,"create":false,"update":false,"destroy":false},"api_links":{"collection":{"rel":"/api/v1/websites","href":"https://the-guide-staging.herokuapp.com/api/v1/websites"},"resource":{"rel":"/api/v1/websites/50e669d7bd028648e0000023","href":"https://the-guide-staging.herokuapp.com/api/v1/websites/50e669d7bd028648e0000023"}}}],"manufacturer_specs":[{"id":"50fa369fbd0286ee4a03a536","name":"brand_name","value":"(Minden)","value_units":"","value_type":"String","order":0,"options":[]},{"id":"50fa369fbd0286ee4a03a537","name":"manufacturer_name","value":"Minden","value_units":"","value_type":"String","order":0,"options":[]},{"id":"50fa369fbd0286ee4a03a538","name":"manual_url","value":"","value_units":"","value_type":"String","order":0,"options":[]},{"id":"50fa369fbd0286ee4a03a539","name":"manual_text","value":"","value_units":"","value_type":"String","order":0,"options":[]},{"id":"50fa369fbd0286ee4a03a53a","name":"manufacturer_text","value":null,"value_units":"","value_type":"String","order":0,"options":[]},{"id":"50fa369fbd0286ee4a03a53b","name":"manufacturer_url","value":"","value_units":"","value_type":"String","order":0,"options":[]},{"id":"50fa369fbd0286ee4a03a53c","name":"series_name","value":"","value_units":"","value_type":"String","order":0,"options":[]},{"id":"50fa369fbd0286ee4a03a53d","name":"Fuel","value":["LP
63
- Gas"],"value_units":"","value_type":"MultiListItem","order":0,"options":["LP
64
- Gas","Natural Gas","Charcoal","Electricity","Natural Gas (adaptor sold separately)","Propane
65
- (adaptor sold separately)"]},{"id":"50fa369fbd0286ee4a03a53e","name":"Install
66
- Type","value":"Freestanding","value_units":"","value_type":"String","order":0,"options":["Freestanding","Portable","Install"]},{"id":"50fa369fbd0286ee4a03a53f","name":"Finish
67
- or Color","value":"Green","value_units":"","value_type":"String","order":0,"options":["Electricity"]},{"id":"50fa369fbd0286ee4a03a540","name":"Side
68
- Burner","value":"No","value_units":"","value_type":"String","order":0,"options":["Yes","No"]},{"id":"50fa369fbd0286ee4a03a541","name":"Rotisserie","value":"No","value_units":"","value_type":"String","order":0,"options":["Yes","No"]},{"id":"50fa369fbd0286ee4a03a542","name":"Original
69
- Price","value":479.0,"value_units":"","value_type":"Decimal","order":0,"options":[]}],"attachments":[{"id":"50fca08abd02862d77009628","created_at":"2013-01-21T01:57:30Z","updated_at":"2013-01-21T01:57:30Z","name":"Minden-360MD-vanity.jpg","type":"file","tags":["vanity"],"versions":{"s50x50":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s50x50_Minden-360MD-vanity.jpg","s150x150":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s150x150_Minden-360MD-vanity.jpg","s250x250":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s250x250_Minden-360MD-vanity.jpg","s300x150":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s300x150_Minden-360MD-vanity.jpg","s300x112":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s300x112_Minden-360MD-vanity.jpg","s500x500":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s500x500_Minden-360MD-vanity.jpg","s600x400":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s600x400_Minden-360MD-vanity.jpg","s600x600":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s600x600_Minden-360MD-vanity.jpg","s940x400":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s940x400_Minden-360MD-vanity.jpg","s940x350":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s940x350_Minden-360MD-vanity.jpg","s940x110":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/s940x110_Minden-360MD-vanity.jpg","original":"http://reviewed-staging.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/Minden-360MD-vanity.jpg"},"caption":null,"alt_text":null,"data":{"url":"http://reviewed-production.s3.amazonaws.com/attachment/3b2dd14de6c1b9abfafa0df5e479b547ef7c7bbd/Minden-360MD-vanity.jpg","file_size":29538,"content_type":"image/jpeg"},"position":0,"processing":null,"permissions":{"read":true,"create":false,"update":false,"destroy":false},"api_links":{"collection":{"rel":"/api/v1/attachments","href":"https://the-guide-staging.herokuapp.com/api/v1/attachments"},"resource":{"rel":"/api/v1/attachments/50fca08abd02862d77009628","href":"https://the-guide-staging.herokuapp.com/api/v1/attachments/50fca08abd02862d77009628"}}}],"brand":{"id":"50f9ed7cbd0286638e000272","created_at":"2012-05-15T21:11:27Z","updated_at":"2012-05-15T21:11:27Z","name":"Minden","slug":"minden","url":null,"resource_uri":"/products?brand=minden","website_ids":[],"websites":[],"logo_url":null,"permissions":{"read":true,"create":false,"update":false,"destroy":false},"api_links":{"collection":{"rel":"/api/v1/brands","href":"https://the-guide-staging.herokuapp.com/api/v1/brands"},"resource":{"rel":"/api/v1/brands/50f9ed7cbd0286638e000272","href":"https://the-guide-staging.herokuapp.com/api/v1/brands/50f9ed7cbd0286638e000272"}}},"awards":[],"bulk_uploads":[],"permissions":{"read":true,"create":false,"update":false,"destroy":false,"manage_baseline_products":false},"api_links":{"collection":{"rel":"/api/v1/products","href":"https://the-guide-staging.herokuapp.com/api/v1/products"},"resource":{"rel":"/api/v1/products/51cc5d7df82dc772ea000069","href":"https://the-guide-staging.herokuapp.com/api/v1/products/51cc5d7df82dc772ea000069"}}}'
81
+ encoding: ASCII-8BIT
82
+ string: !binary |-
83
+ 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
70
120
  http_version:
71
- recorded_at: Thu, 27 Jun 2013 15:42:54 GMT
72
- recorded_with: VCR 2.5.0
121
+ recorded_at: Wed, 24 Jul 2013 21:03:26 GMT
122
+ recorded_with: VCR 2.4.0
data/spec/product_spec.rb CHANGED
@@ -11,7 +11,8 @@ describe Reviewed::Product do
11
11
  describe 'attachments', vcr: true do
12
12
 
13
13
  before(:each) do
14
- @product = client.products.find('minden-master-ii')
14
+ Faraday::Cache.store.clear
15
+ @product = client.products.with_no_cache.find('minden-master-ii')
15
16
  end
16
17
 
17
18
  it 'no longer has_many :attachments' do
data/spec/request_spec.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper.rb'
2
2
 
3
3
  describe Reviewed::Request do
4
+ before do
5
+ Faraday::Cache.store.clear
6
+ end
4
7
 
5
8
  let(:request) do
6
9
  Reviewed::Request.new(
@@ -47,6 +50,24 @@ describe Reviewed::Request do
47
50
  end
48
51
  end
49
52
 
53
+ it "does not use cached version when with_no_cache is used" do
54
+ request.with_no_cache.should be_uncached
55
+ end
56
+
57
+ it "caches requests that haven't been called with with_no_cache or with_new_cache" do
58
+ request.should be_cached
59
+ end
60
+
61
+ it "calls client with skip-cache if with_no_cache is used" do
62
+ client = Reviewed::Client.new
63
+ client.articles.with_no_cache.cache_control_params.should include(:"skip-cache")
64
+ end
65
+
66
+ it "calls client with reset-cache if with_new_cache is used" do
67
+ client = Reviewed::Client.new
68
+ client.articles.with_new_cache.cache_control_params.should include(:"reset-cache")
69
+ end
70
+
50
71
  describe '#find' do
51
72
 
52
73
  it 'delegates to object_from_response' do
data/spec/spec_helper.rb CHANGED
@@ -11,6 +11,7 @@ RSpec.configure do |config|
11
11
  config.alias_example_to :fit, :focused => true
12
12
  config.alias_example_to :pit, :pending => true
13
13
  config.run_all_when_everything_filtered = true
14
+ #config.backtrace_clean_patterns = []
14
15
  end
15
16
 
16
17
  VCR.configure do |config|
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reviewed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Nick Plante
@@ -9,67 +10,76 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-06-28 00:00:00.000000000 Z
13
+ date: 2013-07-24 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: activesupport
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - '>='
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: '3.0'
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - '>='
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '3.0'
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: activemodel
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '3.0'
35
39
  type: :runtime
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '3.0'
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: faraday
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
- - - '>='
52
+ - - ! '>='
47
53
  - !ruby/object:Gem::Version
48
54
  version: 0.8.4
49
55
  type: :runtime
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
- - - '>='
60
+ - - ! '>='
54
61
  - !ruby/object:Gem::Version
55
62
  version: 0.8.4
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: faraday_middleware
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
- - - '>='
68
+ - - ! '>='
61
69
  - !ruby/object:Gem::Version
62
70
  version: 0.9.0
63
71
  type: :runtime
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
- - - '>='
76
+ - - ! '>='
68
77
  - !ruby/object:Gem::Version
69
78
  version: 0.9.0
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: hashie
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
84
  - - ~>
75
85
  - !ruby/object:Gem::Version
@@ -77,6 +87,7 @@ dependencies:
77
87
  type: :runtime
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
92
  - - ~>
82
93
  - !ruby/object:Gem::Version
@@ -84,99 +95,129 @@ dependencies:
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: rack
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
- - - '>='
100
+ - - ! '>='
89
101
  - !ruby/object:Gem::Version
90
102
  version: '0'
91
103
  type: :runtime
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
- - - '>='
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: redis-rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
96
125
  - !ruby/object:Gem::Version
97
126
  version: '0'
98
127
  - !ruby/object:Gem::Dependency
99
128
  name: rake
100
129
  requirement: !ruby/object:Gem::Requirement
130
+ none: false
101
131
  requirements:
102
- - - '>='
132
+ - - ! '>='
103
133
  - !ruby/object:Gem::Version
104
134
  version: '0'
105
135
  type: :development
106
136
  prerelease: false
107
137
  version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
108
139
  requirements:
109
- - - '>='
140
+ - - ! '>='
110
141
  - !ruby/object:Gem::Version
111
142
  version: '0'
112
143
  - !ruby/object:Gem::Dependency
113
144
  name: rspec
114
145
  requirement: !ruby/object:Gem::Requirement
146
+ none: false
115
147
  requirements:
116
- - - '>='
148
+ - - ! '>='
117
149
  - !ruby/object:Gem::Version
118
150
  version: '2.10'
119
151
  type: :development
120
152
  prerelease: false
121
153
  version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
122
155
  requirements:
123
- - - '>='
156
+ - - ! '>='
124
157
  - !ruby/object:Gem::Version
125
158
  version: '2.10'
126
159
  - !ruby/object:Gem::Dependency
127
160
  name: webmock
128
161
  requirement: !ruby/object:Gem::Requirement
162
+ none: false
129
163
  requirements:
130
- - - '>='
164
+ - - ! '>='
131
165
  - !ruby/object:Gem::Version
132
166
  version: '1.8'
133
167
  type: :development
134
168
  prerelease: false
135
169
  version_requirements: !ruby/object:Gem::Requirement
170
+ none: false
136
171
  requirements:
137
- - - '>='
172
+ - - ! '>='
138
173
  - !ruby/object:Gem::Version
139
174
  version: '1.8'
140
175
  - !ruby/object:Gem::Dependency
141
176
  name: vcr
142
177
  requirement: !ruby/object:Gem::Requirement
178
+ none: false
143
179
  requirements:
144
- - - '>='
180
+ - - ! '>='
145
181
  - !ruby/object:Gem::Version
146
182
  version: '2.1'
147
183
  type: :development
148
184
  prerelease: false
149
185
  version_requirements: !ruby/object:Gem::Requirement
186
+ none: false
150
187
  requirements:
151
- - - '>='
188
+ - - ! '>='
152
189
  - !ruby/object:Gem::Version
153
190
  version: '2.1'
154
191
  - !ruby/object:Gem::Dependency
155
192
  name: guard-rspec
156
193
  requirement: !ruby/object:Gem::Requirement
194
+ none: false
157
195
  requirements:
158
- - - '>='
196
+ - - ! '>='
159
197
  - !ruby/object:Gem::Version
160
198
  version: '1.0'
161
199
  type: :development
162
200
  prerelease: false
163
201
  version_requirements: !ruby/object:Gem::Requirement
202
+ none: false
164
203
  requirements:
165
- - - '>='
204
+ - - ! '>='
166
205
  - !ruby/object:Gem::Version
167
206
  version: '1.0'
168
207
  - !ruby/object:Gem::Dependency
169
208
  name: pry
170
209
  requirement: !ruby/object:Gem::Requirement
210
+ none: false
171
211
  requirements:
172
- - - '>='
212
+ - - ! '>='
173
213
  - !ruby/object:Gem::Version
174
214
  version: '0'
175
215
  type: :development
176
216
  prerelease: false
177
217
  version_requirements: !ruby/object:Gem::Requirement
218
+ none: false
178
219
  requirements:
179
- - - '>='
220
+ - - ! '>='
180
221
  - !ruby/object:Gem::Version
181
222
  version: '0'
182
223
  description: Client library for the Reviewed.com API
@@ -194,6 +235,7 @@ files:
194
235
  - README.md
195
236
  - Rakefile
196
237
  - lib/faraday/api_key.rb
238
+ - lib/faraday/cache.rb
197
239
  - lib/faraday/errors.rb
198
240
  - lib/reviewed.rb
199
241
  - lib/reviewed/article.rb
@@ -225,6 +267,7 @@ files:
225
267
  - spec/collection_spec.rb
226
268
  - spec/embeddable_spec.rb
227
269
  - spec/faraday/api_key_spec.rb
270
+ - spec/faraday/cache_spec.rb
228
271
  - spec/faraday/errors_spec.rb
229
272
  - spec/fixtures/vcr/Reviewed_Article/associations/attachments/assigns_attachments_to_the_correct_class.yml
230
273
  - spec/fixtures/vcr/Reviewed_Article/associations/attachments/does_not_has_many_attachments.yml
@@ -236,17 +279,12 @@ files:
236
279
  - spec/fixtures/vcr/Reviewed_Article/associations/products/has_many_products.yml
237
280
  - spec/fixtures/vcr/Reviewed_Article/associations/products/returns_products_of_the_correct_class.yml
238
281
  - spec/fixtures/vcr/Reviewed_Article/associations/related_articles/has_many_related_articles.yml
239
- - spec/fixtures/vcr/Reviewed_Article/does_not_request_for_an_attachment_if_it_can_be_found_in_attributes.yml
240
- - spec/fixtures/vcr/Reviewed_Article/fetches_all_attachments_when_no_tag_is_asked_for.yml
241
- - spec/fixtures/vcr/Reviewed_Article/fetches_attachments_when_non-existent.yml
242
282
  - spec/fixtures/vcr/Reviewed_Article/fetches_when_a_tag_is_not_in_pre-loaded_set.yml
243
- - spec/fixtures/vcr/Reviewed_Article/fetches_when_an_tag_is_not_in_pre-loaded_set.yml
244
283
  - spec/fixtures/vcr/Reviewed_Article/find_page/finds_a_page_with_a_matching_slug.yml
245
284
  - spec/fixtures/vcr/Reviewed_Article/primary_product/returns_a_product_of_the_correct_class.yml
246
285
  - spec/fixtures/vcr/Reviewed_Article/primary_product/returns_nil_if_does_not_respond_to_products.yml
247
286
  - spec/fixtures/vcr/Reviewed_Article/primary_product/returns_the_primary_product.yml
248
287
  - spec/fixtures/vcr/Reviewed_Article/returns_local_attachments_when_available.yml
249
- - spec/fixtures/vcr/Reviewed_Article/sets_DEFAULT_ATTACHMENTS.yml
250
288
  - spec/fixtures/vcr/Reviewed_Client/_perform/request_params/not_set/has_nil_query_params.yml
251
289
  - spec/fixtures/vcr/Reviewed_Client/_perform/request_params/set/merges_quest_params.yml
252
290
  - spec/fixtures/vcr/Reviewed_Collection/collection_data/fetches_the_first_page_by_default.yml
@@ -283,26 +321,27 @@ files:
283
321
  - spec/website_spec.rb
284
322
  homepage: ''
285
323
  licenses: []
286
- metadata: {}
287
324
  post_install_message:
288
325
  rdoc_options: []
289
326
  require_paths:
290
327
  - lib
291
328
  required_ruby_version: !ruby/object:Gem::Requirement
329
+ none: false
292
330
  requirements:
293
- - - '>='
331
+ - - ! '>='
294
332
  - !ruby/object:Gem::Version
295
333
  version: '0'
296
334
  required_rubygems_version: !ruby/object:Gem::Requirement
335
+ none: false
297
336
  requirements:
298
- - - '>='
337
+ - - ! '>='
299
338
  - !ruby/object:Gem::Version
300
339
  version: '0'
301
340
  requirements: []
302
341
  rubyforge_project:
303
- rubygems_version: 2.0.2
342
+ rubygems_version: 1.8.25
304
343
  signing_key:
305
- specification_version: 4
344
+ specification_version: 3
306
345
  summary: A Ruby Gem for Accessing the Reviewed.com API
307
346
  test_files:
308
347
  - spec/article_spec.rb
@@ -315,6 +354,7 @@ test_files:
315
354
  - spec/collection_spec.rb
316
355
  - spec/embeddable_spec.rb
317
356
  - spec/faraday/api_key_spec.rb
357
+ - spec/faraday/cache_spec.rb
318
358
  - spec/faraday/errors_spec.rb
319
359
  - spec/fixtures/vcr/Reviewed_Article/associations/attachments/assigns_attachments_to_the_correct_class.yml
320
360
  - spec/fixtures/vcr/Reviewed_Article/associations/attachments/does_not_has_many_attachments.yml
@@ -326,17 +366,12 @@ test_files:
326
366
  - spec/fixtures/vcr/Reviewed_Article/associations/products/has_many_products.yml
327
367
  - spec/fixtures/vcr/Reviewed_Article/associations/products/returns_products_of_the_correct_class.yml
328
368
  - spec/fixtures/vcr/Reviewed_Article/associations/related_articles/has_many_related_articles.yml
329
- - spec/fixtures/vcr/Reviewed_Article/does_not_request_for_an_attachment_if_it_can_be_found_in_attributes.yml
330
- - spec/fixtures/vcr/Reviewed_Article/fetches_all_attachments_when_no_tag_is_asked_for.yml
331
- - spec/fixtures/vcr/Reviewed_Article/fetches_attachments_when_non-existent.yml
332
369
  - spec/fixtures/vcr/Reviewed_Article/fetches_when_a_tag_is_not_in_pre-loaded_set.yml
333
- - spec/fixtures/vcr/Reviewed_Article/fetches_when_an_tag_is_not_in_pre-loaded_set.yml
334
370
  - spec/fixtures/vcr/Reviewed_Article/find_page/finds_a_page_with_a_matching_slug.yml
335
371
  - spec/fixtures/vcr/Reviewed_Article/primary_product/returns_a_product_of_the_correct_class.yml
336
372
  - spec/fixtures/vcr/Reviewed_Article/primary_product/returns_nil_if_does_not_respond_to_products.yml
337
373
  - spec/fixtures/vcr/Reviewed_Article/primary_product/returns_the_primary_product.yml
338
374
  - spec/fixtures/vcr/Reviewed_Article/returns_local_attachments_when_available.yml
339
- - spec/fixtures/vcr/Reviewed_Article/sets_DEFAULT_ATTACHMENTS.yml
340
375
  - spec/fixtures/vcr/Reviewed_Client/_perform/request_params/not_set/has_nil_query_params.yml
341
376
  - spec/fixtures/vcr/Reviewed_Client/_perform/request_params/set/merges_quest_params.yml
342
377
  - spec/fixtures/vcr/Reviewed_Collection/collection_data/fetches_the_first_page_by_default.yml
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 204586e11652106dfafc82e5aea75e5d3438a53d
4
- data.tar.gz: 9e7819e0a1081293bd3e6aa3cc0fc69b1130c59e
5
- SHA512:
6
- metadata.gz: 80722e2f6171b5f3b4fef91fe1290a32bb38d2fa70a7b233c23c63bc6d9f49ac483a13d1c29dd4fe35e2ede7b24cdf9537f527fe2f4d13eba3edaf4b4b945576
7
- data.tar.gz: 343297a543489c280abbf6a8d61d514432fcbb66614f66eac688fb98c4e2bc72852fd14334becd48e9272b7c17070c97953d9772cdc639ee1caaaf33e3cbdcd0