vacuum 1.4.0 → 1.4.1

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: df850a458336e82984c3b2eacb1cfabd70470608
4
- data.tar.gz: fc09442244188347f4e2ca9a9eaf92d82ce9a1ad
3
+ metadata.gz: b0a673fbb5abdaae748ad40500d5fc2712f2bc21
4
+ data.tar.gz: d5037349839a8fc734b3460a827b9584db0ad338
5
5
  SHA512:
6
- metadata.gz: 8908f5f1c4dba41b40e0b255ff22742e28a5c0226525b48c99340fb5e40b6db19c1900d1560e6daede3c7e449ac8b1680036056a14f0bcb04d1c02f18d64a7c2
7
- data.tar.gz: 13624259664f0c2e5d3b6ba8d4964a2a06d77862a953b20c45110846df0e75ab5bff46a1dab86829cf19ac0e85b97ef8b009813fdf438ebfcf59b1c2d3b27997
6
+ metadata.gz: cb0425bf241f4d92168b1014a80a2248467bde887d2f40f7c5a25e66c8d4a53b6bbd79fff42d441ddc0aa871f1f48287b144dda9aede133b99c907789e01d7a8
7
+ data.tar.gz: 5c13b763aa705fd1f22cc1db2906873d4bbbee0f63f7bd0739629a6ebb67dc03bbe79fcc1b1a9a4bcb840f5eb06daf20119b05d35508170630a5096c0198037f
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2013 Hakan Ensari
3
+ Copyright (c) Hakan Ensari
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -5,6 +5,10 @@ Vacuum is a fast, light-weight Ruby wrapper to the [Amazon Product Advertising A
5
5
 
6
6
  ![vacuum](http://f.cl.ly/items/2k2X0e2u0G3k1c260D2u/vacuum.png)
7
7
 
8
+ > Amazon is a $250 billion dollar company that reacts to you buying a vacuum by going THIS GUY LOVES BUYING VACUUMS HERE ARE SOME MORE VACUUMS
9
+
10
+ — [@kibblesmith](https://twitter.com/kibblesmith/status/724817086309142529)
11
+
8
12
  ## Usage
9
13
 
10
14
  ### Prerequisite
@@ -6,9 +6,9 @@ module Vacuum
6
6
  class Request
7
7
  include Jeff
8
8
 
9
- BadLocale = Class.new(ArgumentError)
9
+ BadLocale = Class.new(ArgumentError)
10
10
 
11
- LATEST_VERSION = '2013-08-01'
11
+ LATEST_VERSION = '2013-08-01'.freeze
12
12
 
13
13
  HOSTS = {
14
14
  'BR' => 'webservices.amazon.com.br',
@@ -25,7 +25,7 @@ module Vacuum
25
25
  'MX' => 'webservices.amazon.com.mx'
26
26
  }.freeze
27
27
 
28
- OPERATIONS = %w(
28
+ OPERATIONS = %w[
29
29
  BrowseNodeLookup
30
30
  CartAdd
31
31
  CartClear
@@ -35,7 +35,7 @@ module Vacuum
35
35
  ItemLookup
36
36
  ItemSearch
37
37
  SimilarityLookup
38
- ).freeze
38
+ ].freeze
39
39
 
40
40
  params 'AssociateTag' => -> { associate_tag },
41
41
  'Service' => 'AWSECommerceService',
@@ -53,8 +53,8 @@ module Vacuum
53
53
  # Raises a Bad Locale error if locale is not valid.
54
54
  def initialize(locale = 'US', secure = false)
55
55
  locale = 'GB' if locale == 'UK'
56
- host = HOSTS.fetch(locale) { fail BadLocale }
57
- @aws_endpoint = "#{secure ? 'https' : 'http' }://#{host}/onca/xml"
56
+ host = HOSTS.fetch(locale) { raise BadLocale }
57
+ @aws_endpoint = "#{secure ? 'https' : 'http'}://#{host}/onca/xml"
58
58
  end
59
59
 
60
60
  # Configure the Amazon Product Advertising API request.
@@ -1,3 +1,3 @@
1
1
  module Vacuum
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'.freeze
3
3
  end
@@ -1,5 +1,4 @@
1
1
  require 'minitest/autorun'
2
- require 'minitest/pride'
3
2
  require 'vcr'
4
3
  require_relative '../lib/vacuum'
5
4
 
@@ -28,7 +27,7 @@ class TestIntegration < Minitest::Test
28
27
  # rubocop:disable AbcSize
29
28
  def test_encoding_issues
30
29
  params = { 'SearchIndex' => 'All', 'Keywords' => 'google' }
31
- titles = %w(BR CA CN DE ES FR GB IN IT JP US MX).flat_map do |locale|
30
+ titles = %w[BR CA CN DE ES FR GB IN IT JP US MX].flat_map do |locale|
32
31
  req = Vacuum.new(locale)
33
32
  req.associate_tag = 'foo'
34
33
  res = req.item_search(query: params)
@@ -39,6 +38,6 @@ class TestIntegration < Minitest::Test
39
38
 
40
39
  # Newer JRuby now appears to return both US-ASCII and UTF-8, depending on
41
40
  # whether the string has non-ASCII characters. MRI will only return latter.
42
- assert encodings.any? { |encoding| encoding == 'UTF-8' }
41
+ assert(encodings.any? { |encoding| encoding == 'UTF-8' })
43
42
  end
44
43
  end
data/test/test_vacuum.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'minitest/autorun'
2
- require 'minitest/pride'
3
2
  require_relative '../lib/vacuum'
4
3
 
5
4
  class TestVacuum < Minitest::Test
@@ -26,11 +25,11 @@ class TestVacuum < Minitest::Test
26
25
  end
27
26
 
28
27
  def test_accepts_uk_as_locale
29
- Request.new("UK")
28
+ Request.new('UK')
30
29
  end
31
30
 
32
31
  def test_accepts_mx_as_locale
33
- Request.new("MX")
32
+ Request.new('MX')
34
33
  end
35
34
 
36
35
  def test_fetches_parsable_response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vacuum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jeff
@@ -30,14 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.0
33
+ version: 0.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.5.0
40
+ version: 0.6.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: minitest
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +81,7 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: appraisal
84
+ name: rubocop
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -120,9 +134,9 @@ require_paths:
120
134
  - lib
121
135
  required_ruby_version: !ruby/object:Gem::Requirement
122
136
  requirements:
123
- - - ">="
137
+ - - ">"
124
138
  - !ruby/object:Gem::Version
125
- version: '1.9'
139
+ version: '2.0'
126
140
  required_rubygems_version: !ruby/object:Gem::Requirement
127
141
  requirements:
128
142
  - - ">="
@@ -130,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
144
  version: '0'
131
145
  requirements: []
132
146
  rubyforge_project:
133
- rubygems_version: 2.4.5.1
147
+ rubygems_version: 2.6.8
134
148
  signing_key:
135
149
  specification_version: 4
136
150
  summary: Amazon Product Advertising in Ruby
@@ -138,4 +152,3 @@ test_files:
138
152
  - test/cassettes/vacuum.yml
139
153
  - test/test_integration.rb
140
154
  - test/test_vacuum.rb
141
- has_rdoc: