Skip to content
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

[WIP] Update to ROM 3.x #15

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

[WIP] Update to ROM 3.x #15

wants to merge 18 commits into from

Conversation

elskwid
Copy link
Contributor

@elskwid elskwid commented Feb 20, 2017

Work in progress to get rom-csv up-to-snuff with ROM 3.x.

This includes several of the changes from #14 (ROM 2.x) as well.


TODO:

  • update spec configuration
  • use dry-struct instead of virtus
  • use dry-initializer where possible
  • add Types module and use types in initializers
  • inherit from ROM::Memory::Relation
  • extract file handling out of the dataset (may lead to some re-use but for now it makes the dataset clearer)
  • add support for rom-repository 💃
  • remove dataset mutation while still supporting commands - it currently reloads the data under the dataset which is 😞
  • rename integration/gateway_spec -> integration/adapter_spec and add more specs
  • consider renaming database_setup to something more revealing
  • add multi-file support (in a single directory) like rom-yaml
  • add relevant command specs from rom-sql - there's some good specs in there that could be helpful here (perhaps another linter?).
  • review changes in 2.x and 3.x to make sure we're not missing anything here

This was removed from `ROM::Command` as part of the move to 3.x. Data
should be validated before being sent to commands.

See: rom commit 80bb84
The `assert_tuple_count` checking was removed from `ROM::Command`
during the 2.x work. The underlying command no longer performs
this check so the spec was failing.

See: rom commit bec2c4
`ROM::Memory::Dataset` was updated to use `dry-initializer` so the calls
to `option` in dataset here are now updated using the new syntax with
some bonus type checking courtesy of `dry-types`.

See: rom commit 25f937
Support the same ruby versions as other `rom-*` gems.
Provides a `Test` module to the specs to isolate test-specific classes
and objects. This is similar to setup in other rom-* gems.
There were still a few references to repository which are now removed.
Updates the gateway to use the ROM initializer class, which is a thin
wrapper around `dry-initializer` - eliminating some boilerplate and
allow for some type enforcement for params.

Of note, the `options` param was renamed to `csv_options` since
`dry-initializer` *did not like* a param named `options`. Also, the
`datasets` attr reader was moved up to make it a little more obvious.
Updates the `relation_spec` to use the new `Test` module to isolate the
`RelationPlugin` module created for the examples.
Use the new `ROM::CSV::Types` module in the params/options definitions
throughout.
The `execute` method is the only public method exposed by commands at
this time.
Recent changes to `ROM::Memory::Relation` made it possible to use it as
the superclass for adapter relations. This adds schema support among
other things.
Adds `CSV::Storage` to perform the reading and writing to csv files. The
new class is used in the `Dataset` and the `Gateway`. The connection is
passed in to the dataset to keep the command functionality working.
@elskwid elskwid force-pushed the update-to-rom-3.x branch from d86215d to 983fc7b Compare March 6, 2017 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant