01:49
<rob_>
how do i go about doing relative paths in sinatra? im running my application as a cgi script under an unknown directory..
02:41
beawesomeinstead joined
04:44
hipertracker joined
06:51
rmontgomery429 joined
07:25
josephholsten joined
07:43
<jashkenas>
'morning #sinatra. What's the current story with using Sinatra together with ActiveRecord 2.3.5?
07:43
<jashkenas>
Sinatra requires Rack, Rack 1.1.0 isn't compatible with ActiveRecord 2.3.5 (claims ActiveRecord)
07:44
<jashkenas>
So you get the gem mismatch bugaboo, and I was wondering how y'all are sidestepping it.
07:48
<cypher23>
jashkenas, I don't use Sinatra w/ ActiveRecord, but you might try editing the gemfiles and change the dependecy, as described in the ticket comments
08:10
<cfurrow>
jashkenas: I've been using Sinatra w/ DataMapper for the past few days, and it's gone pretty well.
08:47
<rmontgomery429>
+1 for DataMapper and Sinatra.
08:52
<soveran>
sr_: ping
10:15
thefifthcircuit joined
12:26
<sr_>
soveran, pong
12:38
<soveran>
sr: I was updating monk to work with 1.0 and the only issues is that settings is now a method in Sinatra::Base, but now we are thinking what to do with it.
12:38
<soveran>
sr: so, we will probably change the way Monk works.
12:44
<donpdonp>
im converting a geomena script into a geomena::base class. the script says 'mime :type,"code"', where does this go in the base class?
12:51
<cylence>
What is the code for rendering a partial in a view using haml?
12:51
<cylence>
is it simple: = haml(:partialname)
12:51
<cylence>
I'm assuming not since that's giving me an error
12:52
<cylence>
or if that is correct, where should the partials be stored?
12:52
blakemizerany joined
12:52
<GitHub179>
tilt: 07master 03Justin Knowlden * 00ce3f7 (2 files in 2 dirs): Cleaned up Tilt[](ext) method because the redundancy was bothering me. Broke out some tests to be more explicit as well.
12:52
<GitHub179>
tilt: 07master 03Justin Knowlden * 779c398 (1 files in 1 dirs): Adding a comment about what to expect from Tilt.registered?
12:52
<cylence>
wow, just answered my own question. thank you
12:53
<cylence>
I suppose the other one I've been chewing on would be how to do multiple line bits of code in views (should I ever need to)
13:17
<cylence>
how do I do logic in a view without out putting it using haml?
13:18
<cylence>
heh, this would be so easy in erb
13:33
<jbrennan>
I'm trying to set up a sinatra app hosted on dreamhost, and when I cloned my git repo into the directory for my website ( website.com/ hosted by dreamhost) it ended up actually creating website.com/projectName/allmystuffhere instead.... In my config.ru file I made it point to the actual location of my sinatra_app_script.rb but when I visit the website I just get a directory listing
13:33
<jbrennan>
Any ideas?
13:33
<dnyy>
cylence: can you give an example, don't really get your question. ;o
13:34
<cylence>
dnyy: absolutely. I resolved it another way, but I was using @thing.each { |e| puts e }
13:34
<jbrennan>
oh, now I'm getting a Rack error, no such file "sinatra" in my config.ru file
13:35
<cylence>
dnyy: I did this WITH the '=' at the front in the view, as I understand is necessary. but that ALSO outputs the content, so it was outputting it twice
13:35
<cylence>
dnyy: I recall a way, but don't remember the exact syntax for performing logic in the view but not outputting it.
13:35
<dnyy>
cylence: just don't put a =
13:35
<cylence>
dnyy: it will still parse it as ruby?!
13:35
<dnyy>
well, put a -
13:36
<cylence>
AHHHHHHHHHHHHH
13:36
<cylence>
there it is
13:36
<cylence>
lol, thank you!!!
13:36
<cylence>
very nice, phew
13:37
<dnyy>
jbrennan: haven't used dreamhost in forever, but do you have mod_rails (or whatever they're using now) pointing to the right directory?
13:37
<jbrennan>
I *think* so
13:38
<jbrennan>
there's a checkbox for using it, and I've got it checked, but it doesn't specify a directory
13:38
<jbrennan>
it seems to be recognizing my config.ru, but finds an error
13:38
<jbrennan>
I've installed the Sinatra gem too
13:38
<dnyy>
pointing at public?
13:39
<jbrennan>
I think so. But here's the thing, my public directory is also inside that other directory. So I pointed dreamhost to that, too
13:40
<jbrennan>
(and by my public directory, I mean /mysite.com/project/public/ , where project holds my sinatra script)
13:42
<jbrennan>
I'm assuming dreamhost's "public" and sinatra's "public" are different things, yes?
13:42
<dnyy>
jbrennan: well, you should be pointing to your apps public directory when setting up mod_rails or whatever.
13:43
<jbrennan>
ok I'll do that
13:44
<jbrennan>
So should everything sinatra related be in the same directory as where I tell dreamhost is "public" ?
13:48
<dnyy>
all the ruby lives outside of that
13:50
<jbrennan>
Just trying to reason with myself :)
13:51
<dnyy>
hah, my bad if i'm misunderstanding the problem. ;p
14:03
<jbrennan>
OK, now I've got all my files in the right spot, but I'm getting the same error, Rack can't find sinatra....
14:25
<mistergibson>
anyone got a whiz-bang url regarding sinatra over thin? I was not going to run it under thin per se, but rather use some mixing thingy to go after my goals.
15:40
<jbrennan>
Can someone lend me a hand deploying this sinatra app to dreamhost? passenger can't seem to find sinatra
15:40
<jbrennan>
is there a way to verify I've got the gem loaded properly?
15:44
<jbrennan>
mind you, if I just run $ ruby mySinatraApp.rb on the server, it actually runs
16:13
<jbrennan>
See the strange thing is, if I just run the app on the server with ruby myApp.rb then I don't get any errors
16:14
<jbrennan>
but when I run with passenger, it can't find the things I required in the app itself
18:28
<TomV-415>
Anyone had luck catching exceptions? I want to use my apps exisitng mailer to send alerts when sinatra/rack excption is raised. (get '/boom' { raise 'my silly exception } should send an email..
18:28
<TomV-415>
Using 'on error' doesn't seem to work in this case.
18:30
<TomV-415>
(anyone around on a sunny Friday afternoon (here in San Francisco at least..) )?
18:31
<sr>
TomV-415, beautiful day heh
18:31
<sr>
TomV-415, try enable :raise_errors
18:31
<TomV-415>
sr: thanks - I did that but let me look at my code and whip up a gist. :-)
18:50
<TomV-415>
do I need to be working with a Rack middleware layer to catch this error?
18:52
<sr>
checkout mailexception in rack-contrib
18:59
<TomV-415>
sr thanks, I found that before, but thought I could just use my own mailer.. I'll look at how that gets configured and work my way backwards..
19:01
<sr>
TomV-415, you could. i was talking of the technique. rack/contrib/mailexception uses
19:11
<soveran>
sr: late reply: I like the idea of local settings
19:16
thefifthcircuit joined
19:32
<TomV-415>
sr: I'm still fiddling... can't get the mailexception to connect.. but I'll look more closely at the implementaion as you suggest and go from there.. Thanks.
19:36
<mistergibson>
anyone work with thin and sinatra before? I'm a n00b looking to cobble some bit together
19:37
<mistergibson>
it appears the thin docs are scattered hither, thither and yon ... but you have any favorite urls, any help would be apprecitated
19:37
<mistergibson>
err... appreciated
19:38
<harryv>
what do you need?
19:40
<mistergibson>
I am looking to use sinatra over thin withing a module (not running via thin), to integrate with eventmachine
19:41
<harryv>
take a look at the source, in examples/
19:41
<harryv>
examples/adapter.rb e.g.
19:41
<mistergibson>
ok, thanks
19:44
<mistergibson>
I don't see examples in github
19:46
<mistergibson>
ok, thanks
19:47
<mistergibson>
(looking at wrong project)
20:09
<mistergibson>
that's pretty cool
21:14
<TomV-415>
The one on line 42 confuses me.
21:16
<sr>
TomV-415, it'll send whatever you put in env[
21:16
<sr>
that is, the rack env. so say in yer sinatra app you do env[
21:17
<sr>
err, env["mail.exception"] = 'foo' it'll be send even if no exception is raised
21:18
<TomV-415>
Ahh... that closing if clause - so it executes when the sinatra ap closes to send the 'foo' message?
21:18
<TomV-415>
(line 42)
21:18
<TomV-415>
Thanks for the help - basic stuff I realize. I'm building a little module modeled on this one.
21:24
<sr>
TomV-415, nah, it sends if there is a 'mail.exception' key on the rack env hash
21:39
<TomV-415>
sr: Are you in Norway? I'm going to spend 5 months in Finland later this year..seems nearby from where I sit now.
21:40
<sr>
my irssi is. i am actually in sf
21:42
<TomV-415>
sr: that's funny! small world indeed! I thought given the time, you must be in a different time zone.
21:54
<TomV-415>
sr: I see that @app = app was missing from my initialize method, but that was not the issue - fixed it.
23:21
<TomV-415>
Anyone have a suggestion for me?
23:22
<syd_>
eat your homework
23:22
<syd_>
do your vegetables
23:22
<syd_>
the worst part is
23:22
<syd_>
I didn't even mean to mix those two up
23:26
<TomV-415>
my favorite "The problem is you see the glass as half full, and I see it as empty"
23:27
<TomV-415>
btw, I did my homework, but got the wrong answer.. not sure where to start troubleshooting.
23:29
<TomV-415>
I guess my next move is to copy the example EXACTLY and see if it works..