Allows to set a global ParamBuilder - #1833
Conversation
|
If we want to add global configuration to Grape lets adopt the Ruby-esque standard like all the other gems. I should be able to do Grape.configure do |config|
config.x =
endTake a look at https://github.com/dblock/strava-ruby-client/blob/master/lib/strava/api/config.rb for an example. |
Not particularly a fan of it (which is why it wasn't my first choice), but should be fairly easy to implement, and I see your point 👍 |
|
Ruby is lovely because it's often convention over configuration, and predictable imperfect way of doing things consistently. Long live Ruby :) Code looks good otherwise so far. I'll re-review thoroughly when you have the config stuff sorted out. Thanks! |
|
@dblock I've made those changes |
dblock
left a comment
There was a problem hiding this comment.
Looks good. I made some minor suggestions for language in README. Feel free to make/not make them and merge (I would squash since the change ended up being quite minimal).
|
|
||
| ## Configuration | ||
|
|
||
| Grape counts with a module `Grape.configure` for some basic configuration at load time. |
There was a problem hiding this comment.
Counts is probably the wrong word. I tend to keep this as short as possible. For example:
Use Grape.configure to setup global settings at load time.
| end | ||
| ``` | ||
|
|
||
| Or globally with the [Configuration](#configuration) `Grape.configure.param_builder` |
| Grape counts with a module `Grape.configure` for some basic configuration at load time. | ||
| Currently the configurable settings are: | ||
|
|
||
| * `param_builder`: Sets the default [Parameter Builder](#parameters), by default: `Grape::Extensions::ActiveSupport::HashWithIndifferentAccess::ParamBuilder` |
There was a problem hiding this comment.
Sets the Parameter Builder, defaults to Grape::Extensions::ActiveSupport::HashWithIndifferentAccess::ParamBuilder
|
We do need a green CI. Didn't look at failures. |
|
There seems to be an independent failure on the Gem dependencies. I'll try to address it on a separate PR |
|
Opened issue for this: #1839 It seems to be related with coveralls which is no longer maintained |
|
👍 |
This is related to the issue: #1775
Creates a new module for global configuration (I checked the documentation and couldn't find one available), and added the setting for a global param builder