03:36
<Mathetes>
[00rss] <alie...@gmail.com (Lorenzo Giuliani)> Re: WYSIWYG - http://z.pist0s.ca/112t
04:07
peterhellberg joined
09:52
<oilpastels_>
guys, quick question
09:52
<oilpastels_>
http://pastie.org/3472199
09:53
<oilpastels_>
is this not enough to pass params over to '/preview'?
09:54
<oilpastels_>
what am i missing?
10:04
<peterhellberg>
oilpastels_: What do you expect to happen? Just a redirect to /preview?
10:05
<oilpastels_>
i want to be able to view the @text content on preview
10:05
<oilpastels_>
peterhellberg: ^ sorry
10:06
<peterhellberg>
@text will only be available on "POST /"
10:07
<peterhellberg>
You could add the text to a query parameter like: redirect "/preview?text=#{@text}" or just render the preview directly
10:07
<oilpastels_>
peterhellberg: thanks, let me see
10:08
<peterhellberg>
I hope you know that you don’t magically have sessions in Sinatra, you need to enable them if you for some reason need to persist data between pages
10:10
<oilpastels_>
peterhellberg: i forgot about that
10:15
<oilpastels_>
peterhellberg: jesus, i was totally confused as to how sinatra worked. i got it working now and i feel properly stupid.
10:16
<oilpastels_>
peterhellberg: thanks!
10:16
<shellox>
khaase: are you around?
10:16
<khaase>
shellox: yes
10:16
<shellox>
I have some weird issues with a modular sinatra application :/
10:16
<shellox>
Could not find gem 'sinatra (= 1.3.2) ruby' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
10:17
<shellox>
moment, i create a gist
10:19
<peterhellberg>
oilpastels_: Something like this: https://gist.github.com/1924504 (I would write a modular Sinatra application instead)
10:20
<shellox>
khaase: http://pastie.org/3472434
10:21
<oilpastels_>
peterhellberg: wow, that's very thorough, thanks a lot :)
10:25
<shellox>
and bundle install returns: Could not install to path `Gemfile` because of an invalid symlink. Remove the symlink so the directory can be created.
10:26
<khaase>
shellox: no idea, maybe ask in bundler channel?
10:31
<peterhellberg>
khaase: Thanks for Travis CI btw :) (Is there any reasonable way to save VCR data between runs?)
10:32
<khaase>
peterhellberg: we plan to add a artifacts feature that would allow this
10:33
<shellox>
khaase: haha got it, a hidden .bundle file ;)
10:33
<peterhellberg>
khaase: Oh, cool. (My test suite take ~1-2 mins because it need to download some data over the net)
11:47
delinquentme joined
11:49
<delinquentme>
When making API calls ... specifically in sinatra .. I've seen the instances where args are simply placed in the URL ... what happens when they're packaged up with something like curl? I'm guessing those args go into the header?
12:33
<Defusal>
delinquentme, HTTP requests have GET args which go in the URL and certain HTTP methods such as POST has a body of data
12:34
<Defusal>
headers are reasonably rearly used for APIs
12:38
<delinquentme>
headers aren't used for APIs?
13:03
<khaase>
delinquentme: they are, but url params are no headers
13:03
<khaase>
delinquentme: in curl, set headers with -H
13:04
<delinquentme>
yeah i've got a nice example of that ...now how does sinatra dissect those headers for use in the app.rb routes file?
13:23
<delinquentme>
I need a Rails.root type operation in sinatra
13:23
<delinquentme>
WAIT .:/ should work as the current dir right?
16:59
<Hydroxide>
hi. I have two modular apps which share enough logic that I made them inherit from a shared class which inherits from Sinatra::Base. the shared superclass lives in a subdirectory but needs to know the top-level settings.root dir for file access purposes. how can I do this?
16:59
<Hydroxide>
i.e., every way I've tried seems to result in no settings.root value being passed to the superclass. I could add an argument to the superclass constructor and pass it via initialize, but that's ugly.
17:13
<Hydroxide>
actually, initialize probably wouldn't work
17:13
<Hydroxide>
since it's a class method-based DSL
17:23
<tla>
Hydroxide: passing information from subclass to its superclass seems odd :)
17:24
<Hydroxide>
tla: I'd be fine doing it in a cleaner way
17:24
<tbuehlmann>
do you want to share that between the classes?
17:24
<Hydroxide>
tla: it's just hard to figure out what the answer is. maybe I need to make it an extension and use two lines, one to register and one to call a DSL/class macro to pass the info
17:24
<Hydroxide>
but I"m already doing that too much
17:25
<Hydroxide>
tbuehlmann: it's a mixture of settings that all the modular apps should share, plus some config info they should load from disk
17:25
<Hydroxide>
tbuehlmann: the config info is relative to where the top-level apps live
17:26
<Hydroxide>
but the subclass or extension or whatever is trying to access the config info relative to itself
17:26
<Hydroxide>
if that makes sense
17:26
<tla>
I think I ended up with adding a function on the superclass returning a variable set on the subclass
17:26
<tbuehlmann>
if you just have a shared state, you could use a class variable
17:27
<Hydroxide>
tla: hm, that's interesting
17:27
<Hydroxide>
tbuehlmann: class variable where?
17:27
<Hydroxide>
in the children?
17:27
<tla>
Hydroxide: it was a looong time ago in some PHP :)
17:27
<Hydroxide>
haha :)
17:28
<tbuehlmann>
in the parent
17:29
<Hydroxide>
hm, I think I might do the register + call a class macro option after all. that will give max flexibility if I want to have different modular apps use different config files with the same shared logic
18:12
<Hydroxide>
tla, tbuehlmann: works nicely. thanks for listening and discussing :)
18:12
<* Hydroxide>
waves
18:14
WillMarshall joined
18:57
<Jarred>
I have three apps. Two talk to a backend, which stores data and maintains state. One of those two is sending back and forth sensor data (it's state). The third is a way of representing state. Is Sinatra a good backend for this situation?
19:56
<gnarg>
hey khaase: this is Jon from New Relic, we met when you were in Portland at EY
19:56
<gnarg>
If you're around I have a couple questions
19:57
<gnarg>
I'm trying to fix up our instrumentation of 1.3.x, which is kind of broken right now
23:10
<l1x>
can i use in configure block a cache control header for static files?