Bil Kleb | 9 Feb 2007 22:07
Picon
Favicon

a series of tabbed forms

Hi,

I've previously described one of my wish list items,

  http://kleb.tadalist.com/lists/public/427170

in

  http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/217068

where I basically take a hash of hashes and create
a set of tabbed dialogs for each key of the large hash
where each tab has a form to set each key-value pair
of the embedded hashes.

Toward this end I looked at Erik Veenstra's RubyWebDialogs,
but he said that it is dead in favor of Rails.  I want
something less heavy that I can wrap my tiny brain around.

Does anyone have a non-database-backed Camping app with tabs
they could share as an example?  (Or suggest an alternative
approach entirely.)

Thanks,
--
Bil Kleb
http://fun3d.larc.nasa.gov
Lennon Day-Reynolds | 10 Feb 2007 01:34
Picon
Gravatar

Re: a series of tabbed forms

On 2/9/07, Bil Kleb <Bil.Kleb@...> wrote:
> Does anyone have a non-database-backed Camping app with tabs
> they could share as an example?  (Or suggest an alternative
> approach entirely.)

Leaving out the database is easy -- just don't inherit from Base
(a.k.a. ActiveRecord::Base) in your model classes. In fact, for your
model, it looks like you could basically have a single
(namelist-backed) model class, representing a 'tab' worth of data from
your namelist file. Presumably, you've written (or have ideas about
how to write) the namelist marshalling code, and some sort of handler
for the metadata files described in your Tadalist item.

As far as making it "tabbed", I would personally probably just make
each "tab" a separate page to render, defining a controller class that
took the tab as a URL parameter, and having it load the current 'tab'
worth of data. See the attached example app for some code that does
this (albeit using a minimal, ugly chunk of CSS).

Does that help at all?

-Lennon
Attachment (tabbing.rb): text/x-ruby-script, 1944 bytes
_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Bil Kleb | 11 Feb 2007 13:52
Picon
Favicon

"no camping required" deployment?

Hi,

So Lennon got me going with my database-less Camping app,
but I've just realized that, I have no deployment strategy.

This app is to provide a GUI front end to our FUN3D fluid
flow simulation monster, which is used by ourselves, companies,
universities, hobbyists, and the military.  The end result
of which, is a file of (key, value) pairs read by FUN3D.

Requiring our users to have Camping installed is too much
to ask.  While we could host the Camping app, the hassle
of getting it approved by our IT folks is daunting, and
requiring an Internet connection is troublesome for our
black-world users.

So, I'm thinking either a stand-alone executable (via
RubyScript2Exe?) or a set of static HTML pages they could
load locally?

Any other suggestions?

Thanks,
--
Bil Kleb
http://fun3d.larc.nasa.gov
Bil Kleb | 10 Feb 2007 18:09
Picon
Favicon

Re: a series of tabbed forms

Lennon Day-Reynolds wrote:
> 
> Does that help at all?

Oh yes!

Thanks,
--
Bil Kleb
http://funit.rubyforge.org
Eric Mill | 11 Feb 2007 17:55
Picon
Gravatar

Re: "no camping required" deployment?

You can just include the camping library alongside the app.  Put
camping.rb (and maybe the folder 'camping' that has some helper
scripts for sessions, webrick, etc.) in the same directory as your
main .rb file.  In your script, when you say "require 'camping'" it
will load Camping from there, instead of looking for the gem.  If you
remove "require 'rubygems'" from your script, you can test it on your
machine to make sure it's working, without uninstalling the gem.

-- Eric

On 2/11/07, Bil Kleb <Bil.Kleb@...> wrote:
> Hi,
>
> So Lennon got me going with my database-less Camping app,
> but I've just realized that, I have no deployment strategy.
>
> This app is to provide a GUI front end to our FUN3D fluid
> flow simulation monster, which is used by ourselves, companies,
> universities, hobbyists, and the military.  The end result
> of which, is a file of (key, value) pairs read by FUN3D.
>
> Requiring our users to have Camping installed is too much
> to ask.  While we could host the Camping app, the hassle
> of getting it approved by our IT folks is daunting, and
> requiring an Internet connection is troublesome for our
> black-world users.
>
> So, I'm thinking either a stand-alone executable (via
> RubyScript2Exe?) or a set of static HTML pages they could
> load locally?
(Continue reading)

Lennon Day-Reynolds | 11 Feb 2007 20:26
Picon
Gravatar

Re: "no camping required" deployment?

On 2/11/07, Bil Kleb <Bil.Kleb@...> wrote:
> So, I'm thinking either a stand-alone executable (via
> RubyScript2Exe?) or a set of static HTML pages they could
> load locally?

I've used both RubyScript2Exe and Exerb in the past, and actually had
quite-good results. It's been a while since I had to support Windows
deployment, but if I recall correctly, RubyScript2Exe offered somewhat
simpler packaging, while Exerb allowed for much smaller .exe files,
since you could use a compressor like UPX on the "core" image files it
used to shrink them considerably.

(Again, it's been at least two years since I really had to think about
any of this, though, so I'd check out both projects and see where
they've gone in the meantime.)

RS2E does have the additional advantage of being cross-platform, so if
you anticipate having any need to support Linux or Mac OS users, it
would be the obvious choice.

Good luck,

Lennon
Matt Jones | 14 Feb 2007 06:00
Picon

Linking between Camping apps?

I've been working with Camping for a little while, reading through the
examples. The "Small Apps, Many Mounts" idea makes sense, and
interacting with other apps' models (using the full class name) works
just as it should.

But what is the best way to include links to other mounted applications?
As a toy example, I'm trying to add links to the pages in the Tepee example
to the index page of the Blog example. I've got this code:

    class Index < R '/'
        def get
             <at> posts = Post.find :all
             <at> pages = Tepee::Models::Page.find :all
            render :index
        end
    end

in Blog::Controllers, and a view that looks like:

    def index
      if  <at> posts.empty?
        p 'No posts found.'
        p { a 'Add', :href => R(Add) }
      else
        for post in  <at> posts
          _post(post)
        end
        for page in  <at> pages
          p { a page.title, :href => self/R(Tepee::Controllers::Show, page) }
        end
(Continue reading)

Nagy Bence | 18 Feb 2007 17:40
Picon

FastCGI without ScriptAlias

Hi,

I made some experiments with the sample blog application, my index.fcgi 
file contains the following:

require 'camping/fastcgi'
Camping::Models::Base.establish_connection(
	:adapter => 'sqlite3',
	:database => 'database/camping.db'
)
Camping::FastCGI.serve('blog.rb')

Without ScriptAlias the application works fine, but only if I give the 
url with "index.fcgi/" at the end 
(http://localhost/~gimb/camping/index.fcgi/). Loading 
http://localhost/~gimb/camping/ or 
http://localhost/~gimb/camping/index.fcgi (no slash at the end) gives an 
error:

./lib/camping/fastcgi.rb:180:in `camp_do': undefined local variable or 
method `exc' for #<Camping::FastCGI:0xb78443e4> (NameError)
         from ./lib/camping/fastcgi.rb:79:in `start'
         from /usr/lib/ruby/1.8/fcgi.rb:117:in `session'
         from /usr/lib/ruby/1.8/fcgi.rb:104:in `each_request'
         from /usr/lib/ruby/1.8/fcgi.rb:36:in `each'
         from ./lib/camping/fastcgi.rb:78:in `start'
         from ./lib/camping/fastcgi.rb:90:in `start'
         from ./lib/camping/fastcgi.rb:123:in `serve'
         from /home/gimb/public_html/camping/index.fcgi:8

(Continue reading)

Jonas Pfenniger | 26 Feb 2007 16:17
Picon
Gravatar

Looking for a dev

Hello,

I'm working for a small Swiss company called STVS[1]. Our product is about to be
released and we're looking for more developers to join our Team !

What we're looking for is a good ruby developer that is able to think out of
the box and that is not afraid of "technologies" like Camping. Yeah, we're
using Camping ! We mainly code in Ruby but for some times
we do a little bit of C and bash scripting. Some knowledge in Linux and esp.
Gentoo is very good since we distribute our product in a derived Gentoo distro.
You'll also need to know HTML and Javascript. But what matters the most is that
you are independent and flexible.

So if you're interested, the best way to apply is to choose a ruby quiz[2], write
a unique solution and send us the result with your CV and a small explanation
of why you chose that quiz.

With hope to see you at my work,

  Jonas Pfenniger

[1] : http://stvs.ch
[2] : http://www.rubyquiz.com/

_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Dan Gottlieb | 27 Feb 2007 03:28

Camping on Dreamhost - Please Help!

Hi Folks,

I've been trying to get camping up and running on dreamhost for the
past six hours, but have had no success.  I'd really appreciate any
suggestions!

The camping gem is on the dreamhost server, but just to make sure it
wasn't a dependency issue causing all the problems, I installed
camping + the full set of dependencies in my own gem directory (both
are on the GEM_PATH).  Other gems in this directory work fine.

The following script, which really just loads camping, works from the
command line, but gives me a internal server error if I invoke it as a
cgi. When I substitute any other gem for camping (for example gruff)
it runs fine as a cgi.

#!/usr/bin/ruby

require 'rubygems'
require 'camping' # 'gruff'

puts "Content-Type: text/html"
puts
puts "<html>"
puts "<body>"
puts "<h1>Hello World</h1>"
puts "</body>"
puts "</html>"

This next script gives me a "(eval):14:in `initialize': private method
`sub' called for nil:NilClass (NoMethodError)" error on the command
line, and an "internal server error" as a cgi.  Of course it runs
perfectly on my dev machine :).

#! /usr/bin/ruby

require 'rubygems'
require 'camping'

Camping.goes :TestPage

module TestPage::Controllers

 class Index < R '/'
   def get
     render :index
   end
 end

end

module TestPage::Views

   def index
     h1 "Hello World"
   end

end

if __FILE__ == $0
 puts TestPage.run
end

Please help - I'd really love to use camping for this project!  Thanks!

Dan

Gmane