hub_kernel-interface 0.8.0 → 0.9.0

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: d0080a27457d5f374c3c92fbbeeecbd3ad8e1c6543e2274634cb14df708626c0
4
- data.tar.gz: 76609fd82439a9b52510439ab93ed23d81f222edd14a3aa9f2d3276a5bc7aa76
3
+ metadata.gz: aa94379e01e0ee039f41a4781b67f39ad4ad030ec77f0b4782f7c567b74a8002
4
+ data.tar.gz: 3b589b03f7b4ebe8d853943297e617aa9179d00fc53d3c0bd46ee428e3f5ca5a
5
5
  SHA512:
6
- metadata.gz: 1c9820a93999b13cf6895dc4b5a10622210aa656b9ec078650790886079dee7a149f507e47c973275e7ab41ceb375e08f0d5fa8246dc62ad39f02f8a84811af0
7
- data.tar.gz: 7c9f45f51ebac824991737b2170e48c7665788d5ed30d4f3d2f98b6bd5db820e1fa2afa278abc48e7bc9d10ab8bcfe8d01644823d5682bd6f74dde37dc8fe16b
6
+ metadata.gz: 0c4701fdf78fe037fdaf67ac3694ba07ff7d1c6d7bf4479bded9f131f56a886876feba0334cf89a6328da5604a621bec573261d9ff31d6e4b18a5850909d9e6f
7
+ data.tar.gz: d087e461324a72ac89c1262dd9bae5d84abde0af484a2c894b38b72bb7f8063c604a30a93d8b44947d9b6b83686b95373e196aa2bc725b76ef89318c943c9826
data/README.md CHANGED
@@ -40,9 +40,11 @@ for a missing person, account or required value. A hub refuses with `HubKernel::
40
40
  reason a person can read. A call made while the permission check or the account scope is unset
41
41
  raises `HubKernel::UnwiredPortError`.
42
42
 
43
- The host names the hubs every interface serves, once. A hub listed alone is served at its
43
+ Every interface serves every hub that exposes a method, each at its module name in snake
44
+ case, unless the host names the hubs to serve, once. A hub listed alone is served at its
44
45
  module name in snake case, and a hub listed as a one-pair hash is served only at the name
45
- given. An interface gem finds the hub served at a name, or `nil` when none is:
46
+ given. Setting the list to `nil` serves every exposing hub again. An interface gem finds the
47
+ hub served at a name, or `nil` when none is:
46
48
 
47
49
  ```ruby
48
50
  HubKernel::Interface.hubs = [ Supplies, { "money" => Billing::Ledger } ]
@@ -55,6 +57,14 @@ HubKernel::Interface.served # => { "supplies" => Supplies, "money" =>
55
57
  The permission check is still asked about a hub served under a chosen name by its own name,
56
58
  such as `ledger:record_spend`.
57
59
 
60
+ The host names the methods that give the calling person and account once, here, for an
61
+ interface gem to read:
62
+
63
+ ```ruby
64
+ HubKernel::Interface.person_method = :hub_person
65
+ HubKernel::Interface.account_method = :hub_account
66
+ ```
67
+
58
68
  An interface gem's boot check runs `HubKernel::Interface.check!`, which raises
59
69
  `HubKernel::Interface::UnservableHubError` naming every problem in the served list at once:
60
70
  an entry that exposes no methods, two entries that answer at the same name, and each
@@ -1,5 +1,5 @@
1
1
  module HubKernel
2
2
  module Interface
3
- VERSION = "0.8.0"
3
+ VERSION = "0.9.0"
4
4
  end
5
5
  end
@@ -2,6 +2,7 @@ require "hub_kernel/interface/version"
2
2
  require "hub_kernel/interface/hub_kernel_release"
3
3
  HubKernel::Interface::HubKernelRelease.refuse_older!(Gem.loaded_specs["hub_kernel"])
4
4
  require "hub_kernel/exposes"
5
+ require "hub_kernel/interface/exposing_hubs"
5
6
  require "hub_kernel/interface/call_reasons"
6
7
 
7
8
  module HubKernel
@@ -9,8 +10,9 @@ module HubKernel
9
10
  class UnservableHubError < StandardError; end
10
11
 
11
12
  singleton_class.attr_writer :hubs
13
+ singleton_class.attr_accessor :person_method, :account_method
12
14
 
13
- def self.hubs = @hubs ||= []
15
+ def self.hubs = @hubs || ExposingHubs.list.dup
14
16
 
15
17
  def self.find(name) = served[name]
16
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_kernel-interface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider