pluggaloid 1.6.0 → 1.7.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: 9a93383e1c1e927a50677dac1de618e66f2b558c9dd03ab0e1a4d8ca4d67a7c8
4
- data.tar.gz: 226442cc3d33c6441ac51d705ac3b230fd53ba26de52e7b82cd82d0629a69bdc
3
+ metadata.gz: d47426a6d55a1f8bb30898b9056766dceff9346b1fdc33561f6c21af9c2c9f98
4
+ data.tar.gz: c9953550293c3f3be07e5ef429d29f90651717f74b443613cd274b702578c938
5
5
  SHA512:
6
- metadata.gz: 04a64880fef38f6092ff1efb49b40f4eb84cc714b02605077663f3f9937453dec61de160aa727311f646a465aad79c0e3a15c6cd2dc935a2e6d33955d409b36c
7
- data.tar.gz: 95d9e7309b800f3eee223336e00568e946e6d59eea3599db51c3b7c70fa380f8fca368611dd8622f32c6bc35309670f8f857e80a7bba5df6eb1d1c2f038a47df
6
+ metadata.gz: 9ac80a75430f7721d6752698deb760b883fe3f9e0a2cf4cdd5b2866b164c01815064749dd9d0acfcdbe799aad88e91346a03272ad171fdab1df20658d14c0688
7
+ data.tar.gz: ca65d05402e64b7daa429596275d25d2af72806c66009f7e10321f2a6a1d9c4ec9f1d7c7e6dd29494394262ad26dd13cbb8fe58374bf8a2de28072d380de5960
@@ -14,6 +14,19 @@ module Pluggaloid
14
14
  def pluggaloid_mirage_repository
15
15
  @pluggaloid_mirage_repository ||= {}
16
16
  end
17
+
18
+ # `Pluggaloid::Mirage` をincludeしたClassのnamespaceを返す。
19
+ # namespaceはStringで、 `Pluggaloid::Mirage` をincludeしたほかのClassと
20
+ # 重複しない。
21
+ # 同じClassであれば、別のPluggaloid host(Pluggaloid::VMやプロセス)でも
22
+ # 同じ値を返す。
23
+ def pluggaloid_mirage_namespace
24
+ -to_s
25
+ end
26
+
27
+ def inherited(klass)
28
+ Mirage.pluggaloid_mirage_classes[klass.pluggaloid_mirage_namespace] = klass
29
+ end
17
30
  end
18
31
 
19
32
  def self.unwrap(namespace:, id:)
@@ -31,7 +44,7 @@ module Pluggaloid
31
44
 
32
45
  def self.included(klass)
33
46
  klass.extend(Extend)
34
- pluggaloid_mirage_classes[klass.to_s] = klass
47
+ pluggaloid_mirage_classes[klass.pluggaloid_mirage_namespace] = klass
35
48
  end
36
49
 
37
50
  def self.pluggaloid_mirage_classes
@@ -43,10 +56,14 @@ module Pluggaloid
43
56
  def pluggaloid_mirage_id
44
57
  generate_pluggaloid_mirage_id.freeze.tap do |id|
45
58
  self.class.pluggaloid_mirage_repository[id] = self
46
- Mirage.pluggaloid_mirage_classes[self.class.to_s] ||= self.class
59
+ Mirage.pluggaloid_mirage_classes[self.class.pluggaloid_mirage_namespace] ||= self.class
47
60
  end
48
61
  end
49
62
 
63
+ def pluggaloid_mirage_namespace
64
+ self.class.pluggaloid_mirage_namespace
65
+ end
66
+
50
67
  private
51
68
 
52
69
  # このClassのなかで、Pluggaloid::Mirageがインスタンスを同定するためのid(String)を返す。
@@ -1,3 +1,3 @@
1
1
  module Pluggaloid
2
- VERSION = '1.6.0'
2
+ VERSION = '1.7.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluggaloid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiaki Asai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-15 00:00:00.000000000 Z
11
+ date: 2021-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: delayer
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 3.2.13
152
+ rubygems_version: 3.2.15
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Extensible plugin system