Camping now comes with a sessioning class, checked in tonight. To get sessions working for your application: 1. require ''camping/session'' 2. include Camping::Session in your application''s toplevel module. 3. In your application''s create method, add a call to Camping::Models::Schema.create_schema 4. Throughout your application, use the @state method like a hash to store your application''s data. You can see a practical example in the examples/blog/blog.rb app: require ''camping/session'' Camping.goes :Blog module Blog include Camping::Session end ... module Blog::Controllers class Add def get unless @state.user_id.blank? @user = User.find @state.user_id @post = Post.new end render :add end end ... def Blog.create Camping::Models::Session.create_schema unless Blog::Models::Post.table_exists? ActiveRecord::Schema.define(&Blog::Models.schema) end end This is also covered at the wiki: code.whytheluckystiff.net/camping/wiki/CampingSessions. _why
Hello. I got the following warnings while installing camping with gem under windows (xp). Is this OK? C:\Documents and Settings\Maurizio\My Documents\ruby>gem install camping --inclu de-dependencies Attempting local installation of ''camping'' Local gem file not found: camping*.gem Attempting remote installation of ''camping'' Successfully installed camping-1.3 Successfully installed markaby-0.3 Successfully installed builder-2.0.0 Successfully installed metaid-1.0 Installing RDoc documentation for camping-1.3... lib/camping-unabridged.rb:578:32: Couldn''t find Base. Assuming it''s a module Installing RDoc documentation for markaby-0.3... c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:25: warning: already initialized constant FONTS c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:235: warning: already initialized constant STYLE c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:335: warning: already initialized constant FILE_PAGE c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:384: warning: already initialized constant CLASS_PAGE c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:604: warning: already initialized constant METHOD_LIST c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:621: warning: already initialized constant BODY c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:649: warning: already initialized constant FR_INDEX_BODY c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:675: warning: already initialized constant FILE_INDEX c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:677: warning: already initialized constant CLASS_INDEX c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:678: warning: already initialized constant METHOD_INDEX c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/html.rb:704: warning: already initialized constant INDEX c:/ruby/lib/ruby/1.8/rdoc/generators/template/html/one_page_html.rb:76: warning: already initialized constant CONTENTS_XML Installing RDoc documentation for builder-2.0.0... Thanks. --M On 2/21/06, why the lucky stiff <why at whytheluckystiff.net> wrote:> Camping now comes with a sessioning class, checked in tonight. > > To get sessions working for your application: > > 1. require ''camping/session'' > 2. include Camping::Session in your application''s toplevel module. > 3. In your application''s create method, add a call to > Camping::Models::Schema.create_schema > 4. Throughout your application, use the @state method like a hash to > store your application''s data. > > You can see a practical example in the examples/blog/blog.rb app: > > require ''camping/session'' > > Camping.goes :Blog > > module Blog > include Camping::Session > end > > ... > > module Blog::Controllers > class Add > def get > unless @state.user_id.blank? > @user = User.find @state.user_id > @post = Post.new > end > render :add > end > end > > ... > > def Blog.create > Camping::Models::Session.create_schema > unless Blog::Models::Post.table_exists? > ActiveRecord::Schema.define(&Blog::Models.schema) > end > end > > This is also covered at the wiki: > code.whytheluckystiff.net/camping/wiki/CampingSessions. > > _why > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > rubyforge.org/mailman/listinfo/camping-list >
Maurizio Balestrieri wrote:> Hello. > > I got the following warnings while installing camping with gem under > windows (xp). > Is this OK? >Sure, it''s fine. RDoc is being noisy. I''ll see what I can do about quieting things down. _why
Thank you! I''d take advantage of having you "on line" and ask you a question, which maybe could be useful for other on this list too: would you suggest/consider creating a publicly accessible and potentially (and hopefully) trafficked application with camping rather than with rails? I mean, how far can I go with camping? Could I successfully develop an application of the size of some well known rails applications like, for example, basecamp or instiki, in camping? What are the differences, in few words, between camping and rails? Sorry for being maybe too naive :) --M PS Consider I''m now beginning to learn ruby (and rails) and that I''ve some years experiences in programming (basic, c, awk, perl) albeit I could not be considered a professional programmer but rather an amateur programmer (because I do other things to earn a living). On 2/25/06, why the lucky stiff <why at whytheluckystiff.net> wrote:> Sure, it''s fine. RDoc is being noisy. I''ll see what I can do about > quieting things down.
Maurizio Balestrieri wrote:> I''d take advantage of having you "on line" and ask you a question, > which maybe could be useful for other on this list too: would you > suggest/consider creating a publicly accessible and potentially (and > hopefully) trafficked application with camping rather than with rails? > I mean, how far can I go with camping?At some point, I''d really like to have a site with some Camping apps for people to try out, sure. But you could write a blog in Camping and it would scale just fine with FastCGI. It would probably perform better than Rails in many situation, however Camping doesn''t have any caching built-in, so you can''t tune performance as much.> Could I successfully develop an application of the size of some well known rails applications like, for example, basecamp or instiki, in camping? What are the > differences, in few words, between camping and rails? >Basecamp''s probably too big for Camping. Instiki would probably work well in Camping, though. It''s smaller and it''s designed for distribution. See, this is the distinction: Rails is great for large web apps and commercial stuff which is hosted for general use by users all over the world. You don''t install Basecamp on your machine, you hit the Signals'' machines and use their app. Instiki, however, is designed for you to install and use on your machine. Camping is great for this kind of software. You download instiki.rb and run: camping instiki.rb. The bin/camping tool requires SQLite and takes care of setting up the database. _why
_why: Couldn''t you also migrate your Camping app to Rails, if needed. Camping is perfect from some of the utilities I''m writing now. Having all the logic nicely encapsulated in one file makes for very rapid development. If gets too big, will push out to respective model, controller, and view files (as you suggested). Since Camping uses ActiveRecord seems pretty easy to port to Rails if needed, or not... Camping rocks. I''m still trying to wrap my brain around some of your clever expressions. - Matt ________________________________ From: camping-list-bounces at rubyforge.org on behalf of why the lucky stiff Sent: Sat 2/25/2006 9:13 AM To: camping-list at rubyforge.org Subject: Re: + camping/session Maurizio Balestrieri wrote:> I''d take advantage of having you "on line" and ask you a question, > which maybe could be useful for other on this list too: would you > suggest/consider creating a publicly accessible and potentially (and > hopefully) trafficked application with camping rather than with rails? > I mean, how far can I go with camping?At some point, I''d really like to have a site with some Camping apps for people to try out, sure. But you could write a blog in Camping and it would scale just fine with FastCGI. It would probably perform better than Rails in many situation, however Camping doesn''t have any caching built-in, so you can''t tune performance as much.> Could I successfully develop an application of the size of some well known rails applications like, for example, basecamp or instiki, in camping? What are the > differences, in few words, between camping and rails? >Basecamp''s probably too big for Camping. Instiki would probably work well in Camping, though. It''s smaller and it''s designed for distribution. See, this is the distinction: Rails is great for large web apps and commercial stuff which is hosted for general use by users all over the world. You don''t install Basecamp on your machine, you hit the Signals'' machines and use their app. Instiki, however, is designed for you to install and use on your machine. Camping is great for this kind of software. You download instiki.rb and run: camping instiki.rb. The bin/camping tool requires SQLite and takes care of setting up the database. _why _______________________________________________ Camping-list mailing list Camping-list at rubyforge.org rubyforge.org/mailman/listinfo/camping-list -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5170 bytes Desc: not available Url : rubyforge.org/pipermail/camping-list/attachments/20060225/f70f11ad/attachment-0001.bin
Matt Bowen wrote:> Having all the logic nicely encapsulated in one file makes for very rapid development. If gets too big, will push out to respective model, controller, and view files (as you suggested).Yeah, sure, for most things you''ll end up moving to Rails. It''s so easy that someone could probably write a camping2rails script that would do it for you. It''s kind of a sticky subject because Rails is pretty easy to prototype with anyway. So the Rails/Camping connection isn''t really a better/worse situation, it''s just a "what foot is it easier for you to start off on" sort of situation. However, Hoodwink''d is an example of a larger Camping sort of thing and, man, I''m surprised, it''s worked out pretty well actually. _why