I was having some issue getting the class variables in Camping::Session to work with some old apps, so I''ve changed @@state_secret to a method. module Blog include Camping::Session def state_secret; "kxxxx" end end Also, merged some of zimbatm''s patches. And trying to revive the Junebug wiki <http://github.com/why/junebug> since it''s still my favorite one. Oh and Passenger is working with Camping 2.0. You just use `run Blog` in your config.ru (following everything else in the latest Passenger docs.) Best to wait until they release 1.1.0 gems. _why
I like Junebug alot ... maybe I''ll try to add bluecloth to it or something besides straight textile. On Tue, Jun 3, 2008 at 1:11 AM, _why <why at whytheluckystiff.net> wrote:> I was having some issue getting the class variables in > Camping::Session to work with some old apps, so I''ve changed > @@state_secret to a method. > > module Blog > include Camping::Session > def state_secret; "kxxxx" end > end > > Also, merged some of zimbatm''s patches. And trying to revive the > Junebug wiki <http://github.com/why/junebug> since it''s still my > favorite one. > > Oh and Passenger is working with Camping 2.0. You just use > `run Blog` in your config.ru (following everything else in the > latest Passenger docs.) Best to wait until they release 1.1.0 gems. > > _why > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20080603/b83b95d7/attachment.html>
Great! If we clean up the documentation, are we then ready for 2.0? The only thing I want now is the catch(:halt) in #service, so we can do stuff like this: module Example module Helpers def require_login! unless @state.user_id redirect Login throw :halt end end end module Controllers class List < R ''/list'' def get require_login! # do stuff end end end end (It''s already in my repo, just pull from judofyr/master) On Tue, Jun 3, 2008 at 10:11 AM, _why <why at whytheluckystiff.net> wrote:> > I was having some issue getting the class variables in > Camping::Session to work with some old apps, so I''ve changed > @@state_secret to a method. > > module Blog > include Camping::Session > def state_secret; "kxxxx" end > end > > Also, merged some of zimbatm''s patches. And trying to revive the > Junebug wiki <http://github.com/why/junebug> since it''s still my > favorite one. > > Oh and Passenger is working with Camping 2.0. You just use > `run Blog` in your config.ru (following everything else in the > latest Passenger docs.) Best to wait until they release 1.1.0 gems. > > _why > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list-- Magnus Holm
I second this! On 05/06/2008, at 12:12 AM, Magnus Holm wrote:> Great! If we clean up the documentation, are we then ready for 2.0? > > The only thing I want now is the catch(:halt) in #service, so we can > do stuff > like this: > > module Example > module Helpers > def require_login! > unless @state.user_id > redirect Login > throw :halt > end > end > end > > module Controllers > class List < R ''/list'' > def get > require_login! > # do stuff > end > end > end > end > > (It''s already in my repo, just pull from judofyr/master) > > On Tue, Jun 3, 2008 at 10:11 AM, _why <why at whytheluckystiff.net> > wrote: >> >> I was having some issue getting the class variables in >> Camping::Session to work with some old apps, so I''ve changed >> @@state_secret to a method. >> >> module Blog >> include Camping::Session >> def state_secret; "kxxxx" end >> end >> >> Also, merged some of zimbatm''s patches. And trying to revive the >> Junebug wiki <http://github.com/why/junebug> since it''s still my >> favorite one. >> >> Oh and Passenger is working with Camping 2.0. You just use >> `run Blog` in your config.ru (following everything else in the >> latest Passenger docs.) Best to wait until they release 1.1.0 gems. >> >> _why >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > > -- > Magnus Holm > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
Why do you need that if you can just skip calling super if the authentication fails? On 4 jun 2008, at 16:30, Bluebie, Jenna wrote:> I second this! > > On 05/06/2008, at 12:12 AM, Magnus Holm wrote: > >> Great! If we clean up the documentation, are we then ready for 2.0? >> >> The only thing I want now is the catch(:halt) in #service, so we >> can do stuff >> like this:
No no, this is something we can use in helper methods, so writing ''render :blah'' for instance would render it and terminate the thingo... instead of having to be the very last thing in the controller method or be prefixed with return. Though I don''t mind this too much, it would open possibilities for some nifty things. On 05/06/2008, at 6:23 AM, Julian Tarkhanov wrote:> Why do you need that if you can just skip calling super if the > authentication fails? > > On 4 jun 2008, at 16:30, Bluebie, Jenna wrote: > >> I second this! >> >> On 05/06/2008, at 12:12 AM, Magnus Holm wrote: >> >>> Great! If we clean up the documentation, are we then ready for 2.0? >>> >>> The only thing I want now is the catch(:halt) in #service, so we >>> can do stuff >>> like this: > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
On Jun 4, 2008, at 4:46 PM, Bluebie, Jenna wrote:> No no, this is something we can use in helper methods, so writing > ''render :blah'' for instance would render it and terminate the > thingo... instead of having to be the very last thing in the > controller method or be prefixed with return. Though I don''t mind > this too much, it would open possibilities for some nifty things. >I almost expected this behavior. I''ve certainly wondered where my view went when I did something after rendering. Aria Stewart aredridel at nbtsc.org
I''ve had that annoyance too. Another thing I really want to see fixed in 2.0 is when the controller returns something that isn''t a string, ignore it! Don''t throw exceptions about thingo not being a stringo. Writing methods called using xmlhttprequests, sometimes I don''t return anything, so the last method ends up returning a number or something and breaks everything. I shouldn''t have to put return ''''; at the end of a controller method to make it work. On 05/06/2008, at 8:58 AM, Aria Stewart wrote:> > On Jun 4, 2008, at 4:46 PM, Bluebie, Jenna wrote: > >> No no, this is something we can use in helper methods, so writing >> ''render :blah'' for instance would render it and terminate the >> thingo... instead of having to be the very last thing in the >> controller method or be prefixed with return. Though I don''t mind >> this too much, it would open possibilities for some nifty things. >> > > I almost expected this behavior. I''ve certainly wondered where my > view went when I did something after rendering. > > Aria Stewart > aredridel at nbtsc.org > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
would be great to do something simple like that for authenticating controller methods. been using something like this to authenticate get and post in one sweep. module Controllers module AuthenticationHelper def self.included(base) base.module_eval do def get(*a) end unless method_defined? :get def post(*a) end unless method_defined? :post alias_method :__post__, :post alias_method :__get__ , :get def get(*args) on_authenticated do __get__(*args) end end def post(*args) on_authenticated do __post__(*args) end end end end private def on_authenticated unless @state.blank? or @state.user_id.nil? yield else @state.link_back=@env.REQUEST_URI redirect(Login) end end end end # included at the end class Add def get;end def post;end include AuthenticationHelper end