Is there something like Praxis::Application.reload!

14 views
Skip to first unread message

Nick Gorbikoff

unread,
Oct 22, 2014, 11:27:20 PM10/22/14
to praxis-...@googlegroups.com
Hi
Is there something like Praxis::Application.reload! ? Similar to rails console  reload to be used in praxis console? 

Josep Blanquer

unread,
Oct 23, 2014, 1:46:58 PM10/23/14
to Nick Gorbikoff, praxis-...@googlegroups.com
no, there isn't a .reload capability

I guess everybody might have a different view on how to deal with these things but, what's your use case?

For example, I use "guard" when developing an app on top Praxis. Everything will reload as soon as I change or add any test. Both unit and functional.

If I want to play/fix with an app that is racked up, I use "shotgun" so it'll fork an load a new app on every request.

If I want to do drop int he console, I usually add a "console" like below, and simply restart it on my own if I need to reload (but that's really not the flow I use...I use the first one above if I need to reload/change stuff)

desc "console"
task :console => :environment do
  require 'pry'
  require 'pry-byebug'
  pry
end


Cheers,

Josep M.

On Wed, Oct 22, 2014 at 8:27 PM, Nick Gorbikoff <nick.go...@gmail.com> wrote:
Hi
Is there something like Praxis::Application.reload! ? Similar to rails console  reload to be used in praxis console? 

--
You received this message because you are subscribed to the Google Groups "praxis-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to praxis-suppor...@googlegroups.com.
To post to this group, send email to praxis-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/praxis-support/ed2b59a6-375a-43dd-a285-f8ef0f6ba78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nick Gorbikoff

unread,
Oct 23, 2014, 3:04:33 PM10/23/14
to praxis-...@googlegroups.com, nick.go...@gmail.com
I use guard to run tests and to touch tmp/restart.txt and do an inital curl request to localhost  ( I use passenger as my dev server)   - that takes about 6-7 seconds right now. 
The main  reason I need reload is to mimic my rails workflow. I often make changes to classes while developing, especially when developing models or service objects with complicated logic and it helps to be able to play with changes in the console  rather than exit and start console every time I need this. Nobody disputes the tenets of TDD but sometimes it's just easier to play with stuff before even writing a test. 
For instance I'm writing an LdapUser class based of ActiveLdap to connect to MS ActiveDirectory for user authentication and details lookup. Since there is no official support or docs for integrating ActiveLdap with ActiveDirectory - I end up playing a lot in the console to test different ideas, and trying to figure out what code does. 

Right now " exit out of pry  then bundle exec rake praxis:console takes about 7 seconds ( I moved about 50 AR models from my rails app into praxis), once I start moving my sevice objects and other stuff, it will only keep growing. 
Reply all
Reply to author
Forward
0 new messages