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

Raise when seed finds no files. #99

Merged
merged 2 commits into from
Jan 9, 2025
Merged

Conversation

kaspth
Copy link
Owner

@kaspth kaspth commented Jan 9, 2025

Ref #95

In case users pass a typo'ed name/path to seed we won't give them any indication of what's going on.

Running a test fails silently.

Now we raise when we can't find any files.

In case users pass a typo'ed name/path to `seed` we won't give them any indication of what's going on.

Running a test fails silently.

Now we raise when we can't find any files.
@kaspth
Copy link
Owner Author

kaspth commented Jan 9, 2025

I'm not super happy with this implementation, all these details are pretty quangled together.

Will try to sleep on it and see if I can come up with anything better.

end

private def load_from(path)
@loader = Oaken::Loader.new path
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this @loader instance variable, since we're not using it anymore.

In case a user does `seed :accounts, :missing` we want to raise when we can't load from `:missing`.

Previously, we'd proceed silently because `:accounts` found files.
@kaspth kaspth merged commit eeb2e87 into main Jan 9, 2025
5 checks passed
@kaspth kaspth deleted the raise-when-seed-finds-no-files branch January 9, 2025 01:13
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