sinclair 1.3.3 → 1.3.4

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: 46aae0be813637d70c6060f5ac9a14537d19eb2d5e4275a31e864625b396c038
4
- data.tar.gz: '08f41f83267f7f017b036e4fd806e336a17932ae4f93eadae0e08dd4341c51cb'
3
+ metadata.gz: 6e1275a6e3f8459ed0176557d4d9580c7cac9bc537b36dd3a96179d43803035b
4
+ data.tar.gz: baba86f5fe29bddf70c3d440e0539c4d0aa4a7b892a9548f73dbaf8945d51be7
5
5
  SHA512:
6
- metadata.gz: 61deac1e3f21b5f238f33fd900ffadacd478b48cdaa3387ac7c272c28edb6d810af1609ec0d76b670861339c9de13600c8c39538c5be0199d5175fe6ed899434
7
- data.tar.gz: 3681a6b3f56c9380e6bcc19bde499c0f4afc593075d8e23144ecc3d0168f0c89bf5352f351b1b87930fc2ba937f313a94292498157e75e6e4e7d56b12bd2efac
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.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
- class MyConfigurable
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
- # class MyConfigurable
74
+ # module MyConfigurable
75
75
  # extend Sinclair::Configurable
76
76
  #
77
77
  # # port is defaulted to 80
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Sinclair
4
- VERSION = '1.3.3'
4
+ VERSION = '1.3.4'
5
5
  end
@@ -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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MyConfigurable
3
+ module MyConfigurable
4
4
  extend Sinclair::Configurable
5
5
 
6
6
  # port is defaulted to 80
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinclair
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthJee