asin 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/.travis.yml +4 -6
  2. data/CHANGELOG.rdoc +10 -0
  3. data/Gemfile.lock +36 -26
  4. data/README.rdoc +11 -9
  5. data/asin.gemspec +13 -11
  6. data/lib/asin/client.rb +27 -7
  7. data/lib/asin/configuration.rb +52 -100
  8. data/lib/asin/version.rb +1 -1
  9. data/rakefile.rb +1 -7
  10. data/spec/browse_node_spec.rb +1 -3
  11. data/spec/cart_spec.rb +26 -36
  12. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_add_items_to_a_cart.yml +68 -0
  13. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_clear_a_cart.yml +66 -0
  14. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_get_a_cart.yml +67 -0
  15. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_update_a_cart.yml +70 -0
  16. data/spec/cassettes/{browse_node_599826.yml → asin/browse_node_should_lookup_a_browse_node.yml} +8 -8
  17. data/spec/cassettes/asin/cart_should_create_a_cart.yml +36 -0
  18. data/spec/cassettes/{lookup_1430218150_item_class.yml → asin/lookup_and_search_should_have_metadata.yml} +39 -21
  19. data/spec/cassettes/{lookup_1430218150.yml → asin/lookup_and_search_should_lookup_a_book.yml} +39 -21
  20. data/spec/cassettes/{lookup_multiple_asins.yml → asin/lookup_and_search_should_lookup_multiple_books.yml} +89 -71
  21. data/spec/cassettes/{lookup_1430218150_small_and_alternateversions.yml → asin/lookup_and_search_should_lookup_multiple_response_groups.yml} +7 -7
  22. data/spec/cassettes/{lookup_1430218150_rash.yml → asin/lookup_and_search_should_return_a_custom_item_class.yml} +39 -21
  23. data/spec/cassettes/{lookup_1430218150_medium.yml → asin/lookup_and_search_should_return_a_mash_value.yml} +39 -21
  24. data/spec/cassettes/{lookup_1430218150_mash.yml → asin/lookup_and_search_should_return_a_rash_value.yml} +39 -21
  25. data/spec/cassettes/asin/lookup_and_search_should_return_a_raw_value.yml +81 -0
  26. data/spec/cassettes/asin/lookup_and_search_should_search_keywords_a_book_with_fulltext.yml +538 -0
  27. data/spec/cassettes/{search_keywords_single_result.yml → asin/lookup_and_search_should_search_keywords_and_handle_a_single_result.yml} +19 -19
  28. data/spec/cassettes/{search_keywords_index_music.yml → asin/lookup_and_search_should_search_keywords_never_mind_music.yml} +62 -59
  29. data/spec/cassettes/asin/lookup_and_search_should_search_music.yml +37 -0
  30. data/spec/cassettes/{search_keywords_key_index_music.yml → asin/lookup_and_search_should_search_never_mind_music.yml} +76 -67
  31. data/spec/cassettes/asin/similarity_should_find_similar_items.yml +618 -0
  32. data/spec/cassettes/asin/similarity_should_find_similar_items_for_multiple_asins_and_different_config.yml +58 -0
  33. data/spec/cassettes/asin/similarity_should_lookup_for_similar_items.yml +618 -0
  34. data/spec/config_spec.rb +2 -7
  35. data/spec/search_spec.rb +60 -87
  36. data/spec/similarity_spec.rb +23 -0
  37. data/spec/spec_helper.rb +19 -6
  38. metadata +158 -137
  39. data/spec/cassettes/add_items1430216263.yml +0 -67
  40. data/spec/cassettes/clear_cart.yml +0 -65
  41. data/spec/cassettes/create_cart_with_asin_1430218150_and_other_asin_1430216263.yml +0 -36
  42. data/spec/cassettes/get_cart.yml +0 -67
  43. data/spec/cassettes/lookup_1430218150_raw.yml +0 -63
  44. data/spec/cassettes/search_index_music.yml +0 -32
  45. data/spec/cassettes/search_keywords.yml +0 -479
  46. data/spec/cassettes/update_items.yml +0 -70
@@ -1,70 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://webservices.amazon.com:80/onca/xml?AWSAccessKeyId=AKIAJFA5X7RTOKFNPVZQ&AssociateTag=&Item.0.ASIN=1430218150&Item.0.Quantity=1&Operation=CartCreate&Service=AWSECommerceService&Signature=teKwB2EafVm0YnL0yBFFiYYG7xmBGvoaLKLxDULbhTI=&Timestamp=2011-09-04T15:14:34Z&Version=2010-11-01
6
- body: !!null
7
- headers: !!null
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- date:
14
- - Sun, 04 Sep 2011 15:14:35 GMT
15
- server:
16
- - Server
17
- content-type:
18
- - text/xml;charset=UTF-8
19
- vary:
20
- - Accept-Encoding,User-Agent
21
- nncoection:
22
- - close
23
- transfer-encoding:
24
- - chunked
25
- body: <?xml version="1.0" encoding="UTF-8"?><CartCreateResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2010-11-01"><OperationRequest><HTTPHeaders><Header
26
- Name="UserAgent" Value="Jakarta Commons-HttpClient/3.0.1"></Header></HTTPHeaders><RequestId>1PBZWQRV31Y2WX6YATN8</RequestId><Arguments><Argument
27
- Name="Service" Value="AWSECommerceService"></Argument><Argument Name="Item.0.Quantity"
28
- Value="1"></Argument><Argument Name="Operation" Value="CartCreate"></Argument><Argument
29
- Name="Version" Value="2010-11-01"></Argument><Argument Name="Timestamp" Value="2011-09-04T15:14:34Z"></Argument><Argument
30
- Name="AssociateTag"></Argument><Argument Name="Signature" Value="teKwB2EafVm0YnL0yBFFiYYG7xmBGvoaLKLxDULbhTI="></Argument><Argument
31
- Name="Item.0.ASIN" Value="1430218150"></Argument><Argument Name="AWSAccessKeyId"
32
- Value="AKIAJFA5X7RTOKFNPVZQ"></Argument></Arguments><RequestProcessingTime>0.11704683303833</RequestProcessingTime></OperationRequest><Cart><Request><IsValid>True</IsValid><CartCreateRequest><Items><Item><ASIN>1430218150</ASIN><Quantity>1</Quantity></Item></Items></CartCreateRequest></Request><CartId>184-0713673-9871555</CartId><HMAC>m4ctJLxx4HfpJgFQ7cvjdUbAtpI=</HMAC><URLEncodedHMAC>m4ctJLxx4HfpJgFQ7cvjdUbAtpI%3D</URLEncodedHMAC><PurchaseURL>https://www.amazon.com/gp/cart/aws-merge.html?cart-id=184-0713673-9871555%26associate-id=ws%26hmac=m4ctJLxx4HfpJgFQ7cvjdUbAtpI=%26SubscriptionId=AKIAJFA5X7RTOKFNPVZQ%26MergeCart=False</PurchaseURL><SubTotal><Amount>2434</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$24.34</FormattedPrice></SubTotal><CartItems><SubTotal><Amount>2434</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$24.34</FormattedPrice></SubTotal><CartItem><CartItemId>U3G241HVLLB8N6</CartItemId><ASIN>1430218150</ASIN><MerchantId>ATVPDKIKX0DER</MerchantId><SellerId>A2R2RITDJNW1Q6</SellerId><SellerNickname>Amazon.com</SellerNickname><Quantity>1</Quantity><Title>Learn
33
- Objective-C on the Mac (Learn Series)</Title><ProductGroup>Book</ProductGroup><Price><Amount>2434</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$24.34</FormattedPrice></Price><ItemTotal><Amount>2434</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$24.34</FormattedPrice></ItemTotal></CartItem></CartItems></Cart></CartCreateResponse>
34
- http_version: '1.1'
35
- - !ruby/struct:VCR::HTTPInteraction
36
- request: !ruby/struct:VCR::Request
37
- method: :get
38
- uri: http://webservices.amazon.com:80/onca/xml?AWSAccessKeyId=AKIAJFA5X7RTOKFNPVZQ&AssociateTag=&CartId=184-0713673-9871555&HMAC=m4ctJLxx4HfpJgFQ7cvjdUbAtpI=&Item.0.Action=SaveForLater&Item.0.CartItemId=U3G241HVLLB8N6&Item.1.CartItemId=U3G241HVLLB8N6&Item.1.Quantity=7&Operation=CartModify&Service=AWSECommerceService&Signature=FXv2kMcVIbL19F+fY90CC6+5hexWfVNCiFW2mVBwwQM=&Timestamp=2011-09-04T15:14:35Z&Version=2010-11-01
39
- body: !!null
40
- headers: !!null
41
- response: !ruby/struct:VCR::Response
42
- status: !ruby/struct:VCR::ResponseStatus
43
- code: 200
44
- message: OK
45
- headers:
46
- date:
47
- - Sun, 04 Sep 2011 15:14:35 GMT
48
- server:
49
- - Server
50
- content-type:
51
- - text/xml;charset=UTF-8
52
- vary:
53
- - Accept-Encoding,User-Agent
54
- nncoection:
55
- - close
56
- transfer-encoding:
57
- - chunked
58
- body: <?xml version="1.0" encoding="UTF-8"?><CartModifyResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2010-11-01"><OperationRequest><HTTPHeaders><Header
59
- Name="UserAgent" Value="Jakarta Commons-HttpClient/3.0.1"></Header></HTTPHeaders><RequestId>1NT7680RBA7ZE11EQG5Z</RequestId><Arguments><Argument
60
- Name="Service" Value="AWSECommerceService"></Argument><Argument Name="Item.1.Quantity"
61
- Value="7"></Argument><Argument Name="Operation" Value="CartModify"></Argument><Argument
62
- Name="Item.0.CartItemId" Value="U3G241HVLLB8N6"></Argument><Argument Name="Timestamp"
63
- Value="2011-09-04T15:14:35Z"></Argument><Argument Name="Version" Value="2010-11-01"></Argument><Argument
64
- Name="AssociateTag"></Argument><Argument Name="Item.0.Action" Value="SaveForLater"></Argument><Argument
65
- Name="Signature" Value="FXv2kMcVIbL19F+fY90CC6+5hexWfVNCiFW2mVBwwQM="></Argument><Argument
66
- Name="Item.1.CartItemId" Value="U3G241HVLLB8N6"></Argument><Argument Name="HMAC"
67
- Value="m4ctJLxx4HfpJgFQ7cvjdUbAtpI="></Argument><Argument Name="CartId" Value="184-0713673-9871555"></Argument><Argument
68
- Name="AWSAccessKeyId" Value="AKIAJFA5X7RTOKFNPVZQ"></Argument></Arguments><RequestProcessingTime>0.0536201000213623</RequestProcessingTime></OperationRequest><Cart><Request><IsValid>True</IsValid><CartModifyRequest><CartId>184-0713673-9871555</CartId><HMAC>m4ctJLxx4HfpJgFQ7cvjdUbAtpI=</HMAC><Items><Item><Action>SaveForLater</Action><CartItemId>U3G241HVLLB8N6</CartItemId></Item><Item><CartItemId>U3G241HVLLB8N6</CartItemId><Quantity>7</Quantity></Item></Items></CartModifyRequest></Request><CartId>184-0713673-9871555</CartId><HMAC>m4ctJLxx4HfpJgFQ7cvjdUbAtpI=</HMAC><URLEncodedHMAC>m4ctJLxx4HfpJgFQ7cvjdUbAtpI%3D</URLEncodedHMAC><PurchaseURL>https://www.amazon.com/gp/cart/aws-merge.html?cart-id=184-0713673-9871555%26associate-id=ws%26hmac=m4ctJLxx4HfpJgFQ7cvjdUbAtpI=%26SubscriptionId=AKIAJFA5X7RTOKFNPVZQ%26MergeCart=False</PurchaseURL><SubTotal><Amount>17038</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$170.38</FormattedPrice></SubTotal><SavedForLaterItems><SubTotal><Amount>17038</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$170.38</FormattedPrice></SubTotal><SavedForLaterItem><CartItemId>U3G241HVLLB8N6</CartItemId><ASIN>1430218150</ASIN><MerchantId>ATVPDKIKX0DER</MerchantId><SellerId>A2R2RITDJNW1Q6</SellerId><Quantity>7</Quantity><Title>Learn
69
- Objective-C on the Mac (Learn Series)</Title><ProductGroup>Book</ProductGroup><Price><Amount>2434</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$24.34</FormattedPrice></Price><ItemTotal><Amount>17038</Amount><CurrencyCode>USD</CurrencyCode><FormattedPrice>$170.38</FormattedPrice></ItemTotal></SavedForLaterItem></SavedForLaterItems></Cart></CartModifyResponse>
70
- http_version: '1.1'