Commit Graph

28 Commits

Author SHA1 Message Date
Tim Riley 592fb1ca9f
Memoize config hash on finalize (#151)
Freezing the hash is beneficial at this point because it saves repeated expensive
computation if that hash is to be used later in performance-sensitive situations, such as
when serving as a cache key or similar.
2022-10-13 07:04:57 +11:00
Tim Riley a0c245dbef
Add memory profiler 2022-10-09 09:04:21 +11:00
Peter Solnica e4e3ad0f6a
Rely on auto-loading in dry-core 2022-10-08 10:42:09 +02:00
Tim Riley df58417cd6
Use released dry-core without autoloading (#142) 2022-09-24 16:03:59 +10:00
Tim Riley a7cec82081
Add memory usage benchmark (#137)
This compares the memory cost of inheritance from the following superclasses:

- dry-configurable using two top-level settings
- dry-configurable using the same two settings, just nested one level deeper
- dry-core class attributes
- hanami-utils class attributes
- a plain old Ruby class, serving as a "control" for the benchmark
2022-08-24 22:03:22 +10:00
Peter Solnica 147fea1ed6
Rely on dry-core autoloading 2022-07-06 08:23:11 +02:00
Nikita Shilnikov 516250981e
[rubocop] autocorrect 2021-12-23 13:57:09 +03:00
Nikita Shilnikov 55df3ebf8f
[ci] Do not install hotch on jruby 2021-12-22 14:22:55 +03:00
Piotr Solnica 0738ac3526
Add Hotch to Gemfile 2020-02-14 11:42:18 +01:00
Piotr Solnica 63a9e93b13
Add benchmarks group to Gemfile 2020-02-14 11:42:18 +01:00
Piotr Solnica a9f58e77dd
Remove duplicated entry from Gemfile 2020-02-14 11:42:18 +01:00
Piotr Solnica 4e6e90dd5d
rubocop -a --only Style/FrozenStringLiteralComment 2020-01-06 12:39:30 +01:00
Piotr Solnica 2b70df3992
Remove guard from Gemfile 2020-01-04 13:18:49 +01:00
Piotr Solnica f10eeec9af
Use Gemfile.devtools 2020-01-04 13:16:56 +01:00
Piotr Solnica f03c6d22bb
Update Gemfile 2019-10-16 10:48:41 +02:00
Nikita Shilnikov e353aba551
Redefine existing setting in a subclass without a warning
It used to issue a warning about redefined method.
2019-08-08 18:17:44 +03:00
Nikita Shilnikov 0b4a788298
pry-byebug is not available on jruby 2019-02-02 19:08:09 +03:00
Nikita Shilnikov d2c31a0305
Remove Config::Nested, add Settings, and fix mutexes handling (again)
This major refactoring simplifies the code base by removing speacial treatment
for nested configs. I also added a dedicated class for settings, now it acts as
a factory for configs which kind of makes sense.

The `clone` methods were removed since they didn't really work. You can't clone
a frozen object and set instance variables after that since the new object is
frozen already.

Finally, dry-configurable now uses fewer instance variables, one for settings
and another one for config, this is it.
2019-02-02 15:16:14 +03:00
Tim Riley 4849354e81 Revert conversion to dry-struct
Using dry-struct was neat in some ways, in that a config object is effectively a typed struct, but it introduced unsatisfiable gem dependency cycles, e.g. that dry-struct required dry-types, and dry-types required dry-container, and dry-container was already using dry-configurable.

Secondly, with the dry-struct dependency bringing in those extra transitive depdencies, dry-configurable became less lightweight, and less palatable for others to use, especially given it has such a narrow, low-level focus.

We'll reintroduce type support via another approach with doesn't have these downsides.

This reverts the following commits:

- 1caa28e3b4
- abefc03b94
- 208e6a426f
- 600d60703d
- 2ecae98d89
2019-01-12 21:55:12 +11:00
Gustavo Caso 5885defe8e
fix dependencies issue 2018-04-25 07:04:59 +02:00
Gustavo Caso 5ecab91ed7
fix rubocop offenses 2018-04-25 06:31:35 +02:00
GustavoCaso 1752484fdb Add backward compatibility with previous versions
- Using `Dry::Types['any']` to allow previous users to continue using
the previous api
- Show a warning message explaining that in the future the api will
change
- Add test to show still works with old api
2018-03-12 23:46:15 +01:00
GustavoCaso 135ca3d726 Add dry-{container|struct|types} from master 2018-03-12 23:46:15 +01:00
Andy Holland a18f358c15 Fix build 2016-12-07 20:35:21 +00:00
Andy Holland 68b978e2d9 Remove rubocop 2016-08-31 23:15:06 +01:00
Andy Holland 834b832684 Setup rubocop on CC 2016-04-29 02:29:21 +01:00
Andy Holland 0de7701442 Lock listen to 3.0.6 2016-04-28 22:22:45 +01:00
Andy Holland 297d111b5c Initial commit 2015-06-10 22:33:23 +01:00