hi list, This is my first time here, my first time reading seriously something about Camping. I need to create a very simple web server for serving only .xml files, extracted from a sqlite database with some queries. I''m quite comfortable with Ruby on Rails, but it would be too much for this project, so I''ve decided to take a look at Camping or Sinatra, not sure what''s the best option. There would be only 5 tables, 100 rows per table, and the idea is fetch data from a device like iPad/iPhone/iPod, update it and persist the changes in the server. The data transfer would be in plain .xml files, no html or css. Any helpful directions would be great :-) thanks, r.
Hi again, I''m trying to install Camping on my OS X but I''m getting some errors: MacBook-ProII-2:~ montx$ gem -v 1.3.5 MacBook-ProII-2:~ montx$ sudo gem install camping WARNING: RubyGems 1.2+ index not found for: http://gems.rubyforge.org/ RubyGems will revert to legacy indexes degrading performance. Bulk updating Gem source index for: http://gems.rubyforge.org/ ERROR: While executing gem ... (Gem::RemoteSourceException) Error fetching remote gem cache: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://gems.rubyforge.org/yaml) What are the minimums ? I''m using in my developer machine Ruby On Rails and Ruby without any problems, with some gems. thanks, regards, r.
On 8jun, 2010, at 09:18 , Raimon Fernandez wrote:> Hi again, > > > I''m trying to install Camping on my OS X but I''m getting some errors: > > MacBook-ProII-2:~ montx$ gem -v > 1.3.5 > > MacBook-ProII-2:~ montx$ sudo gem install camping > WARNING: RubyGems 1.2+ index not found for: > http://gems.rubyforge.org/ > > RubyGems will revert to legacy indexes degrading performance. > Bulk updating Gem source index for: http://gems.rubyforge.org/ > ERROR: While executing gem ... (Gem::RemoteSourceException) > Error fetching remote gem cache: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://gems.rubyforge.org/yaml) > > > What are the minimums ? > > I''m using in my developer machine Ruby On Rails and Ruby without any problems, with some gems.I want to add that I''m not behind any proxy or firewall, and that I could successfully download/and install some other gems in this machine without any problems, but no, no, I can''t install nothing from gem. It seems like a time-out problem: I have this remote sources: - REMOTE SOURCES: - http://gems.rubyforge.org/ - http://gems.github.com MacBook-ProII-2:~ montx$ mmm, a ping to http://gems.rubyforge.org/ => cannot resolve http://gems.rubyforge.org/: Unknown host MacBook-ProII-2:~ montx$ sudo gem sources -r http://gems.rubyforge.org/ http://gems.rubyforge.org/ removed from sources now I have only - http://gems.github.com MacBook-ProII-2:~ montx$ sudo gem install camping ERROR: could not find gem camping locally or in a repository MacBook-ProII-2:~ montx$ any idea ? thanks, r.> > thanks, > > regards, > > r. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hey Raimon, Try a `sudo gem update --system` first to upgrade to the latest RubyGems // Magnus Holm On Tue, Jun 8, 2010 at 10:59, Raimon Fernandez <coder at montx.com> wrote:> > On 8jun, 2010, at 09:18 , Raimon Fernandez wrote: > >> Hi again, >> >> >> I''m trying to install Camping on my OS X but I''m getting some errors: >> >> MacBook-ProII-2:~ montx$ gem -v >> 1.3.5 >> >> MacBook-ProII-2:~ montx$ sudo gem install camping >> WARNING: ?RubyGems 1.2+ index not found for: >> ? ? ? http://gems.rubyforge.org/ >> >> RubyGems will revert to legacy indexes degrading performance. >> Bulk updating Gem source index for: http://gems.rubyforge.org/ >> ERROR: ?While executing gem ... (Gem::RemoteSourceException) >> ? ?Error fetching remote gem cache: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://gems.rubyforge.org/yaml) >> >> >> What are the minimums ? >> >> I''m using in my developer machine Ruby On Rails and Ruby without any problems, with some gems. > > > I want to add that I''m not behind any proxy or firewall, and that I could successfully download/and install some other gems in this machine without any problems, but no, no, I can''t install nothing from gem. > > It seems like a time-out problem: > > I have this remote sources: > > ?- REMOTE SOURCES: > ? ? - http://gems.rubyforge.org/ > ? ? - http://gems.github.com > MacBook-ProII-2:~ montx$ > > mmm, a ping to http://gems.rubyforge.org/ => cannot resolve http://gems.rubyforge.org/: Unknown host > > > MacBook-ProII-2:~ montx$ sudo gem sources -r http://gems.rubyforge.org/ > http://gems.rubyforge.org/ removed from sources > > now I have only ? ? ?- http://gems.github.com > > MacBook-ProII-2:~ montx$ sudo gem install camping > ERROR: ?could not find gem camping locally or in a repository > MacBook-ProII-2:~ montx$ > > any idea ? > > thanks, > > > r. > > > > > >> >> thanks, >> >> regards, >> >> r. >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi Raimon I''m having the same problem with rubygems.org - won''t even load in a browser. In February there was a bit of a change: http://update.gemcutter.org/2010/02/20/rubygems-org-move-complete.html Fro current status see the tweets here: http://twitter.com/gemcutter and Magnus'' Temporary fix: add "72.4.120.124 rubygems.org" to your /etc/hosts Otherwise, get the bleeding edge version: sudo gem install camping --source http://gems.judofyr.net/ Dave Everitt> I want to add that I''m not behind any proxy or firewall, and that I > could successfully download/and install some other gems in this > machine without any problems, but no, no, I can''t install nothing > from gem. > > It seems like a time-out problem: > > I have this remote sources: > > - REMOTE SOURCES: > - http://gems.rubyforge.org/ > - http://gems.github.com > MacBook-ProII-2:~ montx$ > > mmm, a ping to http://gems.rubyforge.org/ => cannot resolve http:// > gems.rubyforge.org/: Unknown host > > > MacBook-ProII-2:~ montx$ sudo gem sources -r http:// > gems.rubyforge.org/ > http://gems.rubyforge.org/ removed from sources > > now I have only - http://gems.github.com > > MacBook-ProII-2:~ montx$ sudo gem install camping > ERROR: could not find gem camping locally or in a repository > MacBook-ProII-2:~ montx$
Hmm - trying to help here too as I have the same problem. $ sudo gem update --system ERROR: http://rubygems.org does not appear to be a repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) SocketError: getaddrinfo: No address associated with nodename (http://rubygems.org/yaml) Was fine about 2 weeks ago. For now, I just advised Raimon to fetch it from: --source http://gems.judofyr.net/ ? Dave Everitt> Hey Raimon, > > Try a `sudo gem update --system` first to upgrade to the latest > RubyGems > > // Magnus Holm
On 8jun, 2010, at 11:34 , Magnus Holm wrote:> Hey Raimon, > > Try a `sudo gem update --system` first to upgrade to the latest RubyGems > > // Magnus HolmMacBook-ProII-2:~ montx$ sudo gem update --system Password: Updating RubyGems Nothing to update MacBook-ProII-2:~ montx$ thanks, r.
Hi Dave, On 8jun, 2010, at 11:52 , Dave Everitt wrote:> Hi Raimon > > I''m having the same problem with rubygems.org - won''t even load in a browser.ok,> In February there was a bit of a change: > http://update.gemcutter.org/2010/02/20/rubygems-org-move-complete.html > > Fro current status see the tweets here: > http://twitter.com/gemcutterthanks for the info!> and Magnus'' Temporary fix: > add "72.4.120.124 rubygems.org" to your /etc/hostsok, done! mmm, I''ve removed the rubygems.org from the remote sources and now I can''t add it again MacBook-ProII-2:~ montx$ sudo gem sources -a http://rubygems.org Error fetching http://rubygems.org: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://rubygems.org/specs.4.8.gz) MacBook-ProII-2:~ montx$ sudo gem sources -a http://rubygems.org Error fetching http://rubygems.org: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://rubygems.org/specs.4.8.gz)> Otherwise, get the bleeding edge version: > sudo gem install camping --source http://gems.judofyr.net/maybe later ! :-) thanks, regards, r.
On 8jun, 2010, at 11:52 , Dave Everitt wrote:> Otherwise, get the bleeding edge version: > sudo gem install camping --source http://gems.judofyr.net/ok, I want to focus on Camping so I''ve installed the edge version without any problems :-) the problem is when I try to execute some example: acBook-ProII-2:Camping montx$ camping homepage.rb /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:27: uninitialized constant Rack::Server (NameError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' from /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:6 from /usr/bin/camping:19:in `load'' from /usr/bin/camping:19 I''ve installed Rack as I use it with some of my Ruby On Rails and Thin projects ... Maybe the Rack::Server is not the same ? Should I install more dependencies ? thanks, r.
I believe Rack::Server was introduced in one of the later Rack versions. Looks like I forgot to update the version dependency. Are you able to install the latest rack (gem install rack), or is rubygems.org fully down? // Magnus Holm On Tue, Jun 8, 2010 at 12:25, Raimon Fernandez <coder at montx.com> wrote:> > On 8jun, 2010, at 11:52 , Dave Everitt wrote: > >> Otherwise, get the bleeding edge version: >> sudo gem install camping --source http://gems.judofyr.net/ > > ok, I want to focus on Camping so I''ve installed the edge version without any problems :-) > > the problem is when I try to execute some example: > > acBook-ProII-2:Camping montx$ camping homepage.rb > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:27: uninitialized constant Rack::Server (NameError) > ? ? ? ?from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' > ? ? ? ?from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' > ? ? ? ?from /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:6 > ? ? ? ?from /usr/bin/camping:19:in `load'' > ? ? ? ?from /usr/bin/camping:19 > > > I''ve installed Rack as I use it with some of my Ruby On Rails and Thin projects ... > > Maybe the Rack::Server is not the same ? > > Should I install more dependencies ? > > thanks, > > r. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi Raimon, Sounds like maybe you don''t have Rack. Do you have the following gem installed? - rack (1.1.0) - markaby (0.5) [will not work with a higher version] - activerecord (any version) - activesupport (any version) If not gem install them and let us know. Philippe On 6/8/2010 4:25 AM, Raimon Fernandez wrote:> On 8jun, 2010, at 11:52 , Dave Everitt wrote: > > >> Otherwise, get the bleeding edge version: >> sudo gem install camping --source http://gems.judofyr.net/ >> > ok, I want to focus on Camping so I''ve installed the edge version without any problems :-) > > the problem is when I try to execute some example: > > acBook-ProII-2:Camping montx$ camping homepage.rb > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:27: uninitialized constant Rack::Server (NameError) > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' > from /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:6 > from /usr/bin/camping:19:in `load'' > from /usr/bin/camping:19 > > > I''ve installed Rack as I use it with some of my Ruby On Rails and Thin projects ... > > Maybe the Rack::Server is not the same ? > > Should I install more dependencies ? > > thanks, > > r. > _______________________________________________ > 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/20100608/b79fccc3/attachment.html>
On 8jun, 2010, at 12:30 , Magnus Holm wrote:> I believe Rack::Server was introduced in one of the later Rack > versions. Looks like I forgot to update the version dependency. Are > you able to install the latest rack (gem install rack), or is > rubygems.org fully down? >I think is fully down because I can''t install nothing from gem install ... thanks, r.> > // Magnus Holm
Rubygems still down. Rack 1.1 on Github: http://github.com/rack/rack.git - DaveE> Are you able to install the latest rack (gem install rack), or is > rubygems.org fully down?
Hi Philippe, On 8jun, 2010, at 12:53 , Philippe Monnet wrote:> Hi Raimon, > > Sounds like maybe you don''t have Rack. > Do you have the following gem installed? > - rack (1.1.0) > - markaby (0.5) [will not work with a higher version] > - activerecord (any version) > - activesupport (any version) > If not gem install them and let us know.those are my gems: *** LOCAL GEMS *** actionmailer (2.3.5, 2.3.4, 2.2.2, 1.3.6) actionpack (2.3.5, 2.3.4, 2.2.2, 1.13.6) actionwebservice (1.2.6) activerecord (2.3.5, 2.3.4, 2.2.2, 1.15.6) activeresource (2.3.5, 2.3.4, 2.2.2) activesupport (2.3.5, 2.3.4, 2.2.2, 1.4.4) acts_as_ferret (0.4.3) builder (2.1.2) camping (2.0.392) capistrano (2.5.2) cgi_multipart_eof_fix (2.5.0) daemons (1.0.10) dnssd (0.6.0) eventmachine (0.12.10) fastthread (1.0.1) fcgi (0.8.7) ferret (0.11.6) gem_plugin (0.2.3) highline (1.5.0) hpricot (0.6.164) libxml-ruby (1.1.3, 1.1.2) mongrel (1.1.5) needle (1.3.0) net-scp (1.0.1) net-sftp (2.0.4, 2.0.1, 1.1.1) net-ssh (2.0.19, 2.0.4, 1.1.4) net-ssh-gateway (1.0.0) pg (0.8.0) prawn (0.7.1) prawn-core (0.7.1) prawn-layout (0.7.1) prawn-security (0.7.1) rack (1.0.1) rails (2.3.5, 2.3.4, 2.2.2, 1.2.6) rake (0.8.3) RedCloth (4.1.1) ruby-openid (2.1.7, 2.1.2) ruby-yadis (0.3.4) rubynode (0.1.5) rubyzip (0.9.1) sqlite3-ruby (1.2.5, 1.2.4) termios (0.9.4) thin (1.2.5) will_paginate (2.3.11) xmpp4r (0.4) I have to update rack and install markaby, but I can''t, more info in the next post related. thanks, r.> > Philippe > > On 6/8/2010 4:25 AM, Raimon Fernandez wrote: >> >> On 8jun, 2010, at 11:52 , Dave Everitt wrote: >> >> >>> Otherwise, get the bleeding edge version: >>> sudo gem install camping --source http://gems.judofyr.net/ >>> >> ok, I want to focus on Camping so I''ve installed the edge version without any problems :-) >> >> the problem is when I try to execute some example: >> >> acBook-ProII-2:Camping montx$ camping homepage.rb >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:27: uninitialized constant Rack::Server (NameError) >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' >> from /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:6 >> from /usr/bin/camping:19:in `load'' >> from /usr/bin/camping:19 >> >> >> I''ve installed Rack as I use it with some of my Ruby On Rails and Thin projects ... >> >> Maybe the Rack::Server is not the same ? >> >> Should I install more dependencies ? >> >> thanks, >> >> r. >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> >> > > _______________________________________________ > 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/20100608/a8c5bfb0/attachment.html>
On 8jun, 2010, at 13:19 , Dave Everitt wrote:> Rubygems still down. Rack 1.1 on Github: > > http://github.com/rack/rack.gitthanks, How I cann add this repository to gem ? Currently I have: - REMOTE SOURCES: - http://gems.rubyforge.org/ I want to add: MacBook-ProII-2:~ montx$ sudo gem sources -a http://github.com Password: Error fetching http://github.com: bad response Not Found 404 (http://github.com/specs.4.8.gz) And my /etc/hosts ... 72.4.120.124 rubygems.org 72.4.120.124 gems.rubyforge.org but when I try MacBook-ProII-2:~ montx$ sudo gem install rack it can''t find the server or package ... thanks, r.> > - DaveE > >> Are you able to install the latest rack (gem install rack), or is rubygems.org fully down? > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi Raimon Github is no longer maintaining this but the gems are still there, so try: --source http://gems.github.com DaveE>> Rubygems still down. Rack 1.1 on Github: >> >> http://github.com/rack/rack.git > > thanks, > > How I cann add this repository to gem ? > > Currently I have: > > - REMOTE SOURCES: > - http://gems.rubyforge.org/ > > I want to add: > > MacBook-ProII-2:~ montx$ sudo gem sources -a http://github.com > Password: > Error fetching http://github.com: > bad response Not Found 404 (http://github.com/specs.4.8.gz)
Hi David, On 8jun, 2010, at 15:38 , Dave Everitt wrote:> Hi Raimon > > Github is no longer maintaining this but the gems are still there, so try: > > --source http://gems.github.comdo you mean using like this ? MacBook-ProII-2:~ montx$ sudo gem install rack --source http://gems.github.com ERROR: could not find gem rack locally or in a repository MacBook-ProII-2:~ montx$ thanks, r.
Hi Raimon I did mean that, but the rubygems site is back up... and it looks like they''re making progress as the error messages are changing. So maybe try again tomorrow? Dave> Hi David, > > On 8jun, 2010, at 15:38 , Dave Everitt wrote: > >> Hi Raimon >> >> Github is no longer maintaining this but the gems are still there, >> so try: >> >> --source http://gems.github.com > > do you mean using like this ? > > MacBook-ProII-2:~ montx$ sudo gem install rack --source http:// > gems.github.com > ERROR: could not find gem rack locally or in a repository > MacBook-ProII-2:~ montx$ > > thanks, > > r.
Camping with reststop ought will make serving the xml files easy enough. The example on github ought to get you started: http://github.com/camping/reststop Dave On Tue, Jun 8, 2010 at 2:25 AM, Raimon Fernandez <coder at montx.com> wrote:> hi list, > > > This is my first time here, my first time reading seriously something about Camping. > > I need to create a very simple web server for serving only .xml files, extracted from a sqlite database with some queries. > > I''m quite comfortable with Ruby on Rails, but it would be too much for this project, so I''ve decided to take a look at Camping or Sinatra, not sure what''s the best option. > > There would be only 5 tables, 100 rows per table, and the idea is fetch data from a device like iPad/iPhone/iPod, update it and persist the changes in the server. The data transfer would be in plain .xml files, no html or css. > > Any helpful directions would be great > > :-) > > thanks, > > r. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave
Hi David, On 8jun, 2010, at 16:59 , Dave Everitt wrote:> Hi Raimon > > I did mean that, but the rubygems site is back up... and it looks like they''re making progress as the error messages are changing.ok> So maybe try again tomorrow?If I have to wait, I''ll wait ... what can I do ? :-) I was ''excited'' to do a demo tomorrow morning with camping and the devices but ... thanks! regards, r.> > Dave > >> Hi David, >> >> On 8jun, 2010, at 15:38 , Dave Everitt wrote: >> >>> Hi Raimon >>> >>> Github is no longer maintaining this but the gems are still there, so try: >>> >>> --source http://gems.github.com >> >> do you mean using like this ? >> >> MacBook-ProII-2:~ montx$ sudo gem install rack --source http://gems.github.com >> ERROR: could not find gem rack locally or in a repository >> MacBook-ProII-2:~ montx$ >> >> thanks, >> >> r. > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Raimon apologies, rack is not listed in the Github gems (http:// gems.github.com/list.html). BUT (still trying to get around the rubygems.org gem server issues and get you started with Camping) you can try this mirror: sudo gem install rack --source http://chneukirchen.org/releases/gems/ see: http://docs.github.com/rack/rack/ (FYI the actual rack 1.1 gem is mirrored here: http:// chneukirchen.org/releases/gems/gems/ but the above install should get it) Dave> MacBook-ProII-2:~ montx$ sudo gem install rack --source http:// > gems.github.com >> > ERROR: could not find gem rack locally or in a repository
Hi Dave, On 8jun, 2010, at 17:47 , Dave Everitt wrote:> Raimon > > apologies, rack is not listed in the Github gems (http://gems.github.com/list.html). > > BUT (still trying to get around the rubygems.org gem server issues and get you started with Camping) you can try this mirror: > > sudo gem install rack --source http://chneukirchen.org/releases/gems/ok, installed and running, now I''m a Camper!!! :-) Sure I''ll come back here with more questions about Camping ... thanks all! regards, r.> see: > http://docs.github.com/rack/rack/ > (FYI the actual rack 1.1 gem is mirrored here: http://chneukirchen.org/releases/gems/gems/ but the above install should get it) > > Dave > >> MacBook-ProII-2:~ montx$ sudo gem install rack --source http://gems.github.com >>> >> ERROR: could not find gem rack locally or in a repository > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi Dave, On 8jun, 2010, at 17:04 , David Susco wrote:> Camping with reststop ought will make serving the xml files easy > enough. The example on github ought to get you started: > > http://github.com/camping/reststopthanks ! reststop is also a gem for camping ? regards, r.
Hi Raimon - welcome, glad we got around the rubygems.org fail :-) - Dave Everitt>> sudo gem install rack --source http://chneukirchen.org/releases/gems/ > > ok, installed and running, now I''m a Camper!!! > > :-) > > Sure I''ll come back here with more questions about Camping ...
I don''t believe the gem has been updated to include Matt''s or Philippe''s latest changes. You could clone it from GitHub though and rake and install it yourself. Dave On Tue, Jun 8, 2010 at 11:55 AM, Raimon Fernandez <coder at montx.com> wrote:> Hi Dave, > > On 8jun, 2010, at 17:04 , David Susco wrote: > >> Camping with reststop ought will make serving the xml files easy >> enough. The example on github ought to get you started: >> >> http://github.com/camping/reststop > > thanks ! > > reststop is also a gem for camping ? > > regards, > > > > r. > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave
On 8jun, 2010, at 18:19 , Dave Everitt wrote:> Hi Raimon - welcome,thanks!> glad we got around the rubygems.org fail :-)hey, I need more workarounds ..... :-) I''m playing with Camping and the introduction found in http://camping.rubyforge.org/book/02_getting_started.html Now I''m reading the Reststop documentation for serving .xml data, and here comes again the same error: MacBook-ProII-2:~ montx$ sudo gem install restr Password: WARNING: RubyGems 1.2+ index not found for: http://gems.rubyforge.org/ RubyGems will revert to legacy indexes degrading performance. Bulk updating Gem source index for: http://gems.rubyforge.org/ ERROR: While executing gem ... (Gem::RemoteSourceException) Error fetching remote gem cache: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://gems.rubyforge.org/yaml) So the error is general, don''t know if I can just clone the git repository of restr and install it using ruby setup.rb thanks again for your help! regards, r.
Hi again, In Reststop docs they say a good example is the blog.rb, but their link is broken. Where I can find it ? thanks, regards, raimon
Hi Raimon> don''t know if I can just clone the git repository of restr and > install it using ruby setup.rbthat seems the best way, as David Susco suggested:>> I don''t believe the gem has been updated to include Matt''s or >> Philippe''s latest changes. You could clone it from GitHub though >> and rake and install it yourself.> So the error is generalIndeed. We have no control over rubygems.org :-) DaveE
On 8jun, 2010, at 18:43 , David Susco wrote:> I don''t believe the gem has been updated to include Matt''s or > Philippe''s latest changes. You could clone it from GitHub though and > rake and install it yourself.I think it requieres ''hoe'' and I can''t install without rubygems working or once again, find where the repo is and start digging again ... :-) MacBook-ProII-2:reststop montx$ sudo rake Rakefile (in /Users/montx/Documents/Camping/reststop) rake aborted! no such file to load -- hoe /Users/montx/Documents/Camping/reststop/rakefile:10 thanks! r.
2010/6/8, Raimon Fernandez <coder at montx.com>:> In Reststop docs they say a good example is the blog.rb, but their link is broken. > > Where I can find it ?It should come with the gem, in examples directory. You can also find it here: http://github.com/camping/camping/blob/master/examples/blog.rb -- Matma Rex - http://matma-rex.prv.pl/
Is the hoe gem installed? Dave On Tue, Jun 8, 2010 at 1:01 PM, Raimon Fernandez <coder at montx.com> wrote:> > On 8jun, 2010, at 18:43 , David Susco wrote: > >> I don''t believe the gem has been updated to include Matt''s or >> Philippe''s latest changes. You could clone it from GitHub though and >> rake and install it yourself. > > I think it requieres ''hoe'' and I can''t install without rubygems working or once again, find where the repo is and start digging again ... > > :-) > > MacBook-ProII-2:reststop montx$ sudo rake Rakefile > (in /Users/montx/Documents/Camping/reststop) > rake aborted! > no such file to load -- hoe > /Users/montx/Documents/Camping/reststop/rakefile:10 > > > thanks! > > r. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave
On 8jun, 2010, at 21:18 , David Susco wrote:> Is the hoe gem installed?no, the same error as before: Last login: Tue Jun 8 18:43:33 on ttys002 MacBook-ProII-2:~ montx$ sudo gem install hoe Password: ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) SocketError: getaddrinfo: nodename nor servname provided, or not known (http://gems.rubyforge.org/gems/json_pure-1.4.3.gem) MacBook-ProII-2:~ montx$ we have to wait ... thanks, r.> > Dave > > On Tue, Jun 8, 2010 at 1:01 PM, Raimon Fernandez <coder at montx.com> wrote: >> >> On 8jun, 2010, at 18:43 , David Susco wrote: >> >>> I don''t believe the gem has been updated to include Matt''s or >>> Philippe''s latest changes. You could clone it from GitHub though and >>> rake and install it yourself. >> >> I think it requieres ''hoe'' and I can''t install without rubygems working or once again, find where the repo is and start digging again ... >> >> :-) >> >> MacBook-ProII-2:reststop montx$ sudo rake Rakefile >> (in /Users/montx/Documents/Camping/reststop) >> rake aborted! >> no such file to load -- hoe >> /Users/montx/Documents/Camping/reststop/rakefile:10 >> >> >> thanks! >> >> r. >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > > -- > Dave > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
On 8jun, 2010, at 20:31 , Bartosz Dziewo?ski wrote:> 2010/6/8, Raimon Fernandez <coder at montx.com>: >> In Reststop docs they say a good example is the blog.rb, but their link is broken. >> >> Where I can find it ? > > It should come with the gem, in examples directory.oughhh, you''re right, it''s there.> You can also find it here: http://github.com/camping/camping/blob/master/examples/blog.rbthanks, raimon> > -- > Matma Rex - http://matma-rex.prv.pl/ > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi Bartosz, On 8jun, 2010, at 20:31 , Bartosz Dziewo?ski wrote:> It should come with the gem, in examples directory. You can also find > it here: http://github.com/camping/camping/blob/master/examples/blog.rbThis version doesn''t use reststop. The one that is included in the examples, it does, but has some errors: MacBook-ProII-2:examples montx$ camping blog.rb ** Starting Mongrel on 0.0.0.0:3301 !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: NameError: uninitialized constant Logger /Library/Ruby/Site/1.8/reststop.rb:43 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' /Users/montx/Documents/Camping/reststop/examples/blog.rb:32 /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load_apps'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:105:in `reload!'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:180:in `reload!'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `each'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `reload!'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:158:in `update'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:157:in `find_scripts'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:161:in `reload!'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:169:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' ... So I''ve added: require ''Logger'' and started again camping: MacBook-ProII-2:examples montx$ camping blog.rb ** Starting Mongrel on 0.0.0.0:3301 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:172: warning: already initialized constant VERSION /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:174: warning: already initialized constant ProgName /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:181: warning: already initialized constant DEBUG /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:182: warning: already initialized constant INFO /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:183: warning: already initialized constant WARN /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:184: warning: already initialized constant ERROR /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:185: warning: already initialized constant FATAL /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:186: warning: already initialized constant UNKNOWN /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:424: warning: already initialized constant SEV_LABEL /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:436: warning: already initialized constant Format /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:537: warning: already initialized constant SiD Creating RESTful controller for "posts" using Reststop pull version number here Creating RESTful controller for "comments" using Reststop pull version number here Creating RESTful controller for "sessions" using Reststop pull version number here 127.0.0.1 - - [09/Jun/2010 08:28:07] "GET / HTTP/1.1" 404 45 0.4875 And in the browser, I see: Camping problem! /not found and If I force the login: http://127.0.0.1:3301/login Plenty of errors again ... RuntimeError: Can''t find template _login (eval):16:in `camping_render'' /Library/Ruby/Site/1.8/reststop.rb:135:in `render'' /Users/montx/Documents/Camping/reststop/examples/blog.rb:101:in `get'' (eval):27:in `send'' (eval):27:in `camping_service'' (eval):27:in `catch'' (eval):27:in `camping_service'' /Library/Ruby/Site/1.8/reststop.rb:53:in `service'' (eval):38:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call'' (eval):42:in `call'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `call'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67:in `process'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38:in `run'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start'' /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start'' /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:9 /usr/bin/camping:19:in `load'' /usr/bin/camping:19 So, this versions is ''ready for test'' ???? :-) thanks, regards, raimon
Hi Raimon, I did a quick test this morning and it looks like some change in Camping after version 2.0 impacted RESTstop. By reverting to camping-2.0 I was able to run the blog example. I will need to investigate what the issue is. Also I realized that a couple things need to be done: a) publish a new version of the reststop gem (as the current one no longer matches the current camping/reststop project code on GitHub b) merge some of my changes from March re: the RESTR library and publish a new gem Philippe PS - eventually I will write a blog post on this ;-) On 6/9/2010 12:31 AM, Raimon Fernandez wrote:> Hi Bartosz, > > On 8jun, 2010, at 20:31 , Bartosz Dziewo?ski wrote: > > >> It should come with the gem, in examples directory. You can also find >> it here: http://github.com/camping/camping/blob/master/examples/blog.rb >> > This version doesn''t use reststop. > > The one that is included in the examples, it does, but has some errors: > > MacBook-ProII-2:examples montx$ camping blog.rb > ** Starting Mongrel on 0.0.0.0:3301 > !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: > NameError: uninitialized constant Logger > /Library/Ruby/Site/1.8/reststop.rb:43 > /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' > /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' > /Users/montx/Documents/Camping/reststop/examples/blog.rb:32 > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load_apps'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:105:in `reload!'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:180:in `reload!'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `each'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `reload!'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:158:in `update'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:157:in `find_scripts'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:161:in `reload!'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:169:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' > ... > > So I''ve added: > > require ''Logger'' > > and started again camping: > > MacBook-ProII-2:examples montx$ camping blog.rb > ** Starting Mongrel on 0.0.0.0:3301 > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:172: warning: already initialized constant VERSION > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:174: warning: already initialized constant ProgName > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:181: warning: already initialized constant DEBUG > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:182: warning: already initialized constant INFO > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:183: warning: already initialized constant WARN > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:184: warning: already initialized constant ERROR > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:185: warning: already initialized constant FATAL > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:186: warning: already initialized constant UNKNOWN > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:424: warning: already initialized constant SEV_LABEL > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:436: warning: already initialized constant Format > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:537: warning: already initialized constant SiD > Creating RESTful controller for "posts" using Reststop pull version number here > Creating RESTful controller for "comments" using Reststop pull version number here > Creating RESTful controller for "sessions" using Reststop pull version number here > 127.0.0.1 - - [09/Jun/2010 08:28:07] "GET / HTTP/1.1" 404 45 0.4875 > > And in the browser, I see: > > Camping problem! > /not found > > > and If I force the login: > > http://127.0.0.1:3301/login > > Plenty of errors again ... > > RuntimeError: Can''t find template _login > (eval):16:in `camping_render'' > /Library/Ruby/Site/1.8/reststop.rb:135:in `render'' > /Users/montx/Documents/Camping/reststop/examples/blog.rb:101:in `get'' > (eval):27:in `send'' > (eval):27:in `camping_service'' > (eval):27:in `catch'' > (eval):27:in `camping_service'' > /Library/Ruby/Site/1.8/reststop.rb:53:in `service'' > (eval):38:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call'' > (eval):42:in `call'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `call'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67:in `process'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38:in `run'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start'' > /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start'' > /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:9 > /usr/bin/camping:19:in `load'' > /usr/bin/camping:19 > > > > So, this versions is ''ready for test'' ???? > > :-) > > thanks, > > > regards, > > raimon > _______________________________________________ > 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/20100609/d49bd91e/attachment.html>
Hi Philippe, On 9jun, 2010, at 15:09 , Philippe Monnet wrote:> Hi Raimon, > > I did a quick test this morning and it looks like some change in Camping after version 2.0 impacted RESTstop. By reverting to camping-2.0 I was able to run the blog example. I will need to investigate what the issue is. Also I realized that a couple things need to be done: > a) publish a new version of the reststop gem (as the current one no longer matches the current camping/reststop project code on GitHub > b) merge some of my changes from March re: the RESTR library and publish a new gem > > Philippe > > PS - eventually I will write a blog post on this ;-)ok, uninstalled current camping 2.0.392 and installed the gem camping 2.0 and ... it''s working better as before :-) the default page is never found, but if I force for example the login, all is working fine :-) now I can focus on camping and how to send xml files instead of html thanks! regards, raimon> > On 6/9/2010 12:31 AM, Raimon Fernandez wrote: >> >> Hi Bartosz, >> >> On 8jun, 2010, at 20:31 , Bartosz Dziewo?ski wrote: >> >> >>> It should come with the gem, in examples directory. You can also find >>> it here: http://github.com/camping/camping/blob/master/examples/blog.rb >>> >> This version doesn''t use reststop. >> >> The one that is included in the examples, it does, but has some errors: >> >> MacBook-ProII-2:examples montx$ camping blog.rb >> ** Starting Mongrel on 0.0.0.0:3301 >> !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: >> NameError: uninitialized constant Logger >> /Library/Ruby/Site/1.8/reststop.rb:43 >> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' >> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' >> /Users/montx/Documents/Camping/reststop/examples/blog.rb:32 >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load_apps'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:105:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:180:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `each'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:158:in `update'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:157:in `find_scripts'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:161:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:169:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >> ... >> >> So I''ve added: >> >> require ''Logger'' >> >> and started again camping: >> >> MacBook-ProII-2:examples montx$ camping blog.rb >> ** Starting Mongrel on 0.0.0.0:3301 >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:172: warning: already initialized constant VERSION >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:174: warning: already initialized constant ProgName >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:181: warning: already initialized constant DEBUG >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:182: warning: already initialized constant INFO >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:183: warning: already initialized constant WARN >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:184: warning: already initialized constant ERROR >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:185: warning: already initialized constant FATAL >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:186: warning: already initialized constant UNKNOWN >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:424: warning: already initialized constant SEV_LABEL >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:436: warning: already initialized constant Format >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:537: warning: already initialized constant SiD >> Creating RESTful controller for "posts" using Reststop pull version number here >> Creating RESTful controller for "comments" using Reststop pull version number here >> Creating RESTful controller for "sessions" using Reststop pull version number here >> 127.0.0.1 - - [09/Jun/2010 08:28:07] "GET / HTTP/1.1" 404 45 0.4875 >> >> And in the browser, I see: >> >> Camping problem! >> /not found >> >> >> and If I force the login: >> >> http://127.0.0.1:3301/login >> >> Plenty of errors again ... >> >> RuntimeError: Can''t find template _login >> (eval):16:in `camping_render'' >> /Library/Ruby/Site/1.8/reststop.rb:135:in `render'' >> /Users/montx/Documents/Camping/reststop/examples/blog.rb:101:in `get'' >> (eval):27:in `send'' >> (eval):27:in `camping_service'' >> (eval):27:in `catch'' >> (eval):27:in `camping_service'' >> /Library/Ruby/Site/1.8/reststop.rb:53:in `service'' >> (eval):38:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call'' >> (eval):42:in `call'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67:in `process'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38:in `run'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:9 >> /usr/bin/camping:19:in `load'' >> /usr/bin/camping:19 >> >> >> >> So, this versions is ''ready for test'' ???? >> >> :-) >> >> thanks, >> >> >> regards, >> >> raimon >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > 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/20100609/64c4bab7/attachment-0001.html>
hey Philippe, thanks for raking care of the support on this. I''ve been badly neglecting my camping projects lately due to time constraints... let me know if there''s anything I can do to help with the reststop gem push (gemcutter/rubyforge access?) On 2010-06-09 8:17 AM, "Philippe Monnet" <ruby at monnet-usa.com> wrote: Hi Raimon, I did a quick test this morning and it looks like some change in Camping after version 2.0 impacted RESTstop. By reverting to camping-2.0 I was able to run the blog example. I will need to investigate what the issue is. Also I realized that a couple things need to be done: a) publish a new version of the reststop gem (as the current one no longer matches the current camping/reststop project code on GitHub b) merge some of my changes from March re: the RESTR library and publish a new gem Philippe PS - eventually I will write a blog post on this ;-) On 6/9/2010 12:31 AM, Raimon Fernandez wrote:> > Hi Bartosz, > > On 8jun, 2010, at 20:31 , Bartos..._______________________________________________ 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/20100609/b30b7ae9/attachment.html>
> PS - eventually I will write a blog post on this ;-)with a link on the Camping Github wiki :-)
Hi Matt, I just forked restr and added cookie support. Could you pull my changes and republish the gem? On 6/9/2010 10:21 AM, Matt Zukowski wrote:> > hey Philippe, thanks for raking care of the support on this. I''ve been > badly neglecting my camping projects lately due to time constraints... > let me know if there''s anything I can do to help with the reststop gem > push (gemcutter/rubyforge access?) > >> On 2010-06-09 8:17 AM, "Philippe Monnet" <ruby at monnet-usa.com >> <mailto:ruby at monnet-usa.com>> wrote: >> >> Hi Raimon, >> >> I did a quick test this morning and it looks like some change in >> Camping after version 2.0 impacted RESTstop. By reverting to >> camping-2.0 I was able to run the blog example. I will need to >> investigate what the issue is. Also I realized that a couple things >> need to be done: >> a) publish a new version of the reststop gem (as the current one no >> longer matches the current camping/reststop project code on GitHub >> b) merge some of my changes from March re: the RESTR library and >> publish a new gem >> >> Philippe >> >> PS - eventually I will write a blog post on this ;-) >> >> >> >> On 6/9/2010 12:31 AM, Raimon Fernandez wrote: >> > >> > Hi Bartosz, >> > >> > On 8jun, 2010, at 20:31 , Bartos... >> >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org <mailto:Camping-list at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > 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/20100609/712f1ac6/attachment.html>
Matt, Do you have the gemspec file for RESTStop? Could you add it to GitHub and I can update the version number and push it to RubyGems? I figured out what the issue was. With Camping 2.0.392 (Tilt support), the render method looks for view methods in either the Views module or in the views folder (for example to find the haml version of the view). Since in RESTstop the Views module has 2 submodules: HTML and XML, I needed to adapt the new lookup method of Camping to have a chance to look in the HTML module first and then delegate to the base Camping method. I have committed my changes and tested them with an updated version of blog.rb. Philippe On 6/9/2010 7:09 AM, Philippe Monnet wrote:> Hi Raimon, > > I did a quick test this morning and it looks like some change in > Camping after version 2.0 impacted RESTstop. By reverting to > camping-2.0 I was able to run the blog example. I will need to > investigate what the issue is. Also I realized that a couple things > need to be done: > a) publish a new version of the reststop gem (as the current one no > longer matches the current camping/reststop project code on GitHub > b) merge some of my changes from March re: the RESTR library and > publish a new gem > > Philippe > > PS - eventually I will write a blog post on this ;-) > > On 6/9/2010 12:31 AM, Raimon Fernandez wrote: >> Hi Bartosz, >> >> On 8jun, 2010, at 20:31 , Bartosz Dziewo?ski wrote: >> >> >>> It should come with the gem, in examples directory. You can also find >>> it here:http://github.com/camping/camping/blob/master/examples/blog.rb >>> >> This version doesn''t use reststop. >> >> The one that is included in the examples, it does, but has some errors: >> >> MacBook-ProII-2:examples montx$ camping blog.rb >> ** Starting Mongrel on 0.0.0.0:3301 >> !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: >> NameError: uninitialized constant Logger >> /Library/Ruby/Site/1.8/reststop.rb:43 >> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' >> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' >> /Users/montx/Documents/Camping/reststop/examples/blog.rb:32 >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load_apps'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:105:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:180:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `each'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:158:in `update'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:157:in `find_scripts'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:161:in `reload!'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:169:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >> ... >> >> So I''ve added: >> >> require ''Logger'' >> >> and started again camping: >> >> MacBook-ProII-2:examples montx$ camping blog.rb >> ** Starting Mongrel on 0.0.0.0:3301 >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:172: warning: already initialized constant VERSION >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:174: warning: already initialized constant ProgName >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:181: warning: already initialized constant DEBUG >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:182: warning: already initialized constant INFO >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:183: warning: already initialized constant WARN >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:184: warning: already initialized constant ERROR >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:185: warning: already initialized constant FATAL >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:186: warning: already initialized constant UNKNOWN >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:424: warning: already initialized constant SEV_LABEL >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:436: warning: already initialized constant Format >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:537: warning: already initialized constant SiD >> Creating RESTful controller for "posts" using Reststop pull version number here >> Creating RESTful controller for "comments" using Reststop pull version number here >> Creating RESTful controller for "sessions" using Reststop pull version number here >> 127.0.0.1 - - [09/Jun/2010 08:28:07] "GET / HTTP/1.1" 404 45 0.4875 >> >> And in the browser, I see: >> >> Camping problem! >> /not found >> >> >> and If I force the login: >> >> http://127.0.0.1:3301/login >> >> Plenty of errors again ... >> >> RuntimeError: Can''t find template _login >> (eval):16:in `camping_render'' >> /Library/Ruby/Site/1.8/reststop.rb:135:in `render'' >> /Users/montx/Documents/Camping/reststop/examples/blog.rb:101:in `get'' >> (eval):27:in `send'' >> (eval):27:in `camping_service'' >> (eval):27:in `catch'' >> (eval):27:in `camping_service'' >> /Library/Ruby/Site/1.8/reststop.rb:53:in `service'' >> (eval):38:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call'' >> (eval):42:in `call'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `call'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67:in `process'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'' >> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38:in `run'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start'' >> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start'' >> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:9 >> /usr/bin/camping:19:in `load'' >> /usr/bin/camping:19 >> >> >> >> So, this versions is ''ready for test'' ???? >> >> :-) >> >> thanks, >> >> >> regards, >> >> raimon >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > 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/20100609/c5803e5b/attachment-0001.html>
Raimon, I have committed a bunch of code fixes and added a wiki page to reststop on GitHub. If you want to upgrade you will need to do the following: 1. Get the latest source (we''ll update the gem soon) 2. Use the new blog.rb 3. If you have customized it or created your own service you will also need to replace the ::Base module with the contents from the Blog::Base (there is a new alias statement and a new method definition) Testing is easy if you use IRB + restr + TcpTrace. See the new wiki page for details. Philippe On 6/9/2010 9:19 AM, Raimon Fernandez wrote:> Hi Philippe, > > > On 9jun, 2010, at 15:09 , Philippe Monnet wrote: > >> Hi Raimon, >> >> I did a quick test this morning and it looks like some change in >> Camping after version 2.0 impacted RESTstop. By reverting to >> camping-2.0 I was able to run the blog example. I will need to >> investigate what the issue is. Also I realized that a couple things >> need to be done: >> a) publish a new version of the reststop gem (as the current one no >> longer matches the current camping/reststop project code on GitHub >> b) merge some of my changes from March re: the RESTR library and >> publish a new gem >> >> Philippe >> >> PS - eventually I will write a blog post on this ;-) > > ok, > > uninstalled current camping 2.0.392 and installed the gem camping 2.0 > and ... > > it''s working better as before :-) > > the default page is never found, but if I force for example the login, > all is working fine > > :-) > > now I can focus on camping and how to send xml files instead of html > > thanks! > > regards, > > raimon > > >> >> On 6/9/2010 12:31 AM, Raimon Fernandez wrote: >>> Hi Bartosz, >>> >>> On 8jun, 2010, at 20:31 , Bartosz Dziewo?ski wrote: >>> >>> >>>> It should come with the gem, in examples directory. You can also find >>>> it here:http://github.com/camping/camping/blob/master/examples/blog.rb >>>> >>> This version doesn''t use reststop. >>> >>> The one that is included in the examples, it does, but has some errors: >>> >>> MacBook-ProII-2:examples montx$ camping blog.rb >>> ** Starting Mongrel on 0.0.0.0:3301 >>> !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: >>> NameError: uninitialized constant Logger >>> /Library/Ruby/Site/1.8/reststop.rb:43 >>> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' >>> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' >>> /Users/montx/Documents/Camping/reststop/examples/blog.rb:32 >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load_apps'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:105:in `reload!'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:180:in `reload!'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `each'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `reload!'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:158:in `update'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:157:in `find_scripts'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:161:in `reload!'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:169:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >>> ... >>> >>> So I''ve added: >>> >>> require ''Logger'' >>> >>> and started again camping: >>> >>> MacBook-ProII-2:examples montx$ camping blog.rb >>> ** Starting Mongrel on 0.0.0.0:3301 >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:172: warning: already initialized constant VERSION >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:174: warning: already initialized constant ProgName >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:181: warning: already initialized constant DEBUG >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:182: warning: already initialized constant INFO >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:183: warning: already initialized constant WARN >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:184: warning: already initialized constant ERROR >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:185: warning: already initialized constant FATAL >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:186: warning: already initialized constant UNKNOWN >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:424: warning: already initialized constant SEV_LABEL >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:436: warning: already initialized constant Format >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:537: warning: already initialized constant SiD >>> Creating RESTful controller for "posts" using Reststop pull version number here >>> Creating RESTful controller for "comments" using Reststop pull version number here >>> Creating RESTful controller for "sessions" using Reststop pull version number here >>> 127.0.0.1 - - [09/Jun/2010 08:28:07] "GET / HTTP/1.1" 404 45 0.4875 >>> >>> And in the browser, I see: >>> >>> Camping problem! >>> /not found >>> >>> >>> and If I force the login: >>> >>> http://127.0.0.1:3301/login >>> >>> Plenty of errors again ... >>> >>> RuntimeError: Can''t find template _login >>> (eval):16:in `camping_render'' >>> /Library/Ruby/Site/1.8/reststop.rb:135:in `render'' >>> /Users/montx/Documents/Camping/reststop/examples/blog.rb:101:in `get'' >>> (eval):27:in `send'' >>> (eval):27:in `camping_service'' >>> (eval):27:in `catch'' >>> (eval):27:in `camping_service'' >>> /Library/Ruby/Site/1.8/reststop.rb:53:in `service'' >>> (eval):38:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call'' >>> (eval):42:in `call'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `call'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67:in `process'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'' >>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38:in `run'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start'' >>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start'' >>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:9 >>> /usr/bin/camping:19:in `load'' >>> /usr/bin/camping:19 >>> >>> >>> >>> So, this versions is ''ready for test'' ???? >>> >>> :-) >>> >>> thanks, >>> >>> >>> regards, >>> >>> raimon >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org <mailto:Camping-list at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > 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/20100609/d5b77140/attachment.html>
Hi Philippe, I''m ''out'' for some days, I''ll give it a try ASAP thanks, r. On 10jun, 2010, at 01:12 , Philippe Monnet wrote:> Raimon, > > I have committed a bunch of code fixes and added a wiki page to reststop on GitHub. > If you want to upgrade you will need to do the following: > Get the latest source (we''ll update the gem soon) > Use the new blog.rb > If you have customized it or created your own service you will also need to replace the ::Base module with the contents from the Blog::Base (there is a new alias statement and a new method definition) > Testing is easy if you use IRB + restr + TcpTrace. See the new wiki page for details. > > Philippe > > On 6/9/2010 9:19 AM, Raimon Fernandez wrote: >> >> Hi Philippe, >> >> >> On 9jun, 2010, at 15:09 , Philippe Monnet wrote: >> >>> Hi Raimon, >>> >>> I did a quick test this morning and it looks like some change in Camping after version 2.0 impacted RESTstop. By reverting to camping-2.0 I was able to run the blog example. I will need to investigate what the issue is. Also I realized that a couple things need to be done: >>> a) publish a new version of the reststop gem (as the current one no longer matches the current camping/reststop project code on GitHub >>> b) merge some of my changes from March re: the RESTR library and publish a new gem >>> >>> Philippe >>> >>> PS - eventually I will write a blog post on this ;-) >> >> ok, >> >> uninstalled current camping 2.0.392 and installed the gem camping 2.0 and ... >> >> it''s working better as before :-) >> >> the default page is never found, but if I force for example the login, all is working fine >> >> :-) >> >> now I can focus on camping and how to send xml files instead of html >> >> thanks! >> >> regards, >> >> raimon >> >> >>> >>> On 6/9/2010 12:31 AM, Raimon Fernandez wrote: >>>> >>>> Hi Bartosz, >>>> >>>> On 8jun, 2010, at 20:31 , Bartosz Dziewo?ski wrote: >>>> >>>> >>>>> It should come with the gem, in examples directory. You can also find >>>>> it here: http://github.com/camping/camping/blob/master/examples/blog.rb >>>>> >>>> This version doesn''t use reststop. >>>> >>>> The one that is included in the examples, it does, but has some errors: >>>> >>>> MacBook-ProII-2:examples montx$ camping blog.rb >>>> ** Starting Mongrel on 0.0.0.0:3301 >>>> !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: >>>> NameError: uninitialized constant Logger >>>> /Library/Ruby/Site/1.8/reststop.rb:43 >>>> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' >>>> /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'' >>>> /Users/montx/Documents/Camping/reststop/examples/blog.rb:32 >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in `load_apps'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:105:in `reload!'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:180:in `reload!'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `each'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in `reload!'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:158:in `update'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:157:in `find_scripts'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:161:in `reload!'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:169:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >>>> ... >>>> >>>> So I''ve added: >>>> >>>> require ''Logger'' >>>> >>>> and started again camping: >>>> >>>> MacBook-ProII-2:examples montx$ camping blog.rb >>>> ** Starting Mongrel on 0.0.0.0:3301 >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:172: warning: already initialized constant VERSION >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:174: warning: already initialized constant ProgName >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:181: warning: already initialized constant DEBUG >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:182: warning: already initialized constant INFO >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:183: warning: already initialized constant WARN >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:184: warning: already initialized constant ERROR >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:185: warning: already initialized constant FATAL >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:186: warning: already initialized constant UNKNOWN >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:424: warning: already initialized constant SEV_LABEL >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:436: warning: already initialized constant Format >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:537: warning: already initialized constant SiD >>>> Creating RESTful controller for "posts" using Reststop pull version number here >>>> Creating RESTful controller for "comments" using Reststop pull version number here >>>> Creating RESTful controller for "sessions" using Reststop pull version number here >>>> 127.0.0.1 - - [09/Jun/2010 08:28:07] "GET / HTTP/1.1" 404 45 0.4875 >>>> >>>> And in the browser, I see: >>>> >>>> Camping problem! >>>> /not found >>>> >>>> >>>> and If I force the login: >>>> >>>> http://127.0.0.1:3301/login >>>> >>>> Plenty of errors again ... >>>> >>>> RuntimeError: Can''t find template _login >>>> (eval):16:in `camping_render'' >>>> /Library/Ruby/Site/1.8/reststop.rb:135:in `render'' >>>> /Users/montx/Documents/Camping/reststop/examples/blog.rb:101:in `get'' >>>> (eval):27:in `send'' >>>> (eval):27:in `camping_service'' >>>> (eval):27:in `catch'' >>>> (eval):27:in `camping_service'' >>>> /Library/Ruby/Site/1.8/reststop.rb:53:in `service'' >>>> (eval):38:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call'' >>>> (eval):42:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `call'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67:in `process'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'' >>>> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38:in `run'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start'' >>>> /Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start'' >>>> /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:9 >>>> /usr/bin/camping:19:in `load'' >>>> /usr/bin/camping:19 >>>> >>>> >>>> >>>> So, this versions is ''ready for test'' ???? >>>> >>>> :-) >>>> >>>> thanks, >>>> >>>> >>>> regards, >>>> >>>> raimon >>>> _______________________________________________ >>>> Camping-list mailing list >>>> Camping-list at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/camping-list >>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >> >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > 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/20100611/42f3d1c4/attachment-0001.html>
Hi Philippe, On 10jun, 2010, at 01:12 , Philippe Monnet wrote:> Raimon, > > I have committed a bunch of code fixes and added a wiki page to reststop on GitHub. > If you want to upgrade you will need to do the following: > Get the latest source (we''ll update the gem soon)How I should install from the source code ? I''ve just clone the git page: 77-208-180-31:Camping montx$ git clone http://github.com/camping/reststop.git Once I have the source code downloaded, should I use this ? 77-208-180-31:reststop montx$ ruby setup.rb I''m having always the same error when I start blog.rb with camping: 77-208-180-31:examples montx$ camping blog.rb ** Starting Mongrel on 0.0.0.0:3301 !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: NameError: undefined method `lookup'' for module `Blog::Base'' /Users/montx/Documents/Camping/reststop/examples/blog.rb:47 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:80:in `load_apps'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:167:in `update'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:161:in `map'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:161:in `update'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:51:in `find_scripts'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:149:in `reload!'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:144:in `start'' /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/camping:97 /usr/bin/camping:19:in `load'' /usr/bin/camping:19 !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb, see backtrace above> Use the new blog.rbI suppose the new one is the one that''s in git> If you have customized it or created your own service you will also need to replace the ::Base module with the contents from the Blog::Base (there is a new alias statement and a new method definition)this should be related to the problem I have ...> Testing is easy if you use IRB + restr + TcpTrace. See the new wiki page for details.ok, thanks again, raimon -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100612/74ca5ff4/attachment.html>
? Hi Raimon, ? Yes to install RESTstop, run ruby setup.rb - the gem will then appear in your gems folder. (I have not been able to publish the gem yet) ? It looks like you don''t have the latest version of camping so you can either: ? a) gem install camping --source http://gems.judofyr.net ? b) or clone the current camping repository and do a ruby setup.rb ? (The lookup method is a new Camping method) ? Philippe ? On June 12, 2010 at 10:33 AM Raimon Fernandez <coder at montx.com> wrote:> Hi Philippe, > > On 10jun, 2010, at 01:12 , Philippe Monnet wrote: > > > Raimon, > > > > I have committed a bunch of code fixes and added a wiki page to reststop on > > GitHub. > > If you want to upgrade you will need to do the following: > > Get the latest source (we''ll update the gem soon) > How I should install from the source code ? > > I''ve just clone the git page: > > 77-208-180-31:Camping montx$ git clone http://github.com/camping/reststop.git > > Once I have the source code downloaded, should I use this ? > > 77-208-180-31:reststop montx$ ruby setup.rb > > I''m having always the same error when I start blog.rb with camping: > > 77-208-180-31:examples montx$ camping blog.rb > ** Starting Mongrel on 0.0.0.0:3301 > !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: > NameError: undefined method `lookup'' for module `Blog::Base'' > /Users/montx/Documents/Camping/reststop/examples/blog.rb:47 > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/g > ems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in > `load_without_new_constant_marking'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/g > ems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/g > ems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in > `new_constants_in'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/g > ems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:80:in > `load_apps'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:167:in > `update'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:161:in > `map'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:161:in > `update'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:51:in > `find_scripts'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:149:in > `reload!'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:144:in > `start'' > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/camping:97 > /usr/bin/camping:19:in `load'' > /usr/bin/camping:19 > !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb, see > backtrace above > > > > > > > Use the new blog.rb > I suppose the new one is the one that''s in git > > > >? If you have customized it or created your own service you will also need to > >replace the ::Base module with the contents from the Blog::Base (there is a > >new alias statement and a new method definition) > this should be related to the problem I have ... > > > > Testing is easy if you use IRB + restr + TcpTrace. See the new wiki page for > > details. > > ok, > > thanks again, > > raimon >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100612/de455de2/attachment.html>
Philippe, On 12jun, 2010, at 14:40 , ruby at monnet-usa.com wrote:> > Hi Raimon, > > Yes to install RESTstop, run ruby setup.rb - the gem will then appear in your gems folder. > (I have not been able to publish the gem yet) > > It looks like you don''t have the latest version of camping so you can either: > a) gem install camping --source http://gems.judofyr.net > b) or clone the current camping repository and do a ruby setup.rb > > (The lookup method is a new Camping method)yes, that was the issue ... now is running, thanks again, regards, r.> > Philippe > > On June 12, 2010 at 10:33 AM Raimon Fernandez <coder at montx.com> wrote: > > > Hi Philippe, > > > > On 10jun, 2010, at 01:12 , Philippe Monnet wrote: > > > > > Raimon, > > > > > > I have committed a bunch of code fixes and added a wiki page to reststop on GitHub. > > > If you want to upgrade you will need to do the following: > > > Get the latest source (we''ll update the gem soon) > > How I should install from the source code ? > > > > I''ve just clone the git page: > > > > 77-208-180-31:Camping montx$ git clone http://github.com/camping/reststop.git > > > > Once I have the source code downloaded, should I use this ? > > > > 77-208-180-31:reststop montx$ ruby setup.rb > > > > I''m having always the same error when I start blog.rb with camping: > > > > 77-208-180-31:examples montx$ camping blog.rb > > ** Starting Mongrel on 0.0.0.0:3301 > > !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb: > > NameError: undefined method `lookup'' for module `Blog::Base'' > > /Users/montx/Documents/Camping/reststop/examples/blog.rb:47 > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'' > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'' > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'' > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:80:in `load_apps'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:167:in `update'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:161:in `map'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/reloader.rb:161:in `update'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:51:in `find_scripts'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:149:in `reload!'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/../lib/camping/server.rb:144:in `start'' > > /Library/Ruby/Gems/1.8/gems/camping-2.0/bin/camping:97 > > /usr/bin/camping:19:in `load'' > > /usr/bin/camping:19 > > !! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb, see backtrace above > > > > > > > > > > > > > Use the new blog.rb > > I suppose the new one is the one that''s in git > > > > > > > If you have customized it or created your own service you will also need to replace the ::Base module with the contents from the Blog::Base (there is a new alias statement and a new method definition) > > this should be related to the problem I have ... > > > > > > > Testing is easy if you use IRB + restr + TcpTrace. See the new wiki page for details. > > > > ok, > > > > thanks again, > > > > raimon > > > _______________________________________________ > 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/20100614/3eb40da3/attachment-0001.html>
Hey Raimon, I see that you''ve been experimenting with Camping and Reststop lately, and just thought I should chime in a bit. You definitely don''t *need* Reststop in order to achieve what you want, so it might be a good idea to just leave Reststop until it gets a little more robust. Let''s see how we can tackle your problem with Camping only: For serving XML, you can use Builder (http://builder.rubyforge.org/). Here''s a little helper for you: require ''camping'' require ''builder'' Camping.goes :App module App # We include the Views module so we can call them as methods. include Views module Helpers def xml(name) # We''ll need to send this as text/xml @headers["Content-Type"] = "text/xml" result = String.new # The builder takes a `target` where the XML will end up builder = Builder::XmlMarkup.new(:target => result, :indent => 2) # Generates a <?xml version="1.0" encoding="UTF-8" ?> builder.instruct! # Calls the method you sent in, passing in the builder as an argument send(name, builder) # Return the restult result end end end ---- If you for instance want to generate this XML: <posts> <post title="Post title">Content of post</post> </posts> You would have the following view: module App::Views def posts(xml) xml.posts do @posts.each do |post| xml.post(post.content, :title => post.title) end end end end And if you want this XML: <?xml version="1.0" encoding="UTF-8"?> <posts> <post> <title>Hiya</title> <content>Hey</content> </post> </posts> You have this view: module App::Views def posts(xml) xml.posts do @posts.each do |post| xml.post do xml.title(post.title) xml.content(post.content) end end end end end ----- You render the XML in the controller like this: module App::Controllers class Index def get # The view has access to this variable @posts = Post.all # Calls the helper, which in turn calls the view xml :posts end end end ---- That''s (hopefully) the simplest way to generate XML with Camping. You still need to create a model to store/retrieve the data. Before we can help you here, we need to know a few things: Is it going to fetch data from a specific place, or should it create its own database (from scratch)? Any specific database you want to use? Here''s a Pastie with all the code: http://pastie.org/1008983 (Should work on any version of Camping). // Magnus Holm On Tue, Jun 8, 2010 at 08:25, Raimon Fernandez <coder at montx.com> wrote:> hi list, > > > This is my first time here, my first time reading seriously something about Camping. > > I need to create a very simple web server for serving only .xml files, extracted from a sqlite database with some queries. > > I''m quite comfortable with Ruby on Rails, but it would be too much for this project, so I''ve decided to take a look at Camping or Sinatra, not sure what''s the best option. > > There would be only 5 tables, 100 rows per table, and the idea is fetch data from a device like iPad/iPhone/iPod, update it and persist the changes in the server. The data transfer would be in plain .xml files, no html or css. > > Any helpful directions would be great > > :-) > > thanks, > > r. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Something''s not right with your rubygems install.... maybe try `gem update --system` first? On Tue, Jun 8, 2010 at 3:33 PM, Raimon Fernandez <coder at montx.com> wrote:> > On 8jun, 2010, at 21:18 , David Susco wrote: > > > Is the hoe gem installed? > > no, the same error as before: > > Last login: Tue Jun 8 18:43:33 on ttys002 > MacBook-ProII-2:~ montx$ sudo gem install hoe > Password: > ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) > SocketError: getaddrinfo: nodename nor servname provided, or not known ( > http://gems.rubyforge.org/gems/json_pure-1.4.3.gem) > MacBook-ProII-2:~ montx$ > > > we have to wait ... > > thanks, > > r. > > > > > Dave > > > > On Tue, Jun 8, 2010 at 1:01 PM, Raimon Fernandez <coder at montx.com> > wrote: > >> > >> On 8jun, 2010, at 18:43 , David Susco wrote: > >> > >>> I don''t believe the gem has been updated to include Matt''s or > >>> Philippe''s latest changes. You could clone it from GitHub though and > >>> rake and install it yourself. > >> > >> I think it requieres ''hoe'' and I can''t install without rubygems working > or once again, find where the repo is and start digging again ... > >> > >> :-) > >> > >> MacBook-ProII-2:reststop montx$ sudo rake Rakefile > >> (in /Users/montx/Documents/Camping/reststop) > >> rake aborted! > >> no such file to load -- hoe > >> /Users/montx/Documents/Camping/reststop/rakefile:10 > >> > >> > >> thanks! > >> > >> r. > >> _______________________________________________ > >> Camping-list mailing list > >> Camping-list at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/camping-list > >> > > > > > > > > -- > > Dave > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > _______________________________________________ > 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/20100617/a8f188a0/attachment.html>
P.S. latest version of reststop with Philippe''s changes has been pushed to gemcutter... I am told it now works with the latest version of camping, but haven''t had a chance to try it myself. On Thu, Jun 17, 2010 at 5:12 PM, Matt Zukowski <matt at roughest.net> wrote:> Something''s not right with your rubygems install.... maybe try `gem update > --system` first? > > > On Tue, Jun 8, 2010 at 3:33 PM, Raimon Fernandez <coder at montx.com> wrote: > >> >> On 8jun, 2010, at 21:18 , David Susco wrote: >> >> > Is the hoe gem installed? >> >> no, the same error as before: >> >> Last login: Tue Jun 8 18:43:33 on ttys002 >> MacBook-ProII-2:~ montx$ sudo gem install hoe >> Password: >> ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) >> SocketError: getaddrinfo: nodename nor servname provided, or not known >> (http://gems.rubyforge.org/gems/json_pure-1.4.3.gem) >> MacBook-ProII-2:~ montx$ >> >> >> we have to wait ... >> >> thanks, >> >> r. >> >> > >> > Dave >> > >> > On Tue, Jun 8, 2010 at 1:01 PM, Raimon Fernandez <coder at montx.com> >> wrote: >> >> >> >> On 8jun, 2010, at 18:43 , David Susco wrote: >> >> >> >>> I don''t believe the gem has been updated to include Matt''s or >> >>> Philippe''s latest changes. You could clone it from GitHub though and >> >>> rake and install it yourself. >> >> >> >> I think it requieres ''hoe'' and I can''t install without rubygems working >> or once again, find where the repo is and start digging again ... >> >> >> >> :-) >> >> >> >> MacBook-ProII-2:reststop montx$ sudo rake Rakefile >> >> (in /Users/montx/Documents/Camping/reststop) >> >> rake aborted! >> >> no such file to load -- hoe >> >> /Users/montx/Documents/Camping/reststop/rakefile:10 >> >> >> >> >> >> thanks! >> >> >> >> r. >> >> _______________________________________________ >> >> Camping-list mailing list >> >> Camping-list at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/camping-list >> >> >> > >> > >> > >> > -- >> > Dave >> > _______________________________________________ >> > Camping-list mailing list >> > Camping-list at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/camping-list >> > >> >> >> _______________________________________________ >> 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/20100617/e27a844f/attachment.html>
Hi Magnus, On 17jun, 2010, at 21:04 , Magnus Holm wrote:> Hey Raimon, > > I see that you''ve been experimenting with Camping and Reststop lately, > and just thought I should chime in a bit. > > You definitely don''t *need* Reststop in order to achieve what you > want, so it might be a good idea to just leave Reststop until it gets > a little more robust. Let''s see how we can tackle your problem with > Camping only:Thanks for your code. It''s true that if I can do what I want with fewer tools/gems, it''s a better starter, and once I''m confident I can go further.> That''s (hopefully) the simplest way to generate XML with Camping.yes!> You still need to create a model to store/retrieve the data. Before we > can help you here, we need to know a few things: Is it going to fetch > data from a specific place, or should it create its own database (from > scratch)? Any specific database you want to use?Not sure yet, but maybe Sqlite or PostgreSQL. Normally I use PostgreSQL for all of my RoR projects, but in this case Sqlite would be simpler. The initial data will come from some xml files but I can update the database from another file with Ruby code. In some examples of Camping they just created the database but I couldn''t find where they are storing it ... So, the best option is to provide to Camping an existing SQLite database.> Here''s a Pastie with all the code: http://pastie.org/1008983 (Should > work on any version of Camping).thanks, it works and it''s very simple :-) Now I''m playing with your code and examples, thanks again! regards, raimon
Rubygems.org was playing up recently (gems.rubyforge.org forwards to it - see previous posts), and this looks like the same issue... Dave E.> Something''s not right with your rubygems install.... maybe try `gem > update --system` first?
On 18jun, 2010, at 10:25 , Dave Everitt wrote:> Rubygems.org was playing up recently (gems.rubyforge.org forwards to it - see previous posts), and this looks like the same issue... Dave E. > >> Something''s not right with your rubygems install.... maybe try `gem update --system` first?yes, now it''s working ok ... thanks, r.
On 17jun, 2010, at 21:04 , Magnus Holm wrote:> > That''s (hopefully) the simplest way to generate XML with Camping. > > You still need to create a model to store/retrieve the data. Before we > can help you here, we need to know a few things: Is it going to fetch > data from a specific place, or should it create its own database (from > scratch)? Any specific database you want to use? > > Here''s a Pastie with all the code: http://pastie.org/1008983 (Should > work on any version of Camping).I''m trying to adapt your pastie to use a sqlite databse, but I''m having some errors that I can''t see ... Here''s a Pastie with all code: http://pastie.org/1009797 I''m just trying to create with code a simple table called Persons with some fields but ... :-) Also, I can''t find where is creating the database ... thanks, regards, r.
Yeah, people always get a little confused because you don''t need to define your database when you''re using bin/camping (it has a default SQLite database at ~/.camping.db). I also see that there''s some old, database code here; we definitely need to update our documentation (yes, I''m working on it!) First of all, the table name should be "list_people" (since "people" is the plural to "person" and the table names are always in lowercase), but you should rather do `create_table Person.table_name` and `drop_table Person.table_name` because then you don''t need to think about it at all :-) Secondly, you only need this in order to create the database: def List.create List::Models.create_schema end Then it will use a SQLite database at ~/.camping.db (as long as you start it with `camping list.rb`). This is perfect for just testing things out (you can also run `camping -C list.rb` to get an IRB console). Please note that if you only run `camping list.rb`, you''ll have to load the page in the browser before the migrations run. If you want to use a specific database, you can add this: def List.create List::Models::Base.establish_connection( :adapter => "postgresql", :username => "root", :password => "toor, :database => "list" ) List::Models.create_schema end Or you might want to add the information in a database.yml file: --- adapter: postgresql username: root password: toor database: list And then rather do: require ''yaml'' def List.create List::Models::Base.establish_connection(YAML.load(File.read("database.yml"))) List::Models.create_schema end Please note that if you connect to a database which already has the tables, DON''T run `List::Models.create_schema` as this will probably delete the whole database. General rule: you only need migrations to setup the database. -- And thirdly: Yes, we are aware of that the migration support isn''t very nice. In the future we hope to have something like: module List::Models class Person t.string :name end end def List.create List::Models.setup! end Until then, you''ll have to stick with the current solution :-) // Magnus Holm On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez <coder at montx.com> wrote:> > On 17jun, 2010, at 21:04 , Magnus Holm wrote: > >> >> That''s (hopefully) the simplest way to generate XML with Camping. >> >> You still need to create a model to store/retrieve the data. Before we >> can help you here, we need to know a few things: Is it going to fetch >> data from a specific place, or should it create its own database (from >> scratch)? Any specific database you want to use? >> >> Here''s a Pastie with all the code: http://pastie.org/1008983 (Should >> work on any version of Camping). > > I''m trying to adapt your pastie to use a sqlite databse, but I''m having some errors that I can''t see ... > > Here''s a Pastie with all code: http://pastie.org/1009797 > > I''m just trying to create with code a simple table called Persons with some fields but ... > > :-) > > Also, ?I can''t find where is creating the database ... > > thanks, > > regards, > > r. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
buf, now I''m lost ... :-)) no, really, thanks for that info, now I have working as I want ... :-) I''ve tested and created a new databse, and is working also. I''ve created a new sqlite3 from terminal and filled-up with some data and now I can use this databse from Camping, cool! And, caping is serving the data with .xml format and I can get it from my devices, cool! I''m going to play more with thise, sure I''ll come back with more questions ... :-) ah, I always use Thin with Nginx for my RoR instead of Mongrel, I suppose there would be no problem with camping ? and speed: normally it''s all very fast, but sometimes, it takes a little bit (3 or more seconds) to respond camping, and I''m not doing nothing serious at all, just the example from pastie. is because I''m using the development mode instead of production, like in RoR ? thanks again ! regards, r. On 18jun, 2010, at 12:33 , Magnus Holm wrote:> Yeah, people always get a little confused because you don''t need to > define your database when you''re using bin/camping (it has a default > SQLite database at ~/.camping.db). > > I also see that there''s some old, database code here; we definitely > need to update our documentation (yes, I''m working on it!) > > First of all, the table name should be "list_people" (since "people" > is the plural to "person" and the table names are always in > lowercase), but you should rather do `create_table Person.table_name` > and `drop_table Person.table_name` because then you don''t need to > think about it at all :-) > > Secondly, you only need this in order to create the database: > > def List.create > List::Models.create_schema > end > > Then it will use a SQLite database at ~/.camping.db (as long as you > start it with `camping list.rb`). This is perfect for just testing > things out (you can also run `camping -C list.rb` to get an IRB > console). Please note that if you only run `camping list.rb`, you''ll > have to load the page in the browser before the migrations run. > > If you want to use a specific database, you can add this: > > def List.create > List::Models::Base.establish_connection( > :adapter => "postgresql", > :username => "root", > :password => "toor, > :database => "list" > ) > List::Models.create_schema > end > > Or you might want to add the information in a database.yml file: > > --- > adapter: postgresql > username: root > password: toor > database: list > > And then rather do: > > require ''yaml'' > > def List.create > List::Models::Base.establish_connection(YAML.load(File.read("database.yml"))) > List::Models.create_schema > end > > Please note that if you connect to a database which already has the > tables, DON''T run `List::Models.create_schema` as this will probably > delete the whole database. General rule: you only need migrations to > setup the database. > > -- > > And thirdly: Yes, we are aware of that the migration support isn''t > very nice. In the future we hope to have something like: > > module List::Models > class Person > t.string :name > end > end > > def List.create > List::Models.setup! > end > > Until then, you''ll have to stick with the current solution :-) > > > // Magnus Holm > > > > On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez <coder at montx.com> wrote: >> >> On 17jun, 2010, at 21:04 , Magnus Holm wrote: >> >>> >>> That''s (hopefully) the simplest way to generate XML with Camping. >>> >>> You still need to create a model to store/retrieve the data. Before we >>> can help you here, we need to know a few things: Is it going to fetch >>> data from a specific place, or should it create its own database (from >>> scratch)? Any specific database you want to use? >>> >>> Here''s a Pastie with all the code: http://pastie.org/1008983 (Should >>> work on any version of Camping). >> >> I''m trying to adapt your pastie to use a sqlite databse, but I''m having some errors that I can''t see ... >> >> Here''s a Pastie with all code: http://pastie.org/1009797 >> >> I''m just trying to create with code a simple table called Persons with some fields but ... >> >> :-) >> >> Also, I can''t find where is creating the database ... >> >> thanks, >> >> regards, >> >> r. >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
Raimon a few things you probably already know but... just in case! 1. because of the preceding ''.'' in ''.camping.db'' you''ll need to use ls - al to see the file listed (in the ~ home dir) in your file system. 2. In Magnus'' example settings (database => "list") you can also add a path to your database as well as its name (unless something''s changed since I last did it!) e.g.: database => "./data/mydata.db" 3. The Firefox SQLite Manager is handy for errr.. managing your SQLite database: https://addons.mozilla.org/en-US/firefox/addon/5817/ Note: with SQLite you cannot change column names once they''re in the database (unless anyone knows better?). Dave E.> Yeah, people always get a little confused because you don''t need to > define your database when you''re using bin/camping (it has a > default SQLite database at ~/.camping.db).
Excellent! Camping uses Rack, so it should be very simple to get it running on any Ruby web server. Just create a config.ru like this: require ''list'' List.create if List.respond_to?(:create) # call List.create if it exists run List # and run the app! Then you can start it with: `thin start` (when you''re in the app directory) One thing you''ll have to remember is that any exceptions which are raised, won''t be rescued inside Camping, but rather be raised all the way up. Thin (hopefully) catches it somewhere, but you should probably handle it yourself: module List def r500(klass, method, exception) # Do some funky things "There was an exception in #{klass}.#{method}: #{exception}" end end You could also use something like http://hoptoadapp.com/ (they have free plans) which gives you a nice dashboard and sends you an email every time an exception is raised. Just create an account, run `gem install toadhopper` and add this to your app: require ''toadhopper'' module List ExceptionHandler = Toadhopper.new("YOUR API KEY") def r500(klass, method, exception) # Send the exception to Hoptoad: ExceptionHandler.post!(exception) # Render something for the user. You would probably want to render some XML # so the client knows something went wrong. "There was an exception in #{klass}.#{method}: #{exception}" end end // Magnus Holm On Fri, Jun 18, 2010 at 13:23, Raimon Fernandez <coder at montx.com> wrote:> buf, now I''m lost ... > > :-)) > > no, really, thanks for that info, now I have working as I want ... > > :-) > > > I''ve tested and created a new databse, and is working also. > > I''ve created a new sqlite3 from terminal and filled-up with some data and now I can use this databse from Camping, cool! > > And, caping is serving the data with .xml format and I can get it from my devices, cool! > > I''m going to play more with thise, sure I''ll come back with more questions ... > > :-) > > ah, I always use Thin with Nginx for my RoR instead of Mongrel, I suppose there would be no problem with camping ? > > and speed: normally it''s all very fast, but sometimes, it takes a little bit (3 or more seconds) to respond camping, and I''m not doing nothing serious at all, just the example from pastie. > > is because I''m using the development mode instead of production, like in RoR ? > > thanks again ! > > regards, > > r. > > > > On 18jun, 2010, at 12:33 , Magnus Holm wrote: > >> Yeah, people always get a little confused because you don''t need to >> define your database when you''re using bin/camping (it has a default >> SQLite database at ~/.camping.db). >> >> I also see that there''s some old, database code here; we definitely >> need to update our documentation (yes, I''m working on it!) >> >> First of all, the table name should be "list_people" (since "people" >> is the plural to "person" and the table names are always in >> lowercase), but you should rather do `create_table Person.table_name` >> and `drop_table Person.table_name` because then you don''t need to >> think about it at all :-) >> >> Secondly, you only need this in order to create the database: >> >> def List.create >> ?List::Models.create_schema >> end >> >> Then it will use a SQLite database at ~/.camping.db (as long as you >> start it with `camping list.rb`). This is perfect for just testing >> things out (you can also run `camping -C list.rb` to get an IRB >> console). Please note that if you only run `camping list.rb`, you''ll >> have to load the page in the browser before the migrations run. >> >> If you want to use a specific database, you can add this: >> >> def List.create >> ?List::Models::Base.establish_connection( >> ? ?:adapter => "postgresql", >> ? ?:username => "root", >> ? ?:password => "toor, >> ? ?:database => "list" >> ?) >> ?List::Models.create_schema >> end >> >> Or you might want to add the information in a database.yml file: >> >> --- >> adapter: postgresql >> username: root >> password: toor >> database: list >> >> And then rather do: >> >> require ''yaml'' >> >> def List.create >> ?List::Models::Base.establish_connection(YAML.load(File.read("database.yml"))) >> ?List::Models.create_schema >> end >> >> Please note that if you connect to a database which already has the >> tables, DON''T run `List::Models.create_schema` as this will probably >> delete the whole database. General rule: you only need migrations to >> setup the database. >> >> -- >> >> And thirdly: Yes, we are aware of that the migration support isn''t >> very nice. In the future we hope to have something like: >> >> module List::Models >> ?class Person >> ? ?t.string :name >> ?end >> end >> >> def List.create >> ?List::Models.setup! >> end >> >> Until then, you''ll have to stick with the current solution :-) >> >> >> // Magnus Holm >> >> >> >> On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez <coder at montx.com> wrote: >>> >>> On 17jun, 2010, at 21:04 , Magnus Holm wrote: >>> >>>> >>>> That''s (hopefully) the simplest way to generate XML with Camping. >>>> >>>> You still need to create a model to store/retrieve the data. Before we >>>> can help you here, we need to know a few things: Is it going to fetch >>>> data from a specific place, or should it create its own database (from >>>> scratch)? Any specific database you want to use? >>>> >>>> Here''s a Pastie with all the code: http://pastie.org/1008983 (Should >>>> work on any version of Camping). >>> >>> I''m trying to adapt your pastie to use a sqlite databse, but I''m having some errors that I can''t see ... >>> >>> Here''s a Pastie with all code: http://pastie.org/1009797 >>> >>> I''m just trying to create with code a simple table called Persons with some fields but ... >>> >>> :-) >>> >>> Also, ?I can''t find where is creating the database ... >>> >>> thanks, >>> >>> regards, >>> >>> r. >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Oh, and I also have the speed issue! That''s definitely a bug. I''ll have a look at it later... On Friday, June 18, 2010, Raimon Fernandez <coder at montx.com> wrote:> buf, now I''m lost ... > > :-)) > > no, really, thanks for that info, now I have working as I want ... > > :-) > > > I''ve tested and created a new databse, and is working also. > > I''ve created a new sqlite3 from terminal and filled-up with some data and now I can use this databse from Camping, cool! > > And, caping is serving the data with .xml format and I can get it from my devices, cool! > > I''m going to play more with thise, sure I''ll come back with more questions ... > > :-) > > ah, I always use Thin with Nginx for my RoR instead of Mongrel, I suppose there would be no problem with camping ? > > and speed: normally it''s all very fast, but sometimes, it takes a little bit (3 or more seconds) to respond camping, and I''m not doing nothing serious at all, just the example from pastie. > > is because I''m using the development mode instead of production, like in RoR ? > > thanks again ! > > regards, > > r. > > > > On 18jun, 2010, at 12:33 , Magnus Holm wrote: > >> Yeah, people always get a little confused because you don''t need to >> define your database when you''re using bin/camping (it has a default >> SQLite database at ~/.camping.db). >> >> I also see that there''s some old, database code here; we definitely >> need to update our documentation (yes, I''m working on it!) >> >> First of all, the table name should be "list_people" (since "people" >> is the plural to "person" and the table names are always in >> lowercase), but you should rather do `create_table Person.table_name` >> and `drop_table Person.table_name` because then you don''t need to >> think about it at all :-) >> >> Secondly, you only need this in order to create the database: >> >> def List.create >> ?List::Models.create_schema >> end >> >> Then it will use a SQLite database at ~/.camping.db (as long as you >> start it with `camping list.rb`). This is perfect for just testing >> things out (you can also run `camping -C list.rb` to get an IRB >> console). Please note that if you only run `camping list.rb`, you''ll >> have to load the page in the browser before the migrations run. >> >> If you want to use a specific database, you can add this: >> >> def List.create >> ?List::Models::Base.establish_connection( >> ? ?:adapter => "postgresql", >> ? ?:username => "root", >> ? ?:password => "toor, >> ? ?:database => "list" >> ?) >> ?List::Models.create_schema >> end >> >> Or you might want to add the information in a database.yml file: >> >> --- >> adapter: postgresql >> username: root >> password: toor >> database: list >> >> And then rather do: >> >> require ''yaml'' >> >> def List.create >> ?List::Models::Base.establish_connection(YAML.load(File.read("database.yml"))) >> ?List::Models.create_schema >> end >> >> Please note that if you connect to a database which already has the >> tables, DON''T run `List::Models.create_schema` as this will probably >> delete the whole database. General rule: you only need migrations to >> setup the database. >> >> -- >> >> And thirdly: Yes, we are aware of that the migration support isn''t >> very nice. In the future we hope to have something like: >> >> module List::Models >> ?class Person >> ? ?t.string :name >> ?end >> end >> >> def List.create >> ?List::Models.setup! >> end >> >> Until then, you''ll have to stick with the current solution :-) >> >> >> // Magnus Holm >> >> >> >> On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez <coder at montx.com> wrote: >>> >>> On 17jun, 2010, at 21:04 , Magnus Holm wrote: >>> >>>> >>>> That''s (hopefully) the simplest way to generate XML with Camping. >>>> >>>> You still need to create a model to store/retrieve the data. Before we >>>> can help you here, we need to know a few things: Is it going to fetch >>>> data from a specific place, or should it create its own database (from >>>> scratch)? Any specific database you want to use? >>>> >>>> Here''s a Pastie with all the code: http://pastie.org/1008983 (Should >>>> work on any version of Camping). >>> >>> I''m trying to adapt your pastie to use a sqlite databse, but I''m having some errors that I can''t see ... >>> >>> Here''s a Pastie with all code: http://pastie.org/1009797 >>> >>> I''m just trying to create with code a simple table called Persons with some fields but ... >>> >>> :-) >>> >>> Also, ?I can''t find where is creating the database ... >>> >>> thanks, >>> >>> regards, >>> >>> r. >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> ?<http://rubyforge.org/mailman/listinfo/camping-list>-- // Magnus Holm
On 18jun, 2010, at 15:34 , Magnus Holm wrote:> Oh, and I also have the speed issue! That''s definitely a bug. I''ll > have a look at it later...uffff, I was thinking it was my code ... :-) thanks ! regards, r.> > On Friday, June 18, 2010, Raimon Fernandez <coder at montx.com> wrote: >> buf, now I''m lost ... >> >> :-)) >> >> no, really, thanks for that info, now I have working as I want ... >> >> :-) >> >> >> I''ve tested and created a new databse, and is working also. >> >> I''ve created a new sqlite3 from terminal and filled-up with some data and now I can use this databse from Camping, cool! >> >> And, caping is serving the data with .xml format and I can get it from my devices, cool! >> >> I''m going to play more with thise, sure I''ll come back with more questions ... >> >> :-) >> >> ah, I always use Thin with Nginx for my RoR instead of Mongrel, I suppose there would be no problem with camping ? >> >> and speed: normally it''s all very fast, but sometimes, it takes a little bit (3 or more seconds) to respond camping, and I''m not doing nothing serious at all, just the example from pastie. >> >> is because I''m using the development mode instead of production, like in RoR ? >> >> thanks again ! >> >> regards, >> >> r. >> >> >> >> On 18jun, 2010, at 12:33 , Magnus Holm wrote: >> >>> Yeah, people always get a little confused because you don''t need to >>> define your database when you''re using bin/camping (it has a default >>> SQLite database at ~/.camping.db). >>> >>> I also see that there''s some old, database code here; we definitely >>> need to update our documentation (yes, I''m working on it!) >>> >>> First of all, the table name should be "list_people" (since "people" >>> is the plural to "person" and the table names are always in >>> lowercase), but you should rather do `create_table Person.table_name` >>> and `drop_table Person.table_name` because then you don''t need to >>> think about it at all :-) >>> >>> Secondly, you only need this in order to create the database: >>> >>> def List.create >>> List::Models.create_schema >>> end >>> >>> Then it will use a SQLite database at ~/.camping.db (as long as you >>> start it with `camping list.rb`). This is perfect for just testing >>> things out (you can also run `camping -C list.rb` to get an IRB >>> console). Please note that if you only run `camping list.rb`, you''ll >>> have to load the page in the browser before the migrations run. >>> >>> If you want to use a specific database, you can add this: >>> >>> def List.create >>> List::Models::Base.establish_connection( >>> :adapter => "postgresql", >>> :username => "root", >>> :password => "toor, >>> :database => "list" >>> ) >>> List::Models.create_schema >>> end >>> >>> Or you might want to add the information in a database.yml file: >>> >>> --- >>> adapter: postgresql >>> username: root >>> password: toor >>> database: list >>> >>> And then rather do: >>> >>> require ''yaml'' >>> >>> def List.create >>> List::Models::Base.establish_connection(YAML.load(File.read("database.yml"))) >>> List::Models.create_schema >>> end >>> >>> Please note that if you connect to a database which already has the >>> tables, DON''T run `List::Models.create_schema` as this will probably >>> delete the whole database. General rule: you only need migrations to >>> setup the database. >>> >>> -- >>> >>> And thirdly: Yes, we are aware of that the migration support isn''t >>> very nice. In the future we hope to have something like: >>> >>> module List::Models >>> class Person >>> t.string :name >>> end >>> end >>> >>> def List.create >>> List::Models.setup! >>> end >>> >>> Until then, you''ll have to stick with the current solution :-) >>> >>> >>> // Magnus Holm >>> >>> >>> >>> On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez <coder at montx.com> wrote: >>>> >>>> On 17jun, 2010, at 21:04 , Magnus Holm wrote: >>>> >>>>> >>>>> That''s (hopefully) the simplest way to generate XML with Camping. >>>>> >>>>> You still need to create a model to store/retrieve the data. Before we >>>>> can help you here, we need to know a few things: Is it going to fetch >>>>> data from a specific place, or should it create its own database (from >>>>> scratch)? Any specific database you want to use? >>>>> >>>>> Here''s a Pastie with all the code: http://pastie.org/1008983 (Should >>>>> work on any version of Camping). >>>> >>>> I''m trying to adapt your pastie to use a sqlite databse, but I''m having some errors that I can''t see ... >>>> >>>> Here''s a Pastie with all code: http://pastie.org/1009797 >>>> >>>> I''m just trying to create with code a simple table called Persons with some fields but ... >>>> >>>> :-) >>>> >>>> Also, I can''t find where is creating the database ... >>>> >>>> thanks, >>>> >>>> regards, >>>> >>>> r. >>>> _______________________________________________ >>>> 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
Hi again, I know this is more related to builder than to camping, but not sure where to ask for it ... :-) My app receives .xml file from some different sources, and all of them, except the camping one, are formatted like this: <?xml version="1.0" encoding="UTF-8"?> <person> <name>Jim Fern?ndez</name> <phone>555-1234</phone> </person> but camping is formatting like this: <?xml version="1.0" encoding="UTF-8"?> <person> <name>Jim Fernández</name> <phone>555-1234</phone> </person> The main difference is the encoding for some chars: ? => á I can''t find in builder how to write values without escaping them ... thanks, r. On 17jun, 2010, at 21:04 , Magnus Holm wrote:> And if you want this XML: > > <?xml version="1.0" encoding="UTF-8"?> > <posts> > <post> > <title>Hiya</title> > <content>Hey</content> > </post> > </posts> > > You have this view: > > module App::Views > def posts(xml) > xml.posts do > @posts.each do |post| > xml.post do > xml.title(post.title) > xml.content(post.content) > end > end > end > end > end
Hmm - quickly: in similar setups this usually requires UTF-8 to be specified throughout Camping(?), the database, within your files (and any markup files they generate), and (sometimes) also on the server. Then you can just use/store/retrieve the characters as they are - Dave E> The main difference is the encoding for some chars: > > ? => á
This shouldn''t be a problem, because that''s the way to add non-ASCII characters to XML documents. A proper XML parser should handle it... // Magnus Holm (from my phone) On Friday, June 18, 2010, Raimon Fernandez <coder at montx.com> wrote:> Hi again, > > I know this is more related to builder than to camping, but not sure where to ask for it ... > > :-) > > > My app receives .xml file from some different sources, and all of them, except the camping one, are formatted like this: > > > <?xml version="1.0" encoding="UTF-8"?> > <person> > ?<name>Jim Fern?ndez</name> > ?<phone>555-1234</phone> > </person> > > > but camping is formatting like this: > > <?xml version="1.0" encoding="UTF-8"?> > <person> > ?<name>Jim Fernández</name> > ?<phone>555-1234</phone> > </person> > > > The main difference is the encoding for some chars: > > ? => á > > I can''t find in builder how to write values without escaping them ... > > thanks, > > r. > > On 17jun, 2010, at 21:04 , Magnus Holm wrote: > >> And if you want this XML: >> >> <?xml version="1.0" encoding="UTF-8"?> >> <posts> >> ?<post> >> ? ?<title>Hiya</title> >> ? ?<content>Hey</content> >> ?</post> >> </posts> >> >> You have this view: >> >> module App::Views >> ?def posts(xml) >> ? ?xml.posts do >> ? ? ?@posts.each do |post| >> ? ? ? ?xml.post do >> ? ? ? ? ?xml.title(post.title) >> ? ? ? ? ?xml.content(post.content) >> ? ? ? ?end >> ? ? ?end >> ? ?end >> ?end >> end > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- // Magnus Holm
Hi all, On 18jun, 2010, at 17:51 , Magnus Holm wrote:> This shouldn''t be a problem, because that''s the way to add non-ASCII > characters to XML documents. A proper XML parser should handle it...But in this case, it''s an ASCII ?, well, the extended ASCII, and all .xml files that I''ve created never added this encoded, always the char itself, like ? ? ? ? I''m using the TBMXML parser http://www.tbxml.co.uk/TBXML/TBXML_Free.html And because the xml file has the encoding="UTF-8" I suppose that those chars can be added as they are without encoding. And also I''m using other C libraries in other projects that they do not escape those chars ... Thanks! regards, r.> > // Magnus Holm (from my phone) > > On Friday, June 18, 2010, Raimon Fernandez <coder at montx.com> wrote: >> Hi again, >> >> I know this is more related to builder than to camping, but not sure where to ask for it ... >> >> :-) >> >> >> My app receives .xml file from some different sources, and all of them, except the camping one, are formatted like this: >> >> >> <?xml version="1.0" encoding="UTF-8"?> >> <person> >> <name>Jim Fern?ndez</name> >> <phone>555-1234</phone> >> </person> >> >> >> but camping is formatting like this: >> >> <?xml version="1.0" encoding="UTF-8"?> >> <person> >> <name>Jim Fernández</name> >> <phone>555-1234</phone> >> </person> >> >> >> The main difference is the encoding for some chars: >> >> ? => á >> >> I can''t find in builder how to write values without escaping them ... >> >> thanks, >> >> r. >> >> On 17jun, 2010, at 21:04 , Magnus Holm wrote: >> >>> And if you want this XML: >>> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <posts> >>> <post> >>> <title>Hiya</title> >>> <content>Hey</content> >>> </post> >>> </posts> >>> >>> You have this view: >>> >>> module App::Views >>> def posts(xml) >>> xml.posts do >>> @posts.each do |post| >>> xml.post do >>> xml.title(post.title) >>> xml.content(post.content) >>> end >>> end >>> end >>> end >>> end >> >> >> _______________________________________________ >> 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
I think the problem is that Builder don''t know that you''re using UTF-8, so it''s just doing the "safest" thing and just escapes everything. But this shouldn''t really be a "problem", since the parser should handle it and treat every á as ?. // Magnus Holm On Sat, Jun 19, 2010 at 15:53, Raimon Fernandez <coder at montx.com> wrote:> Hi all, > > On 18jun, 2010, at 17:51 , Magnus Holm wrote: > >> This shouldn''t be a problem, because that''s the way to add non-ASCII >> characters to XML documents. A proper XML parser should handle it... > > But in this case, it''s an ASCII ?, well, the extended ASCII, and all .xml files that I''ve created never added this encoded, always the char itself, like ? ? ? ? > > I''m using the TBMXML parser http://www.tbxml.co.uk/TBXML/TBXML_Free.html > > And because the xml file has the encoding="UTF-8" I suppose that those chars can be added as they are without encoding. > > And also I''m using other C libraries in other projects that they do not escape those chars ... > > Thanks! > > regards, > > r. > > >> >> // Magnus Holm (from my phone) >> >> On Friday, June 18, 2010, Raimon Fernandez <coder at montx.com> wrote: >>> Hi again, >>> >>> I know this is more related to builder than to camping, but not sure where to ask for it ... >>> >>> :-) >>> >>> >>> My app receives .xml file from some different sources, and all of them, except the camping one, are formatted like this: >>> >>> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <person> >>> ?<name>Jim Fern?ndez</name> >>> ?<phone>555-1234</phone> >>> </person> >>> >>> >>> but camping is formatting like this: >>> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <person> >>> ?<name>Jim Fernández</name> >>> ?<phone>555-1234</phone> >>> </person> >>> >>> >>> The main difference is the encoding for some chars: >>> >>> ? => á >>> >>> I can''t find in builder how to write values without escaping them ... >>> >>> thanks, >>> >>> r. >>> >>> On 17jun, 2010, at 21:04 , Magnus Holm wrote: >>> >>>> And if you want this XML: >>>> >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <posts> >>>> ?<post> >>>> ? ?<title>Hiya</title> >>>> ? ?<content>Hey</content> >>>> ?</post> >>>> </posts> >>>> >>>> You have this view: >>>> >>>> module App::Views >>>> ?def posts(xml) >>>> ? ?xml.posts do >>>> ? ? ?@posts.each do |post| >>>> ? ? ? ?xml.post do >>>> ? ? ? ? ?xml.title(post.title) >>>> ? ? ? ? ?xml.content(post.content) >>>> ? ? ? ?end >>>> ? ? ?end >>>> ? ?end >>>> ?end >>>> end >>> >>> >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
On 19jun, 2010, at 16:34 , Magnus Holm wrote:> I think the problem is that Builder don''t know that you''re using > UTF-8, so it''s just doing the "safest" thing and just escapes > everything. But this shouldn''t really be a "problem", since the parser > should handle it and treat every á as ?.yes, but don''t know why the parser doesn''t treat it, I''ll try to find another XML parser ... thanks, r.> > // Magnus Holm > > > > On Sat, Jun 19, 2010 at 15:53, Raimon Fernandez <coder at montx.com> wrote: >> Hi all, >> >> On 18jun, 2010, at 17:51 , Magnus Holm wrote: >> >>> This shouldn''t be a problem, because that''s the way to add non-ASCII >>> characters to XML documents. A proper XML parser should handle it... >> >> But in this case, it''s an ASCII ?, well, the extended ASCII, and all .xml files that I''ve created never added this encoded, always the char itself, like ? ? ? ? >> >> I''m using the TBMXML parser http://www.tbxml.co.uk/TBXML/TBXML_Free.html >> >> And because the xml file has the encoding="UTF-8" I suppose that those chars can be added as they are without encoding. >> >> And also I''m using other C libraries in other projects that they do not escape those chars ... >> >> Thanks! >> >> regards, >> >> r. >> >> >>> >>> // Magnus Holm (from my phone) >>> >>> On Friday, June 18, 2010, Raimon Fernandez <coder at montx.com> wrote: >>>> Hi again, >>>> >>>> I know this is more related to builder than to camping, but not sure where to ask for it ... >>>> >>>> :-) >>>> >>>> >>>> My app receives .xml file from some different sources, and all of them, except the camping one, are formatted like this: >>>> >>>> >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <person> >>>> <name>Jim Fern?ndez</name> >>>> <phone>555-1234</phone> >>>> </person> >>>> >>>> >>>> but camping is formatting like this: >>>> >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <person> >>>> <name>Jim Fernández</name> >>>> <phone>555-1234</phone> >>>> </person> >>>> >>>> >>>> The main difference is the encoding for some chars: >>>> >>>> ? => á >>>> >>>> I can''t find in builder how to write values without escaping them ... >>>> >>>> thanks, >>>> >>>> r. >>>> >>>> On 17jun, 2010, at 21:04 , Magnus Holm wrote: >>>> >>>>> And if you want this XML: >>>>> >>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>> <posts> >>>>> <post> >>>>> <title>Hiya</title> >>>>> <content>Hey</content> >>>>> </post> >>>>> </posts> >>>>> >>>>> You have this view: >>>>> >>>>> module App::Views >>>>> def posts(xml) >>>>> xml.posts do >>>>> @posts.each do |post| >>>>> xml.post do >>>>> xml.title(post.title) >>>>> xml.content(post.content) >>>>> end >>>>> end >>>>> end >>>>> end >>>>> end >>>> >>>> >>>> _______________________________________________ >>>> 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 >> >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
On 18jun, 2010, at 15:34 , Magnus Holm wrote:> Oh, and I also have the speed issue! That''s definitely a bug. I''ll > have a look at it later...I''m making some progress with Camping and well, it''s impressive, really !!!! :-) Wich version can I use that has not the bug for speed issue ? I would like to do some demo and I prefer to avoid this bug ... :-) thanks! regards, r.
On 20jun, 2010, at 23:38 , Raimon Fernandez wrote:> > On 18jun, 2010, at 15:34 , Magnus Holm wrote: > >> Oh, and I also have the speed issue! That''s definitely a bug. I''ll >> have a look at it later... > > I''m making some progress with Camping and well, it''s impressive, really !!!! > > :-) > > Wich version can I use that has not the bug for speed issue ? > > I would like to do some demo and I prefer to avoid this bug ... :-)Just observed that when I run camping with Thin I''m not getting the speed issue, only with Mongrel ... thanks, r.
What if you run Thin with `camping -s thin app.rb`? Do you have the speed issue then? Thanks, Magnus On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote:> > On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: > >> >> On 18jun, 2010, at 15:34 , Magnus Holm wrote: >> >>> Oh, and I also have the speed issue! That''s definitely a bug. I''ll >>> have a look at it later... >> >> I''m making some progress with Camping and well, it''s impressive, really !!!! >> >> :-) >> >> Wich version can I use that has not the bug for speed issue ? >> >> I would like to do some demo and I prefer to avoid this bug ... :-) > > Just observed that when I run camping with Thin I''m not getting the speed issue, only with Mongrel ... > > thanks, > > r. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- // Magnus Holm
On 21jun, 2010, at 12:56 , Magnus Holm wrote:> What if you run Thin with `camping -s thin app.rb`? Do you have the > speed issue then?No, with Thin I don''t have the speed issue ... thanks, r.> > Thanks, Magnus > > On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >> >> On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: >> >>> >>> On 18jun, 2010, at 15:34 , Magnus Holm wrote: >>> >>>> Oh, and I also have the speed issue! That''s definitely a bug. I''ll >>>> have a look at it later... >>> >>> I''m making some progress with Camping and well, it''s impressive, really !!!! >>> >>> :-) >>> >>> Wich version can I use that has not the bug for speed issue ? >>> >>> I would like to do some demo and I prefer to avoid this bug ... :-) >> >> Just observed that when I run camping with Thin I''m not getting the speed issue, only with Mongrel ... >> >> thanks, >> >> r. >> _______________________________________________ >> 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 >
Okay, I was just wondering since if you run the app with the thin command, you won''t get the reloader. So apparently the issue exists only with the reloader+Mongrel... On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote:> > On 21jun, 2010, at 12:56 , Magnus Holm wrote: > >> What if you run Thin with `camping -s thin app.rb`? Do you have the >> speed issue then? > > No, with Thin I don''t have the speed issue ... > > thanks, > > r. > >> >> Thanks, Magnus >> >> On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >>> >>> On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: >>> >>>> >>>> On 18jun, 2010, at 15:34 , Magnus Holm wrote: >>>> >>>>> Oh, and I also have the speed issue! That''s definitely a bug. I''ll >>>>> have a look at it later... >>>> >>>> I''m making some progress with Camping and well, it''s impressive, really !!!! >>>> >>>> :-) >>>> >>>> Wich version can I use that has not the bug for speed issue ? >>>> >>>> I would like to do some demo and I prefer to avoid this bug ... :-) >>> >>> Just observed that when I run camping with Thin I''m not getting the speed issue, only with Mongrel ... >>> >>> thanks, >>> >>> r. >>> _______________________________________________ >>> 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 >> > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- // Magnus Holm
On 21jun, 2010, at 13:49 , Magnus Holm wrote:> Okay, I was just wondering since if you run the app with the thin > command, you won''t get the reloader. So apparently the issue exists > only with the reloader+Mongrel...What''s the reloader ? When I make some changes in the app.rb file ? thanks, regards. r.> > On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >> >> On 21jun, 2010, at 12:56 , Magnus Holm wrote: >> >>> What if you run Thin with `camping -s thin app.rb`? Do you have the >>> speed issue then? >> >> No, with Thin I don''t have the speed issue ... >> >> thanks, >> >> r. >> >>> >>> Thanks, Magnus >>> >>> On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >>>> >>>> On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: >>>> >>>>> >>>>> On 18jun, 2010, at 15:34 , Magnus Holm wrote: >>>>> >>>>>> Oh, and I also have the speed issue! That''s definitely a bug. I''ll >>>>>> have a look at it later... >>>>> >>>>> I''m making some progress with Camping and well, it''s impressive, really !!!! >>>>> >>>>> :-) >>>>> >>>>> Wich version can I use that has not the bug for speed issue ? >>>>> >>>>> I would like to do some demo and I prefer to avoid this bug ... :-) >>>> >>>> Just observed that when I run camping with Thin I''m not getting the speed issue, only with Mongrel ... >>>> >>>> thanks, >>>> >>>> r. >>>> _______________________________________________ >>>> 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 >>> >> >> >> _______________________________________________ >> 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 >
Yep, The reloader (located in camping/reloader.rb) watches a file and then reloads the server whenever the file changes. It''s what makes it possible to just run `camping app.rb` and always have the latest version served. I can''t reproduce it at my machine at the moment :( Could you send me an example app which has the speed issues on your machine? // Magnus Holm On Mon, Jun 21, 2010 at 16:10, Raimon Fernandez <coder at montx.com> wrote:> > On 21jun, 2010, at 13:49 , Magnus Holm wrote: > >> Okay, I was just wondering since if you run the app with the thin >> command, you won''t get the reloader. So apparently the issue exists >> only with the reloader+Mongrel... > > What''s the reloader ? > > When I make some changes in the app.rb file ? > > thanks, > > regards. > > r. > > >> >> On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >>> >>> On 21jun, 2010, at 12:56 , Magnus Holm wrote: >>> >>>> What if you run Thin with `camping -s thin app.rb`? Do you have the >>>> speed issue then? >>> >>> No, with Thin I don''t have the speed issue ... >>> >>> thanks, >>> >>> r. >>> >>>> >>>> Thanks, Magnus >>>> >>>> On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >>>>> >>>>> On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: >>>>> >>>>>> >>>>>> On 18jun, 2010, at 15:34 , Magnus Holm wrote: >>>>>> >>>>>>> Oh, and I also have the speed issue! That''s definitely a bug. I''ll >>>>>>> have a look at it later... >>>>>> >>>>>> I''m making some progress with Camping and well, it''s impressive, really !!!! >>>>>> >>>>>> :-) >>>>>> >>>>>> Wich version can I use that has not the bug for speed issue ? >>>>>> >>>>>> I would like to do some demo and I prefer to avoid this bug ... :-) >>>>> >>>>> Just observed that when I run camping with Thin I''m not getting the speed issue, only with Mongrel ... >>>>> >>>>> thanks, >>>>> >>>>> r. >>>>> _______________________________________________ >>>>> 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 >>>> >>> >>> >>> _______________________________________________ >>> 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 >> > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi Magnus, On 21jun, 2010, at 21:40 , Magnus Holm wrote:> Yep, > > The reloader (located in camping/reloader.rb) watches a file and then > reloads the server whenever the file changes. It''s what makes it > possible to just run `camping app.rb` and always have the latest > version served.if I start with camping list.rb and enter this url http://127.0.0.1:3301/people/list and I hit the reload continuosly, you will see how if ''freezes'' ... if I start with camping -s thin list.rb and enter this url http://127.0.0.1:3301/people/list and I hit the reload continuosly, it''s always fast and responsive> > I can''t reproduce it at my machine at the moment :( Could you send me > an example app which has the speed issues on your machine?Where I can send a .db also ? I can put the code in the pastie but the database ? It has some rows that I fetch ... thanks, regards, r.> > // Magnus Holm > > > > On Mon, Jun 21, 2010 at 16:10, Raimon Fernandez <coder at montx.com> wrote: >> >> On 21jun, 2010, at 13:49 , Magnus Holm wrote: >> >>> Okay, I was just wondering since if you run the app with the thin >>> command, you won''t get the reloader. So apparently the issue exists >>> only with the reloader+Mongrel... >> >> What''s the reloader ? >> >> When I make some changes in the app.rb file ? >> >> thanks, >> >> regards. >> >> r. >> >> >>> >>> On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >>>> >>>> On 21jun, 2010, at 12:56 , Magnus Holm wrote: >>>> >>>>> What if you run Thin with `camping -s thin app.rb`? Do you have the >>>>> speed issue then? >>>> >>>> No, with Thin I don''t have the speed issue ... >>>> >>>> thanks, >>>> >>>> r. >>>> >>>>> >>>>> Thanks, Magnus >>>>> >>>>> On Monday, June 21, 2010, Raimon Fernandez <coder at montx.com> wrote: >>>>>> >>>>>> On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: >>>>>> >>>>>>> >>>>>>> On 18jun, 2010, at 15:34 , Magnus Holm wrote: >>>>>>> >>>>>>>> Oh, and I also have the speed issue! That''s definitely a bug. I''ll >>>>>>>> have a look at it later... >>>>>>> >>>>>>> I''m making some progress with Camping and well, it''s impressive, really !!!! >>>>>>> >>>>>>> :-) >>>>>>> >>>>>>> Wich version can I use that has not the bug for speed issue ? >>>>>>> >>>>>>> I would like to do some demo and I prefer to avoid this bug ... :-) >>>>>> >>>>>> Just observed that when I run camping with Thin I''m not getting the speed issue, only with Mongrel ... >>>>>> >>>>>> thanks, >>>>>> >>>>>> r. >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >> >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi, I''m trying to use filters in my Camping App, but at this moment they are not working ... I''ve found some presentation by Jeremy McAnally (http://slideshow.rubyforge.org/camping.html#1) At the end, appears a Library that makes our life easier, but I can''t find this library. Also, this presentation is from 2007 and we are now in 2011, so maybe Camping can handle those filters in an easy way. I use them in Rails but here I''m getting always ./list.rb:278: uninitialized constant List::Filters (NameError) Basically what I want to do is before each controller, check if there are some input variables in the post, and proceed if they are OK or send an error page, well, preferably a an error status in the header. thanks in advance, regards, r. ************************************************************************************************************ Here is what says about Kindling: Kindling ? A new library by me that takes the top 5-10 ?Railsisms? and lets you use them in Camping ? Currently supports? ? Easy before/after filters ? Static file download/upload ? Easy addition of template handlers, with default support for ERb ************************************************************************************************************
Maybe it''d work if you set your clock correctly? Worth a shot. ? Jenna On 03/10/2010, at 10:21 PM, Raimon Fernandez wrote:> Hi, > > > I''m trying to use filters in my Camping App, but at this moment they are not working ... > > I''ve found some presentation by Jeremy McAnally (http://slideshow.rubyforge.org/camping.html#1) > > At the end, appears a Library that makes our life easier, but I can''t find this library. > > Also, this presentation is from 2007 and we are now in 2011, so maybe Camping can handle those filters in an easy way. > > I use them in Rails but here I''m getting always ./list.rb:278: uninitialized constant List::Filters (NameError) > > Basically what I want to do is before each controller, check if there are some input variables in the post, and proceed if they are OK or send an error page, well, preferably a an error status in the header. > > thanks in advance, > > regards, > > r. > > ************************************************************************************************************ > > Here is what says about Kindling: > > Kindling > > ? A new library by me that takes the top 5-10 ?Railsisms? and lets you use them in Camping > ? Currently supports? > ? Easy before/after filters > ? Static file download/upload > ? Easy addition of template handlers, with default support for ERb > > ************************************************************************************************************ > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
Hi Raimon, Take a look at one of my blog posts on using Camping and OAuth, there a section regarding the use of filters: http://blog.monnet-usa.com/?p=293#caoatodoa I had packaged Magnus'' filtering_camping library as a gem. You can also see how I use filters in the Camping OAuth plugin: http://github.com/techarch/camping-oauth <http://github.com/techarch/camping-oauth> See |To implement filtering: | 1) |gem install filtering_camping 2) in your main Camping module add: include CampingFilters | 3) still in your main module add your global filters: before :all do | x | Camping::Models::Base.logger.debug "[before] filter on #{x.inspect}" end after :all do end 4) add your controller specific filters # when targeting a single controller before :MyController1 do #your filter logic end after :MyController1 do #your filter logic end # when targeting multiple controllers use an array before [:MyController2, MyController3] do #your filter logic end after [:MyController2, MyController3] do #your filter logic end Note you can also use a lambda: myblock1 = lambda { Camping::Models::Base.logger.debug "hello - before (Index)" } before :Index , &myblock1 One of these days I''ll write a post on that. ;-) Philippe (@techarch) On 10/3/2010 5:21 AM, Raimon Fernandez wrote:> Hi, > > > I''m trying to use filters in my Camping App, but at this moment they are not working ... > > I''ve found some presentation by Jeremy McAnally (http://slideshow.rubyforge.org/camping.html#1) > > At the end, appears a Library that makes our life easier, but I can''t find this library. > > Also, this presentation is from 2007 and we are now in 2011, so maybe Camping can handle those filters in an easy way. > > I use them in Rails but here I''m getting always ./list.rb:278: uninitialized constant List::Filters (NameError) > > Basically what I want to do is before each controller, check if there are some input variables in the post, and proceed if they are OK or send an error page, well, preferably a an error status in the header. > > thanks in advance, > > regards, > > r. > > ************************************************************************************************************ > > Here is what says about Kindling: > > Kindling > > ? A new library by me that takes the top 5-10 ?Railsisms? and lets you use them in Camping > ? Currently supports? > ? Easy before/after filters > ? Static file download/upload > ? Easy addition of template handlers, with default support for ERb > > ************************************************************************************************************ > _______________________________________________ > 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/20101003/6ad8c220/attachment.html>
On 3oct, 2010, at 16:02 , Jenna Fox wrote:> Maybe it''d work if you set your clock correctly? > > Worth a shot.I''m a programmer of the future ... :-))) back to reality, we are in 2010 ... r.> > ? > Jenna > > > On 03/10/2010, at 10:21 PM, Raimon Fernandez wrote: > >> Hi, >> >> >> I''m trying to use filters in my Camping App, but at this moment they are not working ... >> >> I''ve found some presentation by Jeremy McAnally (http://slideshow.rubyforge.org/camping.html#1) >> >> At the end, appears a Library that makes our life easier, but I can''t find this library. >> >> Also, this presentation is from 2007 and we are now in 2011, so maybe Camping can handle those filters in an easy way. >> >> I use them in Rails but here I''m getting always ./list.rb:278: uninitialized constant List::Filters (NameError) >> >> Basically what I want to do is before each controller, check if there are some input variables in the post, and proceed if they are OK or send an error page, well, preferably a an error status in the header. >> >> thanks in advance, >> >> regards, >> >> r. >> >> ************************************************************************************************************ >> >> Here is what says about Kindling: >> >> Kindling >> >> ? A new library by me that takes the top 5-10 ?Railsisms? and lets you use them in Camping >> ? Currently supports? >> ? Easy before/after filters >> ? Static file download/upload >> ? Easy addition of template handlers, with default support for ERb >> >> ************************************************************************************************************ >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi, Finally I could remember the great Blog camping, where are some filters that do what I want ... thanks, r. On 3oct, 2010, at 13:21 , Raimon Fernandez wrote:> Hi, > > > I''m trying to use filters in my Camping App, but at this moment they are not working ... > > I''ve found some presentation by Jeremy McAnally (http://slideshow.rubyforge.org/camping.html#1) > > At the end, appears a Library that makes our life easier, but I can''t find this library. > > Also, this presentation is from 2007 and we are now in 2011, so maybe Camping can handle those filters in an easy way. > > I use them in Rails but here I''m getting always ./list.rb:278: uninitialized constant List::Filters (NameError) > > Basically what I want to do is before each controller, check if there are some input variables in the post, and proceed if they are OK or send an error page, well, preferably a an error status in the header. > > thanks in advance, > > regards, > > r. > > ************************************************************************************************************ > > Here is what says about Kindling: > > Kindling > > ? A new library by me that takes the top 5-10 ?Railsisms? and lets you use them in Camping > ? Currently supports? > ? Easy before/after filters > ? Static file download/upload > ? Easy addition of template handlers, with default support for ERb > > ************************************************************************************************************ > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Hi Philippe, Thanks for your long explain, I''ll have a look to your blog post also ! regards, r. On 3oct, 2010, at 16:30 , Philippe Monnet wrote:> Hi Raimon, > > Take a look at one of my blog posts on using Camping and OAuth, there a section regarding the use of filters: http://blog.monnet-usa.com/?p=293#caoatodoa > I had packaged Magnus'' filtering_camping library as a gem. > You can also see how I use filters in the Camping OAuth plugin: http://github.com/techarch/camping-oauth > See > > To implement filtering: > 1) gem install filtering_camping > > 2) in your main Camping module add: > include CampingFilters > > 3) still in your main module add your global filters: > > before :all do | x | > Camping::Models::Base.logger.debug "[before] filter on #{x.inspect}" > end > > after :all do > end > > 4) add your controller specific filters > > # when targeting a single controller > before :MyController1 do > #your filter logic > end > > after :MyController1 do > #your filter logic > end > > # when targeting multiple controllers use an array > before [:MyController2, MyController3] do > #your filter logic > end > > after [:MyController2, MyController3] do > #your filter logic > end > > Note you can also use a lambda: > > myblock1 = lambda { Camping::Models::Base.logger.debug "hello - before (Index)" } > before :Index , &myblock1 > > One of these days I''ll write a post on that. ;-) > > Philippe (@techarch) > > On 10/3/2010 5:21 AM, Raimon Fernandez wrote: >> >> Hi, >> >> >> I''m trying to use filters in my Camping App, but at this moment they are not working ... >> >> I''ve found some presentation by Jeremy McAnally (http://slideshow.rubyforge.org/camping.html#1) >> >> At the end, appears a Library that makes our life easier, but I can''t find this library. >> >> Also, this presentation is from 2007 and we are now in 2011, so maybe Camping can handle those filters in an easy way. >> >> I use them in Rails but here I''m getting always ./list.rb:278: uninitialized constant List::Filters (NameError) >> >> Basically what I want to do is before each controller, check if there are some input variables in the post, and proceed if they are OK or send an error page, well, preferably a an error status in the header. >> >> thanks in advance, >> >> regards, >> >> r. >> >> ************************************************************************************************************ >> >> Here is what says about Kindling: >> >> Kindling >> >> ? A new library by me that takes the top 5-10 ?Railsisms? and lets you use them in Camping >> ? Currently supports? >> ? Easy before/after filters >> ? Static file download/upload >> ? Easy addition of template handlers, with default support for ERb >> >> ************************************************************************************************************ >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > _______________________________________________ > 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/20101003/d8edbcae/attachment.html>
Hi again, I''m trying to force a different Response Status-Code when some situations occur. Once again, in Rails I just use the :status => 404 and that''s all ... Here, I suppose I must use the @headers[] but I''m always getting the 200 Status OK. I''m not sure wich name exactly the header must be, as in Internet there are lots of options and none of them is giving me a 404 or whatever code I use, I''m always getting the 200. If I force a bad url, camping returns the famouse Camping problem with a 404 status code, I want to force this code. How can I do that ? ... @headers["Content-Type"] = "text/xml" # none of them are working ... @headers["HTTP/1.0"] = "404" @headers["Status"] = "404" @headers["Response"] = "404" @headers["Status-Code"] = "404" maybe I have to use a different option in camping ? thanks again, regards, r.
@status = 404 // Magnus Holm On Sun, Oct 3, 2010 at 18:09, Raimon Fernandez <coder at montx.com> wrote:> Hi again, > > I''m trying to force a different Response Status-Code when some situations > occur. > > Once again, in Rails I just use the :status => 404 and that''s all ... > > Here, I suppose I must use the @headers[] but I''m always getting the 200 > Status OK. > > I''m not sure wich name exactly the header must be, as in Internet there are > lots of options and none of them is giving me a 404 or whatever code I use, > I''m always getting the 200. > > If I force a bad url, camping returns the famouse Camping problem with a > 404 status code, I want to force this code. > > How can I do that ? > > ... > > @headers["Content-Type"] = "text/xml" > > # none of them are working ... > > @headers["HTTP/1.0"] = "404" > @headers["Status"] = "404" > @headers["Response"] = "404" > @headers["Status-Code"] = "404" > > maybe I have to use a different option in camping ? > > thanks again, > > regards, > > r. > _______________________________________________ > 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/20101003/2365b30f/attachment.html>
@status = 404 On Sun, Oct 3, 2010 at 9:09 AM, Raimon Fernandez <coder at montx.com> wrote:> Hi again, > > I''m trying to force a different Response Status-Code when some situations > occur. > > Once again, in Rails I just use the :status => 404 and that''s all ... > > Here, I suppose I must use the @headers[] but I''m always getting the 200 > Status OK. > > I''m not sure wich name exactly the header must be, as in Internet there are > lots of options and none of them is giving me a 404 or whatever code I use, > I''m always getting the 200. > > If I force a bad url, camping returns the famouse Camping problem with a > 404 status code, I want to force this code. > > How can I do that ? > > ... > > @headers["Content-Type"] = "text/xml" > > # none of them are working ... > > @headers["HTTP/1.0"] = "404" > @headers["Status"] = "404" > @headers["Response"] = "404" > @headers["Status-Code"] = "404" > > maybe I have to use a different option in camping ? > > thanks again, > > regards, > > r. > _______________________________________________ > 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/20101003/10139706/attachment-0001.html>
Thanks John & Magnus, Where I can find more info about those little magic ???? :-) Also, I was calling from the wrong place, in a helper it is not working, but works if I call from a Controller. thanks again, regards, r. On 3oct, 2010, at 18:22 , John Beppu wrote:> @status = 404On 3oct, 2010, at 18:21 , Magnus Holm wrote:> @status = 404
There''s some info about the request/response here: http://camping.rubyforge.org/api.html#class-Camping-Controllers // Magnus Holm On Sun, Oct 3, 2010 at 22:47, Raimon Fernandez <coder at montx.com> wrote:> Thanks John & Magnus, > > > Where I can find more info about those little magic ???? > > :-) > > Also, I was calling from the wrong place, in a helper it is not working, > but works if I call from a Controller. > > thanks again, > > regards, > > r. > > > On 3oct, 2010, at 18:22 , John Beppu wrote: > > > @status = 404 > > > On 3oct, 2010, at 18:21 , Magnus Holm wrote: > > > @status = 404 > > > _______________________________________________ > 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/20101003/57891ced/attachment.html>
oooouuuccccchhhhh !!!!!!!! it''s there !!!!!! I''ve read it twice before posting here ..... :-( thanks again, r. The Response: You can change these variables to your needs: ? @status is the HTTP status (defaults to 200) ? @headers is a hash with the headers ? @body is the body (a string or something which responds to each) ? Any changes in @cookies and @state will also be sent to the client On 3oct, 2010, at 22:54 , Magnus Holm wrote:> There''s some info about the request/response here: http://camping.rubyforge.org/api.html#class-Camping-Controllers > > // Magnus Holm > > > On Sun, Oct 3, 2010 at 22:47, Raimon Fernandez <coder at montx.com> wrote: > Thanks John & Magnus, > > > Where I can find more info about those little magic ???? > > :-) > > Also, I was calling from the wrong place, in a helper it is not working, but works if I call from a Controller. > > thanks again, > > regards, > > r. > > > On 3oct, 2010, at 18:22 , John Beppu wrote: > > > @status = 404 > > > On 3oct, 2010, at 18:21 , Magnus Holm wrote: > > > @status = 404 > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
Hi, In my main Camping module I''m including the views: include Views # We include the Views module so we can call them as methods. My controllers call those views directly, as I''m generating always .xml responses, never .html If I remove the Include Views the filters work as expected, but not my Controllers that can''t call directly the views Why it''s not working if I just include the views ? Also , I noted that some examples have all de models nested inside the main Camping Model, and some others are defined outside it. My problem is the same no matter wich approach I take. Here is some code: require ''camping'' require ''ostruct'' require ''builder'' require ''filtering_camping'' Camping.goes :List module List include CampingFilters before [:ResumeGroupedByDevice, :ResumeGroupedl] do @device = Device.find_by_device_id(input.device_uuid) end include Views # We include the Views module so we can call them as methods. module List::Controllers ... class Device < Base end ... module List::Controllers ... class ResumeGroupedByDevice < R ''/people/resume_by_device'' def post @resume = Person.find(:all,xxxxxxxxxxxx) xml :people_resume_by_device end end ... module List::Helpers def xml(name) # We''ll need to send this as text/xml @headers["Content-Type"] = "text/xml" result = String.new # The builder takes a `target` where the XML will end up builder = Builder::XmlMarkup.new(:target => result, :indent => 2) # Generates a <?xml version="1.0" encoding="UTF-8" ?> builder.instruct! # Calls the method you sent in, passing in the builder as an argument send(name, builder) # Return the restult result end ... module List::Views def people_resume_by_device(xml) xml.groups(:found => @resume.size) do @resume.each do |element| xml.group do xml.id(0) # future use! xml.device_name(element.device_name) xml.count(element.count) end end end end thanks .... r. On 3oct, 2010, at 16:30 , Philippe Monnet wrote:> Take a look at one of my blog posts on using Camping and OAuth, there a section regarding the use of filters: http://blog.monnet-usa.com/?p=293#caoatodoa > I had packaged Magnus'' filtering_camping library as a gem. > You can also see how I use filters in the Camping OAuth plugin: http://github.com/techarch/camping-oauth > See > > To implement filtering: > 1) gem install filtering_camping > > 2) in your main Camping module add: > include CampingFilters > > 3) still in your main module add your global filters: > > before :all do | x | > Camping::Models::Base.logger.debug "[before] filter on #{x.inspect}" > end > > after :all do > end > > 4) add your controller specific filters > > # when targeting a single controller > before :MyController1 do > #your filter logic > end > > after :MyController1 do > #your filter logic > end > > # when targeting multiple controllers use an array > before [:MyController2, MyController3] do > #your filter logic > end > > after [:MyController2, MyController3] do > #your filter logic > end-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20101004/1bc0852a/attachment.html>
Ok, solved, but I would like to know why: This works and the filers execute: include Views # We include the Views module so we can call them as methods. include CampingFilters This DON''T work, filters never execute include CampingFilters include Views # We include the Views module so we can call them as methods. There is some precedence in order ? thanks, r. On 4oct, 2010, at 11:39 , Raimon Fernandez wrote:> Hi, > > > In my main Camping module I''m including the views: > > include Views # We include the Views module so we can call them as methods. > > > My controllers call those views directly, as I''m generating always .xml responses, never .html > > If I remove the Include Views the filters work as expected, but not my Controllers that can''t call directly the views > > Why it''s not working if I just include the views ? > > Also , I noted that some examples have all de models nested inside the main Camping Model, and some others are defined outside it. > > My problem is the same no matter wich approach I take. > > Here is some code: > > > require ''camping'' > require ''ostruct'' > require ''builder'' > require ''filtering_camping'' > > Camping.goes :List > > module List > > include CampingFilters > > > > before [:ResumeGroupedByDevice, :ResumeGroupedl] do > @device = Device.find_by_device_id(input.device_uuid) > end > > include Views # We include the Views module so we can call them as methods. > > module List::Controllers > > ... > > class Device < Base > end > > ... > > > module List::Controllers > > ... > > class ResumeGroupedByDevice < R ''/people/resume_by_device'' > > def post > @resume = Person.find(:all,xxxxxxxxxxxx) > xml :people_resume_by_device > end > > end > > ... > > module List::Helpers > def xml(name) > # We''ll need to send this as text/xml > @headers["Content-Type"] = "text/xml" > result = String.new > # The builder takes a `target` where the XML will end up > builder = Builder::XmlMarkup.new(:target => result, :indent => 2) > # Generates a <?xml version="1.0" encoding="UTF-8" ?> > builder.instruct! > # Calls the method you sent in, passing in the builder as an argument > send(name, builder) > # Return the restult > result > end > > ... > > > module List::Views > > def people_resume_by_device(xml) > xml.groups(:found => @resume.size) do > @resume.each do |element| > xml.group do > xml.id(0) # future use! > xml.device_name(element.device_name) > xml.count(element.count) > end > end > end > end > > > > thanks .... > > r. > > > > > On 3oct, 2010, at 16:30 , Philippe Monnet wrote: > >> Take a look at one of my blog posts on using Camping and OAuth, there a section regarding the use of filters: http://blog.monnet-usa.com/?p=293#caoatodoa >> I had packaged Magnus'' filtering_camping library as a gem. >> You can also see how I use filters in the Camping OAuth plugin: http://github.com/techarch/camping-oauth >> See >> >> To implement filtering: >> 1) gem install filtering_camping >> >> 2) in your main Camping module add: >> include CampingFilters >> >> 3) still in your main module add your global filters: >> >> before :all do | x | >> Camping::Models::Base.logger.debug "[before] filter on #{x.inspect}" >> end >> >> after :all do >> end >> >> 4) add your controller specific filters >> >> # when targeting a single controller >> before :MyController1 do >> #your filter logic >> end >> >> after :MyController1 do >> #your filter logic >> end >> >> # when targeting multiple controllers use an array >> before [:MyController2, MyController3] do >> #your filter logic >> end >> >> after [:MyController2, MyController3] do >> #your filter logic >> end > > _______________________________________________ > 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/20101004/5f17af56/attachment-0001.html>