Re: Something is wrong with Camping::H in the svn version

2007-10-15 Thread Nagy Bence
Dear zimbatm,

 you should drop your session table once. Camping::H now inherits from
 Hash but your sessions data still use HashWithIndifferentAccess.
   

problem solved... Thanks!

Greetings, Bence

-- 
Nagy Bence
- Tipográl | www.tipogral.hu
- Tipokert | www.tipokert.hu
- Dekk | www.dekk.hu
- Magyar Grafika | www.mgonline.hu
- Hírkapu | www.hirkapu.hu

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and sessions proposal.

2007-10-10 Thread why the lucky stiff
On Wed, Oct 10, 2007 at 10:09:46AM -0600, Aria Stewart wrote:
 Keep camping light, move sessions as far out of the core as possible!

I'd be okay leaving sessions out.  I think zimbatm's Hash is great,
because it's peewee and it gets the basic methods across for
everyone else to override.  If you're using more than one process
for a Camping app, then you're probably crazy enough to prescribe
your own potions.

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and sessions proposal.

2007-10-10 Thread Nagy Bence
I am using a slightly different session modul with a small and dirty 
Camping hack for implemeting the Remember me function (used on 
http://dekk.hu/).


@headers[Set-Cookie[EMAIL 
PROTECTED]|k,v|#{k}=#{k=~/_sid$/?v:C.escape(v)};#{max-age=0;if 
!v}path=#{self/'/'}if [EMAIL PROTECTED];


Camping does not escape a cookie variable if its name ends with _sid, 
so i can add after the session_id a max_age value as described below in 
remember_me and forget_me functions. (The application function gets 
only the name of the the app.)


module Camping

  module WigwamSession
include Camping::Helpers

def sessioncookie
  #{application.to_s.downcase}_sid
end

def remember_me
  @cookies[sessioncookie] = @session_id + ';max-age=31536000'
end

def forget_me
  @cookies[sessioncookie] = @session_id + ';max-age=0'
end

def service(*a)
  session = Camping::Models::WigwamSession.find_by_sessionid 
@cookies[sessioncookie] if @cookies[sessioncookie]
  if session
@session_id = session.sessionid
@state = session.variables
  else
@session_id = [*0..31].map { ([*'A'..'Z'] + [*'a'..'z'] + 
[*'0'..'1'])[rand(62)] }.join
@state = Camping::H[]
  end
  @cookies[sessioncookie] = @session_id
  state = @state.dup
  s = super(*a)
  if @state.empty?
session.destroy if session
  elsif @state != state
unless session
  Camping::Models::WigwamSession.create :sessionid = 
@session_id, :variables = @state
else
  session.variables = @state
  session.save
end
  end
  s
end
  end
end


The possibility of adding max-age value for a cookie in the new 
version of Camping without hack the original source would be really great...

Greetings, Bence

-- 
Nagy Bence
- Tipográl | www.tipogral.hu
- Tipokert | www.tipokert.hu
- Dekk | www.dekk.hu
- Magyar Grafika | www.mgonline.hu
- Hírkapu | www.hirkapu.hu

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


RE: Session handling busted on Oracle

2007-10-09 Thread Berger, Daniel
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Jonas Pfenniger
 Sent: Monday, October 08, 2007 12:23 PM
 To: camping-list@rubyforge.org
 Subject: Re: Session handling busted on Oracle
 
 
 2007/10/8, Berger, Daniel [EMAIL PROTECTED]:
  Was there something else I should have used?
 
 Well technically, the id field is not necessary anymore. I 
 don't know how AR will react if it is set. Also, are you sure 
 that you are using camping from trunk ?
 
 Btw, here is the schema I have on sqlite :
 
 CREATE TABLE sessions (hashid varchar(32) NOT NULL, 
 created_at datetime DEFAULT NULL, ivars text DEFAULT NULL);

Upon further review that isn't going to work. You can't set the @state
variable without an id field.

Camping Problem!
FastPath::Controllers::Login.POST
ActiveRecord::StatementInvalid OCIError: ORA-00904: ID: invalid
identifier: UPDATE sessions SET hashid =
'iNr6UPnc3KjbQBxZwktujSIENXWIhzfd', ivars = '---
!map:HashWithIndifferentAccess FastPath: !map:HashWithIndifferentAccess
cuid: true ', created_at = '2007-10-09 11:00:32' WHERE id = NULL:
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/con
nection_adapters/abstract_adapter.rb:128:in `log'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/con
nection_adapters/oracle_adapter.rb:222:in `execute'

...

Suggestions?

Thanks,

Dan


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


RE: Session handling busted on Oracle

2007-10-09 Thread Berger, Daniel


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Berger, Daniel
 Sent: Tuesday, October 09, 2007 11:15 AM
 To: camping-list@rubyforge.org
 Subject: RE: Session handling busted on Oracle
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Jonas Pfenniger
  Sent: Monday, October 08, 2007 12:23 PM
  To: camping-list@rubyforge.org
  Subject: Re: Session handling busted on Oracle
  
  
  2007/10/8, Berger, Daniel [EMAIL PROTECTED]:
   Was there something else I should have used?
  
  Well technically, the id field is not necessary anymore. I
  don't know how AR will react if it is set. Also, are you sure 
  that you are using camping from trunk ?
  
  Btw, here is the schema I have on sqlite :
  
  CREATE TABLE sessions (hashid varchar(32) NOT NULL,
  created_at datetime DEFAULT NULL, ivars text DEFAULT NULL);
 
 Upon further review that isn't going to work. You can't set 
 the @state variable without an id field.

Upon further review of the previous review, it seems the problem is not
the ID field, but the datatype of the ivars field. I went with this:

CREATE TABLE sessions (
   id number primary key,
   hashid varchar(32) NOT NULL,
   created_at date DEFAULT NULL,
   ivars varchar(256) DEFAULT NULL
);

So far, so good

Regards,

Dan


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Session handling busted on Oracle

2007-10-09 Thread David Gurba
after a bit of fuss ... i fully shipped off EES at 8am today to Jason  
at Bren.

I'm dabbling in drupal at the moment in some core themeing  
components.  I know that I will need at least 2 other things to do  
this week besides IDs site ...

Sakai themeing or ASP-PHP are others items i'm aware of ... but not  
sure as to the resource locations.

-dg

On Oct 9, 2007, at 10:57 AM, Berger, Daniel wrote:



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Berger, Daniel
 Sent: Tuesday, October 09, 2007 11:15 AM
 To: camping-list@rubyforge.org
 Subject: RE: Session handling busted on Oracle


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Jonas Pfenniger
 Sent: Monday, October 08, 2007 12:23 PM
 To: camping-list@rubyforge.org
 Subject: Re: Session handling busted on Oracle


 2007/10/8, Berger, Daniel [EMAIL PROTECTED]:
 Was there something else I should have used?

 Well technically, the id field is not necessary anymore. I
 don't know how AR will react if it is set. Also, are you sure
 that you are using camping from trunk ?

 Btw, here is the schema I have on sqlite :

 CREATE TABLE sessions (hashid varchar(32) NOT NULL,
 created_at datetime DEFAULT NULL, ivars text DEFAULT NULL);

 Upon further review that isn't going to work. You can't set
 the @state variable without an id field.

 Upon further review of the previous review, it seems the problem is  
 not
 the ID field, but the datatype of the ivars field. I went with this:

 CREATE TABLE sessions (
id number primary key,
hashid varchar(32) NOT NULL,
created_at date DEFAULT NULL,
ivars varchar(256) DEFAULT NULL
 );

 So far, so good

 Regards,

 Dan


 This communication is the property of Qwest and may contain  
 confidential or
 privileged information. Unauthorized use of this communication is  
 strictly
 prohibited and may be unlawful.  If you have received this  
 communication
 in error, please immediately notify the sender by reply e-mail and  
 destroy
 all copies of the communication and any attachments.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Session handling busted on Oracle

2007-10-09 Thread Julian 'Julik' Tarkhanov


On Oct 9, 2007, at 7:57 PM, Berger, Daniel wrote:



So far, so good


I know it's a minority concern, but maybe it is a good idea to make  
that ID field present and use it accordingly.

--
Julian 'Julik' Tarkhanov
please send all personal mail to [EMAIL PROTECTED]



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Camping and sessions proposal.

2007-10-09 Thread Julian 'Julik' Tarkhanov

On 10-okt-2007, at 0:09, Jonas Pfenniger wrote:
 ActiveRecord doesn't seem to handle
 hashid as an identifier, plus it doesn't seem to be fully consistent
 across the various RDBMS.
Only if you want to totally insist and not give it an ID then yes, it  
becomes a kind of a nuisance (your insistance is not
justified though, as I mentioned in the ticket) because an integer is  
actually quite big.
You gain little on the cleanness side, but you lose on the  
implementation and compatibility.

 On the other hand, the scope of the project
 does not permit to implement all kind of client persistence.
+1

 So here is what I propose : Camping will only provide an in-process
 session store with no real security built-in. See it as a hack-ready
 example that will allow you to make your internal apps work quickly
 (ak. no DB dependency).
-1
If we sooo want to dump the DB, why not use PStore? I think  
multiprocess sessions are a must. Be aware that the RAM is not  
rubberized either.
I like the implementation with load_state / save_state but I wonder:
a) in-mem sessions are nasty, please don't
b) how is that supposed to work with many applications on one server?  
which application decides which session driver is going to be used?

If you ask me, I'd say sessions should stay with the DB (also  
considering that people are using them and there are session records  
in the wild).
Give AR that ID and let it shut up :-)

-- 
Julian 'Julik' Tarkhanov
please send all personal mail to
me at julik.nl


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping-list Digest, Vol 18, Issue 1

2007-10-08 Thread Brian Corrigan
UNSUBSCRIBE
On Oct 5, 2007, at 1:27 PM, [EMAIL PROTECTED] wrote:

 Send Camping-list mailing list submissions to
   camping-list@rubyforge.org

 To subscribe or unsubscribe via the World Wide Web, visit
   http://rubyforge.org/mailman/listinfo/camping-list
 or, via email, send a message with subject or body 'help' to
   [EMAIL PROTECTED]

 You can reach the person managing the list at
   [EMAIL PROTECTED]

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Camping-list digest...


 Today's Topics:

1. Re: putting away HashWithIndifferentAccess (Jonas Pfenniger)
2. Re: PUT (and friends) bug? (Brendan Taylor)
3. Re: PUT (and friends) bug? (cdr)
4. Re: PUT (and friends) bug? (Jonas Pfenniger)
5. Session handling busted on Oracle (Berger, Daniel)
6. Cookie session handling? (Berger, Daniel)
7. Re: Session handling busted on Oracle (Jonas Pfenniger)
8. Re: Cookie session handling? (Jonas Pfenniger)
9. Re: Session handling busted on Oracle (Julian 'Julik' Tarkhanov)


 --

 Message: 1
 Date: Sat, 29 Sep 2007 01:16:18 +0200
 From: Jonas Pfenniger [EMAIL PROTECTED]
 Subject: Re: putting away HashWithIndifferentAccess
 To: camping-list@rubyforge.org
 Message-ID:
   [EMAIL PROTECTED]
 Content-Type: text/plain; charset=iso-8859-1

 2007/9/27, why the lucky stiff [EMAIL PROTECTED]:
 Well, case-sensitiveness would be a prob with 1.5 as well.  Since
 @env.HTTP_HOST will work and @env.http_host will not.

 True. So what do you think of the attached patch ? It removes roughly
 50 octets to camping.rb and seems to work pretty well, except for apps
 that used :symbols to access H members.

 --  
 Cheers,
   zimbatm
 -- next part --
 A non-text attachment was scrubbed...
 Name: camping-no-HWIA.diff
 Type: text/x-diff
 Size: 4911 bytes
 Desc: not available
 Url : http://rubyforge.org/pipermail/camping-list/attachments/ 
 20070929/baa051db/attachment-0001.bin

 --

 Message: 2
 Date: Fri, 28 Sep 2007 19:23:57 -0600
 From: Brendan Taylor [EMAIL PROTECTED]
 Subject: Re: PUT (and friends) bug?
 To: camping-list@rubyforge.org
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain; charset=us-ascii

 On Fri, Sep 28, 2007 at 03:22:23PM -0400, Nathaniel Talbott wrote:
 As far as I can tell, sending an actual HTTP PUT request to a Camping
 app will never parse the params out of the request body - or am I
 going nuts? This code seems to say only POST's will parse the request
 body:

   elsif @method == post and \
   e.CONTENT_TYPE == application/x-www-form-urlencoded
 q.u(C.qsp(@in.read))
   end

 The @method == post test is a vestige of when Camping just parsed
 anything that was POSTed. I didn't really think about it when I
 submitted the patch to test the Content-Type.

 AFAIK there's no reason not to remove the method test altogether; use
 those bytes for something more useful.
 -- next part --
 A non-text attachment was scrubbed...
 Name: not available
 Type: application/pgp-signature
 Size: 189 bytes
 Desc: not available
 Url : http://rubyforge.org/pipermail/camping-list/attachments/ 
 20070928/d90429e5/attachment-0001.bin

 --

 Message: 3
 Date: Sat, 29 Sep 2007 08:50:47 -0400
 From: cdr [EMAIL PROTECTED]
 Subject: Re: PUT (and friends) bug?
 To: camping-list@rubyforge.org
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain; charset=us-ascii

 The @method == post test is a vestige of when Camping just parsed
 anything that was POSTed. I didn't really think about it when I
 submitted the patch to test the Content-Type.

 AFAIK there's no reason not to remove the method test altogether; use
 those bytes for something more useful.

 agreed. you can handle request body - @input for any method except  
 the ones that explicitly forbid request bodies (GET, HEAD, OPTIONS/ 
 TRACE?..), in one swoop.

 the MIME test must stay, of course. otherwise when you add support  
 for other MIMEs using #service it silenty fails trying to parse  
 JSON or whatever as QSVars..


 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list


 --

 Message: 4
 Date: Sun, 30 Sep 2007 22:27:45 +0200
 From: Jonas Pfenniger [EMAIL PROTECTED]
 Subject: Re: PUT (and friends) bug?
 To: camping-list@rubyforge.org
 Message-ID:
   [EMAIL PROTECTED]
 Content-Type: text/plain; charset=ISO-8859-1

 Okay, I'll remove the test then.

 -- 
 Cheers,
   zimbatm


 --

 Message: 5
 Date: Fri, 5 Oct 2007 08:38:57 -0500
 From: Berger, Daniel [EMAIL PROTECTED]
 Subject: Session handling busted on Oracle
 To: camping-list@rubyforge.org
 Message-ID:
   [EMAIL PROTECTED]
 Content-Type: text/plain; charset=us-ascii

 Hi,

 Ruby 1.8.6 

Re: Session handling busted on Oracle

2007-10-08 Thread Jonas Pfenniger
2007/10/8, Berger, Daniel [EMAIL PROTECTED]:
 Was there something else I should have used?

Well technically, the id field is not necessary anymore. I don't know
how AR will react if it is set. Also, are you sure that you are using
camping from trunk ?

Btw, here is the schema I have on sqlite :

CREATE TABLE sessions (hashid varchar(32) NOT NULL, created_at
datetime DEFAULT NULL, ivars text DEFAULT NULL);


-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


RE: Session handling busted on Oracle

2007-10-08 Thread Berger, Daniel
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Jonas Pfenniger
 Sent: Monday, October 08, 2007 12:23 PM
 To: camping-list@rubyforge.org
 Subject: Re: Session handling busted on Oracle
 
 
 2007/10/8, Berger, Daniel [EMAIL PROTECTED]:
  Was there something else I should have used?
 
 Well technically, the id field is not necessary anymore. I 
 don't know how AR will react if it is set. Also, are you sure 
 that you are using camping from trunk ?
 
 Btw, here is the schema I have on sqlite :
 
 CREATE TABLE sessions (hashid varchar(32) NOT NULL, 
 created_at datetime DEFAULT NULL, ivars text DEFAULT NULL);

Ok, this is what I went with:

CREATE TABLE sessions (
   hashid varchar(32) NOT NULL,
   created_at date DEFAULT NULL,
   ivars varchar(256) DEFAULT NULL
);

It seems to be working, so I'm guessing that the id field was indeed the
culprit.

We'll see how it goes. Many thanks!

Dan


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Cookie session handling?

2007-10-07 Thread Jonas Pfenniger
2007/10/5, why the lucky stiff [EMAIL PROTECTED]:
 On Fri, Oct 05, 2007 at 06:08:12PM +0200, Jonas Pfenniger wrote:
  I like the idea pretty much. What do you think of simply using a
  Camping::H that is process-persistent ?

 Sure, and maybe it doesn't really need to be process-persistent.

How can it be less than process-persistent ? Instance persistent ? Or
is it irony and it means not persistent at all ? :p

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Session handling busted on Oracle

2007-10-07 Thread Jonas Pfenniger
Weird, the ivars field should have been defined in the generate
function. Did you drop the session schema on beforehand ?

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Cookie session handling?

2007-10-07 Thread Julian 'Julik' Tarkhanov

On 7-okt-2007, at 18:55, Jonas Pfenniger wrote:

 2007/10/5, why the lucky stiff [EMAIL PROTECTED]:
 On Fri, Oct 05, 2007 at 06:08:12PM +0200, Jonas Pfenniger wrote:
 I like the idea pretty much. What do you think of simply using a
 Camping::H that is process-persistent ?

 Sure, and maybe it doesn't really need to be process-persistent.

 How can it be less than process-persistent ? Instance persistent ? Or
 is it irony and it means not persistent at all ? :p

As mentioned previously, you have cliented sessions with signing -  
but then you are limited to the cookie size minus
the signature.

Personally I'm all for different session drivers - some kind of  
agreement what a session should and sould not do perhaps?
Then you can plug session/cookies, session/files or session/db at  
your heart's content. The thing of note is that
I think it should be configurable per app (because some apps have  
different session size requirements, and some apps would
not want to reveal the session content in a cookie).
-- 
Julian 'Julik' Tarkhanov
please send all personal mail to
me at julik.nl


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Cookie session handling?

2007-10-07 Thread Evan Weaver
 Personally I'm all for different session drivers - some kind of
 agreement what a session should and sould not do perhaps?
 Then you can plug session/cookies, session/files or session/db at
 your heart's content. The thing of note is that
 I think it should be configurable per app (because some apps have
 different session size requirements, and some apps would
 not want to reveal the session content in a cookie).

I agree; a suite of session drivers would be a useful addition. If no
one else steps up, eventually I would be able to write them, but I am
very busy right now and don't have an immediate need for different
session types.

All right, back to the woods.

Evan

-- 
Evan Weaver
Cloudburst, LLC
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Session handling busted on Oracle

2007-10-05 Thread Berger, Daniel
Hi,

Ruby 1.8.6 (one-click)
Camping 1.5

I'd submit this as a bug, but the tracker says I'm forbidden, so here
you go.

The first problem is that the sql to create the sessions table is
broken. This is what it tried to send:

CREATE TABLE sessions (
   id NUMBER(38) NOT NULL PRIMARY KEY (38), -- Problem here
   hashid VARCHAR2(32),
   created_at DATE,
   ivars CLOB DEFAULT empty_clob()
)

The problem is that second (38) after PRIMARY KEY. So, I removed
that and created the table manually.

The next problem was a missing Oracle sequence (which I had no idea was
required, but ok). I figured out (by stepping through oci8.rb) that the
name of the sequence should be sessions_seq. For that I used the
following snippet:

CREATE SEQUENCE ACS_SUPPORT.SESSIONS_SEQ
  START WITH 50
  MAXVALUE 999
  MINVALUE 0
  NOCYCLE
  CACHE 50
  NOORDER;

Unfortunately, there are still problems, and here's where I'm not sure
what's happening:

[2007-10-04 15:53:24] INFO  WEBrick 1.3.1
[2007-10-04 15:53:24] INFO  ruby 1.8.6 (2007-03-13) [i386-mswin32]
[2007-10-04 15:53:24] INFO  WEBrick::HTTPServer#start: pid=1736
port=3301
[2007-10-04 15:53:31] ERROR NoMethodError: undefined method `[]=' for
nil:NilClass
 
C:/ruby/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/session.rb:21:in
`[]='
 
C:/ruby/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/session.rb:110:in
`service'
(eval):44:in `run'
 
C:/ruby/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/reloader.rb:117:i
n `run'
 
C:/ruby/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/webrick.rb:45:in
`service'
C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
C:/ruby/lib/ruby/gems/1.8/gems/camping-1.5/bin/camping:244
C:/ruby/bin/camping:16:in `load'
C:/ruby/bin/camping:16

So, for whatever reason, it's not pulling the sessions_seq.nextval
properly. At least, that's my guess. I haven't debugged further as I
sorta lost energy at that point.

Any ideas?

Regards,

Dan


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Cookie session handling?

2007-10-05 Thread Evan Weaver
 Sure, and maybe it doesn't really need to be process-persistent.

Wouldn't that limit you to non-load-balanced apps, since you could
only have one simultaneous process if you want session consistency?

Evan

On 10/5/07, why the lucky stiff [EMAIL PROTECTED] wrote:
 On Fri, Oct 05, 2007 at 06:08:12PM +0200, Jonas Pfenniger wrote:
  I like the idea pretty much. What do you think of simply using a
  Camping::H that is process-persistent ?

 Sure, and maybe it doesn't really need to be process-persistent.
 Yes, that would be how Camping would want us to do it.

 _why
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list



-- 
Evan Weaver
Cloudburst, LLC
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Cookie session handling?

2007-10-05 Thread Aria Stewart

On Oct 5, 2007, at 3:54 PM, Evan Weaver wrote:

 Sure, and maybe it doesn't really need to be process-persistent.

 Wouldn't that limit you to non-load-balanced apps, since you could
 only have one simultaneous process if you want session consistency?

 Evan


Can always make it easy and well-defined to override. s/H/DHT with  
the right API/ and let 'em go.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: PUT (and friends) bug?

2007-09-30 Thread Jonas Pfenniger
Okay, I'll remove the test then.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: PUT (and friends) bug?

2007-09-29 Thread cdr
 The @method == post test is a vestige of when Camping just parsed
 anything that was POSTed. I didn't really think about it when I
 submitted the patch to test the Content-Type.
 
 AFAIK there's no reason not to remove the method test altogether; use
 those bytes for something more useful.

agreed. you can handle request body - @input for any method except the ones 
that explicitly forbid request bodies (GET, HEAD, OPTIONS/TRACE?..), in one 
swoop.

the MIME test must stay, of course. otherwise when you add support for other 
MIMEs using #service it silenty fails trying to parse JSON or whatever as 
QSVars..


 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and ruby2ruby

2007-09-28 Thread Jonas Pfenniger
2007/9/28, MenTaLguY [EMAIL PROTECTED]:
 Perhaps condensing ?

Yes, with a little touch of artistic sense added :)

Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: PUT (and friends) bug?

2007-09-28 Thread Nathaniel Talbott
On 9/28/07, Lennon Day-Reynolds [EMAIL PROTECTED] wrote:

 I honestly wouldn't expect PUT (or any other HTTP actions other than
 GET, POST, and HEAD) to pass the input through a normal
 form-decoding step -- most of the time, the payload for a PUT is
 going to be XML, JSON, or even raw binary.

 Since browsers won't do PUT, why build in support for what amounts
 to a browser-only MIME type (application/x-www-form-urlencoded)?

It seems to me that most restful frameworks are assuming that you can
PUT the same as you can POST, i.e. that other than the verb (and what
you might do with it) the two will be treated the same.

I actually ran in to this problem while mussing around with my little
Camping testing framework, since I was assuming that doing a proper
PUT would have the same affect as doing a simulated PUT using a
special query parameter. But I was surprised to find out that I was
wrong, and that things aren't parsed as one would expect.

Of course, there's also the fact that while browsers don't *currently*
support form verbs besides POST, I'm hopeful that that may change
eventually.

So am I wrong in assuming that PUT and other non-GET verbs should
support application/x-www-form-urlencoded, or is this something that
should be made to behave more consistently?


-- 
Nathaniel Talbott
:((
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: PUT (and friends) bug?

2007-09-28 Thread Aria Stewart
On Fri, 2007-09-28 at 22:50 +0200, Jonas Pfenniger wrote:
 2007/9/28, Nathaniel Talbott [EMAIL PROTECTED]:
  As far as I can tell, sending an actual HTTP PUT request to a Camping
  app will never parse the params out of the request body - or am I
  going nuts?
 
 No you aren't at all. Actually, Camping is only a toy to quickly hack
 small apps together. I am highly skeptical that we'll never be able to
 implement the 397K of the HTTP1.1 rfc into it's 4K limitation but I
 would be happy if somebody does it :) In the mean time, it doesn't
 mean that it can't provide some facilities for extension. Actually,
 the initialize method is the biggest method in Camping and I remember
 _why talking about splitting it up.
 
 Concerning the PUT method, the rfc starts it's description with the
 following terms : The PUT method requests that the enclosed entity be
 stored under the supplied Request-URI. (sec9.6). As I understand it,
 it is intended to store files under a specific URL, but who knows what
 an entity exactly is ? If I am right, a form is not really a file
 since it's entries order are not strictly defined. At least, it
 rapidly becomes complex because the RFC doesn't specifies a strict
 list of accepted verbs. From the standard ones, OPTION, GET, HEAD and
 TRACE should be safe and thus not accepting post data I guess and
 DELETE makes no sense with an entity attached but I didn't find any
 MUST or SHOULD attached to that assertion.
 

The entity is the requst body. It's in the RFC.

PUT does specify to store something -- there's response codes for We
assigned a URI (201 -- Created, with Location:)

It's very different than POST -- Far more semantic load than POST.

I'm using PUT in Camping with no trouble -- XML body, doing CalDAV --
and it works well. But it's totally different than POST, true.

Aria


signature.asc
Description: This is a digitally signed message part
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: putting away HashWithIndifferentAccess

2007-09-28 Thread Jonas Pfenniger
2007/9/27, why the lucky stiff [EMAIL PROTECTED]:
 Well, case-sensitiveness would be a prob with 1.5 as well.  Since
 @env.HTTP_HOST will work and @env.http_host will not.

True. So what do you think of the attached patch ? It removes roughly
50 octets to camping.rb and seems to work pretty well, except for apps
that used :symbols to access H members.

-- 
Cheers,
  zimbatm
Index: lib/camping.rb
===
--- lib/camping.rb	(revision 232)
+++ lib/camping.rb	(working copy)
@@ -1,7 +1,7 @@
-%w[active_support markaby tempfile uri].map{|l|require l};module Camping;C=self
-S=IO.read(__FILE__)rescue nil;P=Cam\ping Problem!;H=HashWithIndifferentAccess
-class H;def method_missing m,*a;m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:super
-end;alias u regular_update;end;module Helpers def R c,*g;p,h=/\(.+?\)/,g.
+%w[markaby tempfile uri].map{|l|require l};module Camping;C=self
+S=IO.read(__FILE__)rescue nil;P=Cam\ping Problem!;class HHash;
+def method_missing m,*a;m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super
+end;alias u merge!;end;module Helpers def R c,*g;p,h=/\(.+?\)/,g.
 grep(Hash);(g-=h).inject(c.urls.find{|x|x.scan(p).size==g.size}.dup){|s,a|s.
 sub p,C.escape((a[a.class.primary_key]rescue a))}+(h.any?? ?+h[0].
 map{|x|x.map{|z|C.escape z}*=}*: )end;def /(p);p[/^\//[EMAIL PROTECTED]:p
@@ -17,11 +17,11 @@
 match e.CONTENT_TYPE;b=/(?:\r?\n|\A)#{Regexp::quote--#$1}(?:--)?\r$/;until
 @in.eof?;fh=H[];for l [EMAIL PROTECTED];case l;when Z;break;when/^Content-D.+?: form-data;/
 fh.u H[*$'.scan(/(?:\s(\w+)=([^]+))/).flatten];when
-/^Content-Type: (.+?)(\r$|\Z)/m;fh[:type]=$1;end;end;fn=fh[:name];o=if fh[
-:filename];o=fh[:tempfile]=Tempfile.new(:C);o.binmode;else;fh=end;s=8192;k=''
+/^Content-Type: (.+?)(\r$|\Z)/m;fh.type=$1;end;end;fn=fh.name;o=if fh.
+filename;o=fh.tempfile=Tempfile.new(:C);o.binmode;else;fh=end;s=8192;k=''
 [EMAIL PROTECTED](s*2);while l;if(kl)=~b;o$`.chomp;@in.seek(-$'.size,IO::SEEK_CUR)
-break;end;ok.slice!(0...s);[EMAIL PROTECTED](s);end;C.qsp(fn,';',fh,q)if fn;fh[
-:tempfile].rewind if fh.is_a?H;end;[EMAIL PROTECTED]post  e.CONTENT_TYPE==
+break;end;ok.slice!(0...s);[EMAIL PROTECTED](s);end;C.qsp(fn,';',fh,q)if fn;fh.
+tempfile.rewind if fh.is_a?H;end;[EMAIL PROTECTED]post  e.CONTENT_TYPE==
 application/x-www-form-urlencoded;q.u C.qsp(@in.read)end;@cookies,@[EMAIL PROTECTED]
 dup,q.dup end;def service*a;@body=send(@method,*a)if [EMAIL PROTECTED]
 headers[Set-Cookie]=cookies.map{|k,v|#{k}=#{C.escape v}; path=#{self/'/'}if
Index: lib/camping-unabridged.rb
===
--- lib/camping-unabridged.rb	(revision 232)
+++ lib/camping-unabridged.rb	(working copy)
@@ -28,7 +28,7 @@
 # http://rubyforge.org/projects/mongrel  Mongrel comes with examples
 # in its ttexamples/camping/tt directory. 
 #
-%w[active_support markaby tempfile uri].map { |l| require l }
+%w[markaby tempfile uri].map { |l| require l }
 
 # == Camping 
 #
@@ -85,8 +85,7 @@
   C = self
   S = IO.read(__FILE__) rescue nil
   P = Cam\ping Problem!
-  H = HashWithIndifferentAccess
-  # An object-like Hash, based on ActiveSupport's HashWithIndifferentAccess.
+  # An object-like Hash.
   # All Camping query string and cookie variables are loaded as this.
   # 
   # To access the query string, for instance, use the tt@input/tt variable.
@@ -109,7 +108,7 @@
   #
   # Use the tt@cookies/tt variable in the same fashion to access cookie variables.
   # Also, the tt@env/tt variable is an H containing the HTTP headers and server info.
-  class H
+  class H  Hash
 # Gets or sets keys in the hash.
 #
 #   @cookies.my_favorite = :macadamian
@@ -117,9 +116,9 @@
 #   = :macadamian
 #
 def method_missing(m,*a)
-m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:super
+m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super
 end
-alias u regular_update
+alias u merge!
   end
 
   # Helpers contains methods available in your controllers and views.  You may add
@@ -368,12 +367,12 @@
 when /^Content-D.+?: form-data;/
   fh.u H[*$'.scan(/(?:\s(\w+)=([^]+))/).flatten]
 when /^Content-Type: (.+?)(\r$|\Z)/m
-  fh[:type] = $1
+  fh.type = $1
 end
   end
-  fn=fh[:name]
-  o=if fh[:filename]
-o=fh[:tempfile]=Tempfile.new(:C)
+  fn=fh.name
+  o=if fh.filename
+o=fh.tempfile=Tempfile.new(:C)
 o.binmode
   else
 fh=
@@ -391,7 +390,7 @@
 [EMAIL PROTECTED](s) 
   end
   C.qsp(fn,';',fh,q) if fn
-  fh[:tempfile].rewind if fh.is_a?H
+  fh.tempfile.rewind if fh.is_a?H
 end
   elsif @method == post and e.CONTENT_TYPE == application/x-www-form-urlencoded
 q.u(C.qsp(@in.read))
@@ -673,7 +672,7 @@
 #   Blog.post(:Login, :input = {'username' = 'admin', 'password' = 'camping'})
 #   #= 

Re: PUT (and friends) bug?

2007-09-28 Thread Brendan Taylor
On Fri, Sep 28, 2007 at 03:22:23PM -0400, Nathaniel Talbott wrote:
 As far as I can tell, sending an actual HTTP PUT request to a Camping
 app will never parse the params out of the request body - or am I
 going nuts? This code seems to say only POST's will parse the request
 body:
 
   elsif @method == post and \
   e.CONTENT_TYPE == application/x-www-form-urlencoded
 q.u(C.qsp(@in.read))
   end

The @method == post test is a vestige of when Camping just parsed
anything that was POSTed. I didn't really think about it when I
submitted the patch to test the Content-Type.

AFAIK there's no reason not to remove the method test altogether; use
those bytes for something more useful.


pgpB8tqOB2RkY.pgp
Description: PGP signature
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: WEBrick Re: Next camping release

2007-09-27 Thread Jonas Pfenniger
2007/9/27, Ernest Prabhakar [EMAIL PROTECTED]:
 I was looking at the test cases on the changeset:

 http://code.whytheluckystiff.net/camping/browser/trunk/test?rev=227

 However, I didn't see anything about testing with different web
 browsers; which is a concern since there was a nasty WEBrick bug in
 the last version.  Is there test coverage for that?

Hi Ernie,

I didn't get into testing the various web servers yet. Ref 277 is the
base to do that, since those apps can be tested against the various
web servers. I know there are some issues with FastCGI too so I'll
have to get into it anyways.

 P.S. I mean to file the bug, but got into a fight with the trac
 system. ;-(

You need a http://rubyforge.org/ account, which you can then reuse
here : http://code.whytheluckystiff.net/access/
Once you are registered, you can log into the various Trac
applications. File upload doesn't work tough.

Anyways, you can still describe your bug on the list and I'll see what to do.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: WEBrick Re: Next camping release

2007-09-27 Thread Manfred Stienstra

On Sep 27, 2007, at 10:44, Jonas Pfenniger wrote:

 P.S. I mean to file the bug, but got into a fight with the trac
 system. ;-(

Patch uploads seem to be broken, so maybe _why can have a look-see?

Manfred
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Camping and ruby2ruby

2007-09-27 Thread Gregor Schmidt
Hi everybody,

I would like to use ruby2ruby in a caming project, but there seems to
be an incompatibility with camping, ruby2ruby and markaby.
Unfortunately I receive strange Markaby::InvalidXhtmlErrors.

To demonstrate, that only combination of all three components causes
the problem I added the following code. I relies on Markaby and
ruby2ruby only and works fine (a.k.a. as expected).

require rubygems
require ruby2ruby
require markaby

def example(block)
  $mab.pre( block.to_ruby.gsub(/^proc \{\n(.*)\n\}$/m, '\1'))
end

Markaby::Builder.set(:indent, 2)
$mab = Markaby::Builder.new
$mab.xhtml_strict do
  div.literate_markaby! do
example do
  1 + 1 == 2
end
  end
end
puts $mab.to_s

When I wrap that up in a camping project, which looks the following, I
get an error, when using tag! with arguments.

The Code:

require rubygems
require ruby2ruby

Camping.goes :Test

module Test
  module Controllers
class Index  R '/'
  def get
div.literate_programming! do
  example { 1 + 1 == 2 }
end
  end
end
  end

  module Helpers
def example(block)
  pre( block.to_ruby.gsub(/^proc \{\n(.*)\n\}$/m, '\1'))
end
  end
end

It raises Markaby::InvalidXhtmlError no attribute `href' on div
elements: in the line div.literate_programming! do . If I change it
to div do it works okay. Also every other way of providing arguments
raises the error (div.class_name, div(:rel = options), ...).

I don't know where the :href attribute comes from and I don't know,
why it only appears within camping and not in markaby itself.

Any help would be appreciated. Thanks in advance.

Cheers,

Gregor

Note: I'm using the latest release of camping (1.5.180), markaby (0.5)
and ruby2ruby (1.1.7)
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and ruby2ruby

2007-09-27 Thread Jonas Pfenniger
Hi Gregor,

I wasn't able to track the error on Camping side, but it comes from
r2r that defines nil.error_missing.

2007/9/27, Gregor Schmidt [EMAIL PROTECTED]:
 require rubygems
 require ruby2ruby

# It works in this case but probably breaks r2r on a larger scale.
class NilClass
  undef method_missing
end

 Camping.goes :Test

 module Test
   module Controllers
 class Index  R '/'
   def get
 div.literate_programming! do
   example { 1 + 1 == 2 }
 end
   end
 end
   end

   module Helpers
 def example(block)
   pre( block.to_ruby.gsub(/^proc \{\n(.*)\n\}$/m, '\1'))
 end
   end
 end

 I don't know where the :href attribute comes from and I don't know,
 why it only appears within camping and not in markaby itself.

Camping overrides [:href,:action,:src] to translate relative links to
absolute ones. See Mab at the end of camping-unabridged.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and ruby2ruby

2007-09-27 Thread Jonas Pfenniger
2007/9/27, Gregor Schmidt [EMAIL PROTECTED]:
 Defining NilClass#method_missing for nothing is not too clever, for a
 large scale libary IMO.

I'm not sure you understood, it is ruby2ruby who defined
nil.method_missing. We can't start to support each and every hack a
library will add to the Ruby core.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and ruby2ruby

2007-09-27 Thread John Beppu
On 9/27/07, Jonas Pfenniger [EMAIL PROTECTED] wrote:

 2007/9/27, Gregor Schmidt [EMAIL PROTECTED]:
  Defining NilClass#method_missing for nothing is not too clever, for a
  large scale libary IMO.

 I'm not sure you understood, it is ruby2ruby who defined
 nil.method_missing. We can't start to support each and every hack a
 library will add to the Ruby core.



^for this reason, you can't really use ruby2ruby in anything serious.
nil.method_missing prevents a lot of exceptions from being thrown, and
there's a lot of code out their that legitimately needs those exceptions to
be thrown for correct behavior.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Camping and ruby2ruby

2007-09-27 Thread Manfred Stienstra
On Sep 27, 2007, at 7:35 PM, John Beppu wrote:
 ^for this reason, you can't really use ruby2ruby in anything  
 serious.  nil.method_missing prevents a lot of exceptions from  
 being thrown, and there's a lot of code out their that legitimately  
 needs those exceptions to be thrown for correct behavior.

require 'ruby2ruby'
class NilClass
   undef method_missing
end

Solved?

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and ruby2ruby

2007-09-27 Thread Gregor Schmidt
Sorry, if I was misunderstood with saying

 Defining NilClass#method_missing for nothing is not too clever, for a
 large scale libary IMO.

I was insulting ruby2ruby and not camping. So everthing is okay on this side.

I solved my particular problem with the combination of caming and
ruby2ruby and will not use it for something serious - just academics.

I was looking for help, concerning this issue, found it, thankfully,
on this list and will post a blog entry tomorrow, so other probably
will find it as well.

From my side, everything is okay at this point. Thanks again for the
hint. There is nothing I could see, that should be changed inside of
caming to allow such a strange of standard behaviour.

Cheers,

Gregor
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: putting away HashWithIndifferentAccess

2007-09-26 Thread Jonas Pfenniger
2007/9/26, why the lucky stiff [EMAIL PROTECTED]:
 Hey, campineros.  And many good handshakes to zimbatm for getting
 some patches applied.

You're welcome !

 Markaby's going to take much more work.  Part of the issue is: how
 does an app tell Camping that it needs to use Markaby without
 screwing up the other apps?  My hunch is we'll use some eval'd code
 to override render per-App like you see in camping/db.rb.

Adding method_missing to the views would be enough to proxy the calls
to Markaby. You'd still need to propagate the controller's instance
variables to the view tough.

One solution is to add the View into the controller. The disadvantages
is that it greaten the chances of method clashes and that the
distinction between Helper and Base module would be null. The
advantage is that method_missing could be reused, like it is for the
NotFound and ServerError classes.

 And, well, as for ActiveSupport, Camping only uses the supra-
 flexi-careless-hash, so we need a replacement.

I suggest that H is a child of Hash. Extensions can extend it to
provide method_missing goodness or anything else. The only concern I
have is about case-sensitiveness. I am not sure if the http headers
are normalized on input or not.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: putting away HashWithIndifferentAccess

2007-09-26 Thread Julian 'Julik' Tarkhanov


On Sep 26, 2007, at 4:24 AM, Evan Weaver wrote:


As far as I can tell, sym_tbl is just a regular st_table, so it's an
expanding array similar to the Ruby heap.


Oddly enough, this:

c = 0
loop { c += 1; puts two_symbols_sitting_in_a_tree_#{c}.to_sym }
was a total crasher on 1.8.5 but works on 1.8.6 p110. Don't have time  
to build 1.8.5. again and check, unfortunately.


But as people say that symbol table is not even GCed I would avoid  
converting people's input into symbols anyway.


--
Julian 'Julik' Tarkhanov
please send all personal mail to [EMAIL PROTECTED]



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: putting away HashWithIndifferentAccess

2007-09-26 Thread Julian 'Julik' Tarkhanov


On Sep 26, 2007, at 12:35 AM, Julian 'Julik' Tarkhanov wrote:

class H  (HashWithIndifferentAccess rescue Hash)


To be clear, I'm really for the hash also because I use the obj =  
@items.delete paradigm to signify
take this item out because we'll work with it). But you can  
optionally shortcut nil assignment to delete (which would be nasty).

--
Julian 'Julik' Tarkhanov
please send all personal mail to [EMAIL PROTECTED]



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: putting away HashWithIndifferentAccess

2007-09-26 Thread why the lucky stiff
On Wed, Sep 26, 2007 at 11:33:42AM +0200, Jonas Pfenniger wrote:
 I suggest that H is a child of Hash. Extensions can extend it to
 provide method_missing goodness or anything else. The only concern I
 have is about case-sensitiveness. I am not sure if the http headers
 are normalized on input or not.

Well, case-sensitiveness would be a prob with 1.5 as well.  Since
@env.HTTP_HOST will work and @env.http_host will not.

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: putting away HashWithIndifferentAccess

2007-09-26 Thread Jonas Pfenniger
Minimal HWIA removal patch attached. So far, the examples, file
upload, sessions, all work under mongrel with the patch applied.

_why, is it something like that that you want ?

I'm not even sure if HWIA extension is useful. The method_missing
shortcut is even shorter than the one with :symbols.

-- 
Cheers,
  zimbatm
Index: lib/camping-unabridged.rb
===
--- lib/camping-unabridged.rb	(revision 226)
+++ lib/camping-unabridged.rb	(working copy)
@@ -28,8 +28,14 @@
 # http://rubyforge.org/projects/mongrel  Mongrel comes with examples
 # in its ttexamples/camping/tt directory. 
 #
-%w[active_support markaby tempfile uri].map { |l| require l }
+%w[markaby tempfile uri].map { |l| require l }
 
+class Object
+  def meta_def(m,b)
+(classself;self;end).send(:define_method, m, b)
+  end
+end
+
 # == Camping 
 #
 # The camping module contains three modules for separating your application:
@@ -85,8 +91,7 @@
   C = self
   S = IO.read(__FILE__) rescue nil
   P = Cam\ping Problem!
-  H = HashWithIndifferentAccess
-  # An object-like Hash, based on ActiveSupport's HashWithIndifferentAccess.
+  # An object-like Hash.
   # All Camping query string and cookie variables are loaded as this.
   # 
   # To access the query string, for instance, use the tt@input/tt variable.
@@ -109,7 +114,7 @@
   #
   # Use the tt@cookies/tt variable in the same fashion to access cookie variables.
   # Also, the tt@env/tt variable is an H containing the HTTP headers and server info.
-  class H
+  class H  Hash
 # Gets or sets keys in the hash.
 #
 #   @cookies.my_favorite = :macadamian
@@ -117,9 +122,9 @@
 #   = :macadamian
 #
 def method_missing(m,*a)
-m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:super
+m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super
 end
-alias u regular_update
+alias u merge!
   end
 
   # Helpers contains methods available in your controllers and views.  You may add
@@ -369,12 +374,12 @@
 when /^Content-D.+?: form-data;/
   fh.u H[*$'.scan(/(?:\s(\w+)=([^]+))/).flatten]
 when /^Content-Type: (.+?)(\r$|\Z)/m
-  fh[:type] = $1
+  fh.type = $1
 end
   end
-  fn=fh[:name]
-  o=if fh[:filename]
-o=fh[:tempfile]=Tempfile.new(:C)
+  fn=fh.name
+  o=if fh.filename
+o=fh.tempfile=Tempfile.new(:C)
 o.binmode
   else
 fh=
@@ -392,7 +397,7 @@
 [EMAIL PROTECTED](s) 
   end
   C.qsp(fn,';',fh,q) if fn
-  fh[:tempfile].rewind if fh.is_a?H
+  fh.tempfile.rewind if fh.is_a?H
 end
   elsif @method == post and e.CONTENT_TYPE == application/x-www-form-urlencoded
 q.u(C.qsp(@in.read))
@@ -673,7 +678,7 @@
 #   Blog.post(:Login, :input = {'username' = 'admin', 'password' = 'camping'})
 #   #= #Blog::Controllers::Login @user=... 
 #
-#   Blog.get(:Info, :env = {:HTTP_HOST = 'wagon'})
+#   Blog.get(:Info, :env = {'HTTP_HOST' = 'wagon'})
 #   #= #Blog::Controllers::Info @env={'HTTP_HOST'='wagon'} ...
 #
 def method_missing(m, c, *a)
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

WEBrick Re: Next camping release

2007-09-26 Thread Ernest Prabhakar
Hi all,

I was looking at the test cases on the changeset:

http://code.whytheluckystiff.net/camping/browser/trunk/test?rev=227

However, I didn't see anything about testing with different web  
browsers; which is a concern since there was a nasty WEBrick bug in  
the last version.  Is there test coverage for that?

-- Ernie P.

P.S. I mean to file the bug, but got into a fight with the trac  
system. ;-(
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: [ANN] Mosquito TDD Framework Updated

2007-09-25 Thread Manfred Stienstra

On Sep 25, 2007, at 12:40 AM, Geoffrey Grosenbach wrote:
 Thanks to contributions by new team member Julian 'Julik' Tarkhanov!

I was just going to remark that some changelog items have a very  
distinct Julian style to them. Thanks for the great work guys.

Manfred

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Next camping release

2007-09-25 Thread Jonas Pfenniger
2007/9/25, Michael Maltese [EMAIL PROTECTED]:
 That makes sense.
 An extension, do you mean like camping/session?

Yes, and the gem dependency would only be added to camping-omnibus.
But first, let's release Camping 1.6

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Session cookies not passed on first redirect

2007-09-25 Thread Julian 'Julik' Tarkhanov

On Sep 25, 2007, at 10:50 PM, Jonas Pfenniger wrote:


can you try the attached patch applied to camping-trunk ?
camping-session.diff


Will try. Cannot find the SVN URL on the site - only the trac is  
showing.


As of exceptions - in this case I catch the exception myself and  
return from underneath it, so it shouldn't be a problem.
This service(*a) is the super to Camping::Session (because  
Camping::Session gets included after it).


I suspect there is something with the cookie setter rather than with  
the Session service itself. But you are right - let's twist that flow  
one more bit :-)


--
Julian 'Julik' Tarkhanov
please send all personal mail to [EMAIL PROTECTED]



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Session cookies not passed on first redirect

2007-09-25 Thread Julian 'Julik' Tarkhanov


On Sep 25, 2007, at 11:20 PM, Jonas Pfenniger wrote:


2007/9/25, Julian 'Julik' Tarkhanov [EMAIL PROTECTED]:

Cannot find the SVN URL on the site - only the trac is showing.


`svn co http://code.whytheluckystiff.net/svn/camping/trunk`


Thx. Checked that. No the issue isn't fixed. I suspect something is  
wrong with the cookie code, not with the session code (setting the  
cookie manually works after all).



--
Julian 'Julik' Tarkhanov
please send all personal mail to [EMAIL PROTECTED]



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

putting away HashWithIndifferentAccess

2007-09-25 Thread why the lucky stiff
Hey, campineros.  And many good handshakes to zimbatm for getting
some patches applied.

So, yeah, I'd really like to get rid of any serious dependancies with
this 1.6 release.  Anything that's not in stdlib has to go.  Of course,
camping-omnibus will still assume the whole ActiveRecord, Markaby,
Mongrel setup that's in the history books.

Metaid can be removed and replaced with:

  def Object.meta_def n,b
  (classself;self;end).instance_eval{define_method n,b};end

Markaby's going to take much more work.  Part of the issue is: how
does an app tell Camping that it needs to use Markaby without
screwing up the other apps?  My hunch is we'll use some eval'd code
to override render per-App like you see in camping/db.rb.

The default will be plain strings:

  def render *a,b;s=send(*a,b);s=send(:layout){s} if /^_/!~a[0].
  to_s and m.respond_to?:layout;s;end

And, well, as for ActiveSupport, Camping only uses the supra-
flexi-careless-hash, so we need a replacement.

I'm not too hot on [symbol] and [string] equivalence.  But I do like
to call the query string vars like methods.  What do you think about
using OpenStruct instead?

I've been testing with this:

  class H  OpenStruct
def u h;for k,v in h;@table[k.to_sym]=v;new_ostruct_member(k);end
def self.[] *a;new *a;end
  en

Or, you know, just Hash is okay, right folks?

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: putting away HashWithIndifferentAccess

2007-09-25 Thread Julian 'Julik' Tarkhanov


On Sep 26, 2007, at 12:26 AM, why the lucky stiff wrote:


 class H  OpenStruct


How about

class H  (HashWithIndifferentAccess rescue Hash)

for the lesser among us (who always include and require)?
--
Julian 'Julik' Tarkhanov
please send all personal mail to [EMAIL PROTECTED]



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: putting away HashWithIndifferentAccess

2007-09-25 Thread Evan Weaver
Regular hashes are good. Would need to make a decision whether to
prefer string or symbol keys.

String is easier to support; Symbol looks prettier in your editor.

Evan

On 9/25/07, Julian 'Julik' Tarkhanov [EMAIL PROTECTED] wrote:


 On Sep 26, 2007, at 12:26 AM, why the lucky stiff wrote:


  class H  OpenStruct

 How about

 class H  (HashWithIndifferentAccess rescue Hash)

 for the lesser among us (who always include and require)?

 --
 Julian 'Julik' Tarkhanov
 please send all personal mail to [EMAIL PROTECTED]




 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list



-- 
Evan Weaver
Cloudburst, LLC
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: putting away HashWithIndifferentAccess

2007-09-25 Thread Julian 'Julik' Tarkhanov


On Sep 26, 2007, at 2:05 AM, MenTaLguY wrote:


behind the
scenes, every uniquely named method introduces a symbol.
yep. but then it's _you_ who calls that accessor, not some John Doe  
who sends you a POST :-)


--
Julian 'Julik' Tarkhanov
please send all personal mail to [EMAIL PROTECTED]



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: putting away HashWithIndifferentAccess

2007-09-25 Thread Evan Weaver
On 9/25/07, Julian 'Julik' Tarkhanov [EMAIL PROTECTED] wrote:
 this might already be a server crasher. you know how many unique to_syms you
 can do before the table is full?

As far as I can tell, sym_tbl is just a regular st_table, so it's an
expanding array similar to the Ruby heap. So there's no danger of hard
crash. If your camping process runs for a month you should end up with
no more than 10 or 20 extra mbs of memory used in anything but a
deliberately pathological situation.

Evan

-- 
Evan Weaver
Cloudburst, LLC
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Next camping release

2007-09-24 Thread Jonas Pfenniger
2007/9/25, Michael Maltese [EMAIL PROTECTED]:
 Remove Markaby? How will that work?

Only as a direct dependency. It will probably kept as an extension.
Basically, you can return a string containing html from your
controller methods even if it's a bit rough.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Next camping release

2007-09-23 Thread Jonas Pfenniger
Dear camping users,

having been contacted by Julian Tarkhanov, I am willing to prepare the
next camping release. _why has given me his friendly approval, with
the reserve that camping.rb should be lower than 4k. He also told me
that he wanted to remove the ActiveSupport and Markaby dependencies.

I am writing here to get the users input so that I don't do any
mistake. So far, my plans are to :
- solve all remaining bugs in the tracker
- remove the unused #errors_for method. Please give some input if you do !
- add some unit-tests.

This will result in a short-term release with not too much changes,
used for code stabilization.

When this is done, I will embark on 2.0 for bigger changes like
Markaby and AR removal.

Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Next camping release

2007-09-23 Thread andré gustavo cardozo
it would be really cool do remove the apache scriptAlias directive so
camping would run everywhere

On 9/23/07, Manfred Stienstra [EMAIL PROTECTED] wrote:

  This will result in a short-term release with not too much changes,
  used for code stabilization.
 
  When this is done, I will embark on 2.0 for bigger changes like
  Markaby and AR removal.

 Cool, I'm currently trying to get my apps working with svn camping. I
 think I've found a problem surrounding URL(). Jonas, can you try to
 float around #camping to discuss any problems?

 Manfred
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list




-- 
André G. Cardozo
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Next camping release

2007-09-23 Thread Jonas Pfenniger
2007/9/23, Manfred Stienstra [EMAIL PROTECTED]:
  This will result in a short-term release with not too much changes,
  used for code stabilization.
 
  When this is done, I will embark on 2.0 for bigger changes like
  Markaby and AR removal.

 Cool, I'm currently trying to get my apps working with svn camping. I
 think I've found a problem surrounding URL(). Jonas, can you try to
 float around #camping to discuss any problems?

I am not really an IRC user but I will try to.

I'd really appreciate if every concerned person could follow the
changesets and raise objection on the list. It is easy to follow if
you use rss feeds :
http://code.whytheluckystiff.net/camping/timeline?milestone=onticket=onchangeset=onwiki=onmax=50daysback=90format=rss

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


jruby + camping

2007-08-13 Thread andré gustavo cardozo
CodeHaus has a great introduction of jruby running camping. looks really
nice to have this kind of integration

http://jruby.codehaus.org/The+JRuby+Tutorial+Part+2+-+Going+Camping

-- 
André G. Cardozo
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Session + Redirect trouble

2007-08-12 Thread Nagy Bence
Dear Campers,

I have created a small social network site using Camping, it is located 
at http://dekk.hu/ (it is in hungarian).

The authentication part of the application is written so as I saw in 
other applications (@state.user_id = @user.id; redirect Index) But some 
user has problem with the login process, sometimes the app let them in 
only for the second time, sometimes never. Maybe cookies and redirection 
do not work the same time (on my machine is everything fine, Ubuntu and 
Firefox has no problem).

I have made a user for testing purposes (username: test, password: 
test). So, please, give it a try, if the failure exists on your machine 
(the login fields are on the right side, Felhasználó = User, 
Jelszó = Password), or let me know if somebody has already a solution...

Greetings, Bence

-- 
Nagy Bence
- Tipográl | www.tipogral.hu
- Dekk | www.dekk.hu
- Hírkapu | www.hirkapu.hu
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reloader, Mounts, FastCGI

2007-08-10 Thread Naitik Shah
I'm trying to figure out how to get the Reloader to work with this kind
of a setup:
(from http://camping.rubyforge.org/classes/Camping/FastCGI.html)
---
  
require 'camping/fastcgi'
fast = Camping::FastCGI.new
fast.mount(/blog, Blog)
fast.mount(/tepee, Tepee)
fast.mount(/, Index)
fast.start
  
  
Tried a bunch of different variations of the Reloader including trying
to use the find_app method with no luck. In most variations I don't get
any errors, but the reloader doesn't kick in when I modify files. Anyone
know how it can be done?
  
  
-Naitik
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Rv 3 released, with cluster support

2007-08-08 Thread Evan Weaver
Rubyforge is having some mirroring problem with the gem. For now,
download it from here:

http://blog.evanweaver.com/files/rv-3.gem

Thanks

Evan

On 8/8/07, Evan Weaver [EMAIL PROTECTED] wrote:
 Hey Campers,

 Ditch that pup-tent for Camping deployment. Maybe. Either way, drive
 around in Rv 3, newly released *right at this moment*.

 Rv

 A little init.d system for running Camping apps, for Linux.

 Features

 * cluster support
 * custom database configuration
 * interactive setup tasks
 * logging

 Full documentation and instructions at:
 http://blog.evanweaver.com/files/doc/fauna/rv/

 Evan

 --
 Evan Weaver
 Cloudburst, LLC



-- 
Evan Weaver
Cloudburst, LLC
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


[no subject]

2007-08-06 Thread cr
On Mon Aug 06, 2007 at 11:43:06PM +0100, Francisco Cabrita wrote:
 Hi all
 
 Is there another gem to manage logins beyound Equipment (basic
 login/security) to use under Camping?

not a gem, but check Peglist, for an example of an OpenID consumer:
http://opus.winelibrary.com/peglist/trunk/
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Restarting Lighttpd for each change? Error logging?

2007-08-01 Thread Erik Terpstra
To answer my own question, it seems that the requirement to restart 
after each change is only the case for fast-cgi.
Also lighttpd behaves very unpredictable to me, so I am now using a 
Mongrel/Camping + Apache/ProxyReverse combination which seems to work 
much better.

Erik Terpstra wrote:
 Hi,

 It seems that for each change that I make in my camping application, I 
 have to restart lighttpd to make it work.

 Also whenever something goes wrong, a syntax error in my camping 
 application for example, things just stop working and I can't see any 
 error messages in the lighttpd logs or any other log.

 I just followed the instructions to use Camping with lighttpd on the wiki.

 Any ideas?

 Erik.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

   

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Restarting Lighttpd for each change? Error logging?

2007-08-01 Thread Manfred Stienstra

On Aug 1, 2007, at 11:42, Erik Terpstra wrote:

 Mongrel/Camping + Apache/ProxyReverse combination which seems to work
 much better.

You can also use mongrel directly in development, that way you don't  
have to go through Apache. Just camping myapp.rb and hit http:// 
localhost:3301/.

Manfred
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping-list Digest, Vol 15, Issue 2

2007-07-31 Thread Eli Brody
I found the Camping development process with FastCGI to be painful and
frustrating. Error messages were vague or nonexistent (500 Server Error).
Again, I strongly recommend that you find another solution.

On 7/31/07, Brian Corrigan [EMAIL PROTECTED] wrote:

 Eli,

 This is interesting.  I enabled DEBUG logging in Apache and tailed the
 error.log.  Lo and behold, you're right, its a problem with one of my
 require statements.  Namely:

 `gem_original_require': no such file to load -- camping/fastcgi
 (LoadError)

 Strange, it works fine when I do it in IRB, or do it from a ruby script at
 the bash prompt.  Apache runs as the same user that I'm currently logged in
 as, but just as a check, I added the GEM_PATH statement to my /etc/profile
 Still nothing.

 I'm going to screw around with it more today, I'll post if I solve it.

 Thanks again for the help!



 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list




-- 
www.megastructure.org
http://www.last.fm/user/coldphage/
Bubs: Let's head down to the Datum Center and see what we can find.
Strong Bad: Datum sounds good.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: 500 error while trying to run Camping on Dreamhost

2007-07-22 Thread Sérgio Santos

Thanks for the reply Tim.

I'm using the 1.5 version installed on the dreamhost servers, since I didn't
figure out yet out to use a gem from my local account. Maybe I have to set
the gems path somewhere. I also didn't figure out where did you set the
'path = req.env['REQUEST_URI']' you mention on you article.

2007/7/23, Tim Connor [EMAIL PROTECTED]:



http://www.timocracy.com/articles/2007/07/06/getting-camping-working-with-fcgi-on-a-shared-host-dreamhost-part-1

I forgot to write part 2 before I went on vacation - but maybe I'll
look over things and try to recall what else there is.

On 7/22/07, Sérgio [EMAIL PROTECTED] wrote:
 I've tried setting up an Hello World app with Rails (no database), on a
 Dreamhost account. I used the configuration I found here
 http://www.mail-archive.com/camping-list@rubyforge.org/msg00114.html
  with the proper paths. But I keep getting Internal Server
 Errors (500). On the error.log I found this

 [Sun Jul 22 15:32:07 2007] [error] [client 82.154.48.138] FastCGI: comm
with
 (dynamic) server /home/xxx/little/dispatch.fcgi aborted:
 (first read) idle timeout (60 sec), referer: http://little.xxx.com/
 [Sun Jul 22 15:32:07 2007] [error] [client 82.154.48.138] FastCGI:
 incomplete headers (0 bytes) received from server
 /home/xxx/little/dispatch.fcgi, referer:
 http://little.xxx.com/

 It seems that is a somewhat common error, that can have several causes.
 Could anyone who already has their application running on Dreamhost or
other
 shared hosting service, please give a few pointer on how to deploy a
Camping
 application or just try to guess what could be causing the error above.

 I was really hoping I could use Camping on some projects. Thanks in
advance.

 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list





--
www.sergiosantos.info
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Extending Markaby for SVG - done!

2007-07-12 Thread Ernest Prabhakar
Hi Tim,

On Jul 11, 2007, at 3:34 PM, Tim Fletcher wrote:
My opinion would be to keep it seperate so that in can be  
 usedelsewhere, but provide a hook into Markaby. So something along the
 lines of this (completely untested):

Thanks!  That's exactly what I needed.  The whole implementation is  
now at:

http://pastie.caboo.se/78442

This uses an Markaby::SVG11 tagset, which is at:

http://pastie.caboo.se/78441

The only ugly bit is that Markaby defines text as the output  
command, which conflicts with the SVG tag named text. I remember  
_why saying he was going to rename that method to out or something.  
Is that still planned?

To use it, simply make sure that builder_svg is loaded, and do  
something like:

 html do
   head {title Testing HTML+SVG}
   body do
   p Below is a wonderful example of
   a SVG, :href = http://www.w3.org/2000/svg;
   svg do
   title Slide Title
   
 rect({:x=2,:y=2,:width=508,:height=318,:fill=aqua})
   end
   end
 end

I have a test suite, if anyone is interested. I haven't done anything  
fancy yet, but it seems to all work.

Is this something I should submit as a patch to Markaby itself?

Best,
-- Ernie P.



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Extending Markaby for SVG

2007-07-11 Thread Geoffrey Grosenbach
On 7/11/07, Tim Fletcher [EMAIL PROTECTED] wrote:
  Any Markaby experts here who can help me figure out the best way to
  integrate SVG support into Markaby?

I worked on a project started by Scott Barron to do something similar
for CSS. I'm using SASS now, but here it is for reference:

http://topfunky.net/svn/plugins/styleaby/


-- 
Geoffrey Grosenbach
[EMAIL PROTECTED]

Blog | http://nubyonrails.com
Podcast | http://podcast.rubyonrails.com
Screencast | http://peepcode.com
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Mosquito Fixtures Won't Load

2007-06-27 Thread Alpha Chen

On 6/27/07, Joshua Schairbaum [EMAIL PROTECTED] wrote:


I can't get fixtures to load correctly in a Mosquito test.  The first
fixture loads in the unit test, but the rest don't load at all.



I actually ran into a similar problem, although none of my fixtures were
loaded at all. On running the example blog tests included with mosquito,
there were a number of failures which appeared related to to the non-loading
fixtures.

I found that changing change_fixtures to self.fixtures on line 25 of
mosquito.rb solved the problem for me, though I don't know enough about
Camping, Mosquito, and ActiveRecord to know if this is the best fix or not.

Regards,
Alpha
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Mosquito Fixtures Won't Load

2007-06-27 Thread Geoffrey Grosenbach
 On 6/27/07, Joshua Schairbaum [EMAIL PROTECTED] wrote:
  I can't get fixtures to load correctly in a Mosquito test.  The first
 fixture loads in the unit test, but the rest don't load at all.

I haven't touched Mosquito in a while. I've actually hacked out a
simple BDD library for Camping using RSpec, but haven't polished it up
for release yet.

-- 
Geoffrey Grosenbach

Screencast | http://peepcode.com
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Simulate HTTP put and delete in Camping/SleepingBag

2007-06-22 Thread carmen
On Fri Jun 22, 2007 at 04:51:37PM +0200, Gregor Schmidt wrote:
 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.

WebKit and Firefox both take just about any string as the method name. at least 
if youre submitting with XHR

which is good, because then you can use appropriately named methods in your 
camping app, instead of laying things inside other protocols (Atom/Bayeux) or 
resorting to URL and form field hacks (Rails)..


 I cannot make it work, neither can I
 find any hints on that issue in the source of sleeping bag.

if you want to emulate rails. why not just use Rails? do you like jumping 
through hoops to be tied to arbitrary ORMs* and additionally emulations of said 
ORMs frontend-facilitating features on another framework?


* and ORMs that tie you to a static schema and want you to only update it once 
every quarter during a migration-festival and hope you got all the new fields 
right... and the fields are just arbitrary strings rather than anything more 
meaningful to the web at large..


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

i generate the form clientside, cache the old value, and submit PATCH methods 
with the new value. this makes more sense than PUT, but PATCH appeared in some 
draft version f the HTTP1.1 RFC then disappeared, or something.


im pretty sure mongrel was trying to eat anything that wasnt PUT/POST/GET last 
i tried though. i think i may have reluctantly switched to a less sensical name 
beacuse i couldnt figure out how to make mongrel not toss the reqs..


as for REST, i tend to just use the request URI as an implicit subject (object 
ID) for the other operations. it helps if youre using HTTP URIs for everything 
including properties, otherwise you have to have a mapping layer somewhere.


 
 Thanks for these great tools, both camping and sleeping bag feel as
 lightweight as it gets.
 
 Cheers,
 
 Gregor
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: How to create a drop-down list with Markaby?

2007-05-04 Thread Thomas Weibel
One more thing: How would I preselect a certain entry like this?

select name=character
option value=marvin selectedMarvin the paranoid
Android/option
option value=arthurArthur Dent/option
option value=zaphodZaphod Beeblebrox/option
/select

Thanks,
Thomas


signature.asc
Description: This is a digitally signed message part
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: CampingConf?

2007-05-04 Thread Jeremy McAnally
I unfortunately won't be able to make it if you guys do have something
on the 16th.  Plane tickets were a lot more expensive on the 16th
rather than the 17th (for some reason), so the wife veto'd that idea.
;)

The 17th is just tutorial day anyhow; if you could do it that day I'd
be happy to attend (or organize, if need be).

--Jeremy

On 5/4/07, Geoffrey Grosenbach [EMAIL PROTECTED] wrote:
 Campers --

 In a few weeks there will be a bunch of people in Portland, OR, for a
 conference. A long time ago some campers mentioned that might be a
 good time for us to get together and hold a mini CampingConf for a few
 hours. Is anyone interested? Does anyone want to organize it?

 I'm thinking Wednesday night, May 16.

 We could possibly get a spot at FreeGeek (not likely since they are
 often booked), or there are small venues nearby that could be rented
 (I'd be glad to foot the bill). Seattle.rb has a projector that we
 could use.

 --
 Geoffrey Grosenbach
 [EMAIL PROTECTED]

 p.s.: r.i.p. RedHanded, it's been a fun ride.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list



-- 
http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: CampingConf?

2007-05-04 Thread Thomas Lockney

On 5/4/07, Geoffrey Grosenbach [EMAIL PROTECTED] wrote:


Campers --

In a few weeks there will be a bunch of people in Portland, OR, for a
conference. A long time ago some campers mentioned that might be a
good time for us to get together and hold a mini CampingConf for a few
hours. Is anyone interested? Does anyone want to organize it?

I'm thinking Wednesday night, May 16.

We could possibly get a spot at FreeGeek (not likely since they are
often booked), or there are small venues nearby that could be rented
(I'd be glad to foot the bill). Seattle.rb has a projector that we
could use.




The Lucky Lay on Hawthorne has a space available for rent:
http://luckylab.com/html/parties.html#brewpub

It's a decent place, centrally located and is one of the main locations used
for after-meeting-beers by the Portland Ruby Brigade.



--
Thomas Lockney | [EMAIL PROTECTED] | http://opposable-thumbs.net
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: CampingConf?

2007-05-04 Thread Mark Fredrickson
There should be an abridged conference, that everyone gets by default,
and an unabridged conference that you have to hunt around in the woods
to find.

-M

On 5/4/07, Eric Mill [EMAIL PROTECTED] wrote:
 My coworker raises a good point, saying that in the spirit of
 CampingConf, it will have to take only 5 minutes, and we'll all give
 our talks at once, using one single run on sentence.

 -- Eric

 On 5/4/07, Eric Mill [EMAIL PROTECTED] wrote:
  I'd love to do a CampingConf, and I bet I have a couple coworkers
  who'd like to do it.  We're flying in on Thursday night though, my
  flight arrives at 9:10pm PST, and we're leaving Monday morning.  Maybe
  Friday or Saturday night, before people are thoroughly exhausted from
  RailsConf, we have it at night, in the dark, in the woods?
 
  -- Eric
 
  On 5/4/07, Thomas Lockney [EMAIL PROTECTED] wrote:
   On 5/4/07, Andrew Dayton [EMAIL PROTECTED] wrote:
Perhaps the following weekend? It just so happens I'll be in Portland
that weekend, so it would work out well for me ... not that I would
expect anyone to change their schedule to fit mine (or know who I am
for that matter) ...
  
   While I won't be able to attend Railsconf, I've got big events the weekend
   before (BarCampPortland) and the weekend after (PDXBot:
   http://www.pdxbot.org), so I really, really hope it's not on the weekend.
   ;~)
  
   Oth, I might be busy with organizational stuff most of the week in between
   anyway. But if there's a CampingConf, I want to at least have the
   possibility of making it out.
  
  
   --
Thomas Lockney | [EMAIL PROTECTED] | http://opposable-thumbs.net
   ___
   Camping-list mailing list
   Camping-list@rubyforge.org
   http://rubyforge.org/mailman/listinfo/camping-list
  
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: CampingConf?

2007-05-04 Thread why the lucky stiff
On Fri, May 04, 2007 at 11:39:01AM -0400, Eric Mill wrote:
 My coworker raises a good point, saying that in the spirit of
 CampingConf, it will have to take only 5 minutes, and we'll all give
 our talks at once, using one single run on sentence.

With a deep breath every 80th character.

You know, if everyone stood and read the complete code aloud in
unison, I think that would be sufficiently occult for my tastes. 

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: URL question

2007-04-30 Thread Michael Gorsuch
Jonathan - I may be blowing smoke, but what about taking advantage of
CGI's escape and unescape methods?

irb(main):009:0 CGI.escape ruby+talk
= ruby%2Btalk
irb(main):010:0 CGI.unescape ruby%2Btalk
= ruby+talk

Would that do the trick?  Just run CGI.unescape on your paramaters?

On 4/29/07, Jonathan Stott [EMAIL PROTECTED] wrote:
 Well, this is more of an apache question, but...

 I'm running a nice little 'cluster' of camping apps and I've recently
 started proxying them through apache with mod_proxy, since I found I
 was forwarding a lot of ports via ssh otherwise. But anyway, enough of
 that.

 One of the apps I use to view logs from IRC (with formatting and
 highlighting!). But occasionally, there are +s in the channel name
 (and I can't just remove them, as sometimes the name exists without
 the + as well). And this works fine, with camping on it's own.  But
 apache rewrites the + to %2B and it all falls apart.

 So if there are any apache gurus on the list, could they let me know
 how to stop this?

 Regards
 Jonathan
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


URL question

2007-04-29 Thread Jonathan Stott
Well, this is more of an apache question, but...

I'm running a nice little 'cluster' of camping apps and I've recently
started proxying them through apache with mod_proxy, since I found I
was forwarding a lot of ports via ssh otherwise. But anyway, enough of
that.

One of the apps I use to view logs from IRC (with formatting and
highlighting!). But occasionally, there are +s in the channel name
(and I can't just remove them, as sometimes the name exists without
the + as well). And this works fine, with camping on it's own.  But
apache rewrites the + to %2B and it all falls apart.

So if there are any apache gurus on the list, could they let me know
how to stop this?

Regards
Jonathan
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: RESTful web service tutorial?

2007-04-28 Thread Caleb Buxton

On 28-Apr-07, at 1:39 PM, Bil Kleb wrote:

 Someone asked:
 Are you looking for a REST tutorial, or are you already familiar with
 REST and just want to know how to use it with Camping?

 I am barely familiar with both REST and Camping, and I'd like
 to explore some RESTful Camping as a way to learn both.


With regards to rest, the rails community has more tutorials. Infact,  
there is a peepcode screencast:

http://nubyonrails.com/articles/2006/10/09/peepcode-rest-basics

It also includes a free, rails specific, cheat sheet.

 From the perspective of services using your camping app, one of the  
most important things (as I understand it) is the URL of the action.

The cheat sheet includes a table which matches up some rails methods  
with HTTP predicates and paths and software actions.

With regards to implementing it in Camping...

This thread includes discussion about getting Camping to recognize  
other predicates

http://www.mail-archive.com/camping-list@rubyforge.org/msg00029.html

Otherwise, some problems with using semicolons to access different  
aspects ( http://code.whytheluckystiff.net/camping/ticket/118 ) which  
is, according to the people talking there, a rails-ish thing anyways.

Hope this helps,
Caleb

ps:  is the airfoil calculator going to be publicly available...? :)

 Later,
 --
 Bil Kleb
 http://fun3d.larc.nasa.gov

 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Gem broekn?

2007-04-18 Thread carmen
gem install --source http://code.whytheluckystiff.net camping
Need to update 3 gems from http://code.whytheluckystiff.net
...
complete
ERROR:  While executing gem ... (TypeError)


gem install camping-omnibus --source http://code.whytheluckystiff.net
Install required dependency camping? [Yn]  y
ERROR:  While executing gem ... (TypeError)
can't convert Hash into String

 ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux]

/me scurries off to manually check out 
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping on Dreamhost - Please Help!

2007-03-28 Thread Dan Gottlieb
HI Andre,

I haven't looked at the apache redirect stuff yet, but if you're using
the DH install of ruby and camping, i've figured out the following:

1) DH installed camping with all dependencies EXCEPT markaby, so at
the very least you'll need to install markaby in your own directory
(i'd recommend installing the full camping gem there)

2) When running cgi/fcgi scripts, DH's 's server ignores the .bashrc
file (though they'll tell you that they don't), so you'll need to set
the gem path (ENV[GEM_PATH] ) in your dispatch script.

Hope this helps!

Dan
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Pimpin' a patch: moving the bin/camping logic to classes

2007-03-27 Thread why the lucky stiff
On Tue, Mar 27, 2007 at 09:52:49PM -0500, Mark Fredrickson wrote:
 I'm unclear on any next steps, but if you like the idea and/or the
 patch, please comment on the issue:
 
 http://code.whytheluckystiff.net/camping/ticket/117

The next step is for me to accept it and I accept it.  You can go
ahead apply this to trunk yourself, if you like, Mark.  Thanks a lot
for doing this!

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: threading and concurrency

2007-03-14 Thread Michael Gorsuch
carmen - I'm not sure _how_ much this will really help you, but I
recently explored a similar issue with an internal Camping app.

In summary, I needed to make sure that all calls to a specific
controller were always executed serially.  i.e. - if two calls came in
at approximately the same time, the second call could not run until
the first one finished.

This was not a problem: I just included the 'thread' library and
wrapped the code in a synchronize block.  The only requirement: I only
run a single mongrel instance.

Simple code example follows:

**

require 'thread'


class Create  R '/create'
  def synchronize
mutex.synchronize {yield self}
  end

  def mutex
@mutex ||= Mutex.new
  end

  def get
synchronize do
  # my code goes here...
end
  end
end

**

I hope this helps out some,

Michael Gorsuch
http://www.styledbits.com



On 3/12/07, carmen [EMAIL PROTECTED] wrote:
 hello all. ive come to the point where im thinking about deploying my 'rails 
 on rails' app-development solution built in camping.

 mainly, im wondering what the barriers to thread-safety are.

 for db, i use redland, and afaik it spawns a single db connection for each 
 find, and keeps a pool around to reuse. iow, no ActiveRecord.

 are class-vars a problem? theres one that i'd like to keep, a 'close' cache 
 of triples in a normal ruby Array.. read/writes to this are fast (much faster 
 than HTML generation in markaby, from what i can tell), but i guess they 
 would need to lock the other threads briefly.

 for simplicity. i'd prefer a single interpreter process. otherwise i'm going 
 to have to come up with some distributed cache invalidation scheme (typically 
 the user load is 1-15, small workgroups, which loadwise is fine except they 
 may experience a few seconds lag in their requests if eg a heavy SPARQL query 
 is going on in another request)

 oh, and id like to hear 'sure, but you have to hack up the mongrel 
 configurator slightly, and not do this' rather than 'just use a pack of 
 mongrels'


 cheers :)
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: [ANN] Parasite and camping_generator 0.2.0

2007-03-12 Thread Mark Fredrickson
On 3/12/07, Jonas Pfenniger [EMAIL PROTECTED] wrote:
 Sweet ! I like the concept but your parasite looks to kind :D

Perhaps I should rename it Cute Cuddly Bug or something. Don't blame
me - nobody uploaded a scary looking bug or worm to openclipart.org

:-)

-M
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


threading and concurrency

2007-03-12 Thread carmen
hello all. ive come to the point where im thinking about deploying my 'rails on 
rails' app-development solution built in camping.

mainly, im wondering what the barriers to thread-safety are.

for db, i use redland, and afaik it spawns a single db connection for each 
find, and keeps a pool around to reuse. iow, no ActiveRecord.

are class-vars a problem? theres one that i'd like to keep, a 'close' cache of 
triples in a normal ruby Array.. read/writes to this are fast (much faster than 
HTML generation in markaby, from what i can tell), but i guess they would need 
to lock the other threads briefly.

for simplicity. i'd prefer a single interpreter process. otherwise i'm going to 
have to come up with some distributed cache invalidation scheme (typically the 
user load is 1-15, small workgroups, which loadwise is fine except they may 
experience a few seconds lag in their requests if eg a heavy SPARQL query is 
going on in another request) 

oh, and id like to hear 'sure, but you have to hack up the mongrel configurator 
slightly, and not do this' rather than 'just use a pack of mongrels'


cheers :)
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


[ANN] Parasite and camping_generator 0.2.0

2007-03-11 Thread Mark Fredrickson
Announcing the the 0.2.0 release of parasite and the camping_generator.

Parasite (from the project page -- http://parasite.rubyforge.org/):

Camping app developers no longer have any reason to envy their Ruby on
Rails friends: Parasite brings generators, environments, and other
Rails-y goodness to the world of Camping app development.

Parasite is currently at version 0.2. The Parasite package is composed
of two gems: parasite and the camping_generator. The first provides a
way to hook into the Rails development environment, while the second
provides a generator for creating Camping apps quickly and painlessly.

More details on installation and usage can be found at:

http://parasite.rubyforge.org/

And to get you interested, some new features/changes in this release:

Release 0-2-0
-- added parasite executable, links into rails environment
-- updated generator to be compatible with changes in Rails
-- updated generator to be compatible with changes in Camping
-- cleaned up some behind the scenes stuff

Cheers,
-Mark
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping on Dreamhost - Please Help!

2007-03-07 Thread carmen
On Thu Mar 08, 2007 at 01:28:37AM +, Andrew Ullmann wrote:
 
 Dan Gottlieb [EMAIL PROTECTED] writes:
 
  
  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!
  
 
 Were you able to get it working? I am struggling as well
 and any help would be appreciated.

you can probably just cp -av /usr/lib/ruby into your homedir and then 
export GEM_HOME=~/lib/ruby/gems/1.8/
export GEM_PATH=~/lib/ruby/gems/1.8/
 in .bashrc

and add any more gems you need like camping.

maybe you can bypass the copy/install of ruby and define GEM_PATH to be 
/usr/lib/ruby/gems/1.8:$HOME/usr/lib/ruby/gems?

maybe you should bug dreamhost to install camping, since its so much lighter 
than rails i dont see why they wouldnt want to promote it in a shared hosting 
environment...


 
 -Andrew
 
 
 
 
 
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: no camping required deployment?

2007-02-11 Thread Eric Mill
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 [EMAIL PROTECTED] 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@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and DBI

2007-01-28 Thread Eric Mill
 Running a full-featured client/server SQL database engine for
 applications that have only a handful of users is often overkill.

Agreed -- I think this is one of the reasons why pushes SQLite so much
and makes it the default DB engine for Camping.  I've started hearing
things about Kirbybase (http://www.netpromi.com/kirbybase_ruby.html)
though.  It's a non-SQL storage engine, uses pleasant Ruby syntax and
blocks, and stores data in flat, easy to edit files.  Has anyone used
it?  Is it any better than using Yaml?

-- Eric

On 1/28/07, Lennon Day-Reynolds [EMAIL PROTECTED] wrote:
 On 1/28/07, Michael Daines [EMAIL PROTECTED] wrote:
  I'm interested in how one can skip the database altogether, though.
  This seems like something that must have come up here before? But
  personally, I threw together a little number I like to call
  DirectoryModel[1] that just keeps track of the files in a directory
  for a (very) small comic-strip app[2]. I bet it needs some work!

 I tend to use YAML::Store as a sort of poor-man's database for simple
 apps like that. There's also a module called 'fsdb' I used for a
 couple of projects which, IIRC, uses a one-file-per-object model for
 persistent storage.


 -Lennon
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping and DBI

2007-01-26 Thread James
On 1/26/07, Lennon Day-Reynolds [EMAIL PROTECTED] wrote:
 That way, your connection will only be established once per model
 class, and will stay open between requests. Alternately, you could set
 @@dbh instead of @dbh, which would open just one connection for all
 your model classes, but you might have problems handling multiple
 simultaneous requests through a single active database handle.

Thanks, I learned something new!  Would it be okay to use a constant
DBH to represent the database handle?

James
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Postamble vs campingrc

2007-01-22 Thread Eric Mill
This may be obvious, but are you also adding on the extra parameters
Mysql needs, like :username, :password, :database?

-- Eric

On 1/22/07, James Earl [EMAIL PROTECTED] wrote:
 Hi,

 Should I be able to use the Webrick postamble instead of using
 .campingrc, to tell Camping I want to use mysql?  It doesn't seem to
 be working for me.  It does work however, when I'm using FastCGI
 (establish_connection :adapter = 'mysql').

 James
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Rendering with erb

2007-01-19 Thread James Earl
On 1/19/07, James Earl [EMAIL PROTECTED] wrote:
 Hi, I thought it would be fun to try to write a render method that
 uses erb for rending.  I'm not much of a programmer, but I still like
 to try:

 module Test
   require 'erb'
   def render(m)
 ERB.new(IO.read(templates/layout.html)).result(binding) do
   ERB.new(IO.read(templates/#{m}.html)).result(binding)
 end
   end
 end

Replying to myself... this works, instead of using yield.  Not very
pretty I know :)

module Test
  require 'erb'
  def render(m)
content=ERB.new(IO.read(templates/#{m}.html)).result(binding)
layout=ERB.new(IO.read(templates/layout.html)).result(binding)
  end
end
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Rendering with erb

2007-01-19 Thread why the lucky stiff
On Fri, Jan 19, 2007 at 11:02:37AM -0700, James Earl wrote:
 Replying to myself... this works, instead of using yield.  Not very
 pretty I know :)
 
 module Test
   require 'erb'
   def render(m)
 content=ERB.new(IO.read(templates/#{m}.html)).result(binding)
 layout=ERB.new(IO.read(templates/layout.html)).result(binding)
   end
 end

Hey, nice tip.  You want to add this to the wiki?  A good place
would be CampingExtras[1].

_why

[1] http://code.whytheluckystiff.net/camping/wiki/CampingExtras
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Rendering with erb

2007-01-19 Thread James Earl
On 1/19/07, why the lucky stiff [EMAIL PROTECTED] wrote:
 On Fri, Jan 19, 2007 at 11:02:37AM -0700, James Earl wrote:
  Replying to myself... this works, instead of using yield.  Not very
  pretty I know :)
 
  module Test
require 'erb'
def render(m)
  content=ERB.new(IO.read(templates/#{m}.html)).result(binding)
  layout=ERB.new(IO.read(templates/layout.html)).result(binding)
end
  end

 Hey, nice tip.  You want to add this to the wiki?  A good place
 would be CampingExtras[1].

 _why

Thanks!  It's added.  Feel free to improve the code if necessary :)

http://code.whytheluckystiff.net/camping/wiki/CampingAndErb
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Overriding ServerError?

2007-01-09 Thread why the lucky stiff
On Tue, Jan 09, 2007 at 02:28:17PM -0500, Michael Gorsuch wrote:
 I am doing things right, I just need to render a template instead of
 output everything in the controller.

Curious.  It should let ya.  Can you pass on the software versions
you're using and i'll ticketize.

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


ActiveSupport Dependency

2007-01-08 Thread james
Hi, Just wondering if ActiveSupport is actually used heavily by
Camping when ActiveRecord is not used?  I see ActiveSupport is a
dependency of ActiveRecord, but Camping still wants it even when
ActiveRecord isn't used.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: ? camping apps in gems

2007-01-06 Thread carmen
On Sat Jan 06, 2007 at 01:37:56AM -0600, why the lucky stiff wrote:
 So would you like this:
 
   $ wget http://rubyforge.org/gems/junebug-0.0.18.gem
   $ camping junebug-0.0.18.gem
 
 Or should it be:
 
   $ gem install junebug
   $ touch junebug.gemcamp
   $ camping junebug.gemcamp

is 

$ gem install junebug
$ camping junebug

too much voodoo? or maybe even

$ gem install junebug
$ camping

 (ok maybe loading all gemcamps is a bit much for the lowly server)

 
 _why
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: ? camping apps in gems

2007-01-06 Thread Geoffrey Grosenbach
On Sat, Jan 06, 2007 at 01:37:56AM -0600, why the lucky stiff wrote:
 So would you like this:
 
   $ wget http://rubyforge.org/gems/junebug-0.0.18.gem
   $ camping junebug-0.0.18.gem

I like that way. Being able to copy a packaged app whole would be very useful 
and would make it easy to deploy updates to a camping app.

One could use Hoe, or even a custom Rake task that would generate a gemspec on 
the fly and make an app out of the gem.

In the future this could even make it possible to list other gems as 
dependencies (equipment, mosquito, etc.) and the camping command could make 
sure that they were present before launching the app.

Geoff
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


! camping 1.5.180

2007-01-06 Thread why the lucky stiff
Just a few minor changes released before I add gem support.

 * R() now accepts a Hash in its arguments which can be used to build a query
   string.

 R(Topic, @topic.id, :page = 24)  #= /topic/14?page=24

 * Base#to_a, discussed here.[1]  Can be used to forward requests.

Both the camping and camping-omnibus gems are fresh.

  gem install camping-omnibus --source http://code.whytheluckystiff.net

_why

[1] http://redhanded.hobix.com/bits/theSiphoningSplat.html
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping Podcast

2007-01-06 Thread Adam Bouhenguel
On 1/6/07, Geoffrey Grosenbach [EMAIL PROTECTED] wrote:

 I'm putting together an episode of the Rails podcast that will be dedicated
 to Camping.

 I already have the first interview recorded. I'd like to get 3 or 4 more
 short interviews (short...maybe 4.096 minutes each).

 If you'd like instant fame, send me an email and tell me what camping
 project you would like to talk about, what your skype username is, and when
 is a good time to contact you.

 Thanks!

 Geoff
 [EMAIL PROTECTED]
 skype: topfunkycorporation
 http://podcast.rubyonrails.org

 p.s. If _why would be so kind as to do the same or even just record a short
 message for the worldwide Camping movement, I'd appreciate it.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


? camping apps in gems

2007-01-05 Thread why the lucky stiff
So would you like this:

  $ wget http://rubyforge.org/gems/junebug-0.0.18.gem
  $ camping junebug-0.0.18.gem

Or should it be:

  $ gem install junebug
  $ touch junebug.gemcamp
  $ camping junebug.gemcamp

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Using Rails Plugins with Camping

2006-12-11 Thread HH
I just picked up Camping and I'm currently reviewing every little
tidbit of information I can find out about it.

I really liked the simplicity of RubyOnRails, but sometimes you want
something fast and everything is relative.  After looking at Camping,
RubyOnRails seems like a lot of work if you just want to test out a
prototype of a small web app.

One thing I do miss are all the pre-built plugins for Rails (such as
acts_as_taggable).

How easy is it to convert Rails plugins to work with Camping?

I've done my first pass at searching for anything related to adapting
Rails plugins for Camping but I only came up with some hackery around
Dr. Nic's Magic Models.

Any finger pointing in the right direction would be greatly appreciated.

Thanks so much,
HH
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Mosquito gem available

2006-12-07 Thread Geoffrey Grosenbach

why has mentioned this before, but I wrote a small test framework for Camping 
and it is now available as a gem. 

  sudo gem install mosquito

If you'd like to write unit or functional test for your Camping app, check it 
out:

http://code.whytheluckystiff.net/camping/wiki/MosquitoForBugFreeCamping

http://rubyforge.org/projects/mosquito


Several people have already submitted patches and I'm glad to give commit 
rights to anyone who wants to contribute.


Geoffrey Grosenbach

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping 1.6 (was Re: Newline problem)

2006-11-27 Thread why the lucky stiff
On Mon, Nov 27, 2006 at 08:20:00AM -0600, Mark Fredrickson wrote:
 I'd like to see the logic in the camping server wrapped into a class.
 This would allow other uses. Right now, there is no easy way to pass
 in database, url, and port parameters. It would be helpful to have an
 API like:
 
 require 'camping/server'
 
 db = { 'host' = 'localhost, 'username' = 'camping', 'password' =
 'foo', 'db' = 'mysql_camping',  }
 myserver = Camping::Server.new('localhost', 3301, db)
 myserver.run # boots the server and returns when the sever dies

That's a brilliant idea.  Thankyou and there's no rush, just: whenever.

_why
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Camping 1.6 (was Re: Newline problem)

2006-11-26 Thread why the lucky stiff
On Sat, Nov 25, 2006 at 02:01:55PM +0100, Manfred Stienstra wrote:
 I think this problem was solved just after Camping 1.5 was released.  

That's true, this little problem bothered me a lot and maybe it's time for 1.6. 
 
Our milestones: are loading apps straight from a Gem and daemon mode[1].

Anything else?

_why

[1] http://code.whytheluckystiff.net/camping/roadmap
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


<    7   8   9   10   11   12   13   >