soaspec 0.2.0 → 0.2.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: bfa2bb6212fe0840b7909f7abc36b9d930130edf
4
- data.tar.gz: 21bf07ae73063ea5b89cb893b34f4b9dd986c574
3
+ metadata.gz: 0c9254d8c1b81ec357de07757ca14a755acd0fa5
4
+ data.tar.gz: 73ae32fa4f6177094e1004709d1fe1d2250001b0
5
5
  SHA512:
6
- metadata.gz: 8da4766d8150595c4087ab1a5d4e85194a6731ccaa8720b8d25bf0f6a91d08e049da0e283f5e2ba3212e2789d74b4f4bb893b489eb33f70461bec05aa34fea2d
7
- data.tar.gz: 7351a1edd83baa1e2dd74555ec8f8f14c5a5064be0bc81d43cf4034d41c4694eedccb5f6e637e5b2c9dfb0cccf8e4bc6738c5ca034100c02ed0f408e6f97454d
6
+ metadata.gz: cdac65c8cc86cef1c33961bbc85afefecf71813756e78f395d80d5bbeb2ff7c0d1a27b42e4290ac7dce8bb67762cd542ebf5e7d5446db3b0cfda9ac7833a9ccd
7
+ data.tar.gz: 93a00b0fafc13444ad7d818da0586d450a2a4c4d173253a7f453700bb1e3ec506692a42167ec4babb843f7d3450de15e9986e782763361e7bbb89ca261414b9f
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.2.1
2
+ * Enhancements
3
+ * Make method to access 'client_id' within a class after specifying 'oauth2_file' to remove unnecessarily loading file twice
4
+
1
5
  Version 0.2.0
2
6
  * Exception handling
3
7
  * Raise meaningful exception if REST header value passed is null
@@ -29,7 +29,15 @@ module Soaspec
29
29
  # Pass path to YAML file containing OAuth2 parameters
30
30
  # @param [String] path_to_filename Will have Soaspec.credentials_folder appended to it if set
31
31
  def oauth2_file(path_to_filename)
32
- oauth2 load_credentials_hash(path_to_filename)
32
+ oauth_parameters = load_credentials_hash(path_to_filename)
33
+ @client_id = oauth_parameters[:client_id] if oauth_parameters[:client_id]
34
+ oauth2 oauth_parameters
35
+ end
36
+
37
+ # @return [String] Client id obtained from credentials file
38
+ def client_id
39
+ raise '@client_id is not set. Set by specifying credentials file with "oauth2_file FILENAME" before this is called' unless @client_id
40
+ @client_id
33
41
  end
34
42
 
35
43
  # Define basic authentication
@@ -36,7 +36,7 @@ module Soaspec
36
36
  self.retry_count = 0 # No initial tries at getting access token
37
37
  params = params_sent.transform_keys_to_symbols
38
38
  params[:token_url] ||= Soaspec::OAuth2.token_url
39
- raise 'client_id and client_secret not set' unless params[:client_id] && params[:client_secret]
39
+ raise ArgumentError, 'client_id and client_secret not set' unless params[:client_id] && params[:client_secret]
40
40
  raise ArgumentError, 'token_url mandatory' unless params[:token_url]
41
41
  self.params = params
42
42
  params[:username] = api_username || ERB.new(params[:username]).result(binding) if params[:username]
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA