nxt_registry 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rakeTasks +7 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +41 -0
- data/LICENSE.txt +21 -0
- data/README.md +68 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/nxt_registry/attribute.rb +17 -0
- data/lib/nxt_registry/blank.rb +4 -0
- data/lib/nxt_registry/errors.rb +6 -0
- data/lib/nxt_registry/nested_registry_builder.rb +7 -0
- data/lib/nxt_registry/recursive_registry.rb +26 -0
- data/lib/nxt_registry/registry.rb +247 -0
- data/lib/nxt_registry/version.rb +3 -0
- data/lib/nxt_registry.rb +18 -0
- data/nxt_registry.gemspec +39 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 375f69d800025475bc7dcec1ce58539c4c9f6cd71f672a38f8fdd7fe8bfb7448
|
4
|
+
data.tar.gz: 8fbaab558bc84ae47d9ecec4b2533b9432d336a0d8b1a7ce54d27262da2dac91
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 74407964a5919ffc06cede9a498110cddffcf5c7821471be6d7352ec6b0267c84972c1369c23e6d1560e113cf3487bc4e100b87ea79e46fedd9d0a9a71e15a8f
|
7
|
+
data.tar.gz: 680c9259e6a733dd580109413274d28a5a1961b7819a60ba20c7b4f84ba60dda899604f71bac74f4aa81ed9e7d0690a898b15884ab890477b9460dc9bd5f0ef4
|
data/.gitignore
ADDED
data/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build nxt_registry-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install nxt_registry-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install nxt_registry-0.1.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.0 and build and push nxt_registry-0.1.0.gem to TODO: Set to 'http://mygemserver.com'" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
nxt_registry (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.2)
|
10
|
+
diff-lcs (1.3)
|
11
|
+
method_source (0.9.2)
|
12
|
+
pry (0.12.2)
|
13
|
+
coderay (~> 1.1.0)
|
14
|
+
method_source (~> 0.9.0)
|
15
|
+
rake (10.5.0)
|
16
|
+
rspec (3.9.0)
|
17
|
+
rspec-core (~> 3.9.0)
|
18
|
+
rspec-expectations (~> 3.9.0)
|
19
|
+
rspec-mocks (~> 3.9.0)
|
20
|
+
rspec-core (3.9.0)
|
21
|
+
rspec-support (~> 3.9.0)
|
22
|
+
rspec-expectations (3.9.0)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.9.0)
|
25
|
+
rspec-mocks (3.9.0)
|
26
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
+
rspec-support (~> 3.9.0)
|
28
|
+
rspec-support (3.9.0)
|
29
|
+
|
30
|
+
PLATFORMS
|
31
|
+
ruby
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
bundler (~> 2.0)
|
35
|
+
nxt_registry!
|
36
|
+
pry
|
37
|
+
rake (~> 10.0)
|
38
|
+
rspec (~> 3.0)
|
39
|
+
|
40
|
+
BUNDLED WITH
|
41
|
+
2.0.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Andreas Robecke
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# NxtRegistry
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/nxt_registry`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'nxt_registry'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install nxt_registry
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
class MyClass
|
27
|
+
include NxtRegistry
|
28
|
+
|
29
|
+
def passengers
|
30
|
+
@passengers ||= begin
|
31
|
+
registry :from do
|
32
|
+
nested :to do
|
33
|
+
nested :via do
|
34
|
+
attrs :train, :car, :plane, :horse
|
35
|
+
default -> { [] }
|
36
|
+
memoize true
|
37
|
+
call true
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
subject = MyClass.new
|
46
|
+
subject.passengers.from(:a).to(:b).via(:train) # => []
|
47
|
+
subject.passengers.from(:a).to(:b).via(:train) << 'Andy'
|
48
|
+
subject.passengers.from(:a).to(:b).via(:car) << 'Lütfi'
|
49
|
+
subject.passengers.from(:a).to(:b).via(:plane) << 'Nils'
|
50
|
+
subject.passengers.from(:a).to(:b).via(:plane) << 'Rapha'
|
51
|
+
subject.passengers.from(:a).to(:b).via(:plane) # => ['Nils', 'Rapha']
|
52
|
+
|
53
|
+
subject.passengers.from(:a).to(:b).via(:hyperloop) # => KeyError
|
54
|
+
```
|
55
|
+
|
56
|
+
## Development
|
57
|
+
|
58
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
59
|
+
|
60
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/nxt_registry.
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "nxt_registry"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module NxtRegistry
|
2
|
+
class Attribute
|
3
|
+
def initialize(name, registry, **options)
|
4
|
+
@name = name
|
5
|
+
@registry = registry
|
6
|
+
@namespace = [name, registry.send(:namespace)].join('.')
|
7
|
+
end
|
8
|
+
|
9
|
+
def eql?(other)
|
10
|
+
{ name => registry.object_id } == { other.send(:name) => other.send(:registry).object_id }
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
attr_reader :name, :registry
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NxtRegistry
|
2
|
+
class RecursiveRegistry < Registry
|
3
|
+
def initialize(name, **options, &config)
|
4
|
+
@level = options.fetch(:level) { 0 }
|
5
|
+
|
6
|
+
@name = name
|
7
|
+
@options = options
|
8
|
+
@config = config
|
9
|
+
|
10
|
+
super(name, **options, &config)
|
11
|
+
set_nested_builder_as_default
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_reader :name
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
attr_reader :options, :config, :level
|
19
|
+
|
20
|
+
def set_nested_builder_as_default
|
21
|
+
self.default = NestedRegistryBuilder.new do
|
22
|
+
RecursiveRegistry.new("level_#{(level + 1)}", **options.merge(level: (level + 1)), &config)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,247 @@
|
|
1
|
+
module NxtRegistry
|
2
|
+
class Registry
|
3
|
+
def initialize(name, **options, &config)
|
4
|
+
@name = name
|
5
|
+
@parent = options[:parent]
|
6
|
+
@is_leaf = true
|
7
|
+
@namespace = [parent, self].compact.map(&:name).join('.')
|
8
|
+
@config = config
|
9
|
+
@store = {}
|
10
|
+
@attrs = nil
|
11
|
+
|
12
|
+
setup_defaults(options)
|
13
|
+
configure(&config)
|
14
|
+
end
|
15
|
+
|
16
|
+
attr_reader :name
|
17
|
+
|
18
|
+
def nested(name, **options, &config)
|
19
|
+
options = options.merge(parent: self)
|
20
|
+
|
21
|
+
if default.is_a?(Blank)
|
22
|
+
self.is_leaf = false
|
23
|
+
|
24
|
+
self.default = NestedRegistryBuilder.new do
|
25
|
+
Registry.new(name, **options, &config)
|
26
|
+
end
|
27
|
+
|
28
|
+
default.call
|
29
|
+
elsif default.is_a?(NestedRegistryBuilder)
|
30
|
+
raise ArgumentError, "Multiple nestings on the same level"
|
31
|
+
else
|
32
|
+
raise ArgumentError, "Default values cannot be defined on registries that nest others"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def attr(name)
|
37
|
+
key = transformed_key(name)
|
38
|
+
raise KeyError, "Attribute #{key} already registered in #{namespace}" if attrs[key]
|
39
|
+
|
40
|
+
attrs[key] = Attribute.new(key, self)
|
41
|
+
end
|
42
|
+
|
43
|
+
def attrs(*args)
|
44
|
+
@attrs ||= {}
|
45
|
+
return @attrs unless args.any?
|
46
|
+
|
47
|
+
args.each { |name| attr(name) }
|
48
|
+
end
|
49
|
+
|
50
|
+
def register(key, value)
|
51
|
+
__register(key, value, raise: true)
|
52
|
+
end
|
53
|
+
|
54
|
+
def register!(key, value)
|
55
|
+
__register(key, value, raise: false)
|
56
|
+
end
|
57
|
+
|
58
|
+
def resolve(key)
|
59
|
+
__resolve(key, raise: true)
|
60
|
+
end
|
61
|
+
|
62
|
+
def resolve!(key)
|
63
|
+
__resolve(key, raise: false)
|
64
|
+
end
|
65
|
+
|
66
|
+
def to_h
|
67
|
+
store
|
68
|
+
end
|
69
|
+
|
70
|
+
def [](key)
|
71
|
+
store[transformed_key(key)]
|
72
|
+
end
|
73
|
+
|
74
|
+
def []=(key, value)
|
75
|
+
store[transformed_key(key)] = value
|
76
|
+
end
|
77
|
+
|
78
|
+
def keys
|
79
|
+
store.keys.map(&method(:transformed_key))
|
80
|
+
end
|
81
|
+
|
82
|
+
def key?(key)
|
83
|
+
store.key?(transformed_key(key))
|
84
|
+
end
|
85
|
+
|
86
|
+
def include?(key)
|
87
|
+
store.include?(transformed_key(key))
|
88
|
+
end
|
89
|
+
|
90
|
+
def exclude?(key)
|
91
|
+
store.exclude?(transformed_key(key))
|
92
|
+
end
|
93
|
+
|
94
|
+
def fetch(key, **opts, &block)
|
95
|
+
store.fetch(transformed_key(key), **opts, &block)
|
96
|
+
end
|
97
|
+
|
98
|
+
delegate :size, :values, :each, to: :store
|
99
|
+
|
100
|
+
def configure(&block)
|
101
|
+
define_accessors
|
102
|
+
define_interface
|
103
|
+
|
104
|
+
if block.present?
|
105
|
+
if block.arity == 1
|
106
|
+
instance_exec(self, &block)
|
107
|
+
else
|
108
|
+
instance_exec(&block)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
private
|
114
|
+
|
115
|
+
attr_reader :namespace, :parent, :config, :store
|
116
|
+
attr_accessor :is_leaf
|
117
|
+
|
118
|
+
def is_leaf?
|
119
|
+
@is_leaf
|
120
|
+
end
|
121
|
+
|
122
|
+
def __register(key, value, raise: true)
|
123
|
+
key = transformed_key(key)
|
124
|
+
|
125
|
+
raise ArgumentError, "Not allowed to register values in a registry that contains nested registries" unless is_leaf
|
126
|
+
raise KeyError, "Keys are restricted to #{attrs.keys}" if attribute_not_allowed?(key)
|
127
|
+
|
128
|
+
on_key_already_registered.call(key) if store[key] && raise
|
129
|
+
|
130
|
+
store[key] = value
|
131
|
+
end
|
132
|
+
|
133
|
+
def __resolve(key, raise: true)
|
134
|
+
key = transformed_key(key)
|
135
|
+
|
136
|
+
value = if is_leaf?
|
137
|
+
if store[key]
|
138
|
+
store.fetch(key)
|
139
|
+
else
|
140
|
+
if default.is_a?(Blank)
|
141
|
+
return unless raise
|
142
|
+
|
143
|
+
on_key_not_registered.call(key)
|
144
|
+
else
|
145
|
+
value = resolve_default
|
146
|
+
return value unless memoize
|
147
|
+
|
148
|
+
store[key] ||= value
|
149
|
+
end
|
150
|
+
end
|
151
|
+
else
|
152
|
+
# Call nested registry builder when we are not a leaf
|
153
|
+
store[key] ||= default.call
|
154
|
+
end
|
155
|
+
|
156
|
+
resolver.call(value)
|
157
|
+
end
|
158
|
+
|
159
|
+
def setup_defaults(options)
|
160
|
+
@default = options.fetch(:default) { Blank.new }
|
161
|
+
@memoize = options.fetch(:memoize) { true }
|
162
|
+
@call = options.fetch(:call) { true }
|
163
|
+
@resolver = options.fetch(:resolver) { ->(value) { value } }
|
164
|
+
@transform_keys = options.fetch(:transform_keys) { ->(key) { key.to_s } }
|
165
|
+
@on_key_already_registered = options.fetch(:on_key_already_registered) { ->(key) { raise_key_already_registered_error(key) } }
|
166
|
+
@on_key_not_registered = options.fetch(:on_key_not_registered) { ->(key) { raise_key_not_registered_error(key) } }
|
167
|
+
end
|
168
|
+
|
169
|
+
def define_interface
|
170
|
+
define_singleton_method name do |key = Blank.new, value = Blank.new|
|
171
|
+
return self if key.is_a?(Blank)
|
172
|
+
|
173
|
+
key = transformed_key(key)
|
174
|
+
|
175
|
+
if value.is_a?(Blank)
|
176
|
+
resolve(key)
|
177
|
+
else
|
178
|
+
register(key, value)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
define_singleton_method "#{name}!" do |key = Blank.new, value = Blank.new|
|
183
|
+
return self if key.is_a?(Blank)
|
184
|
+
|
185
|
+
key = transformed_key(key)
|
186
|
+
|
187
|
+
if value.is_a?(Blank)
|
188
|
+
resolve!(key)
|
189
|
+
else
|
190
|
+
register!(key, value)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
def define_accessors
|
196
|
+
%w[default memoize call resolver transform_keys on_key_already_registered on_key_not_registered].each do |attribute|
|
197
|
+
define_singleton_method attribute do |value = Blank.new, &block|
|
198
|
+
# TODO: Allowing a block does not make sense for memoize and call?!
|
199
|
+
value = block if block
|
200
|
+
|
201
|
+
if value.is_a?(Blank)
|
202
|
+
instance_variable_get("@#{attribute}")
|
203
|
+
else
|
204
|
+
instance_variable_set("@#{attribute}", value)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
define_singleton_method "#{attribute}=" do |value|
|
209
|
+
instance_variable_set("@#{attribute}", value)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
def attribute_not_allowed?(key)
|
215
|
+
return if attrs.empty?
|
216
|
+
|
217
|
+
attrs.keys.exclude?(transformed_key(key))
|
218
|
+
end
|
219
|
+
|
220
|
+
def resolve_default
|
221
|
+
if call && default.respond_to?(:call)
|
222
|
+
default.call
|
223
|
+
else
|
224
|
+
default
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
def raise_key_already_registered_error(key)
|
229
|
+
raise NxtRegistry::Errors::KeyAlreadyRegisteredError, "Key '#{key}' already registered in registry '#{namespace}'"
|
230
|
+
end
|
231
|
+
|
232
|
+
def raise_key_not_registered_error(key)
|
233
|
+
raise NxtRegistry::Errors::KeyNotRegisteredError, "Key '#{key}' not registered in registry '#{namespace}'"
|
234
|
+
end
|
235
|
+
|
236
|
+
def transformed_key(key)
|
237
|
+
@transformed_key ||= {}
|
238
|
+
@transformed_key[key] ||= begin
|
239
|
+
if transform_keys && !key.is_a?(Blank)
|
240
|
+
transform_keys.call(key)
|
241
|
+
else
|
242
|
+
key
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
data/lib/nxt_registry.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'active_support/all'
|
2
|
+
require "nxt_registry/version"
|
3
|
+
require "nxt_registry/blank"
|
4
|
+
require "nxt_registry/attribute"
|
5
|
+
require "nxt_registry/errors"
|
6
|
+
require "nxt_registry/nested_registry_builder"
|
7
|
+
require "nxt_registry/registry"
|
8
|
+
require "nxt_registry/recursive_registry"
|
9
|
+
|
10
|
+
module NxtRegistry
|
11
|
+
def registry(name, &config)
|
12
|
+
Registry.new(name, &config)
|
13
|
+
end
|
14
|
+
|
15
|
+
def recursive_registry(name, &config)
|
16
|
+
RecursiveRegistry.new(name, &config)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "nxt_registry/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "nxt_registry"
|
7
|
+
spec.version = NxtRegistry::VERSION
|
8
|
+
spec.authors = ["Andreas Robecke", "Nils Sommer", "Raphael Kallensee", "Lütfi Demirci"]
|
9
|
+
spec.email = ["a.robecke@getsafe.de"]
|
10
|
+
|
11
|
+
spec.summary = %q{nxt_registry is a simple implementation of the container pattern}
|
12
|
+
spec.homepage = "https://github.com/nxt-insurance"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata["allowed_push_host"] = 'https://rubygems.org'
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/nxt-insurance/nxt_registry"
|
22
|
+
else
|
23
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
24
|
+
"public gem pushes."
|
25
|
+
end
|
26
|
+
# Specify which files should be added to the gem when it is released.
|
27
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
28
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
29
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
30
|
+
end
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
|
+
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
38
|
+
spec.add_development_dependency "pry"
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nxt_registry
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andreas Robecke
|
8
|
+
- Nils Sommer
|
9
|
+
- Raphael Kallensee
|
10
|
+
- Lütfi Demirci
|
11
|
+
autorequire:
|
12
|
+
bindir: exe
|
13
|
+
cert_chain: []
|
14
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: bundler
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - "~>"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '10.0'
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '10.0'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: rspec
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '3.0'
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '3.0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: pry
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
description:
|
73
|
+
email:
|
74
|
+
- a.robecke@getsafe.de
|
75
|
+
executables: []
|
76
|
+
extensions: []
|
77
|
+
extra_rdoc_files: []
|
78
|
+
files:
|
79
|
+
- ".gitignore"
|
80
|
+
- ".rakeTasks"
|
81
|
+
- ".rspec"
|
82
|
+
- ".travis.yml"
|
83
|
+
- Gemfile
|
84
|
+
- Gemfile.lock
|
85
|
+
- LICENSE.txt
|
86
|
+
- README.md
|
87
|
+
- Rakefile
|
88
|
+
- bin/console
|
89
|
+
- bin/setup
|
90
|
+
- lib/nxt_registry.rb
|
91
|
+
- lib/nxt_registry/attribute.rb
|
92
|
+
- lib/nxt_registry/blank.rb
|
93
|
+
- lib/nxt_registry/errors.rb
|
94
|
+
- lib/nxt_registry/nested_registry_builder.rb
|
95
|
+
- lib/nxt_registry/recursive_registry.rb
|
96
|
+
- lib/nxt_registry/registry.rb
|
97
|
+
- lib/nxt_registry/version.rb
|
98
|
+
- nxt_registry.gemspec
|
99
|
+
homepage: https://github.com/nxt-insurance
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata:
|
103
|
+
allowed_push_host: https://rubygems.org
|
104
|
+
homepage_uri: https://github.com/nxt-insurance
|
105
|
+
source_code_uri: https://github.com/nxt-insurance/nxt_registry
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubygems_version: 3.0.6
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: nxt_registry is a simple implementation of the container pattern
|
125
|
+
test_files: []
|