footrest 0.6.0 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ad26005a54e3b2f0b36f04bc5e23e9f1f67b8415d8a81357b6cf71f66c96c42
4
- data.tar.gz: f78c68fbe3d73d34f0074979c027e77c50ba97b1e0631240b90e5cca5d0a695c
3
+ metadata.gz: c1b2c4019f2a8af6e3ee1c001e93aebe66a3cb26215dabc42d4320f1acee55b8
4
+ data.tar.gz: d508b92955ea388de8ed97771a1d721bfb5954f712333049e4b49fee10262c9b
5
5
  SHA512:
6
- metadata.gz: 6558af15c808864590d8fe5e58ea63bb2112bd6dcda9ec705f8d29f03827b552227561c3a49d951b884169756c3eb5646c614af44795e037459925ba6933de99
7
- data.tar.gz: a3cfdc52cda17871d48afbe8e2d467ca18e363d327d7eb203ef2a13c29f80957509805b5d96f892d3cd8401f246c2442ac10589da65b36f80d3465ea1e0f838e
6
+ metadata.gz: 02053c315c359b5e49f3e2ff398b40e9aef316fc4b8e51dddfcfdf79c86a813fbe5053e3581463d46bf947810b3dcd1f023561a65d88f50a23252eac2d4150fa
7
+ data.tar.gz: dea36a4ff0aa9bde0bc4ad78a4354ab2c82aa10289bc96ce9a5863264dbb4ceece7e5a35b371ce13a1c6fc32a83aef4350b6e2885fdd642684516df3b44ff8b3
@@ -1,23 +1,36 @@
1
1
  require 'footrest/connection'
2
2
  require 'footrest/request'
3
- require 'active_support/configurable'
3
+ require 'active_support/ordered_options'
4
4
 
5
5
  module Footrest
6
6
  class Client
7
7
  include Footrest::Connection
8
8
  include Footrest::Request
9
- include ActiveSupport::Configurable
10
9
 
11
- config_accessor :token
12
- config_accessor :prefix
13
- config_accessor :logging
10
+ # Well-known options surfaced as reader/writer methods (e.g. client.token).
11
+ # Any other option remains reachable through #config (e.g. config[:domain]).
12
+ CONFIG_ACCESSORS = %i[token prefix logging].freeze
14
13
 
15
14
  def initialize(options={}, &block)
16
- self.config.merge!(options)
15
+ config.merge!(options)
17
16
  yield self if block_given?
18
17
  set_connection(config)
19
18
  end
20
19
 
20
+ # Per-instance options bag. ActiveSupport::OrderedOptions supports both
21
+ # hash-style (config[:token]) and method-style (config.token) access, the
22
+ # same surface ActiveSupport::Configurable's config object provided. This
23
+ # replaces `include ActiveSupport::Configurable`, which activesupport
24
+ # deprecates in 8.1 and removes in 8.2.
25
+ def config
26
+ @config ||= ActiveSupport::OrderedOptions.new
27
+ end
28
+
29
+ CONFIG_ACCESSORS.each do |name|
30
+ define_method(name) { config[name] }
31
+ define_method("#{name}=") { |value| config[name] = value }
32
+ end
33
+
21
34
  def connection(&block)
22
35
  @connection.tap do |conn|
23
36
  yield conn if block_given?
@@ -1,3 +1,3 @@
1
1
  module Footrest
2
- VERSION = '0.6.0' unless defined?(Footrest::VERSION)
2
+ VERSION = '0.6.1' unless defined?(Footrest::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: footrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duane Johnson