darrrr 0.1.4 → 0.1.5

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/darrrr.rb +4 -12
  3. data/lib/darrrr/provider.rb +2 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d58318c6f4aeb06283eacc6258859456f7eda5655bfc6da47738a3ee290dcbe6
4
- data.tar.gz: bde433b67c03b92340ff317192c4a145f655ddf15073acccd9d8d5e4747ccf3e
3
+ metadata.gz: ad72010cfec2769fc738c5794089a2ce31e1d1b8dddb427d7570055dc8db2c9b
4
+ data.tar.gz: 19bd04a3cefc965cef5d1e837d2cb5522485b5dd5052fc620c513342a11a8836
5
5
  SHA512:
6
- metadata.gz: 1f4e07d24a5524c6ff251a030195362e439ef88b2801569acf7550b911ddab8f563a3f314a24a738a81a4149cee0d58d6664934b4d82a8e721451ff01417e00e
7
- data.tar.gz: c214d0c82c6588a5c7e597d91eaac1c10e584446d69bff879e9a506077c3e41f916486549a2a76d19f8bf1bc827ca2dab6c4eeb7ee5428405fd288a03b183cf1
6
+ metadata.gz: df9cbc3abd3a989f15364393b7b50e43f24b3668e730541687808de59694625934dc938b4106538a0029a1af3072af677cad3c276b5b8b401d40e98baed6974d
7
+ data.tar.gz: fc3765b35e8b5d9f0a3320df2a6eb0e76caa7cd83f74d91791b630dd04ae07d0209a9f77e1a5b2ac96a30a0fb8e0c08a8f12096a8b4e7bb7fba69de1914195cc
@@ -58,13 +58,13 @@ module Darrrr
58
58
  class << self
59
59
  # recovery provider data is only loaded (and cached) upon use.
60
60
  attr_accessor :recovery_providers, :account_providers, :cache, :allow_unsafe_urls,
61
- :privacy_policy, :icon_152px, :authority
61
+ :privacy_policy, :icon_152px, :authority, :faraday_config_callback
62
62
 
63
63
  # Find and load remote recovery provider configuration data.
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, &block)
67
+ def recovery_provider(provider_origin)
68
68
  unless self.recovery_providers
69
69
  raise "No recovery providers configured"
70
70
  end
@@ -72,11 +72,7 @@ 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).tap { |provider|
76
- if block_given?
77
- yield provider
78
- end
79
- }.load
75
+ RecoveryProvider.new(provider_origin).load
80
76
  else
81
77
  raise UnknownProviderError, "Unknown recovery provider: #{provider_origin}"
82
78
  end
@@ -101,11 +97,7 @@ module Darrrr
101
97
  if provider_origin == this_account_provider&.origin
102
98
  this_account_provider
103
99
  elsif self.account_providers.include?(provider_origin)
104
- AccountProvider.new(provider_origin).tap { |provider|
105
- if block_given?
106
- yield provider
107
- end
108
- }.load
100
+ AccountProvider.new(provider_origin).load
109
101
  else
110
102
  raise UnknownProviderError, "Unknown account provider: #{provider_origin}"
111
103
  end
@@ -9,7 +9,6 @@ module Darrrr
9
9
 
10
10
  def self.included(base)
11
11
  base.instance_eval do
12
- attr_accessor :faraday_config_callback
13
12
  # this represents the account/recovery provider on this web app
14
13
  class << self
15
14
  attr_accessor :this
@@ -77,8 +76,8 @@ module Darrrr
77
76
 
78
77
  private def faraday
79
78
  Faraday.new do |f|
80
- if @faraday_config_callback
81
- @faraday_config_callback.call(f)
79
+ if Darrrr.faraday_config_callback
80
+ Darrrr.faraday_config_callback.call(f)
82
81
  else
83
82
  f.adapter(Faraday.default_adapter)
84
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darrrr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Matatall