01:21
bradgonesurfing joined
03:23
hipertracker joined
03:53
<Tass`>
is there a way to to 'take file X and let it behave as it would be here' in HAML?
03:54
<Tass`>
partial only? :-/
04:04
<harryv>
= haml :foo, :layout => false
04:04
<harryv>
the `haml` method in sinatra just renders a template and returns it as a string. no magic.
04:24
<wadner>
hi, anyone deploying on passenger + nginx?
04:37
<wadner>
my files in the public folder works - but the ones inside the main.rb doesn't
04:56
<Tuplanolla>
I've now spent 20 hours trying to print out an unordered list and I'm sick of it.
04:57
<Tuplanolla>
Would someone mind giving a hand?
04:57
<namelessjon>
Tuplanolla: Pastie what you have so far?
04:58
<Tuplanolla>
I've erased it a few times, but here's the basic structure...
04:58
<Tuplanolla>
It's a simple problem I should be able to solve, but apparently can't. :<
05:02
<Tuplanolla>
(It has to be solved that way, because the actual A is not just an array of arrays.)
05:02
<cypher23>
not just?
05:03
<cypher23>
what else can be in there?
05:05
<Tuplanolla>
The values can point to files.
05:06
<Tuplanolla>
And it uses the .sort function, so their order is important.
05:06
<cypher23>
ok, so instead of strings, they can also be File objects
05:07
<Tuplanolla>
No, I mean... the actual problem is what I pasted.
05:08
<Tuplanolla>
The solution just has to follow the same idea, because otherwise it would mess up the rest.
05:36
<cypher23>
Tuplanolla, what I'd do is transform the array into an actual tree (using hashes)
05:36
<cypher23>
(And use an OrderedHash if you're using Ruby 1.8)
05:37
<Tuplanolla>
I knew you'd say that...
05:40
<cypher23>
you did? :)
05:40
<cypher23>
To be honest, I've been trying to come up with an algorithm to convert your array of arrays into a tree, but haven't been quite successful
05:40
<Tuplanolla>
It's out of question in this case, however, I have a solution to that.
05:56
<wadner>
what other files should be in the folder when you deploy in passenger?
05:57
<wadner>
config.ru and .gems?
05:57
<wadner>
i've got haml and it doesn't load somehow
05:59
<cypher23>
have you got haml installed?
05:59
<cypher23>
and did you require it?
05:59
<cypher23>
also, you may need "require 'rubygems'" at the very top
06:00
<cypher23>
(If you're using rubygems, that is)
06:02
<wadner>
darn thing works fine with shotgun
06:04
<cypher23>
wadner, as I said, you might be missing the rubygems require
06:09
<Tuplanolla>
Can anyone solve the non-tree problem?
06:10
<cypher23>
Tuplanolla, sorry, I'm at work right now
06:15
<Tuplanolla>
Maybe later then... I've spent a week on it, so there's no rush.
06:15
<Tuplanolla>
(The project, not the single method.)
08:05
Swimming_Bird joined
08:35
<* Tuplanolla>
just failed at the tree thing for the 7th time.
08:39
<cypher23>
you should keep at it. eventually something's gonna work :)
08:41
<Tuplanolla>
After 20 hours I really doubt it.
08:41
<Tuplanolla>
I usually figure things out in an instant.
08:42
<Tuplanolla>
Frustration just causes more mistakes.
08:48
<cypher23>
true. often, sleeping helps me with my problems
08:48
<cypher23>
(or taking a shower. but sleeping helps more)
08:50
<Tuplanolla>
Doesn't seem to.
08:50
<Tuplanolla>
I work in 2...6 hour periods.
08:59
<Tuplanolla>
I also eat healthy and jog every other day.
08:59
<Tuplanolla>
There's no use trying to find excuses.
09:12
<Tuplanolla>
Sometimes I wish I had studied computer science...
09:36
josephholsten joined
10:10
<erpuds>
i have get '/foo/:bar' and later '/foo/new' .. when hitting "/foo/new" the former template is being returned
10:10
<harryv>
move '/foo/new' up to be before '/foo/:bar'
10:10
<erpuds>
shouldn't the flow continue to find the match?
10:10
<harryv>
routes are added in the order they are defined.
10:11
<harryv>
'/foo/:bar' matches '/foo/new', right?
10:15
<cypher23>
erpuds, sinatra uses the first route that matches, and as harryv said, they are ordered in the same way as you define them
10:16
<erpuds>
yes, for some reason i thought the more specific match would be called - thanks!
10:16
<cypher23>
(though you can call `pass' to fall through to the next matching route)
10:20
<erpuds>
oh good, thanks!
10:20
<erpuds>
i preferred not to reorder them
10:22
<cypher23>
uhm. IMO it's cleaner to have the more specific routes first, then the more general ones
10:26
<erpuds>
yeah i could see how this wouldn't be the best case to use pass
10:26
<khaase>
also, you can reorder routes afterwards. it's not much use, but it shows sinatras felxibility.
10:32
<khaase>
in related new: how do you guys feel about conditional before/after filters?
10:32
<khaase>
like before('foo/*') { ... }
10:33
<cypher23>
khaase, I've been thinking about implementing them, but on the other hand, that just feels like something that should be done in a rack middleware
10:33
<cypher23>
on the other other hand, if it's something that e.g. uses the database...
10:33
<khaase>
cypher23: yeah, exactly
10:34
<khaase>
i just gave it a shot
10:34
<cypher23>
ah, so that's what you wanted the patch file for? :)
10:34
<khaase>
exactly :)
10:34
<cypher23>
it's sufficient if you create a lighthouse ticket w/ a link to your branch & compare view
11:41
<khaase>
do i have to send a pull request when i forked sinata.github.com?
11:44
<Tuplanolla>
No, because that's the wrong server.
11:52
<icco>
Hi guys. So I've been following
http://www.sinatrarb.com/intro learning the basics of Sinatra. I am trying to use erubis and less though, and the examples provided don't work. I did install the gems, but I am getting a method not found error from sinatra for both erubis and less.
11:52
<icco>
Any suggestions?
12:06
<cypher23>
icco, what version of sinatra are you using?
12:06
<icco>
cypher23, 0.9.6
12:12
<cypher23>
icco, I think that only works with 1.0
12:13
<icco>
The intro should probably mention in it that it is written for 1.0 then...
12:13
<cypher23>
though it should be trivial to backport those two from 1.0
12:14
<icco>
I may do that, although I was trying to avoid modifying sinatra so I could easily deploy to heroku.
12:15
<icco>
Alrighty, I just installed 1.0b and looks like that fixed it, thanks cypher23
12:16
<cypher23>
just remember it's still in a beta state
12:16
<cypher23>
and we'd love to have feedback/bug reports
12:18
bradgonesurfing joined
12:18
<icco>
I'll definitely file any bugs I find.
12:43
<Tuplanolla>
Still at work, cypher23?
13:00
Swimming_Bird joined
14:51
<Tuplanolla>
Still at work, cypher23?
15:16
future_chimp joined
15:22
<ajgenius>
well that was easy. faq ftw. :)
15:23
aaroninfidel joined
15:40
<Tuplanolla>
Would it be too much asked for someone to help me with this problem?
15:40
<Tuplanolla>
I've spent over 20 hours on this myself without much progress.
15:40
<Tuplanolla>
Most of you could probably solve it in 10 minutes.
15:41
<tbuehlmann>
pastie spam it
15:41
<tbuehlmann>
you may get an answer
15:44
aaroninfidel_ joined
15:46
<johnny>
Tuplanolla, never ask to ask..
15:46
<johnny>
just ask..
15:46
<johnny>
and then describe what your problem is..
15:46
<johnny>
nobody is gonna click a link without context..
15:48
<Tuplanolla>
It's explained right there.
15:49
<Tuplanolla>
I need to print out an array of strings as a tree with that construct and marking terminal nodes.
15:50
<johnny>
also.. try #ruby for generic ruby questions
15:50
<johnny>
instead of this sinatra specific channel
15:51
<Tuplanolla>
It's not just ruby.
15:51
<johnny>
and perhaps there is a gem that does what you want
15:51
<johnny>
in that it generates a "widget" type thing based on similiar input data
15:51
<johnny>
well it's certainly not sinatra related.. as sinatra does so little :)
15:52
<Tuplanolla>
I have yet to see a channel that stays on topic.
15:53
<johnny>
sure.. doesn' mean you'll get an answer here tho
15:53
<johnny>
thus i was suggesting an alternative
15:54
<johnny>
if it was busy.. you would certainly be suggested to stay on topic
15:54
<Tuplanolla>
I'll go there later...
16:54
<Tuplanolla>
People at #ruby refuse to help.
18:36
Swimming_Bird joined
19:07
aaroninfidel_ joined
19:26
<zodiak>
so, did anyone else think that Tuplanolla's question was either (a) homework or (b) job interview test ?
20:11
aaroninfidel_ joined
20:24
<GitHub180>
sinatra: 07master 03Ryan Tomayko * e1638a4 (2 files in 1 dirs): skip haml / sass tests when they fail to load due to stupid bullshit ... -
http://bit.ly/9JamMQ
21:34
<kematzy>
Q: What's the syntax for making a new Tilt extension? ie: I want to have a rjs(...) method, that loads 'views/app.js.erb'
21:34
<kematzy>
btw, that's inside of a Sinatra app.