unresponsys 0.5 → 0.6

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: dbeffe4db882d79a7eaca6e687c094ef5840e1e6
4
- data.tar.gz: 65d34331d2306fc3bd04b93b5c3f6d59f32cdbad
3
+ metadata.gz: 449bfa6bf87fc18f0a387f1a829ecf5d538799b5
4
+ data.tar.gz: 437b567f92aa2c2d2615fd7c86acdf860f109eaa
5
5
  SHA512:
6
- metadata.gz: 983bd8eead6e8891297ba7f55b4d8859bf4edf81fabb1637fe013fcc48154324694b97e64953161ff7bb9662e7420c9e532f29cffc2ea4d4bd4eeea53beccd0a
7
- data.tar.gz: 3661046ffd22c4ef6ffdb7795916d437ecd5d3d1691c59a76c3c2d0d9695347ae32e975a800a96b4e9a43c90ccf916873d88d4c15d51ea7a78da7507a0ba94be
6
+ metadata.gz: e10538fedf736b1544e8b4fafd1cb27275c05d0e36ed1b73e020ff702f0016bde6f7e8ba0e77b323730ea6ee02e053fd26cce3f8b35537af7ec604f0387a8d8b
7
+ data.tar.gz: 607e67b5bb24e5c6f6d38f6ac3047d1513f0e108afa64e1440f3596b2eb76133a3feded6bdcf50cd3d2558a764557ac4b4164174b180c958a0f1281ce8447bff
@@ -4,8 +4,10 @@ class Unresponsys
4
4
  class Client
5
5
  def initialize(options = {})
6
6
  raise Unresponsys::ArgumentError unless options[:username] && options[:password]
7
+ raise Unresponsys::ArgumentError unless [nil, 2, 5].include?(options[:interact])
7
8
  @username = options[:username]
8
9
  @password = options[:password]
10
+ @interact = options.fetch(:interact, 2)
9
11
  @debug = options[:debug]
10
12
  @logger = Logger.new(STDOUT) if @debug
11
13
  @log_opts = { logger: @logger, log_level: :debug, log_format: :curl }
@@ -85,7 +87,8 @@ class Unresponsys
85
87
  def authenticate
86
88
  headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
87
89
  body = { user_name: @username, password: @password, auth_type: 'password' }
88
- response = HTTParty.post('https://login2.responsys.net/rest/api/v1/auth/token', headers: headers, body: body)
90
+ host = "login#{@interact}.responsys.net"
91
+ response = HTTParty.post("https://#{host}/rest/api/v1/auth/token", headers: headers, body: body)
89
92
 
90
93
  raise Unresponsys::AuthenticationError unless response.success?
91
94
 
@@ -1,3 +1,3 @@
1
1
  class Unresponsys
2
- VERSION = '0.5'
2
+ VERSION = '0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unresponsys
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Kimball
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-04 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty