directive 0.22.0 → 0.22.2
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 +4 -4
- data/lib/directive/config_delegation.rb +3 -3
- data/lib/directive/evaluator.rb +1 -1
- data/lib/directive/spec_helper/dsl.rb +1 -1
- data/lib/directive/spec_helper/matchers/configuration/define_config_option.rb +2 -2
- data/lib/directive/spec_helper/matchers/global/delegate_config_to.rb +2 -2
- data/lib/directive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce4adde6ed014c807f03efb035eaeb2c10c6d5075ead0cd4c19106897af90568
|
4
|
+
data.tar.gz: 8f10119a6c587472b2cf79c6a440fb6eae73d1602af03ac425c6fe2457a4f63f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8760f5f0102da31cb514d4ae10cd7318e98e2c19e87f0c4fd703f94ec7e6dbdb4bb3a6850a9e897df6c45554631624384c16de96e4d303ac9da8e045ab0dac44
|
7
|
+
data.tar.gz: a4179b355ad9b5117cac9acc9bd8640f11b436c79687a98b95e569827ecd8461927968b6ef2939aed6c1f8f3f316b2c69b5580ca38aab192c3e324de0db0c056
|
@@ -17,20 +17,20 @@ module Directive
|
|
17
17
|
#
|
18
18
|
# @example
|
19
19
|
# class SomeClass
|
20
|
-
# include
|
20
|
+
# include Directive::ConfigDelegation
|
21
21
|
#
|
22
22
|
# delegates_to_configuration
|
23
23
|
# end
|
24
24
|
#
|
25
25
|
# module SomeClass::Configuration
|
26
|
-
#
|
26
|
+
# extend Directive
|
27
27
|
# end
|
28
28
|
#
|
29
29
|
# SomeClass.config
|
30
30
|
# => returns SomeClass::Configuration.config
|
31
31
|
# SomeClass.configure do { |config| # config is the yielded config object from SomeClass::Configuration.configure }
|
32
32
|
#
|
33
|
-
# @param config_class [
|
33
|
+
# @param config_class [Directive] A module that extends Directive. Defaults to the module +YourGem::Configuration+
|
34
34
|
def delegates_to_configuration(config_class = nil)
|
35
35
|
@_configuration_module = config_class || "#{self}::#{DEFAULT_CONFIGURATION_MODULE_NAME}".constantize
|
36
36
|
end
|
data/lib/directive/evaluator.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Directive
|
4
4
|
class Evaluator
|
5
5
|
# @param path [Array<Symbol, String>] A message path for the desired config
|
6
|
-
# @param configuration [
|
6
|
+
# @param configuration [Directive::Reader]
|
7
7
|
def initialize(path, configuration)
|
8
8
|
@path = path
|
9
9
|
@configuration = configuration
|
@@ -16,7 +16,7 @@ module Directive
|
|
16
16
|
it "defines nested config object #{config_name}" do
|
17
17
|
expect(parent_config).to respond_to config_name
|
18
18
|
expect(parent_config._nested_options).to include config_name.to_sym
|
19
|
-
expect(parent_config.public_send(config_name)).to be_a
|
19
|
+
expect(parent_config.public_send(config_name)).to be_a Directive::ConfigObject
|
20
20
|
end
|
21
21
|
|
22
22
|
instance_eval(&block)
|
@@ -7,7 +7,7 @@ module Directive
|
|
7
7
|
# RSpec matcher to test options of a Configurable class
|
8
8
|
#
|
9
9
|
# class ExampleConfiguration
|
10
|
-
#
|
10
|
+
# extend Directive
|
11
11
|
#
|
12
12
|
# option :foo
|
13
13
|
# option :bar, default: :baz
|
@@ -26,7 +26,7 @@ module Directive
|
|
26
26
|
match do |obj|
|
27
27
|
@obj = obj
|
28
28
|
|
29
|
-
if obj.is_a?
|
29
|
+
if obj.is_a? Directive::ConfigObject
|
30
30
|
expect(obj).to define_option option, default: default
|
31
31
|
else
|
32
32
|
expect(obj).to respond_to :config
|
@@ -7,11 +7,11 @@ module Directive
|
|
7
7
|
# RSpec matcher to test options of a Configurable class
|
8
8
|
#
|
9
9
|
# module MyGem
|
10
|
-
# include
|
10
|
+
# include Directive::ConfigDelegation
|
11
11
|
# delegates_to_configuration
|
12
12
|
#
|
13
13
|
# class MyGem::Configuration
|
14
|
-
#
|
14
|
+
# extend Directive
|
15
15
|
# ...
|
16
16
|
# end
|
17
17
|
# end
|
data/lib/directive/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: directive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.22.
|
4
|
+
version: 0.22.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Rettberg
|
@@ -128,7 +128,7 @@ dependencies:
|
|
128
128
|
- - '='
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: 4.0.1
|
131
|
-
description:
|
131
|
+
description: Easily create rich, self-documenting gem configuration
|
132
132
|
email:
|
133
133
|
- allen.rettberg@freshly.com
|
134
134
|
executables: []
|