-
Notifications
You must be signed in to change notification settings - Fork 172
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
Example in Readme does not work #279
Comments
I think the multiloader depends on file extensions to determine what to do. Is it possible one or more of the sub-schema files are lacking a file extension? |
Everything is json and ends in.json |
@JanStevens could you share the schema, or at least the particular commands you run to generate them? Then I can hopefully work backwards from there to get this fixed. Thanks! |
I was hitting this too. The issue was the path not being expanded, switching to |
@clowder mind submitting a PR? Thanks! |
@geemus On closer inspection it look like a PEBKAC issue. The example in the README works, the issue is that the OP & I were using glob syntax but it isn't supported. Prmd::RakeTasks::Combine.new do |t|
# Won't work, PRMD doesn't expand the glob
t.paths << 'schema/schemata/*'
# Will work, PRMD likes full paths to files
t.paths << Dir['schema/schemata/*']
# Will work, PRMD will automatically find all schema files in directories
t.paths << 'schema/schemata'
end |
Ah, the check just a bit further into the thing tries to see if the path is a directory (and globs then), but otherwise it assumes you are giving an explicit path. I'd certainly welcome your thoughts on either making the code more flexible or, barring that, improving the documentation to make it clear (or both perhaps). Thanks! |
For me, the problem was (as @JanStevens says above) "Following the recommended folder structure". The README (at the bottom) recommends putting things in Once I added the |
We could probably check for existence in the loader, prior to trying to open the file? I think that is the point at which things error in the unhelpful way any how. I'd certainly be happy to discuss and would welcome help on a PR. Additionally, from the sounds of things, maybe we should just update the README suggested paths to reflect the defaults in the rake to reduce confusion? |
Hello,
Following the recommended folder structure and some example json schema's (auto generated) I cannot run prmd example rake tasks
The text was updated successfully, but these errors were encountered: