adsk_auth_service 1.0.0 → 1.0.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: 24ceb16b5c1979203cb72ca2a45f8b68d6d8cafe
4
- data.tar.gz: 7db9253c7ff03217a9a8a46d276640ae3646a9c2
3
+ metadata.gz: 9a5ce71ed42e6704a80403654d3b6f9748d9488c
4
+ data.tar.gz: db1fbd30c00594ad1d285ca84f16e8744b61806f
5
5
  SHA512:
6
- metadata.gz: b50837937a6502f42deb1090442ac4f2ca06c4ad37e3fa458494fd8a9c2e1e94eeaa7c7364d84d6618bf0477887d0d735d7b3a890f2edc61c134e2574dedfb1b
7
- data.tar.gz: f991be89d33df13020e753573d0e3eafc88c01e1415b78e817750750eecccf7df6973693834bc11957755508715ff104cc57022e0978873acc7101c69f09e3bf
6
+ metadata.gz: 173745f99944fd833e002e527100e39c545ec5d3110f9d28c9ca6039408f320c1143ef0e83f630d11092f9eac5d846cf452f75fa70e64dc127f8e6d9571879cd
7
+ data.tar.gz: c4bde4a2737f69f8fcb08dca49806ae5c0cf041828d6016153d1b8f86b9ee6b26bf65b33f3ddfb6d29a1fdbae90743a21062b8b080a35136c294700e30797653
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'adsk_auth_service'
3
- s.version = '1.0.0'
3
+ s.version = '1.0.1'
4
4
  s.summary = "Autodesk second phase token retrieval"
5
5
  s.description = "A gem for Autodesk 2-phase authentication service."
6
6
  s.authors = ['Linh Chau']
@@ -5,7 +5,19 @@ require_relative '../utils/net_util'
5
5
  class AuthService
6
6
  class << self
7
7
  def load_config
8
- @@config ||= YAML.load(File.open("#{File.expand_path('.')}/conf/auth_keys.yml"))[ENV['RACK_ENV'] || 'local']
8
+ env = ENV['RACK_ENV'] || 'local'
9
+ base_path = File.expand_path('.')
10
+
11
+ config_file = nil
12
+ ['conf', 'config'].each do |sub_path|
13
+ if File.exist?("#{base_path}/#{sub_path}/auth_keys.yml")
14
+ config_file = "#{base_path}/#{sub_path}/auth_keys.yml"
15
+ break
16
+ end
17
+ end
18
+
19
+ raise("You must have the file auth_keys.yml in either 'conf' or 'config' directory of your application") unless config_file
20
+ @@config ||= YAML.load_file(config_file)[env]
9
21
  end
10
22
 
11
23
  def oauth_token
@@ -1,6 +1,12 @@
1
1
  class SdkLogger
2
- LOGGER = Logger.new(STDOUT)
3
- def self.logger
4
- LOGGER
2
+ @@logger = Logger.new(STDOUT)
3
+ class << self
4
+ def logger
5
+ @@logger
6
+ end
7
+
8
+ def logger=(other_logger)
9
+ @@logger = other_logger
10
+ end
5
11
  end
6
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adsk_auth_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linh Chau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-15 00:00:00.000000000 Z
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem for Autodesk 2-phase authentication service.
14
14
  email: chauhonglinh@gmail.com