sinclair 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/sinclair/configurable.rb +2 -2
- data/lib/sinclair/version.rb +1 -1
- data/spec/lib/sinclair/configurable_spec.rb +16 -0
- data/spec/support/models/my_configurable.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e1275a6e3f8459ed0176557d4d9580c7cac9bc537b36dd3a96179d43803035b
|
4
|
+
data.tar.gz: baba86f5fe29bddf70c3d440e0539c4d0aa4a7b892a9548f73dbaf8945d51be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca4c580be409552638fb442d63b5036cac1d45134839f00551ea2cdcf1cada5f8736d6e1f2abdda97bd9d850a25d92599791efa15f423496796f30c834db053f
|
7
|
+
data.tar.gz: 604d5a4c072fff368b8bd6d062ab6730880bef1f29d6d197e00780cf7d8e98d3d6d64a34c87c8d93a1a367ec81a9a3ab98860111d5d425599d2777fb831db7dd
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ methods
|
|
14
14
|
|
15
15
|
Yard Documentation
|
16
16
|
-------------------
|
17
|
-
https://www.rubydoc.info/gems/sinclair/1.3.
|
17
|
+
https://www.rubydoc.info/gems/sinclair/1.3.4
|
18
18
|
|
19
19
|
Installation
|
20
20
|
---------------
|
@@ -311,7 +311,7 @@ Configurations are read-only objects that can only be set using
|
|
311
311
|
the `configurable#configure` method
|
312
312
|
|
313
313
|
```ruby
|
314
|
-
|
314
|
+
module MyConfigurable
|
315
315
|
extend Sinclair::Configurable
|
316
316
|
|
317
317
|
# port is defaulted to 80
|
@@ -52,7 +52,7 @@ class Sinclair
|
|
52
52
|
#
|
53
53
|
# @return [ConfigFactory]
|
54
54
|
def config_factory
|
55
|
-
@config_factory ||= if superclass.is_a?(Configurable)
|
55
|
+
@config_factory ||= if is_a?(Class) && superclass.is_a?(Configurable)
|
56
56
|
superclass.config_factory.child
|
57
57
|
else
|
58
58
|
ConfigFactory.new
|
@@ -71,7 +71,7 @@ class Sinclair
|
|
71
71
|
# @see ConfigFactory#add_configs
|
72
72
|
#
|
73
73
|
# @example Configuring with common {Sinclair::Config} class
|
74
|
-
#
|
74
|
+
# module MyConfigurable
|
75
75
|
# extend Sinclair::Configurable
|
76
76
|
#
|
77
77
|
# # port is defaulted to 80
|
data/lib/sinclair/version.rb
CHANGED
@@ -73,6 +73,22 @@ describe Sinclair::Configurable do
|
|
73
73
|
configurable.reset_config
|
74
74
|
expect(configurable.config).to be_a(Sinclair::Config)
|
75
75
|
end
|
76
|
+
|
77
|
+
context 'when configurable is a module' do
|
78
|
+
subject(:configurable) do
|
79
|
+
Module.new { extend Sinclair::Configurable }
|
80
|
+
end
|
81
|
+
|
82
|
+
it do
|
83
|
+
expect { configurable.send(:configurable_with, :name) }
|
84
|
+
.not_to raise_error
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'adds reader to config' do
|
88
|
+
expect { configurable.send(:configurable_with, :name) }
|
89
|
+
.to add_method(:name).to(configurable.config)
|
90
|
+
end
|
91
|
+
end
|
76
92
|
end
|
77
93
|
|
78
94
|
describe '#configurable_by' do
|