Geoffrey Grosenbach | 1 Jun 2007 07:43
Gravatar

Thief, a Simple Camping App

For your entertainment, a simple Camping app to watch your Backpack
account and show a list of recently updated pages. I hope to implement
an RSS feed soon.

Uses Hpricot to parse the XML from Backpack.

http://svn.topfunky.com/public/camping/thief/

Geoffrey Grosenbach
........................
Screencast | http://peepcode.com
John Sheets | 19 Jun 2007 17:22

[ANN] TentSteak 0.2.0

The second release of TentSteak is out and available as a gem on rubyforge ("gem install tent_steak").  This version introduces a handful of new form helpers, a couple method renames, editable HTML tables, and some application bootstrappers for kickstarting Camping and initializing ActiveRecord.

It's still in active development, and I'd very much appreciate suggestions, feature requests, and even code review.  On tap for the next release is: a thorough test suite; a bit of housecleaning to better modularize the now-huge tent_steak.rb file into smaller bits; and a very simple authentication add-on.  Plus whatever else I happen to need for my own Camping projects.

Enjoy!

----

CHANGES:

* HTML Forms
  * Added new form field helpers: input_text, input_password,
    input_submit, input_hidden, and input_checkbox.
  * Renamed:
    * file_field => input_file
    * select_field => select_menu

* HTML Tables
  * Added support for regexp's in tablerow option :rowclass
  * New support for editable table columns
  * Renamed auto_table option :database_columns to :methods
  * auto_table used to expand row objects into cell arrays;
    now defers expansion to tablerow(:methods)
  * auto_table fixed to better handle non-AR row objects
  * Can pass a block to grouping_table for custom blank rows

* Application Helpers
  * New method init_db to encapsulate AR startup
  * New method add_local_paths to add local (non-gem) libraries
    to $LOAD_PATH
  * New method run_app to run Camping app; supports mongrel,
    webrick, and CGI
  * New method extract_form_fields to extract changed data
    after a posted table edit

John

-- 
"The Internet is not something you just dump something
on.  It's not a big truck.  It's a series of tubes."
 --Senator Ted Stevens, R-AK

John R. Sheets



_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
John Sheets | 19 Jun 2007 21:04

Re: [ANN] TentSteak 0.2.0

On Jun 19, 2007, at 10:22 AM, John Sheets wrote:

The second release of TentSteak is out and available as a gem on rubyforge ("gem install tent_steak").

Sorry, I should have mentioned: project info and API docs at:


John

-- 
"The Internet is not something you just dump something
on.  It's not a big truck.  It's a series of tubes."
 --Senator Ted Stevens, R-AK

John R. Sheets



_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Geoffrey Grosenbach | 19 Jun 2007 21:08
Gravatar

Re: [ANN] TentSteak 0.2.0

On 6/19/07, John Sheets <fisheye@...> wrote:
> Sorry, I should have mentioned: project info and API docs at:
>
>   http://rubyforge.org/projects/tentsteak/
>   http://tentsteak.rubyforge.org/

Steak: piece of meat
Stake: a rod used for securing things to the ground

TentSteak: A tent made out of meat? A hard piece of meat used to
secure a tent to the ground?

Could you explain?

Geoffrey Grosenbach
boss@...
........................
Blog | http://nubyonrails.com
Podcast | http://podcast.rubyonrails.com
Screencast | http://peepcode.com
carmen | 19 Jun 2007 21:20

Reloader paths/


after investigating why the reloader wasnt working , i discovered 2 probs, one of which was sorta my fault
(but will likely happen to others who make one-file apps)

first, my app was like this:

#!/usr/bn/env ruby

%w{applib1 applib2 digest/md80 airbus}.each{|r| require r}}

if __FILE__ == $0
  Mongrel.config do
     handler '/', Camping.reloader.new(__FILE__)
  end
end

not exactly sure how it wraps the run request, since it mainly returns a constant name. but even so, the files
are already required. maybe reloader should record the current $LOADED_FEATURES as soon as its loaded so
even stuff later in the require line gets recorded.. im not sure where camping draws the line for 'too
magic', but i think its somewhere like ' i havent seen a blaze mark on a tree in a few miles, but theres sort of a
path here, maybe made by native chipmunks, so im going to follow it...'

even as i reworked the app structure on disk, to have a front layer that just does the launching (defeating
the single file thing) it still wasnt loading. 

, its matching /^file.basename(scriptname)/,. so unless you have appname.rb then appname/ for further
stuff (which doesnt contain your entire app in a dir), it breaks. one solution would be to expand the path of
the requires, then compare File.dirname.. 

anyone have any preferences on whether the former or the latter technique is a less world-changing
solution? would either one break/fix RV / TentSteak / CampingServer?
John Sheets | 20 Jun 2007 02:51

Re: [ANN] TentSteak 0.2.0

On Jun 19, 2007, at 2:08 PM, Geoffrey Grosenbach wrote:

Steak: piece of meat
Stake: a rod used for securing things to the ground

TentSteak: A tent made out of meat? A hard piece of meat used to
secure a tent to the ground?

Could you explain?

TentSteak is one step up from TentBurger.  Or is that one step up from TarpSteak?  I can never keep it straight.  Really it's just yummy cuisine for Camping apps.  Come to think of it, I should really create a vegan-friendly sister project, TentTofu -- it has half the features of TentSteak, but at least you can't catch Mad CGI Disease from it.

(c:

Give 'er a try and let me know what you think....

John

-- 
"The Internet is not something you just dump something
on.  It's not a big truck.  It's a series of tubes."
 --Senator Ted Stevens, R-AK

John R. Sheets



_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
carmen | 20 Jun 2007 02:53

Re: [ANN] TentSteak 0.2.0

On Tue Jun 19, 2007 at 07:51:25PM -0500, John Sheets wrote:
>  On Jun 19, 2007, at 2:08 PM, Geoffrey Grosenbach wrote:
> 
> > Steak: piece of meat
> > Stake: a rod used for securing things to the ground
> >
> > TentSteak: A tent made out of meat? A hard piece of meat used to
> > secure a tent to the ground?
> >
> > Could you explain?
> 
>  TentSteak is one step up from TentBurger.  Or is that one step up from 
>  TarpSteak?  I can never keep it straight.  Really it's just yummy cuisine 
>  for Camping apps.  Come to think of it, I should really create a 
>  vegan-friendly sister project, TentTofu -- it has half the features of 

my local supermarket has a 'tofu steak'. its not very good..

>  TentSteak, but at least you can't catch Mad CGI Disease from it.

sorry what is this thing again. something about automating mixins? i'll pass ! unless it involves A1 sauce
and lots of Tabasco
John Sheets | 20 Jun 2007 03:01

Re: Reloader paths/

On Jun 19, 2007, at 2:20 PM, carmen wrote:

after investigating why the reloader wasnt working , i discovered 2 probs, one of which was sorta my fault (but will likely happen to others who make one-file apps)

anyone have any preferences on whether the former or the latter technique is a less world-changing solution? would either one break/fix RV / TentSteak / CampingServer?

No idea about TentSteak.  Here's my parameterized kickstart method to run a Camping app under mongrel, webrick, or CGI (haven't gotten to FCGI yet).  Anything clunky in there?  It's kind of an early spitball at this point, so lots of room for improvement.

  def self.run_app(app_module, app_base = "app")
    case ARGV.first
    when "mongrel"
      puts "Running Mongrel in FCGI mode"
      require "mongrel/camping"

      app_module::Models::Base.threaded_connections = false
      server = Mongrel::Camping::start("0.0.0.0", 3301, "/#{app_base}/", app_module)
      puts "#{app_module} app is running at http://localhost:3301/#{app_base}/"
      server.run.join
    when "webrick"
      puts "Running in WEBrick mode"
      require 'webrick/httpserver'
      require 'camping/webrick'

      s = WEBrick::HTTPServer.new(:BindAddress => "0.0.0.0", :Port => 3301)
      s.mount("/#{app_base}", WEBrick::CampingHandler, app_module)
      trap(:INT) { s.shutdown }
      s.start
    else
      # Default to CGI.
      puts app_module.run
    end
  end

John

-- 
"The Internet is not something you just dump something
on.  It's not a big truck.  It's a series of tubes."
 --Senator Ted Stevens, R-AK

John R. Sheets



_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
John Sheets | 20 Jun 2007 03:07

Re: [ANN] TentSteak 0.2.0

On Jun 19, 2007, at 7:53 PM, carmen wrote:

sorry what is this thing again. something about automating mixins? i'll pass ! unless it involves A1 sauce and lots of Tabasco

That's a small part of it.  The bulk of it is currently helper methods for stuff like building HTML tables and forms.  More to come soon.

John

-- 
"The Internet is not something you just dump something
on.  It's not a big truck.  It's a series of tubes."
 --Senator Ted Stevens, R-AK

John R. Sheets



_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Gregor Schmidt | 22 Jun 2007 16:51
Picon
Gravatar

Simulate HTTP put and delete in Camping/SleepingBag

Hello,

I'm not yet a camping guru nor a RESTafarian, but I try.

Currently I'm trying to build a rest-style web app with sleeping
bag/camping and I may successfully access the index, show, new, create
and edit methods, that are provided with sleeping bag. But I don't
know, how to build a form or link to access destroy and update.

I think this is mainly because of the corresponding HTTP verbs, that
are supposed to be used. But unfortunately PUT and DELETE are not
supported by browsers. In Rails, these are simulated with a hidden
field "method" that contains these meta information. In the Mailing
List Archive a found a hint, that sleeping bag would use a hidden
field "_verb" respectively, but I cannot make it work, neither can I
find any hints on that issue in the source of sleeping bag.

Does anybody know, how I can build a link/form to update and destroy?

Thanks for these great tools, both camping and sleeping bag feel as
lightweight as it gets.

Cheers,

Gregor

Gmane