sports_south 2.0.23 → 2.0.24

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: 01e0276217fcd30fd882e40d461e563640eea4ed
4
- data.tar.gz: 3fb5a64481e092901a1eff3b8ab5c86e5d1d1292
3
+ metadata.gz: 72ec6b07da863b3ea7b0fb2b32255614c188c395
4
+ data.tar.gz: 90ac1bc7ef616a3053bf481b2a28b2c0cc162d25
5
5
  SHA512:
6
- metadata.gz: 1815104a181321ba3b15131dc946b37a0e3a8353e78a77dfa6bcfe8043afa513a3b5c2562de560b726e3d16f2fc7b9b56c77b2ee61479a0514e2b00cf712593a
7
- data.tar.gz: 4172ee52b470b36d0976871c6f7fa64775b7a7763b6c40a088212e358c27348a27ec5b803881c3bf5991d7cfbb8febafa31d5ac0a5955eda51fb0d63d5fe23f7
6
+ metadata.gz: 7b79c21f629d0c22ffdd1b89e84d92b5fce394d4a16833f271a74445fdc67fd5e232ee7ac6ab5e9a57ea1acad8b609a4daed00a5a7361b1b8fc3f4822d16ed23
7
+ data.tar.gz: d7b303478976b530231940c1ea40ef9cb01c7c9f6c3720bafc2c40ea139494209650f19e7045bb8451d06330d96e58094dbc8aa3a38e08cbbf552e705026e7c3
data/lib/sports_south.rb CHANGED
@@ -19,4 +19,24 @@ require 'sports_south/user'
19
19
 
20
20
  module SportsSouth
21
21
  class NotAuthenticated < StandardError; end
22
+
23
+ class << self
24
+ attr_accessor :config
25
+ end
26
+
27
+ def self.config
28
+ @config ||= Configuration.new
29
+ end
30
+
31
+ def self.configure
32
+ yield(config)
33
+ end
34
+
35
+ class Configuration
36
+ attr_accessor :source
37
+
38
+ def initialize
39
+ @source ||= "ammor"
40
+ end
41
+ end
22
42
  end
@@ -12,7 +12,7 @@ module SportsSouth
12
12
  end
13
13
 
14
14
  def initialize(options = {})
15
- requires!(options, :username, :password, :source, :customer_number)
15
+ requires!(options, :username, :password)
16
16
  @options = options
17
17
  @po_number = options[:po_number]
18
18
  end
@@ -24,6 +24,8 @@ module SportsSouth
24
24
 
25
25
  request.set_form_data(form_params(@options).merge({
26
26
  PONumber: @po_number,
27
+ customer_number: @options[:username],
28
+ source: SportsSouth.config.source
27
29
  }))
28
30
 
29
31
  response = http.request(request)
@@ -24,12 +24,12 @@ module SportsSouth
24
24
 
25
25
  def self.find(order_number, options = {})
26
26
  requires!(options, :username, :password)
27
- new(options.merge({order_number: order_number}))
27
+ new(options.merge(order_number: order_number))
28
28
  end
29
29
 
30
30
  def initialize(options = {})
31
31
  requires!(options, :username, :password)
32
- @options = options
32
+ @options = options.merge(source: SportsSouth.config.source)
33
33
  @order_number = options[:order_number]
34
34
  end
35
35
 
@@ -1,3 +1,3 @@
1
1
  module SportsSouth
2
- VERSION = '2.0.23'.freeze
2
+ VERSION = '2.0.24'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sports_south
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.23
4
+ version: 2.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-08 00:00:00.000000000 Z
11
+ date: 2018-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri