Stephan W. wrote:
/vendor is for non-app specific code from others – /lib for your
non-app specific code.
I don’t know what you’re doing, but my (first) suggestion was you could
put the code you are developing straight into any model/controller
you’re working with, as long as you know how to extract it into the lib
directory when you’re done.
If Rick Olsen’s recommendation works out for you, maybe you don’t need
to go through this, and you should first properly hook up the changes
you’re applying to Comatose. (“Don’t know what you’re doing.”)
Thanks for the suggestions Rick, and Stephan. I’m not trying to be
secretive about what I’m doing, just thought being generic would make it
applicable to a wider audience…guess it’s obfuscating the issue.
Basically I have the Comatose plugin, and I want to adjust how the
Comatose::Page model, and the ComatoseController controller work a bit,
but I don’t want to edit those files directly (breaking future upgrade
paths).
My thinking was to create my own app-specific overrides in the /lib
folder, where for each case I just open up the class, fiddle with it how
I need, and that’s it, eg:
lib/comatose_page_overrides.rb
This is intended to override/extend:
vendor/plugins/comatose/lib/comatose/page.rb
class Comatose::Page
def some_new_method
# do my new stuff
end
def some_existing_method
# override how plugin works by default
end
end
My overrides are working how I want, it’s just the need to restart the
server with each change I make to the file. The difficulty I’m having is
somehow related to the fact that rails plugins aren’t reloaded
automatically on each call, yet I want my overrides to be reloaded
automatically.
I’ll look into the stuff you both mention though and see if I can figure
it out
Cameron