[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Camping 1.3, the Microframework

why the lucky stiff

2/8/2006 5:47:00 AM

Good people of the town: Maybe some of you are interesting in the
continuing story of Camping. If not, I understand, these are sensitive
matters, best wishes.

Camping is a small framework designed to mimick Rails, but weighing in
3.9k. A full explanation can be had at the documentation site:

http://camping.ruby...

= New in Camping 1.3 =

If you've used previous versions of Camping, I would _highly_ encourage
you to examine the list of changes below, since this will affect how you
build Camping apps. To those you who've been following development
gems, there isn't anything new as of two weeks ago. Who knows, you
might want to read anyway.

== !^! Warning -- ActiveRecord Table Prefixes !^! ==

This is probably the biggest part of Camping which will trip people up.
Since mounted Camping apps are designed to share a database, I'm using
table prefixes to prevent name clash.

If you have a model class called Blog::Models::Post, the database name
will be 'blog_post'. The top-level module name is used.

If your model class is in Camping::Models::Post, prefixes won't be used,
it's just 'post'. The reasoning is: if you're placing your models right
in the Camping module, you probably haven't designed it to play friendly
with other apps. (See Camping.goes below for more on playing nicely.)

Since table prefixes are used, you'll also need to use the full table
name in your IDs:

blog_post.id => blog_post_id
blog_user.id => blog_user_id

Unless you set up the `foreign_key' property and such properly in the
models. See
http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMe...
for instructions.

== bin/camping ==

Camping now comes with a launcher. Once your gem is installed, launch
any Camping application with:

camping your-app.rb

You will need to install SQLite3 and its gem for this to work:
http://code.whytheluckystiff.net/camping/wiki/BeAlertWhe...

The database will be stored in ~/.camping.db. On Windows:
$APPDATA/Camping.db.

== Camping.goes ==

Since you may choose to mount several Camping apps at once and store
them in a mutual database (for possible cross-pollenation), the
Camping.goes mechanism will copy the Camping framework into a new module
for hacking:

require 'camping'
Camping.goes :Blog

module Blog::Models ... end
module Blog::Controllers ... end
module Blog::Views ... end

== Camping.create ==

Every database-dependant Camping app should have a Camping.create method
which checks to see if the database tables are created. If not, run the
schema.

An example on the wiki:
http://code.whytheluckystiff.net/camping/wiki/GiveUsTheCr...

== Camping.run ==

The Camping.run interface is used to interface with the web server.
Traditional CGI environments can call Camping.run without arguments.
Web servers which have nice cushiony Ruby extensions can call
Camping.run with arguments:

controller = Camping.run(request, env)

Examples of working with a bunch of different web servers is in the
postambles collection:
http://code.whytheluckystiff.net/camping/wiki/...

== Rails/PHP-style query string ==

The query string: ?post[user]=_why;post[id]=2

Will be available as a hash at @input.post in your controllers.

module Blog::Controllers
class Save
def post
@post = Post.create(@input.post)
end
end
end

== Luxurious RDoc ==

The RDoc is now a nice multi-page, non-frame RDoc. Try it out:
http://camping.ruby...

= Lastly: Installation =

You may install like so:

gem install camping

Or, if you'd like to follow the bleeding edge gems:

gem install camping --source code.whytheluckystiff.net

_why


9 Answers

why the lucky stiff

2/8/2006 5:56:00 AM

0

Oh and one last thing. There is an indiscriminate mailing list if you want:

http://rubyforge.org/mailman/listinfo/ca...

_why


Jacob Fugal

2/8/2006 5:18:00 PM

0

On 2/7/06, why the lucky stiff <ruby-talk@whytheluckystiff.net> wrote:
> == !^! Warning -- ActiveRecord Table Prefixes !^! ==
>
> This is probably the biggest part of Camping which will trip people up.
> Since mounted Camping apps are designed to share a database, I'm using
> table prefixes to prevent name clash.
>
> If you have a model class called Blog::Models::Post, the database name
> will be 'blog_post'. The top-level module name is used.

Wondering... is that a typo or is it really 'blog_post' instead of
'blog_posts'? The default AR convention is pluralized table names.

Jacob Fugal


Seth Thomas Rasmussen

2/8/2006 7:21:00 PM

0

Hi Jacob,

> Wondering... is that a typo or is it really 'blog_post' instead of
> 'blog_posts'? The default AR convention is pluralized table names.

Is that the AR convention, or is that how AR operates in the context of
Rails, which uses Inflector to translate all those names back and forth
for you?

james_b

2/8/2006 9:05:00 PM

0

why the lucky stiff wrote:
> Good people of the town: Maybe some of you are interesting in the
> continuing story of Camping. If not, I understand, these are sensitive
> matters, best wishes.

Is ActiveRecord a requirement?


--
James Britt

http://www.ru... - Ruby Help & Documentation
http://www.artima.c... - The Journal By & For Rubyists
http://www.rub... - The Ruby Store for Ruby Stuff
http://www.30seco... - Building Better Tools


MenTaLguY

2/8/2006 9:16:00 PM

0

Quoting James Britt <james_b@neurogami.com>:

> why the lucky stiff wrote:
> > Good people of the town: Maybe some of you are interesting in
> > the continuing story of Camping. If not, I understand, these
> > are sensitive matters, best wishes.
>
> Is ActiveRecord a requirement?

No more than it is for Rails.

-mental


james_b

2/8/2006 11:11:00 PM

0

mental@rydia.net wrote:
> Quoting James Britt <james_b@neurogami.com>:
>
>
>>why the lucky stiff wrote:
>>
>>>Good people of the town: Maybe some of you are interesting in
>>>the continuing story of Camping. If not, I understand, these
>>>are sensitive matters, best wishes.
>>
>>Is ActiveRecord a requirement?
>
>
> No more than it is for Rails.

Ah, I see. It does not include its own persistence lib.

Thanks.



--
James Britt


why the lucky stiff

2/9/2006 12:06:00 AM

0

Seth Thomas Rasmussen wrote:

>>Wondering... is that a typo or is it really 'blog_post' instead of
>>'blog_posts'? The default AR convention is pluralized table names.
>>
>>
>
>Is that the AR convention, or is that how AR operates in the context of
>Rails, which uses Inflector to translate all those names back and forth
>for you?
>
Jacob was right about that typo: it's `blog_posts'.

AR convention is to figure out the table names from the class names and
vice versa. Camping sticks on the `blog_' prefix (based on the name of
the module your app is stored in.)

_why



William Black

3/16/2010 4:31:00 PM

0


"Theodore" <theodoredice@gmail.com> wrote in message
news:qf8vp5ddht8riqgb9ar2s89817tu5g96dv@4ax.com...
> On Tue, 16 Mar 2010 14:31:03 +0530, "William Black"
> <william.black@hotmail.co.uk> wrote:
>


> Depends who's guarding them, if anyone. Excuses can easily be made
> about moving them to other locations and simply diverting them to a
> secure location for a short time. We're not talking about gld bullion
> here.

No, but they'll almost certainly be as well protected as anything else the
local government keeps safe.

> Many secrets regarding what precisely MI5 and MI6 do are still kept
> secret, I see no reason why something like this couldn't be either.


Too many people would have to know about it and would have no reason to keep
quiet.

It's not ULTRA and we're not in a war.

> I'm not normally a conspiracy theorist, but I'd be amazed if
> especially during the cold war MI5/MI6 didn't pay an active interest
> in people who voted for anyone vaguely communist.

Too many to worry about.

They don't care who people vote for. That why the ask 'Are you or have you
ever been a _member_ of the Communist Party'.

You've got to remember that the people doing the spying are doing it to
preserve our way of life. If we're as bad as the bad guys why bother?

--
William Black


I've seen things you people wouldn't believe.
Barbeques on fire by the chalets past the castle headland
I watched the gift shops glitter in the darkness off the Newborough gate
All these moments will be lost in time, like icecream on the beach
Time for tea.

Cynic

3/17/2010 7:58:00 PM

0

On Mon, 15 Mar 2010 14:46:29 +0000, Theodore <theodoredice@gmail.com>
wrote:

>>I'm disillusioned with all parties but the reason I'll be voting BNP is
>>because the more votes they get the more worried the mainstream parties
>>will be.
>
>And you'll have a nice big X next to the BNP on your voting record for
>life - nice to have when we get a majority of Muslims in power.

THough it could be a big advantage if the BNP get into power. It
would probably get you a free arm-band.

--
Cynic