patchboard 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/patchboard/action.rb +13 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 916ee5e5133154c488707325cb9e4125f7b472da
4
- data.tar.gz: c78813b303ce9464fe02cf914d72324722ca166e
3
+ metadata.gz: bde78db8d9ac849efda5d8bb08b5f23b00c408ab
4
+ data.tar.gz: 34192a8c8f5aa26a0935f2f0c67969811425cd62
5
5
  SHA512:
6
- metadata.gz: c2ef016046c0629f3d77a8591ba4d5ab89ddc707f5fb3ab962c47a4a6a8ba87458df7e5cfb4062fb2e7bc00d4a290e31c5710420c6ceb9368b6710d24869f1d8
7
- data.tar.gz: c0d10a0e3577e0e2f14b0aa3e80ee17f59b25ec37b41ae116786fcab1d47aeb3a077b66a5507559ab5bdc479cb24f47d4363444e3d710f102b772a2c67b6fb7e
6
+ metadata.gz: c43fd51294b574449ea515458564bf6043308ec1423186732ba2e7a5eb90568f5a2cc5a8a0d1d87cc8b4dc8e7c1ec7a74716e87b7250122f022dc65e07161d41
7
+ data.tar.gz: 87b7c6f25b74a8e788af1b3d2001dccb3c1c69ada108ac30dcf63d9a523af1d35f4b4171f838d69e34f8de33a2e27b004d13017d5e22e5372a14f999da3c40cd
@@ -59,13 +59,24 @@ class Patchboard
59
59
  :url => url, :method => @method, :headers => headers
60
60
  }
61
61
 
62
+ input_options = self.process_args(args)
63
+
62
64
  if @auth_schemes && context.respond_to?(:authorizer)
63
- scheme, credential = context.authorizer(@auth_schemes, resource, @name)
65
+ # Ugly hack to maintain backwards compatibility with existing
66
+ # implementations of context.authorizer
67
+ scheme, credential = begin
68
+ context.authorizer(
69
+ :schemes => @auth_schemes,
70
+ :resource => resource, :action => @name,
71
+ :request => input_options
72
+ )
73
+ rescue ArgumentError
74
+ context.authorizer(@auth_schemes, resource, @name)
75
+ end
64
76
 
65
77
  headers["Authorization"] = "#{scheme} #{credential}"
66
78
  end
67
79
 
68
- input_options = self.process_args(args)
69
80
  if input_options[:body]
70
81
  options[:body] = input_options[:body]
71
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patchboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew King
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-25 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json