-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Configuration
API
#203
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p-lambert
force-pushed
the
pedro/create-module-registry
branch
from
September 29, 2017 15:06
81641f7
to
3140549
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
2 times, most recently
from
September 29, 2017 15:36
1f40584
to
cd31a3c
Compare
p-lambert
force-pushed
the
pedro/create-module-registry
branch
from
September 29, 2017 18:11
3140549
to
4a26746
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
September 29, 2017 18:22
87f767e
to
07fc34f
Compare
p-lambert
force-pushed
the
pedro/create-module-registry
branch
from
September 29, 2017 18:30
4a26746
to
34d6316
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
September 29, 2017 18:32
07fc34f
to
676bbc1
Compare
p-lambert
force-pushed
the
pedro/create-module-registry
branch
from
September 29, 2017 19:04
34d6316
to
8534170
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
2 times, most recently
from
September 29, 2017 19:37
7feb1d7
to
af439d8
Compare
p-lambert
force-pushed
the
pedro/create-module-registry
branch
from
September 29, 2017 20:23
8534170
to
e179839
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
September 29, 2017 20:25
af439d8
to
3ff3f5c
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
October 2, 2017 06:50
3ff3f5c
to
d16ecc6
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
October 3, 2017 23:21
d16ecc6
to
97dcf9e
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
2 times, most recently
from
October 12, 2017 22:22
8da0e36
to
35b13b2
Compare
p-lambert
force-pushed
the
pedro/create-module-registry
branch
from
October 16, 2017 18:51
e179839
to
f0b6e2e
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
October 16, 2017 18:53
35b13b2
to
a97420c
Compare
p-lambert
force-pushed
the
pedro/create-module-registry
branch
from
October 16, 2017 19:17
f0b6e2e
to
79941df
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
2 times, most recently
from
October 16, 2017 20:08
b4a67e4
to
66bb372
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
2 times, most recently
from
October 16, 2017 21:58
19c2020
to
3485012
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
October 16, 2017 22:02
3485012
to
bf5a998
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
October 17, 2017 20:54
20e4ee9
to
af2580b
Compare
p-lambert
force-pushed
the
pedro/create-configurable-module
branch
from
October 18, 2017 18:33
cdb7aa6
to
57a9807
Compare
palazzem
approved these changes
Oct 19, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect design. It allows us to provide configurations like it should be: crystal clear.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR provides the core components that will power the new configuration API. All integrations should include the
Base
module which in turn includes theRegisterable
and theConfigurable
modules.By doing so, the integration will be globally accessible through the name specified in
.register_as
method call and all of its configuration parameters can be exposed through a series of.option
declarations.As a result, users will be able to configure everything within a single configuration block such as:
And the integrations will look like:
These changes should obviate the interaction with
Datadog::Monkey
andDatadog::Pin
in the future.Meta Options! (For Integration Development)
The
.option
method provided byConfigurable
has the following features:Default Values
A default value can be specified as:
Notice that we also support lazily evaluated defaults, so you can have something like:
Custom Setters
You can specify custom setters for your option param using either the
setter
option or providing a block:Dependent Options