Closed dchandekstark closed 9 years ago
@dchandekstark you may be prematurely optimizing. That autoload thing isn't scheduled until ruby 3.0 which is scheduled to be delivered in 22 years: https://bugs.ruby-lang.org/versions/5
@dchandekstark also it seems like that issue was fixed: https://bugs.ruby-lang.org/issues/5653#note-28
@jcoyne I try to plan ahead. :) autoload does make things a little cleaner, also makes manual listing a more palatable option, at least until we can sort out the naming issues.
Lazy-loading will be implemented in https://github.com/ruby-rdf/rdf-vocab.
@gkellogg @acoburn We initially adopted different naming conventions and file organization from RDF.rb, which creates a few challenges. Given what we have now, I think the path of least resistance is to key off the config file. This would require adding non-generated vocabs to the config (#39), and probably making the keys reflect the require path relative to
lib/rdf-vocab/vocab
(e.g., changing "premis" to "premis/v1"). We also have one vocab file (fcrepo3) which include several vocab classes in a module, and we might have to break those out into separate source files.As to the specific lazy loading strategy, I'm inclined to try
const_missing
rather thanautoload
, since Matz has declared the latter deprecated (https://www.ruby-forum.com/topic/3036681#1032667).