homeaway-api 1.3.0 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae07b41c5a30e8aeaa52452b030387757671c384
4
- data.tar.gz: e623705ba17d366361fb316aa33b6d44a6691bea
3
+ metadata.gz: 60c98fd150724b6034d387b6b480432c3ad08621
4
+ data.tar.gz: 64d307f25982cc934ad681a80250838c7c9b7487
5
5
  SHA512:
6
- metadata.gz: 6a9aeb236d4d8cd2b1df1ef77c0d70a62543452523abe6dc5014c5eecc623044cd5e3440f85209ac58c7adef2f21067ae19d6975525712b05f83506e77e3e7d6
7
- data.tar.gz: 4a1af1d23b854653bc45010535834c6b66574742b2480cfc1573e5f8236220eb257793fc394f9b506e9876f6807444fd879e1f29cb2c6729549c4265222f69a1
6
+ metadata.gz: febde1f040afbd5a007af84154ca249a57fdcc86a31f6babbeef0843e363902776ac5a0b2cec461d742e5a9b837cfcd15b3fb73a80e053a50f9e0fa8ae614205
7
+ data.tar.gz: b4815e63411c125c5660e3583c522c25a2b0326ce10e85220160979d4f9c1f6558e96e8826528c19b26d5da6be1736185e4b6fc8da59c07effd7d99b37cbe539
@@ -53,6 +53,7 @@ module HomeAway
53
53
  # @option opts [String] :client_id Your HomeAway API OAuth client id. Required here if not set globally
54
54
  # @option opts [String] :client_secret Your HomeAway API OAuth client secret. Required here if not set globally
55
55
  # @option opts [String] :refresh_token An existing token if you already have one saved from a previous usage of the api
56
+ # @option opts [String] :state A value that will be returned via callback
56
57
  # @return [HomeAway::API::Client] a newly instantiated HomeAway API client
57
58
  def initialize(opts={})
58
59
  @configuration = Hashie::Mash.new(self.class.default_configuration.merge(opts))
@@ -210,4 +211,4 @@ module HomeAway
210
211
  end
211
212
  end
212
213
 
213
- require 'homeaway/api/domain/client_includes'
214
+ require 'homeaway/api/domain/client_includes'
@@ -34,7 +34,7 @@ module HomeAway
34
34
  # @return [String] a 48 characters long, securely random string, used to mitigate
35
35
  # CSRF attacks during the authorization process.
36
36
  def state
37
- @_state ||= SecureRandom.hex(24)
37
+ @_state ||= @configuration.state || SecureRandom.hex(24)
38
38
  end
39
39
 
40
40
  # completes the oauth flow
@@ -54,7 +54,7 @@ module HomeAway
54
54
  error_class = HomeAway::API::Errors.for_http_code e.response.status
55
55
  raise error_class.new(JSON.parse(e.response.response.body))
56
56
  end
57
- raise HomeAway::API::Errors::UnauthorizedError.new
57
+ raise HomeAway::API::Errors::HomeAwayAPIError.new e.message
58
58
  end
59
59
  end
60
60
 
@@ -92,7 +92,7 @@ module HomeAway
92
92
  error_class = HomeAway::API::Errors.for_http_code e.response.status
93
93
  raise error_class.new(JSON.parse(e.response.response.body))
94
94
  end
95
- raise HomeAway::API::Errors::UnauthorizedError.new
95
+ raise HomeAway::API::Errors::HomeAwayAPIError.new e.message
96
96
  end
97
97
  end
98
98
 
@@ -113,10 +113,10 @@ module HomeAway
113
113
  error_class = HomeAway::API::Errors.for_http_code e.response.status
114
114
  raise error_class.new(JSON.parse(e.response.response.body))
115
115
  end
116
- raise HomeAway::API::Errors::UnauthorizedError.new
116
+ raise HomeAway::API::Errors::HomeAwayAPIError.new e.message
117
117
  end
118
118
  end
119
119
  end
120
120
  end
121
121
  end
122
- end
122
+ end
@@ -15,6 +15,6 @@
15
15
 
16
16
  module HomeAway
17
17
  module API
18
- VERSION = '1.3.0'
18
+ VERSION = '1.4.0'
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homeaway-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Meyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -361,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
361
  version: '0'
362
362
  requirements: []
363
363
  rubyforge_project:
364
- rubygems_version: 2.5.1
364
+ rubygems_version: 2.6.6
365
365
  signing_key:
366
366
  specification_version: 4
367
367
  summary: Ruby SDK for interacting with the HomeAway API