GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Greetings! (and sorry for the numerous edits of this pull request - there were some "technical" problems).
Here's a small update from a fan of spira. I believe that the hook (callback) methods generally should be made private (and thus provide for a good API design), but your current implementation calls them only if they are public. I've fixed that and wrote a spec to detect that "bug".
Also added a couple of refactoring commits - while generally making the code more readable (IMHO) and DRY, they were initially aimed at fixing a bug, which was surfaced by abrisse's introduction of Spira::Types::Data property type. Since I cannot submit a spec for it without merging abrisse's pull request, here's a way to detect it until the merge occurs:
property :birthday, :predicate => FOAF.birthday, :type => Date
bob = Person.new("bob")
The exception is raised at this point, because :birthday property is nil, but Spira::Resource#repository_for_attributes attempts to instantiate it, ultimately calling Date.new(nil).
hook (callback) methods are called even when they are private
refactored and sped-up Spira::Resource#_update!
partial refactoring of Spira::Resource#repository_for_attributes
+1 for this pull. I have done similar modification to repository_for_attributes to avoid the raise you point out but only on my local dev branch.
Hope this pull will be included soon in the official spira branch.
This project has moved to ruby-rdf/spira. If this pull request is still relevant, please rebase and resubmit it over there.