librelist archives

« back to archive

small gem question

small gem question

From:
David Cummings
Date:
2011-06-29 @ 20:46
Hey all,

     So I had a small site set up with passenger, nginx and nesta - back in
the github days. I decided to upgrade to the gem version the other day,
following the post instructions, but came up short of having everything
work. I think the main issue is that my root directory for nginx is no
longer where nesta is (they were all in the same directory with github) -
there's content in one directory created by nesta new, but nesta itself is a
system-wide gem in /opt/ruby_whatever/bin ...

     So...where do I point nginx root directive and how does passenger know
where nesta is? In other words, do I have to copy app.rb from the gem to my
content directory? Sorry if this is a dumb gem/ruby question, I don't get
into this world much (half the reason for trying nesta...)

Thanks,
-Dave

Re: [nesta] small gem question

From:
Graham Ashton
Date:
2011-06-29 @ 22:29
On 29 Jun 2011, at 21:46, David Cummings <david.logan.cummings@gmail.com> wrote:

>      So...where do I point nginx root directive and how does passenger 
know where nesta is? In other words, do I have to copy app.rb from the gem
to my content directory? Sorry if this is a dumb gem/ruby question, I 
don't get into this world much (half the reason for trying nesta...)

The ’nesta new mysite.com` command creates everything that passenger 
should need to fire the app up. Converting to the gem was partly an 
exercise in getting all the crap that you don't need out of the way (and 
partly an exercise in making nesta more easily re-used within larger 
projects).

Stick the folder that gets generated by `nesta new …’ on your server 
(typically done with capistrano or vlad, but scp/FTP will do) and set the 
passenger_root setting to point to that directory.

Have you read the Nginx passenger guide? In there somewhere it talks about
setting passenger  up to work with Rack applications, and says that it 
looks for the config.ru file. The app.rb file isn't relevant — it's a bit 
of a convention for tiny Sinatra apps to live in a file called app.rb, but
it has no significance to Rack whatsoever. The rack config file 
(config.ru) is responsible for getting everything kicked off.

I'd post my config (effectif.com runs on passenger) but I'm not on my 
computer right now so can't get to it.

Graham

Re: [nesta] small gem question

From:
David Cummings
Date:
2011-06-29 @ 23:19
alright - got it. I mucked a bit up when I couldn't get it working right
away, so I had to go back and undo some changes.
The biggest confusion for me resulted because 'nesta new' doesn't create a
public/ folder - so I had taken that off of the root directive, and
passenger prefers it that way.
Either way, I'm back up and running - thanks so much!
-Dave

On Wed, Jun 29, 2011 at 6:29 PM, Graham Ashton <graham@effectif.com> wrote:

> On 29 Jun 2011, at 21:46, David Cummings <david.logan.cummings@gmail.com>
> wrote:
>
> >      So...where do I point nginx root directive and how does passenger
> know where nesta is? In other words, do I have to copy app.rb from the gem
> to my content directory? Sorry if this is a dumb gem/ruby question, I don't
> get into this world much (half the reason for trying nesta...)
>
> The ’nesta new mysite.com` command creates everything that passenger
> should need to fire the app up. Converting to the gem was partly an exercise
> in getting all the crap that you don't need out of the way (and partly an
> exercise in making nesta more easily re-used within larger projects).
>
> Stick the folder that gets generated by `nesta new …’ on your server
> (typically done with capistrano or vlad, but scp/FTP will do) and set the
> passenger_root setting to point to that directory.
>
> Have you read the Nginx passenger guide? In there somewhere it talks about
> setting passenger  up to work with Rack applications, and says that it looks
> for the config.ru file. The app.rb file isn't relevant — it's a bit of a
> convention for tiny Sinatra apps to live in a file called app.rb, but it has
> no significance to Rack whatsoever. The rack config file (config.ru) is
> responsible for getting everything kicked off.
>
> I'd post my config (effectif.com runs on passenger) but I'm not on my
> computer right now so can't get to it.
>
> Graham

Haml usage

From:
Tommy Palmer
Date:
2011-07-03 @ 20:35
Quick question about the haml usage in Nesta - I'm trying to render out 
<ol reversed> but it's being processed as xhtml and coming out as <ol 
reversed='reversed'>

The haml doing this is %ol(reversed)

The haml docs say you need to use 'set :haml, :format => :html5' to set 
this in non Rails 3 ruby apps. Adding this to my app.rb does nothing 
however.

What am I missing?

--
Tommy Palmer
@tommypalm
http://tommyp.org


On Thursday, 30 June 2011 at 00:19, David Cummings wrote:

> alright - got it. I mucked a bit up when I couldn't get it working right
away, so I had to go back and undo some changes.
> The biggest confusion for me resulted because 'nesta new' doesn't create
a public/ folder - so I had taken that off of the root directive, and 
passenger prefers it that way. 
> Either way, I'm back up and running - thanks so much!
> -Dave
> 
> On Wed, Jun 29, 2011 at 6:29 PM, Graham Ashton <graham@effectif.com 
(mailto:graham@effectif.com)> wrote:
> > On 29 Jun 2011, at 21:46, David Cummings 
<david.logan.cummings@gmail.com (mailto:david.logan.cummings@gmail.com)> 
wrote:
> > 
> > > So...where do I point nginx root directive and how does passenger 
know where nesta is? In other words, do I have to copy app.rb from the gem
to my content directory? Sorry if this is a dumb gem/ruby question, I 
don't get into this world much (half the reason for trying nesta...)
> > 
> > The ’nesta new mysite.com (http://mysite.com)` command creates 
everything that passenger should need to fire the app up. Converting to 
the gem was partly an exercise in getting all the crap that you don't need
out of the way (and partly an exercise in making nesta more easily re-used
within larger projects).
> > 
> >  Stick the folder that gets generated by `nesta new …’ on your server 
(typically done with capistrano or vlad, but scp/FTP will do) and set the 
passenger_root setting to point to that directory.
> > 
> >  Have you read the Nginx passenger guide? In there somewhere it talks 
about setting passenger up to work with Rack applications, and says that 
it looks for the config.ru (http://config.ru) file. The app.rb file isn't 
relevant — it's a bit of a convention for tiny Sinatra apps to live in a 
file called app.rb, but it has no significance to Rack whatsoever. The 
rack config file (config.ru (http://config.ru)) is responsible for getting
everything kicked off.
> > 
> >  I'd post my config (effectif.com (http://effectif.com) runs on 
passenger) but I'm not on my computer right now so can't get to it.
> > 
> >  Graham

Re: [nesta] Haml usage

From:
Graham Ashton
Date:
2011-07-06 @ 04:58
On 3 Jul 2011, at 21:35, Tommy Palmer <hi@tommyp.org> wrote:

> The haml doing this is %ol(reversed)

Have you tried this variant?

%ol{ :reversed => true }

> The haml docs say you need to use 'set :haml, :format => :html5' to set 
this in non Rails 3 ruby apps. Adding this to my app.rb does nothing 
however.

It's already in Nesta, so shouldn't change anything. You can check if it's
picked up by seeing what doctype gets inserted by !!! at the top of your 
layout.

> What am I missing?

Hopefully just the true bit. It's definitely possible as I went through 
this when I designed the current default theme.

I haven't tested this just now as I'm not on my laptop, but hopefully 
this'll sort it.

Re: [nesta] Haml usage

From:
Graham Ashton
Date:
2011-07-06 @ 07:55
On 3 Jul 2011, at 21:35, Tommy Palmer wrote:

> The haml doing this is %ol(reversed)

Now that I'm back on my computer, I found this example from the default theme:

https://github.com/gma/nesta/blob/master/views/page_meta.haml#L7

It's working properly in Nesta 0.9.5 (I checked the output on my site).

Re: [nesta] Haml usage

From:
Tommy Palmer
Date:
2011-07-06 @ 11:16
Adding new tags is not the issue, haml is looking at the attributes I give
to the %ol and produces it as xhtml like such:

<ol reversed='reversed'>

It needs to produce it as <ol reversed> which is valid html5. Adding set 
:haml, :format => :html5 to app.rb isn't accomplishing this when I follow 
the haml docs for adding a Boolean attribute to the ol. 
--
Tommy Palmer
@tommypalm
http://tommyp.org


On Wednesday, 6 July 2011 at 08:55, Graham Ashton wrote:

> On 3 Jul 2011, at 21:35, Tommy Palmer wrote:
> 
> > The haml doing this is %ol(reversed)
> 
> Now that I'm back on my computer, I found this example from the default theme:
> 
> https://github.com/gma/nesta/blob/master/views/page_meta.haml#L7
> 
> It's working properly in Nesta 0.9.5 (I checked the output on my site).

Re: [nesta] Haml usage

From:
Graham Ashton
Date:
2011-07-06 @ 11:48
On 6 Jul 2011, at 12:16, Tommy Palmer wrote:

> Adding set :haml, :format => :html5 to app.rb isn't accomplishing this 
when I follow the haml docs for adding a Boolean attribute to the ol.

Also see this in Nesta's (internal) app.b (i.e. you're using it already):

https://github.com/gma/nesta/blob/master/lib/nesta/app.rb#L24

Re: [nesta] Haml usage

From:
Graham Ashton
Date:
2011-07-06 @ 11:46
On 6 Jul 2011, at 12:16, Tommy Palmer wrote:

> Adding new tags is not the issue

I'm not sure what you mean.

Look at the example I posted again and take note of "pubdate=true".

Look at the source of http://effectif.com to see what happens to pubdate.