alexspeller has quit [Remote host closed the connection]
oktapodi has joined #ruby
alexspeller has joined #ruby
vlad_starkov has quit [Ping timeout: 244 seconds]
WanderingGlitch has quit [Changing host]
WanderingGlitch has joined #ruby
yshh has quit [Ping timeout: 260 seconds]
BoomCow has joined #ruby
mercwithamouth has joined #ruby
Takehiro has joined #ruby
ania12lat has quit [Ping timeout: 252 seconds]
<dsdeiz>
anyone happen to have any ideas? :D http://pastebin.com/hzu5fVaf how do i call base_uri with the @config from the initialize method?
daniel_hinojosa has quit [Quit: Leaving.]
alexspeller has quit [Remote host closed the connection]
tommyvyo_ has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
kiyoura has quit [Ping timeout: 265 seconds]
Targen has joined #ruby
<breakingthings>
Making a simple irc bot as my first foray into ruby… wondering if anyone knows a cleaner way to respond to PONGs than doing a regex match
<breakingthings>
I know I can do something like message.includes? "PONG"
rondale_sc has quit [Quit: rondale_sc]
Targen_ has quit [Ping timeout: 276 seconds]
phantasm66 has quit [Quit: *sleeeep….]
<breakingthings>
but I'm not sure how to get the identifier after that
BoomCow has quit [Quit: This computer has gone to sleep]
<breakingthings>
or if regex is just the best way to do that
samphippen has quit [Quit: Computer has gone to sleep.]
<TheEmpty>
>> str="this is a PING";print str[str.'index("PING"),4]
<eval-in>
TheEmpty: Output: "/tmp/execpad-12be18d33edd/source-12be18d33edd:1: syntax error, unexpected tSTRING_BEG\nstr=\"this is a PING\";print str[str.'index(\"PING\"),4]\n ^\n/tmp/execpad-12be18d33edd/source-12be18d33edd:1: unterminated string meets end of file\n" (http://eval.in/5724)
<ryanf>
I used a regex
<ryanf>
I think regexes are pretty much just the best way of doing it
<TheEmpty>
>> str="this is a PING";print str[str.index("PING"),4]
Michael has quit [Remote host closed the connection]
samphippen has quit [Quit: Computer has gone to sleep.]
<breakingthings>
not sure why, though...
tommyvyo_ has joined #ruby
adeponte has joined #ruby
_adeponte has quit [Ping timeout: 255 seconds]
<ryanf>
breakingthings: rubot is taken
pskosinski has quit [Read error: Connection reset by peer]
<ryanf>
that was my first choice too
<breakingthings>
ryanf: It's on a different server :)
<ryanf>
nah I meant as a project name
<breakingthings>
I knew it existed I was just being simple
<breakingthings>
yeah i know
<breakingthings>
I wasn't planning on publishing this
<ryanf>
yeah fair enough
<breakingthings>
it's super simple just for playing with ruby
<breakingthings>
but I'm trying to figure out why >> isn't working
<breakingthings>
any idea?
<ryanf>
anyway I think you're probably not waiting long enough before trying to join
<breakingthings>
Yeah, but that statement made my script error out…
<ryanf>
please be more specific than that
browndawg has joined #ruby
<breakingthings>
Well, the only error it gave me was 'Broken pipe' when I interrupted it's execution
<breakingthings>
(Errno:EPIPE)
<ryanf>
why did you interrupt its execution?
<breakingthings>
because it was stalling out
<breakingthings>
removing that statement makes the script behave as expected
<ryanf>
what's the expected behavior?
<breakingthings>
...connect
<breakingthings>
the script did nothing when "@channels << channel" was there
<breakingthings>
and I had to interrupt it
<breakingthings>
when I remove that line, it connects properly
<blazes816>
because you're modifying the array you're looping over
horofox has joined #ruby
horofox has quit [Client Quit]
<ryanf>
oh, yeah
<ryanf>
it's just going to keep iterating forever
<breakingthings>
ah… right.
<breakingthings>
Thanks, I can figure out how to solve it with that
jekotia has joined #ruby
jekotia has quit [Client Quit]
<ryanf>
>> (a = [1]).each { |i| a << i }
<eval-in>
ryanf: Output: "/tmp/execpad-a55d10bc0519/source-a55d10bc0519:1:in `block in <main>': failed to allocate memory (NoMemoryError)\n\tfrom /tmp/execpad-a55d10bc0519/source-a55d10bc0519:1:in `each'\n\tfrom /tmp/execpad-a55d10bc0519/source-a55d10bc0519:1:in `<main>'\n" (http://eval.in/5728)
_adeponte has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
Driscoll has quit [Ping timeout: 244 seconds]
yshh has joined #ruby
mercwithamouth has quit [Ping timeout: 255 seconds]
neurotech has joined #ruby
jamescarr has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
Driscoll has joined #ruby
yshh has quit [Ping timeout: 260 seconds]
elico has joined #ruby
_adeponte has quit [Ping timeout: 256 seconds]
pskosinski has joined #ruby
mercwithamouth has joined #ruby
Mon_Ouie has quit [Ping timeout: 244 seconds]
pcarrier has quit []
landho has quit [Ping timeout: 245 seconds]
landho has joined #ruby
lepht_afk is now known as lepht
adkron has joined #ruby
lepht is now known as lepht_afk
browndawg has quit [Ping timeout: 244 seconds]
alexspeller has joined #ruby
fwp2k has quit [Quit: WeeChat 0.3.2]
stan_man_can has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
alexspeller has quit [Ping timeout: 252 seconds]
<stan_man_can>
Hey all. I wrote a little script to pull some info from an API. It's a large chunk of data and will take quite a while to run. After about 30 seconds or so it's dying with the following error: https://gist.github.com/078b9eeb2addeef0a1c1
atyz has joined #ruby
elico has quit [Ping timeout: 245 seconds]
pen has joined #ruby
eka has joined #ruby
eka has quit [Remote host closed the connection]
pencilcheck has quit [Read error: Connection reset by peer]
stan_man_can has quit [Quit: stan_man_can]
stan_man_can has joined #ruby
atyz has quit [Ping timeout: 245 seconds]
arya has joined #ruby
<TheEmpty>
stan_man_can: the sever is closing the connection because it's taking too long. Are you sure you're sending a valid request and it's not waiting for something?
mercwithamouth has quit [Ping timeout: 264 seconds]
<stan_man_can>
TheEmpty: Yeah that shouldn't be a problem. The server can run slow sometimes. Is it possible to bump up the timeout period?
<TheEmpty>
Are you controlling the server?
<stan_man_can>
TheEmpty: No it's a thirdparty
<stan_man_can>
I
arya_ has quit [Ping timeout: 244 seconds]
<TheEmpty>
Then no you can't
<stan_man_can>
Sorry I misread your reply, I thought the script was timing out
cableray has quit [Ping timeout: 265 seconds]
<IceDragon>
HAPPY NEW YEAR.
<IceDragon>
And now back to code.
Virunga has joined #ruby
elico has joined #ruby
<TheEmpty>
IceDragon: HAPPY FISCAL CLIFF!
<wmoxam>
lolz
<wmoxam>
HAPPY RECCESSION
<IceDragon>
har
<IceDragon>
:D I KNOW RIGHT?
arya has quit [Ping timeout: 244 seconds]
<stan_man_can>
Looks like when I try to hit the URL's directly they're timing out too
<IceDragon>
MY DOLLAR SUX
<stan_man_can>
This is going to be a pain :P
<wmoxam>
ok, now who to blame?
<wmoxam>
Repub or Demo?
<wmoxam>
BOTH??
yshh has joined #ruby
<TheEmpty>
oh shit, switch out the currency!
<TheEmpty>
As a freelancer I'm all for cutting taxes and spending
pen has quit [Remote host closed the connection]
<TheEmpty>
As someone that's ran a company too
* wmoxam
puts on his smug cannuck face
sayan has joined #ruby
elico has quit [Read error: Connection reset by peer]
shammancer has quit [Read error: Connection reset by peer]
<wmoxam>
*kidding
<TheEmpty>
True, probably should stay away from politics in a lang chan
oktapodi has quit [Remote host closed the connection]
oktapodi has joined #ruby
arya has joined #ruby
<IceDragon>
so whats the diff between this channel (600+ users) and #ruby-lang ?
adeponte has joined #ruby
<IceDragon>
And everything I've been hearing about it has been scary
<wmoxam>
IceDragon: this is more newish rubyists, ruby-lang is more oldtimers (thing pre-rails)
<wmoxam>
*think
thufir_ has quit [Read error: Connection reset by peer]
<stan_man_can>
TheEmpty: Is there any way to have the script continue running if it times out?
<stan_man_can>
instead of dying
<TheEmpty>
stan_man_can: begin, rescue, end
elico has joined #ruby
<IceDragon>
>: So its oldskool vs newskool all over again
<TheEmpty>
Hmm, sounds more strict since it has -lang in it
<ner0x>
dsdeiz: Highly suggest it. If you have an eReader of some sort.
<ner0x>
dsdeiz: And if you don't. read.amazon.com seems to work fine.
nomenkun has joined #ruby
atyz has quit [Ping timeout: 244 seconds]
<dsdeiz>
will try that out thx
nomenkun has quit [Read error: Connection reset by peer]
nomenkun has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
atyz has joined #ruby
<ner0x>
dsdeiz: Are you learning ruby for rails?
<dsdeiz>
not rly, i think ror seems to be a big step for me. just plain ruby for now
sn0wb1rd has joined #ruby
havenn has quit [Ping timeout: 260 seconds]
<aedorn>
so like.. happy new year and all that jazz
<xaphod>
haggly nu yar
forced_request has quit [Ping timeout: 245 seconds]
quest88 has quit [Quit: quest88]
<xaphod>
who here uses ruby for primary non-rails applications
<ner0x>
dsdeiz: Fair enough. It's a big leap if you haven't used a MVC before, not so huge if you have and are just learning ruby. As long as you are willing to read. :)
<aedorn>
majority of what I use it for is not Rails, or even web, related
<xaphod>
how does one make a console application which can change without just printing new lines to the screen
<xaphod>
real-time (ASCII) graphics
<xaphod>
I'm actually planning on making a simple game but don't know how to do this
<xaphod>
Like if I wanted to implement Game of Life or a Roguelike in ASCII in Ruby, how can I update the display?
<ner0x>
aedorn: Context?
LouisGB has joined #ruby
<aedorn>
ner0x: hmm?
<ner0x>
aedorn: Oh, you were commenting on the rails comment. Yeah. I was just seeing if that was his primary concern so I could point him in the right direction.
mrdtt has quit [Quit: mrdtt]
jamescarr has quit [Quit: jamescarr]
<aedorn>
oh
tommyvyo has quit [Quit: Computer has gone to sleep.]
elico has quit [Quit: elico]
karasawa has joined #ruby
xaphod has quit [Remote host closed the connection]
atyz has quit [Quit: Leaving...]
zach has joined #ruby
zach has quit [Remote host closed the connection]
browndawg has joined #ruby
Michael has joined #ruby
Michael is now known as Guest39098
Jessykinz has joined #ruby
atyz has joined #ruby
atyz has quit [Client Quit]
<aedorn>
dbus is so anti-ruby
jaygen_ has joined #ruby
jaygen has quit [Read error: Operation timed out]
postmodern has quit [Quit: Leaving]
superbot is now known as nerd
nerd is now known as superbot
Jessykinz has left #ruby [#ruby]
Guest25886 has joined #ruby
alanjc has quit [Remote host closed the connection]
oktapodi has quit [Remote host closed the connection]
oktapodi has joined #ruby
digifiv5e has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
Beoran__ has joined #ruby
oktapodi_ has joined #ruby
oktapodi has quit [Ping timeout: 264 seconds]
Beoran_ has quit [Ping timeout: 276 seconds]
fwp2k has joined #ruby
lewis1711 has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
banseljaj is now known as imami|afk
arya_ has joined #ruby
joeycarmello has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
arya has quit [Ping timeout: 244 seconds]
arya_ has quit [Ping timeout: 244 seconds]
toekutr has quit [Remote host closed the connection]
karasawa has quit [Quit: Lost terminal]
karasawa has joined #ruby
cableray has joined #ruby
arya has joined #ruby
emocakes has joined #ruby
lewis1711 has left #ruby [#ruby]
fwp2k has quit [Quit: WeeChat 0.3.2]
Neomex has joined #ruby
krz has quit [Quit: krz]
Neomex has quit [Client Quit]
karasawa has quit [Quit: Lost terminal]
nipar has quit []
kn330 has quit [Ping timeout: 260 seconds]
LouisGB has quit [Ping timeout: 244 seconds]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
kn330 has joined #ruby
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
atmosx has joined #ruby
oktapodi_ has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
darthdeus has joined #ruby
joeycarmello has joined #ruby
darthdeu has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 244 seconds]
blacktulip has joined #ruby
yacks has quit [Ping timeout: 276 seconds]
x82_nicole has joined #ruby
arya has joined #ruby
karasawa has joined #ruby
karasawa has quit [Client Quit]
karasawa has joined #ruby
pen has joined #ruby
arya has quit []
atyz has joined #ruby
io_syl has joined #ruby
havenn has joined #ruby
arietis has joined #ruby
io_syl has quit [Client Quit]
atyz has quit [Ping timeout: 260 seconds]
joeycarmello has quit [Ping timeout: 255 seconds]
havenn has quit [Ping timeout: 244 seconds]
vlad_starkov has joined #ruby
Lars__ has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
jds has joined #ruby
kirun has joined #ruby
jessta has quit [Ping timeout: 265 seconds]
whowantstolivef2 has joined #ruby
jessta has joined #ruby
marr has joined #ruby
punkrawkR has joined #ruby
fatninja has quit [Read error: Operation timed out]
banister`sleep has quit [Ping timeout: 265 seconds]
<dsdeiz>
got it. one last thing :D if i wanted to find the array which contains a specific value do i use .select? e.g. foo.select { |v| v['bar'] == 'baz' }
<ryanf>
dsdeiz: you can use .find if you want to just get the first match
woolite64 has quit [Ping timeout: 272 seconds]
otters has quit [Ping timeout: 260 seconds]
Jasko has quit [Read error: Connection reset by peer]
<dsdeiz>
ah yeah, that's what i needed. thx!
Jasko has joined #ruby
browndawg has quit [Quit: Leaving.]
banisterfiend has joined #ruby
cirwin has joined #ruby
pcarrier has joined #ruby
superbot has quit [Ping timeout: 265 seconds]
katzekintosh has quit [Quit: This computer has gone to sleep]
DrCode has joined #ruby
<DrCode>
hi all
<DrCode>
whats up
<Hanmac>
everything that is not down :P
oktapodi has joined #ruby
jessta has quit [Ping timeout: 255 seconds]
jessta has joined #ruby
io_syl has joined #ruby
LucidDreamZzZ has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
<ruzu>
is simply accessing ARGV safe from most places (lib classes, mixins, etc) or would it make more sense to have a lib ask for it as some method parameter?
<Hanmac>
ruzu it should be safe, but using parse libs is more sane
<ruzu>
i'm writing a parse lib for kicks :p
<ryanf>
ruzu: I think most parse libs will default to just reaching into ARGV
<ryanf>
for convenience
<ryanf>
but you could also do like parse(args = ARGV)
<ryanf>
there's no danger really except that anyone can mutate ARGV, shift elements off of it, et
<ryanf>
c
<dsdeiz>
ok, i lied. that wasn't my last question. xD is it possible to do this in one line? foo.find { |v| v['foo'] == 'foo' }; foo['bar'];?
<Hanmac>
yeah i think using ARGV as parameter is the best way (so users could use others)
<ruzu>
ah, default parameter, good call. shoulda thought of it :)
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
<Hanmac>
dsdeiz: if you want to be safe: (foo.find { |v| v['foo'] == 'foo' } || {})['bar']
<dsdeiz>
by safe you mean in case it finds no result?
<Hanmac>
yep
<dsdeiz>
got it. thx!
cableray has quit [Quit: cableray]
karasawa has quit [Quit: leaving]
karasawa has joined #ruby
karasawa has quit [Client Quit]
karasawa has joined #ruby
arturaz has joined #ruby
dsdeiz has quit [Ping timeout: 260 seconds]
karasawa has quit [Client Quit]
karasawa has joined #ruby
wermel has joined #ruby
karasawa has quit [Client Quit]
Russell^^ has joined #ruby
karasawa has joined #ruby
eldariof has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
wallerdev has quit [Quit: wallerdev]
karasawa has quit [Quit: leaving]
karasawa has joined #ruby
karasawa has quit [Client Quit]
karasawa has joined #ruby
karasawa has quit [Client Quit]
karasawa has joined #ruby
karasawa has quit [Client Quit]
karasawa has joined #ruby
jds has joined #ruby
slainer68 has joined #ruby
sayan has quit [Ping timeout: 255 seconds]
karasawa has quit [Client Quit]
karasawa has joined #ruby
karasawa has quit [Client Quit]
karasawa has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
superbot has joined #ruby
RagingDave has joined #ruby
jds has quit [Remote host closed the connection]
AxonetBE has joined #ruby
havenn has joined #ruby
marr has quit [Ping timeout: 252 seconds]
havenn has quit [Ping timeout: 245 seconds]
banisterfiend has quit [Ping timeout: 244 seconds]
<ik_5>
i have threads, each thread get variables from outside it scope that constantly changes. and I can't figure out how mri 1.9.3 will deal with such thing, that is what information will it have, will it have a copy of the content, or will it just safe address of the variable itself and when variable changes, so does inside the thread, etc ...
Banistergalaxy has quit [Ping timeout: 245 seconds]
<cirwin>
ik_5: threads don't change scoping rules
<cirwin>
so you have have two threads tinkering with one variable at the same time
<cirwin>
it won't crash ruby as it is protected by the GVL, but it will give you unpredictable results
<ik_5>
cirwin, so if i pass a variable with "1", it will continue to be "1" even if the variable changes by the time the thread uses that information ?
<cirwin>
ik_5: if you change the value of a variable all threads will see the new value
joofsh has joined #ruby
tpelletier has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
<cirwin>
i = 0; t = Thread.new{ puts i; }; i = 1
<cirwin>
usually outputs 1 for me (though it could output 0 sometimes I guess)
Jasko has joined #ruby
<ik_5>
cirwin, how can i make it store an "image" of specific value ?
ananthakumaran1 has joined #ruby
<cirwin>
store it in a variable you're not going to re-assign
<cirwin>
if it's more than a primitive (i.e. a proper object, array or hash) you might want to call .dup on it to prevent modifications being shared
joeycarmello has joined #ruby
ananthakumaran has quit [Ping timeout: 255 seconds]
<ik_5>
thanks cirwin, i'll try it, if only I could do it without threads :)
pskosinski has quit [Ping timeout: 245 seconds]
<cirwin>
ik_5: threads can be so useful :)
emergion has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby
<ik_5>
cirwin, i need to go over 100,000 records a day send each record a set of things, but it takes a lot of time for this set of things, so i need to send it to few servers and threadpool them to the number of servers
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
pskosinski has joined #ruby
jmeeuwen has joined #ruby
havenn has quit [Ping timeout: 260 seconds]
Virunga has joined #ruby
JohnBat26 has joined #ruby
koshii has quit [Ping timeout: 264 seconds]
moos3 has quit [Quit: Computer has gone to sleep.]
JohnBat26 has quit [Client Quit]
DaZ has joined #ruby
nomenkun has joined #ruby
alexspeller has joined #ruby
josh0x0 has joined #ruby
moos3 has joined #ruby
pothibo has joined #ruby
jamescarr has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
jamescarr has quit [Client Quit]
Takehiro has joined #ruby
nomenkun has quit [Ping timeout: 245 seconds]
lkba has joined #ruby
greenarrow has quit [Ping timeout: 260 seconds]
pac1 has joined #ruby
Takehiro has quit [Ping timeout: 264 seconds]
greenarrow has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
theRoUS_ has joined #ruby
koshii has joined #ruby
atyz has joined #ruby
kzar has joined #ruby
<kzar>
Is there a good gem for for pretty HTML indentation?
Jasko has quit [Read error: Connection reset by peer]
JohnBat26 has joined #ruby
Jasko has joined #ruby
quest88 has joined #ruby
<Hanmac>
kzar: nokogiri can do it
superbot has quit [Quit: WeeChat 0.3.9.2]
<kzar>
Hanmac: If I used something like nokogiri though would it break if it wasn't valid XML? e.g. an unclosed img tag or whatever
<Kovensky>
<Mon_Ouie> Nokogiri has an HTML and an XML parser, so it should be fine <-- hopefully separate, and not a disaster like Cocoa's parser...
theRoUS_ has quit [Ping timeout: 276 seconds]
<kzar>
ik_5: Yea I saw that, I was hoping to avoid having a binary dependency... after FFI shenanigans on a different project I can't be arsed!
<Kovensky>
(Cocoa has a XML parser with an HTML-to-XML filter flag you can use to parse HTML, but said filter doesn't actually work and breaks more often than not)
<kzar>
Kovensky: Oh balls!
<kzar>
Kovensky: I think it's one of those tasks that seems easy before you try to do it but actually takes a lot of work to do right
<Kovensky>
the least bad way of parsing HTML is to actually create a hidden WebView (webkit control), use it to load your HTML and then use DOM methods
<ik_5>
i offered to use libtidy :)
<Kovensky>
heh
<Kovensky>
I wonder if you can use libtidy to feed stuff to cocoa's parser
<kzar>
OK pretty HTML is getting dropped from my website I guess
<kzar>
for now at least
x82_nicole has joined #ruby
jamescarr has quit [Quit: jamescarr]
johnmilton has joined #ruby
johnmilton has quit [Read error: Connection reset by peer]
johnmilton has joined #ruby
banisterfiend has quit [Ping timeout: 252 seconds]
Morkel has joined #ruby
AxonetBE has joined #ruby
karasawa has quit [Ping timeout: 255 seconds]
karasawa has joined #ruby
dsdeiz has quit [Ping timeout: 244 seconds]
statarb3 has quit [Read error: Connection reset by peer]
Jasko has quit [Read error: Connection reset by peer]
statarb3 has joined #ruby
Jasko has joined #ruby
nricciar_ has quit [Ping timeout: 264 seconds]
jamescarr has joined #ruby
greenarrow has quit [Read error: Operation timed out]
greenarrow has joined #ruby
jamescarr has quit [Client Quit]
ebouchut_ has joined #ruby
joeycarmello has quit [Ping timeout: 255 seconds]
mmitchell has joined #ruby
evelyette has joined #ruby
AxonetBE has quit [Quit: Leaving.]
ebouchut has quit [Ping timeout: 264 seconds]
AxonetBE has joined #ruby
kirun has joined #ruby
mmitchell has quit [Remote host closed the connection]
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
joeycarmello has joined #ruby
jaygen_ has quit [Ping timeout: 252 seconds]
tommyvyo_ has joined #ruby
atyz has quit [Ping timeout: 255 seconds]
hotovson has joined #ruby
banisterfiend has joined #ruby
io_syl has joined #ruby
jamescarr has joined #ruby
Chryson has joined #ruby
jamescarr has quit [Client Quit]
daniel_-_ has joined #ruby
mrdtt has quit [Quit: mrdtt]
jds has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
pac1 has quit [Quit: I got it one line of code at a time]
cdt has joined #ruby
emmanuelux has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
theRoUS_ has joined #ruby
iamjarvo has quit [Quit: Leaving.]
Morkel has quit [Quit: Morkel]
yacks has joined #ruby
nwertman has joined #ruby
emocakes has quit [Quit: emocakes]
becom33 has joined #ruby
otters has joined #ruby
Advocation has joined #ruby
<becom33>
how can I use a common layout erb in sinatra ? like header and footers and content separately
jaygen has quit [Remote host closed the connection]
wargasm has joined #ruby
Xeago has quit [Remote host closed the connection]
cdt has quit [Ping timeout: 245 seconds]
rwilcox has joined #ruby
EyesIsMine has quit [Remote host closed the connection]
<becom33>
umm anyone ?
oktapodi has joined #ruby
oktapodi_ has quit [Read error: Connection reset by peer]
havenn has joined #ruby
nomenkun has joined #ruby
jgrevich has joined #ruby
daniel_-_ has quit [Quit: WeeChat 0.3.9.2]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
havenn has quit [Ping timeout: 255 seconds]
oktapodi has quit [Ping timeout: 245 seconds]
nwertman has quit [Ping timeout: 245 seconds]
sailias has quit [Quit: Leaving.]
<TheEmpty_>
becom33: How are you processing requests? Do you have a template engine in there?
matchaw_ has joined #ruby
<becom33>
TheEmpty_, I got nothing . I just have a basic html page . which I was thinking to break into headers and footers . looked for some tuts on the net coudnt find any
serhart has joined #ruby
<TheEmpty_>
That's not in the capability of HTML. You could do something hacky such as instead of responding by reading that HTML file, reading header.html, {request}, footer.html but that's pretty horriable to configure. Look into a template engine.
<TheEmpty_>
Such as HAML or ERB
<becom33>
TheEmpty_, thats what Im asking . how to do that with erb
wallerdev has joined #ruby
Lars__ has joined #ruby
elico has joined #ruby
Lars__ has quit [Client Quit]
skcin7 has joined #ruby
onibox has joined #ruby
atyz has joined #ruby
CodeVision has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
atyz has quit [Ping timeout: 245 seconds]
segora has quit [Quit: segora]
jgrevich_ has joined #ruby
joeycarmello has quit [Ping timeout: 240 seconds]
kaen has joined #ruby
jfl0wers has quit [Quit: jfl0wers]
jgrevich has quit [Ping timeout: 245 seconds]
jgrevich_ is now known as jgrevich
landho has quit [Ping timeout: 245 seconds]
eldariof has quit []
eldariof has joined #ruby
banisterfiend has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
sayan has quit [Quit: Leaving]
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
wallerdev has joined #ruby
banisterfiend has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
ebouchut_ has quit [Quit: This computer has gone to sleep]
ebouchut has joined #ruby
casheew has joined #ruby
wallerdev has quit [Quit: wallerdev]
carlyle has joined #ruby
pothibo has quit [Quit: pothibo]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
Advocation has quit [Quit: Advocation]
nricciar_ has quit [Ping timeout: 276 seconds]
joeycarmello has joined #ruby
browndawg has left #ruby [#ruby]
sepp2k has joined #ruby
becom33 has quit [Quit: Leaving]
Virunga has quit []
onibox has quit [Quit: leaving]
Virunga has joined #ruby
dr_neek has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
nmeum has quit [Quit: WeeChat 0.3.8]
casheew has quit [Quit: Lost terminal]
statarb3 has quit [Ping timeout: 276 seconds]
wallerdev has joined #ruby
lenovodroid has joined #ruby
Michael has joined #ruby
Michael is now known as Guest57534
ebouchut has quit [Quit: This computer has gone to sleep]
love_color_text has joined #ruby
karasawa has quit [Ping timeout: 265 seconds]
kapowaz_ is now known as kapowaz
lenovodroid has quit [Read error: Connection reset by peer]
lenovodroid has joined #ruby
karasawa has joined #ruby
<kapowaz>
I'm trying to track down an odd SystemStackError I'm getting in a Sinatra app, and I now think maybe it's something to do with Mash
<kapowaz>
if I try within IRB to create a new Mash then set a key's value, I get: SystemStackError: stack level too deep
Jasko has quit [Read error: Connection reset by peer]
BoomCow has joined #ruby
<kapowaz>
anyone able to offer any wisdom as to why?
Goles has quit [Read error: No route to host]
Jasko has joined #ruby
awestroke has joined #ruby
<waxjar>
can you show some example code?
lenovodroid has quit [Read error: Connection reset by peer]
atyz has joined #ruby
lenovodroid has joined #ruby
<kapowaz>
waxjar: well, if I invoke IRB with -r ./application.rb it's as simple as: `m = Mash.new; m.foo = 'hi'` => exception
havenn has joined #ruby
<kapowaz>
if I invoke irb without my app, the issue doesn't present itself, so it's obviously something else causing that… but I have no idea how to find out where.
<ryanf>
kapowaz: you could use set_trace_func
generalissimo has joined #ruby
<kapowaz>
ryanf: I'm unfamiliar with that — do you just call that in the context of a method?
<kapowaz>
aha, you pass it a proc?
<ryanf>
m = Mash.new; set_trace_func { |*a| p a }; m.foo = 'hi'
<ryanf>
oops yea
<ryanf>
m = Mash.new; set_trace_func proc { |*a| p a }; m.foo = 'hi'
<ryanf>
*yeah
<kapowaz>
cool, I'll try that
<ryanf>
get ready to get spammed
<kapowaz>
heh
<rking>
I'm wanting to do a project that de-spams set_trace_func output
<rking>
Like it writes to a sqlite3 file then you use a web browser to navigate it
<rking>
The thing that sucks about it is that you end up wanting to see the objects at certain frames, and it would probably get ridiculous if you snapshotted them.
atyz has quit [Ping timeout: 255 seconds]
<rking>
But maybe you could implement Object#snapshot to do a shallow version, then per-class/obj override that so you can get more to explore.
<kapowaz>
hmm, it appears to lock up the app completely…
<kapowaz>
(it's a sinatra app fwiw)
pskosinski has quit [Quit: Learn Life's Little Lessons]
<waxjar>
does it do the same thing when you run irb with -r mash (something might clash with sinatra?)
<waxjar>
or whatever the name of the gem is
<rking>
kapowaz: It probably *appears* to, while it writes 10Gb of data somewhere.
<kapowaz>
crap
<rking>
That's why I want to write a gem to contain the volume of data.
<kapowaz>
waxjar: if I load up irb without any required gems, then manually require it, no it's fine
<kapowaz>
you can just do irb -r <gemname> ?
<kapowaz>
that's cool
<waxjar>
yep :)
jds has quit [Remote host closed the connection]
<ryanf>
kapowaz: you really want to minimize the amount of time you're using it (i.e., start it right before the point that breaks)
<kapowaz>
either way, it's fine when I load it that way
<ryanf>
because it slows everything down a lot
<ryanf>
(re: "it appears to lock up the app completely"
<kapowaz>
ryanf: can you get it to stop after that point…?
<ryanf>
)
<ryanf>
yeah, you just call set_trace_func nil
<kapowaz>
yeah I have it in the line before the assignment to the new mash
<kapowaz>
I'll try that so it's around a single assignment. How long should I wait before I consider it AWOL ?
<kapowaz>
I left it about 30 seconds last time…
<ryanf>
is it printing into a log or something?
<ryanf>
you should just watch the output, because
<ryanf>
it's going to be doing some kind of infinite recursion
<ryanf>
which is pretty fast to hit the stack limit normally, but with set_trace_func it will take a long time
<ryanf>
but if you just watch it and ctrl-c when you see it start repeating
<kapowaz>
output… hmm, well given that I'm testing an upload in the browser that might be difficult.
<ryanf>
you may be able to figure out what's happening
<kapowaz>
maybe pow has logs for this
<ryanf>
oh, I don't know where pow's stderr goes
<ryanf>
stdout I mean
<kapowaz>
it goes to the Console app
<ryanf>
why not just do it in irb though?
<kapowaz>
so I see it now
<kapowaz>
honestly, I'm not sure how I'd reproduce a form post from IRB
<kapowaz>
okay, so I have the log here. How do you interpret it?
<ryanf>
basically it's a giant list of method calls, method returns, and some other stuff
Guest57534 has quit [Remote host closed the connection]
<ryanf>
so if you see a repeating pattern at the end, it should be possible to figure out what's causing the recursion
<kapowaz>
aha
<kapowaz>
I think I might have a hint here
<kapowaz>
I see references to a mash.rb both within a mash gem, and extlib
<kapowaz>
could it be that there are two implementations?
<ryanf>
interesting
<ryanf>
sounds plausible
ananthakumaran1 has quit [Quit: Leaving.]
<kapowaz>
I'm not explicitly including extlib
HorizonXP has quit [Quit: leaving]
kirun has quit [Ping timeout: 240 seconds]
<kapowaz>
dm-paperclip depend on it though
<kapowaz>
so maybe that's the issue; I'm including the mash gem separately. I'll try rebundling without it and see what happens.
kiyoura has joined #ruby
<kapowaz>
irb test looks promising!
emsilva has joined #ruby
hotovson has quit [Remote host closed the connection]
<ryanf>
wow, I had no idea datamapper loaded extlib. that would make me pretty nervous about using it in a rails project
cirwin1 has joined #ruby
<ryanf>
because there's tons of stuff in there that overlaps with activesupport, and they haven't updated it in like three years
<ryanf>
I wonder if datamapper 2.0 will still have that dep
benlieb has joined #ruby
cirwin has quit [Ping timeout: 245 seconds]
<kapowaz>
yeah, sounds like a bit of a risk.
<kapowaz>
I'd have to assume it doesn't but I might mention it in the DM channel
<kapowaz>
this is a sinatra app though so I'm less worried myself
lenovodroid has quit [Read error: Connection reset by peer]
pskosinski has joined #ruby
<kapowaz>
but indeed, removing the extra mash gem fixed the issue — I now have another issue to fix, but it's definitely getting further :)
<kapowaz>
so thanks!
iamjarvo has joined #ruby
emsilva has quit [Ping timeout: 252 seconds]
<ryanf>
np
emocakes has joined #ruby
emsilva has joined #ruby
hotovson has joined #ruby
atyz has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
karasawa has quit [Ping timeout: 255 seconds]
Goles has joined #ruby
hotovson has quit [Ping timeout: 245 seconds]
norm has quit [Read error: Connection reset by peer]
norm has joined #ruby
hotovson has joined #ruby
joofsh has quit [Remote host closed the connection]
joeycarmello has quit [Ping timeout: 265 seconds]
daniel_- has quit [Ping timeout: 252 seconds]
_alejandro has joined #ruby
baphled has joined #ruby
emsilva has quit [Quit: Computer has gone to sleep.]
hotovson has quit [Ping timeout: 245 seconds]
tenmilestereo has quit [Read error: Connection reset by peer]
love_color_text has quit [Remote host closed the connection]
emsilva has joined #ruby
mjolk has joined #ruby
<Hanmac>
hey i have an array1 with an unknown size, and i want to turn it into array2 with given size, everything that is tumuch should be cutted, and the gaps should be filled with 0 ... can someone help me?
crackfu has joined #ruby
toekutr has joined #ruby
toekutr has quit [Remote host closed the connection]
daniel_- has joined #ruby
DrCode has joined #ruby
tommyvyo_ has joined #ruby
Michael has joined #ruby
Michael is now known as Guest68050
Guest68050 has quit [Remote host closed the connection]
<shevy>
>> append, < get input from, > write into 2
<eval-in>
shevy: Output: "/tmp/execpad-ae8ee3adf410/source-ae8ee3adf410:1: syntax error, unexpected '<', expecting '='\nappend, < get input from, > write into 2\n ^\n/tmp/execpad-ae8ee3adf410/source-ae8ee3adf410:1: syntax error, unexpected '>'\nappend, < get input from, > write into 2\n ^\n" (http://eval.in/5741)
<shevy>
hmm
<shevy>
how does the bot generate the "27b2ee5a3fe6" and "ae8ee3adf410" part?
<xeviox>
shevy: thanks again, works with correct syntax ^^
adallard has quit [Ping timeout: 245 seconds]
<kapowaz>
I'm getting a TypeError (can't convert nil into Integer) here, which seems to be originating within dm-paperclip, but the actual line of source it points to doesn't seem to be ever reachable for my app (I'm running under Ruby 1.9.3 and it seems to only get into the block in question if RUBY_VERSION <= "1.8.6"
<kapowaz>
there's a way I can inspect the source within an installed gem, isn't there?
karasawa has quit [Ping timeout: 245 seconds]
<kapowaz>
just to verify it is running that actual version
<shevy>
xeviox cool
<shevy>
xeviox on my personal todo list is "write a colourize for GNU autoconfigure"
<shevy>
*colourizer
karasawa has joined #ruby
<shevy>
but I have not found out how to do line-by-line fetching, colouring + displaying
adallard has joined #ruby
<xeviox>
shevy: you could split the line, couldn't you?
<xeviox>
or do mean that you can't wait for autoconfigure to return?
hemanth_ has quit [Read error: Connection reset by peer]
<shevy>
xeviox on newline, yes. but how can you display line-by-line without delay? right now I do system('./configure'). if I do: result = `./configure`, I have to wait until the whole configure command has finished :(
Morkel_ has joined #ruby
<xeviox>
ah ok
<xeviox>
I'm not very experienced in ruby
<shevy>
autoconfigure usually works by line-by-line display, instantly, if I use ``, I get the string... but I must wait until it finished return
BeLucid has quit [Read error: Connection reset by peer]
<shevy>
I think there is a way with IO
<xeviox>
shevy: but imho you can't use system(..) for this
<shevy>
yeah I dont like system() that much
<xeviox>
as system runs a command and returns after the command finishes
mpfundstein_home has quit [Ping timeout: 245 seconds]
h4mz1d has joined #ruby
<shevy>
ok but
iaj has quit [Ping timeout: 245 seconds]
<shevy>
why cant I use system './configure --prefix=/usr --disable-qt' there instead?
<xeviox>
you mean `./configure ... ` (using the backticks)?
hotovson_ has joined #ruby
iaj has joined #ruby
<IceDragon>
just use %x[something something] if your mixing stuff up
eldariof has quit []
BoomCow has quit [Quit: This computer has gone to sleep]
elico has quit [Ping timeout: 265 seconds]
Michael has joined #ruby
Michael is now known as Guest56401
mercwithamouth has joined #ruby
nricciar has quit [Ping timeout: 240 seconds]
samuel02 has joined #ruby
robbyoconnor has quit [Ping timeout: 276 seconds]
generalissimo has quit [Remote host closed the connection]
Guest56401 has quit [Remote host closed the connection]
Iszak has quit []
tenmilestereo has quit [Quit: Leaving]
h4mz1d has quit [Ping timeout: 245 seconds]
Markvilla has joined #ruby
koshii has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
mybrainis404 has quit [Disconnected by services]
mybrainis404__ has joined #ruby
whowantstolivef1 has joined #ruby
jamescarr has quit [Quit: jamescarr]
<shevy>
xeviox I mean
whowantstolivef1 has quit [Read error: Connection reset by peer]
Morkel has quit [Quit: Morkel]
quest88 has joined #ruby
dv_ has quit [Ping timeout: 260 seconds]
whowantstolivef2 has quit [Ping timeout: 255 seconds]
mybrainis404__ has left #ruby [#ruby]
samuel02 has quit [Remote host closed the connection]
swarles is now known as xXswarleyXxX
katzekintosh has joined #ruby
xXswarleyXxX is now known as broken
jds has joined #ruby
<xeviox>
shevy: you can't use "system" or the backticks variant as you'll get the stdout output just when the called application finished
joofsh has quit [Remote host closed the connection]
broken is now known as belittledSwarley
quest88 has quit [Quit: quest88]
belittledSwarley is now known as swarley
dv_ has joined #ruby
xeviox is now known as xeviox|awy
jds has quit [Ping timeout: 255 seconds]
koshii has quit [Ping timeout: 255 seconds]
PragCypher has joined #ruby
cdt has quit [Ping timeout: 245 seconds]
<shevy>
if filename and os.path.isfile(filename):
<shevy>
I find python weird
lenovodroid has joined #ruby
s1n4 has joined #ruby
s1n4 is now known as Guest54564
Umren has quit [Read error: Connection reset by peer]
mark_locklear has quit [Remote host closed the connection]
Squarepy has quit [Quit: Leaving]
mercwithamouth has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
dross has quit [Ping timeout: 255 seconds]
TheEmpty has joined #ruby
cableray has joined #ruby
nricciar has joined #ruby
<ryanf>
shevy: ... as opposed to if filename && File.exist?(filename)
<ryanf>
?
<ryanf>
what's the difference?
h4mz1d has joined #ruby
<ryanf>
at least theirs isn't grammatically questionable
TheEmpty_ has quit [Ping timeout: 245 seconds]
blacktulip has quit [Remote host closed the connection]
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
Xeago has joined #ruby
Michael has joined #ruby
Michael is now known as Guest48247
dross has joined #ruby
Guest25886 has quit [Quit: Guest25886]
bradleyprice has joined #ruby
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
<shevy>
ryanf the python variant seems less readable to me
cheese1756 has joined #ruby
tommyvyo_ has joined #ruby
jamescarr has joined #ruby
yshh has joined #ruby
mercwithamouth has joined #ruby
jamescarr has quit [Client Quit]
rwilcox has quit []
koshii has joined #ruby
hybris has quit [Quit: Leaving]
jessta has quit [Quit: Lost terminal]
joofsh has joined #ruby
alcuadrado has joined #ruby
koshii has quit [Ping timeout: 276 seconds]
<alcuadrado>
I'm trying to teach my little brother programming, and think ruby is a great candidate for that as it's the most similar to plain English. I installed Hackety Hack in his pc and is now really motivated about it, just about to finish it. Do you know any other resources for teaching ruby to kids and teenagers?
Guest48247 has quit [Remote host closed the connection]
kn330 has quit [Quit: Ex-Chat]
joofsh has quit [Remote host closed the connection]
stkowski has quit [Quit: stkowski]
jaygen has joined #ruby
<shevy>
alcuadrado no idea. I think kids can learn ruby, just need to write in simple english
<shevy>
the younger they learn the better
<swarley>
I learned ruby at age 13-14
<alcuadrado>
sure, and he is not THAT young
<alcuadrado>
he is 15
<swarley>
And i used Beginning Ruby Novice to Professional
<swarley>
I'm 16 lol.
<swarley>
Also, why's guide is somewhat entertaining
<pskosinski>
In Estonia kids will be learning programming from primary school.
<alcuadrado>
I tried to to teach him before, but he wasn't proficient in English at that moment
<swarley>
I learned C++ in middle school
<swarley>
But that was my choice
<swarley>
not the school's
<alcuadrado>
swarley, your life has been ruined lol
karasawa has quit [Ping timeout: 265 seconds]
<swarley>
Yes it has.
<swarley>
Ruby has made things better though.
landho has joined #ruby
karasawa has joined #ruby
<kzar>
Any ideas how I can make a rake task run sinatra + `jekyll --auto` in a way that they both end together? (Currently I'm doing `sh 'jekyll --auto & bundle exec ruby app.rb'` but when I C-c to exit Jekyll keeps running in the background. (I know why I just can't see how else to do it.)
robbyoconnor has joined #ruby
<alcuadrado>
swarley, and did you find that book entertaining?
<swarley>
Entertaining, no. But the most definitive guide
awestroke has quit [Remote host closed the connection]
<IceDragon>
make a card struct?
emergion has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
<TheEmpty>
Never worked with structs. My biggest C work was a one file tic-tac-toe game that stored data in global vars
rondale_sc has quit [Client Quit]
xemu has joined #ruby
Driscoll has joined #ruby
<BoomCow>
struct still felt cumbersome
jonahR has joined #ruby
<sorbo_>
a bit, but they're sort of your only option without classes
jamescarr has joined #ruby
assurbanipal has joined #ruby
PerAnnumLex is now known as Quadlex
robbyoconnor has quit [Ping timeout: 252 seconds]
pcarrier has quit []
nemesit has quit [Quit: Leaving...]
Slivka has quit [Read error: Connection reset by peer]
x82_nicole has joined #ruby
robbyoconnor has joined #ruby
Michael has joined #ruby
Michael is now known as Guest83669
Goles has quit [Quit: Out.]
rondale_sc has joined #ruby
banisterfiend has joined #ruby
tpelletier has quit [Ping timeout: 245 seconds]
digifiv5e has quit [Quit: quit]
banisterfiend has quit [Ping timeout: 255 seconds]
jamescarr has quit [Quit: jamescarr]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
Guest83669 has quit [Remote host closed the connection]
jjang has joined #ruby
h4mz1d has quit [Ping timeout: 255 seconds]
assurbanipal has quit [Remote host closed the connection]
LKiS has joined #ruby
atyz has quit [Read error: Connection reset by peer]
assurbanipal has joined #ruby
atyz has joined #ruby
rondale_sc has quit [Quit: rondale_sc]
<kzar>
Trying to get whiskey disk working for deployments on my server, I didn't previously have ruby or anything installed on there. Anyway I just installed rvm, ruby and rake but when I do a deploy it fails with this: "bash: rake: command not found". Any ideas? I can't understand it, I've ssh'd there myself and the rake command _is_ found for me!
elkclone has joined #ruby
matchaw_ has joined #ruby
emocakes has quit [Quit: emocakes]
h4mz1d has joined #ruby
BoomCow has quit [Quit: This computer has gone to sleep]
bttf has joined #ruby
benlieb has joined #ruby
Jake232 has joined #ruby
Driscoll has quit [Ping timeout: 255 seconds]
benlieb has quit [Client Quit]
benlieb has joined #ruby
katzekintosh has quit [Quit: Leaving]
megharsh has quit [Ping timeout: 265 seconds]
<cirwin>
kzar: is the deploy running your .bashrc?
<cirwin>
if you're using rvm, you need to set it up before it will work
<cirwin>
it puts those steps into your .bashrc so that shells you start manually run it automatically
eka has joined #ruby
punkrawkR has quit [Read error: Connection reset by peer]
kokainepizza has joined #ruby
itnomad has quit [Quit: Leaving]
jonahR has quit [Quit: jonahR]
Guest74337 is now known as Astralum
h4mz1d has quit [Ping timeout: 265 seconds]
banisterfiend has joined #ruby
Driscoll has joined #ruby
h4mz1d has joined #ruby
banisterfiend has quit [Remote host closed the connection]