access 1.1.2 → 1.1.3

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: 6537f76a990c764bb1a4db27adcd6ed1e9221f1e
4
- data.tar.gz: 6484c5b0c829d6f2525cdf58b1476c9f173a7cc2
3
+ metadata.gz: 9d55a14dfd773efd0baeeba017984fd1ee3ca01f
4
+ data.tar.gz: 284f9f040bf7afa6bca55778b39078315293f46c
5
5
  SHA512:
6
- metadata.gz: 87098d139b0995f45b9b35145302fd30720930a506bd54e9b2b1a27be4f3d304fcda51a1b52309876be3aaa593f4bd07f39609917a91c5ddc55be7d0bf6925a2
7
- data.tar.gz: 85435069573fa366d97d17e512c0f69f87421790f1e7c26f9e7523df9dddd01d09b123a247fe616bdf3328bf84b1b4352632b3f522c1de4be60199342da61a7c
6
+ metadata.gz: efe4b5d0a0ca83800d9a6ad5a8ecafcaf7740d899565ca2561d923a22a07379763ee67975c17fba457bb9ed81494e95e4cd479ca5e516d72858da454dc472366
7
+ data.tar.gz: 496aea661ff29542d8a70410418913db72077f685a54a3d707e02eb5f99b33648a5552900c2180fafcd0532514cf2ecb0dddc81d7865165336a37a2c997e7b01
data/README.md CHANGED
@@ -134,3 +134,5 @@ Access::Redeem.redeem_offer key redeem_type options` *member_key required
134
134
  4. Push to the branch (`git push origin my-new-feature`)
135
135
  5. Create a new Pull Request
136
136
 
137
+
138
+
data/lib/access/config.rb CHANGED
@@ -13,12 +13,14 @@ module Access
13
13
  end
14
14
 
15
15
  class Config
16
+ DOMAINS = {'production' => '', 'demo' => '-demo', 'stage' => '-stage', 'staging' => '-stage' }
16
17
  attr_accessor :access_token, :format, :api_environment, :api_version, :hashify
17
18
 
18
19
  def initialize
19
20
  @access_token = ENV['ACCESS_TOKEN']
20
21
  @format = ENV['ACCESS_FORMAT'] || 'json'
21
- @api_environment = ENV['ACCESS_ENVIRONMENT'] || 'staging'
22
+ # demo, stage, production
23
+ @api_environment = ENV['ACCESS_ENVIRONMENT'] || 'demo'
22
24
  @api_version = ENV['ACCESS_VERSION'] || 'v1'
23
25
  @hashify = ENV['ACCESS_HASHIFY'] || 'false'
24
26
  end
@@ -26,7 +28,7 @@ module Access
26
28
  def reset
27
29
  self.access_token = ENV['ACCESS_TOKEN']
28
30
  self.format = 'json'
29
- self.api_environment = 'staging'
31
+ self.api_environment = 'demo'
30
32
  self.api_version = 'v1'
31
33
  self.hashify = false
32
34
  end
@@ -1,6 +1,8 @@
1
1
  module Access
2
2
  class Request
3
3
  include HTTParty
4
+ # debug_output $stdout # enable this to log all the requests
5
+
4
6
 
5
7
  def get(path, api_type, options={})
6
8
  set_format
@@ -21,7 +23,7 @@ module Access
21
23
  end
22
24
 
23
25
  def set_base(api_type)
24
- "https://#{ api_type }#{ Access.config.api_environment == 'production' ? '' : '-demo' }.adcrws.com/#{Access.config.api_version}"
26
+ "https://#{ api_type }#{ Access::Config::DOMAINS[Access.config.api_environment] }.adcrws.com/#{Access.config.api_version}"
25
27
  end
26
28
 
27
29
  def set_format
@@ -1,4 +1,4 @@
1
1
  module Access
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-05-19 00:00:00.000000000 Z
13
+ date: 2015-06-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler