regstry 1.0.0 → 1.0.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
- SHA256:
3
- metadata.gz: 88580d89a97da7be18987bc9cfa2f58ccd732441ebc8cd8425d79c452f77cb2a
4
- data.tar.gz: a0a62267b523ae5bce7f724ab1c7ce0e2b8523ee38572890400aa66b3762c6b1
2
+ SHA1:
3
+ metadata.gz: 0e32e0c6479ad1216974e337f9ddfefddb69bdc6
4
+ data.tar.gz: 19003448f93591d530244612162d8eb7dbe68512
5
5
  SHA512:
6
- metadata.gz: 1b63293ff56e37486909227d53a9d15004fba7db60e282e79bff32aa573f3bc19e840fc1ad743688c5ac6cf92e331290cbb103bf4512e5e8715f380617ef7ffd
7
- data.tar.gz: 75de7e7d1fbc9be9c07242ea222c49aec09aeb742a51e954a51746a15add945b43a2f9cd3ffc778db186ba3329666d164bc169c0e62515942e489040c65a6ecb
6
+ metadata.gz: 0456a31ca53a5c87ada9500f01778137f611a87ae1e715e4a87876584dea8eef14f675871b75f279128a8ddb8f87d8a101370c783702a7cbf1f5ed50255798e6
7
+ data.tar.gz: d6b681d4528c331ee038b9bb68c61dbef61370417880a9215f857506aff7f787bde017c142e621a186226f7295a6a03899f4de7dba1d17c90157481615fd332e
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ group :test do
6
+ gem 'rspec'
7
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,32 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ regstry (1.0.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.3)
10
+ rspec (3.8.0)
11
+ rspec-core (~> 3.8.0)
12
+ rspec-expectations (~> 3.8.0)
13
+ rspec-mocks (~> 3.8.0)
14
+ rspec-core (3.8.0)
15
+ rspec-support (~> 3.8.0)
16
+ rspec-expectations (3.8.3)
17
+ diff-lcs (>= 1.2.0, < 2.0)
18
+ rspec-support (~> 3.8.0)
19
+ rspec-mocks (3.8.0)
20
+ diff-lcs (>= 1.2.0, < 2.0)
21
+ rspec-support (~> 3.8.0)
22
+ rspec-support (3.8.0)
23
+
24
+ PLATFORMS
25
+ ruby
26
+
27
+ DEPENDENCIES
28
+ regstry!
29
+ rspec
30
+
31
+ BUNDLED WITH
32
+ 1.16.1
data/README.md CHANGED
@@ -1,11 +1,21 @@
1
- # Registry
1
+ # Registry [![Build Status](https://travis-ci.org/svenfuchs/registry.svg?branch=master)](https://travis-ci.org/svenfuchs/registry)
2
2
 
3
3
  Ruby class registry for registering, and looking up classes using a key, rather
4
4
  than the class name. Decouples looking up classes from their name and namespace.
5
5
 
6
+ ## Installation
7
+
8
+ ```
9
+ gem install regstry
10
+ ```
11
+
12
+ Note the missing `i` in the gem name. The name `registry` is taken by another gem.
13
+
6
14
  ## Usage
7
15
 
8
16
  ```ruby
17
+ require 'registry'
18
+
9
19
  class Obj
10
20
  include Registry
11
21
  end
@@ -1,3 +1,3 @@
1
1
  module Registry
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/lib/registry.rb CHANGED
@@ -85,8 +85,8 @@ module Registry
85
85
  registry[key&.to_sym] || fail(MSGS[:unknown] % [key, registry.keys.sort])
86
86
  end
87
87
 
88
- def registry
89
- @registry ||= registries.registry(registry_name)
88
+ def registry(name = nil)
89
+ name ? registry_name(name) : @registry ||= registries.registry(registry_name)
90
90
  end
91
91
 
92
92
  def registry_name(name = nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regstry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-22 00:00:00.000000000 Z
11
+ date: 2019-04-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Allows registering Ruby classes for lookup using a key.
14
14
  email:
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - Gemfile
21
+ - Gemfile.lock
21
22
  - LICENSE.md
22
23
  - README.md
23
24
  - lib/registry.rb
@@ -41,7 +42,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
42
  - !ruby/object:Gem::Version
42
43
  version: '0'
43
44
  requirements: []
44
- rubygems_version: 3.0.3
45
+ rubyforge_project:
46
+ rubygems_version: 2.6.13
45
47
  signing_key:
46
48
  specification_version: 4
47
49
  summary: Ruby class registry