From Bil.Kleb at nasa.gov Fri Feb 9 16:07:16 2007 From: Bil.Kleb at nasa.gov (Bil Kleb) Date: Fri, 09 Feb 2007 16:07:16 -0500 Subject: a series of tabbed forms Message-ID: <45CCE284.10103@NASA.gov> 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 From rcoder at gmail.com Fri Feb 9 19:34:11 2007 From: rcoder at gmail.com (Lennon Day-Reynolds) Date: Fri, 9 Feb 2007 16:34:11 -0800 Subject: a series of tabbed forms In-Reply-To: <45CCE284.10103@NASA.gov> References: <45CCE284.10103@NASA.gov> Message-ID: <5d4c61240702091634x406b1fccr18e896f408ac7837@mail.gmail.com> On 2/9/07, 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: tabbing.rb Type: text/x-ruby-script Size: 1943 bytes Desc: not available Url : http://rubyforge.org/pipermail/camping-list/attachments/20070209/88aa7ffe/attachment.bin From Bil.Kleb at nasa.gov Sat Feb 10 12:09:52 2007 From: Bil.Kleb at nasa.gov (Bil Kleb) Date: Sat, 10 Feb 2007 12:09:52 -0500 Subject: a series of tabbed forms In-Reply-To: <5d4c61240702091634x406b1fccr18e896f408ac7837@mail.gmail.com> References: <45CCE284.10103@NASA.gov> <5d4c61240702091634x406b1fccr18e896f408ac7837@mail.gmail.com> Message-ID: <45CDFC60.6090501@NASA.gov> Lennon Day-Reynolds wrote: > > Does that help at all? Oh yes! Thanks, -- Bil Kleb http://funit.rubyforge.org From Bil.Kleb at nasa.gov Sun Feb 11 07:52:18 2007 From: Bil.Kleb at nasa.gov (Bil Kleb) Date: Sun, 11 Feb 2007 07:52:18 -0500 Subject: "no camping required" deployment? Message-ID: <45CF1182.4040700@NASA.gov> 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 From kprojection at gmail.com Sun Feb 11 11:55:47 2007 From: kprojection at gmail.com (Eric Mill) Date: Sun, 11 Feb 2007 11:55:47 -0500 Subject: "no camping required" deployment? In-Reply-To: <45CF1182.4040700@NASA.gov> References: <45CF1182.4040700@NASA.gov> Message-ID: 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 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? > > Any other suggestions? > > Thanks, > -- > Bil Kleb > http://fun3d.larc.nasa.gov > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From rcoder at gmail.com Sun Feb 11 14:26:29 2007 From: rcoder at gmail.com (Lennon Day-Reynolds) Date: Sun, 11 Feb 2007 11:26:29 -0800 Subject: "no camping required" deployment? In-Reply-To: <45CF1182.4040700@NASA.gov> References: <45CF1182.4040700@NASA.gov> Message-ID: <5d4c61240702111126t576c4c47yfc5eb26a811e4ca1@mail.gmail.com> On 2/11/07, 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 From mdj.acme at gmail.com Wed Feb 14 00:00:17 2007 From: mdj.acme at gmail.com (Matt Jones) Date: Wed, 14 Feb 2007 00:00:17 -0500 Subject: Linking between Camping apps? Message-ID: <50147c460702132100k5429a04i10076e832ee160@mail.gmail.com> 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 @posts = Post.find :all @pages = Tepee::Models::Page.find :all render :index end end in Blog::Controllers, and a view that looks like: def index if @posts.empty? p 'No posts found.' p { a 'Add', :href => R(Add) } else for post in @posts _post(post) end for page in @pages p { a page.title, :href => self/R(Tepee::Controllers::Show, page) } end end end in Blog::Views. The links produced look like "/blog/blog/1", which is not correct. It seems like I need an instance of Tepee::Mab rather than 'self' (which is an instance of Blog::Mab) in the self/R part above. Is there an easier solution than just constructing one manually? (Yes, I realize the links could be written out explicitly, but it seems a shame to hard-code mounts when the rest of the code so cleanly handles constructing the URLs correctly.) Thanks, -- Matt Jones mdj.acme at gmail.com President/Technical Director, Acme Art Company (acmeartco.org) From lists at tipogral.hu Sun Feb 18 11:40:44 2007 From: lists at tipogral.hu (Nagy Bence) Date: Sun, 18 Feb 2007 17:40:44 +0100 Subject: FastCGI without ScriptAlias Message-ID: <45D8818C.5040204@tipogral.hu> 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 # (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 With ScriptAlias the program run correctly on my computer, but my hosting provider gives access only for the .htaccess files, so there I can not use this directive. Is any other way to run camping programs only with or maybe without .htaccess tricks? Greetings, Bence -- Nagy Bence -> Tipogr?l.hu | www.tipogral.hu -> Tipokert | www.tipokert.hu -> Magyar Grafika | www.mgonline.hu -> H?rkapu | www.hirkapu.hu From zimbatm at oree.ch Mon Feb 26 10:17:38 2007 From: zimbatm at oree.ch (Jonas Pfenniger) Date: Mon, 26 Feb 2007 16:17:38 +0100 Subject: Looking for a dev Message-ID: 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/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20070226/48f5c4cf/attachment.html From camping at dan-gottlieb.com Mon Feb 26 21:28:08 2007 From: camping at dan-gottlieb.com (Dan Gottlieb) Date: Mon, 26 Feb 2007 21:28:08 -0500 Subject: Camping on Dreamhost - Please Help! Message-ID: 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 "" puts "" puts "

Hello World

" puts "" puts "" 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 From lists at tipogral.hu Tue Feb 27 02:29:48 2007 From: lists at tipogral.hu (Nagy Bence) Date: Tue, 27 Feb 2007 08:29:48 +0100 Subject: Camping only with .htaccess Message-ID: <45E3DDEC.8050108@tipogral.hu> Hi, I found a solution for running Camping applications without having access to /etc/apache2/* files. Only two small settings: 1. A small .htaccess file, which contains the following: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ http://nagybence.inter.hu/camping/index.fcgi/$1 [P,L] 2. A little modification in Camping's source: @status, @method, @env, @headers, @root = 200, m.downcase, e, {'Content-Type'=>'text/html'}, e.SCRIPT_NAME.sub(/\/$/,'') to: @status, @method, @env, @headers, @root = 200, m.downcase, e, {'Content-Type'=>'text/html'}, File.dirname(e.SCRIPT_NAME) Now I can make a lot of small applications with my cheap website account. Really good new! The (a little bit modified) sample blog application is located on http://nagybence.inter.hu/camping/ Greetings, Bence -- Nagy Bence -> Tipogr?l.hu | www.tipogral.hu -> Tipokert | www.tipokert.hu -> Magyar Grafika | www.mgonline.hu -> H?rkapu | www.hirkapu.hu