regstry 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 298b20b15b5a1fb8993728bc85cb7b799c995abb
4
- data.tar.gz: 5bb2829c4edb47fba153177fcbf46941375cacfc
3
+ metadata.gz: 1bd6c3f92ed36c1c2cbabbf38e84ba5329235575
4
+ data.tar.gz: 3daa123bcd92d20483b80170faca117c0d7feaec
5
5
  SHA512:
6
- metadata.gz: 77c002139dac06668f97dec94dacb18b934f3dbe80780a94ffcbb558faf06bfb6b484c8966687b19e9afbf1d975147fe602a1f16014053a3d48306460ed77714
7
- data.tar.gz: 1c7d4c8f4d4c75b96b108f7a40a82d5606ccee008144f212292f72ed01372c1d28bcea84cd7b757357d258427c60ac784a76a92971086ddbae335bed666e01a5
6
+ metadata.gz: 4ed6ddc1b97f1efee615490ea81d1430255312513daab6e4681e5a8d7b77340e57ce3f08166c49c591264f5ff8472273165aa41bef4d677977446ce6a07e7312
7
+ data.tar.gz: 7e645a0ae97644121c4628353baec5f423609a9ab25131711fec454575e3a241868e8245b986bb004f58c6bd3b0731030addbdb904670403b1fb08ef2e7e0015
@@ -1,3 +1,3 @@
1
1
  module Registry
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
data/lib/registry.rb CHANGED
@@ -62,7 +62,8 @@ module Registry
62
62
  base.send(:extend, ClassMethods)
63
63
  base.send(:include, InstanceMethods)
64
64
 
65
- name = base.name.to_s.split('::').last&.downcase&.to_sym || :default
65
+ name = base.name.to_s.split('::').last
66
+ name = name ? name.downcase.to_sym : :default
66
67
  base.instance_variable_set(:@registry_name, name)
67
68
 
68
69
  base.instance_variable_set(:@registries, Registries.new)
@@ -78,7 +79,7 @@ module Registry
78
79
  end
79
80
 
80
81
  def registered?(key)
81
- registry.key?(key&.to_sym)
82
+ registry.key?(key && key.to_sym)
82
83
  end
83
84
 
84
85
  def lookup(key)
@@ -86,7 +87,7 @@ module Registry
86
87
  end
87
88
 
88
89
  def [](key)
89
- registry[key&.to_sym] || fail(MSGS[:unknown] % [key, registry.keys.sort])
90
+ registry[key && key.to_sym] || fail(MSGS[:unknown] % [key, registry.keys.sort])
90
91
  end
91
92
 
92
93
  def registry(name = nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regstry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs