darrrr 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/lib/darrrr.rb +12 -4
  3. data/lib/darrrr/provider.rb +6 -1
  4. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d14b89df09e2c495a699508b7b1c10e29f6d416c
4
- data.tar.gz: d1cebf97f5b69c963e663eaaeeee8c5f54b2c4a3
2
+ SHA256:
3
+ metadata.gz: d58318c6f4aeb06283eacc6258859456f7eda5655bfc6da47738a3ee290dcbe6
4
+ data.tar.gz: bde433b67c03b92340ff317192c4a145f655ddf15073acccd9d8d5e4747ccf3e
5
5
  SHA512:
6
- metadata.gz: cf71fdd96d941b63711292e1f981f73b13da91b40c2a099ef626cf2ef9eceaafbdeb7972a114c6ada198a3998b7f0330f9e21893ef3f54767f28fca7047bb740
7
- data.tar.gz: a3b111b878a06733ef88e58c1ed5c8c2161ffb6ffc265f80eb7af1c39711c74396b44b1a3182587db2b08692639b1aadbf9acc937765ce246d661c5a07cdcae0
6
+ metadata.gz: 1f4e07d24a5524c6ff251a030195362e439ef88b2801569acf7550b911ddab8f563a3f314a24a738a81a4149cee0d58d6664934b4d82a8e721451ff01417e00e
7
+ data.tar.gz: c214d0c82c6588a5c7e597d91eaac1c10e584446d69bff879e9a506077c3e41f916486549a2a76d19f8bf1bc827ca2dab6c4eeb7ee5428405fd288a03b183cf1
@@ -64,7 +64,7 @@ module Darrrr
64
64
  #
65
65
  # provider_origin: the origin that contains the config data in a well-known
66
66
  # location.
67
- def recovery_provider(provider_origin)
67
+ def recovery_provider(provider_origin, &block)
68
68
  unless self.recovery_providers
69
69
  raise "No recovery providers configured"
70
70
  end
@@ -72,7 +72,11 @@ module Darrrr
72
72
  if provider_origin == this_recovery_provider&.origin
73
73
  this_recovery_provider
74
74
  elsif self.recovery_providers.include?(provider_origin)
75
- RecoveryProvider.new(provider_origin).load
75
+ RecoveryProvider.new(provider_origin).tap { |provider|
76
+ if block_given?
77
+ yield provider
78
+ end
79
+ }.load
76
80
  else
77
81
  raise UnknownProviderError, "Unknown recovery provider: #{provider_origin}"
78
82
  end
@@ -90,14 +94,18 @@ module Darrrr
90
94
  #
91
95
  # provider_origin: the origin that contains the config data in a well-known
92
96
  # location.
93
- def account_provider(provider_origin)
97
+ def account_provider(provider_origin, &block)
94
98
  unless self.account_providers
95
99
  raise "No account providers configured"
96
100
  end
97
101
  if provider_origin == this_account_provider&.origin
98
102
  this_account_provider
99
103
  elsif self.account_providers.include?(provider_origin)
100
- AccountProvider.new(provider_origin).load
104
+ AccountProvider.new(provider_origin).tap { |provider|
105
+ if block_given?
106
+ yield provider
107
+ end
108
+ }.load
101
109
  else
102
110
  raise UnknownProviderError, "Unknown account provider: #{provider_origin}"
103
111
  end
@@ -9,6 +9,7 @@ module Darrrr
9
9
 
10
10
  def self.included(base)
11
11
  base.instance_eval do
12
+ attr_accessor :faraday_config_callback
12
13
  # this represents the account/recovery provider on this web app
13
14
  class << self
14
15
  attr_accessor :this
@@ -76,7 +77,11 @@ module Darrrr
76
77
 
77
78
  private def faraday
78
79
  Faraday.new do |f|
79
- f.adapter(Faraday.default_adapter)
80
+ if @faraday_config_callback
81
+ @faraday_config_callback.call(f)
82
+ else
83
+ f.adapter(Faraday.default_adapter)
84
+ end
80
85
  end
81
86
  end
82
87
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darrrr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Matatall
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-06 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -106,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubyforge_project:
110
- rubygems_version: 2.6.10
109
+ rubygems_version: 3.0.3
111
110
  signing_key:
112
111
  specification_version: 4
113
112
  summary: Client library for the Delegated Recovery spec