Vert has quit [Read error: Connection reset by peer]
tgriffin2081 has quit []
tgriffin2081 has joined #ruby
cakehero has joined #ruby
maletor has joined #ruby
w400z has joined #ruby
nnv7 has quit [Quit: nnv7]
dmiller has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
guns has joined #ruby
mahmoudimus has joined #ruby
rubious has quit [Quit: Leaving...]
ZachBeta has quit [Quit: Computer has gone to sleep.]
bradhe has joined #ruby
randomautomator has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
ZachBeta has joined #ruby
justsee has joined #ruby
Takehiro has joined #ruby
tymat has joined #ruby
quest88 has joined #ruby
joephelius has quit [Quit: WeeChat 0.3.8]
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
BrokenCog has joined #ruby
Takehiro has quit [Ping timeout: 245 seconds]
Azure has quit [Excess Flood]
alvaro_o has quit [Quit: Ex-Chat]
Guest69256 has joined #ruby
darren has quit [Remote host closed the connection]
jenrzzz has quit [Quit: leaving]
jenrzzz has joined #ruby
Guest69256 is now known as Azure
Azure has quit [Changing host]
Azure has joined #ruby
mrsolo has quit [Quit: Leaving]
dgs has joined #ruby
<dgs>
if you're using sockets in ruby, is it possible to get the source port of a tcp connection. (eg not the port you are listening on, but the port the request left the other machine on)
mxweas has quit [Quit: Leaving...]
johnjohnson has quit []
wpaulson has joined #ruby
mmitchell has quit [Remote host closed the connection]
drags has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
<drags>
does anyone know what influences hash ordering in ruby-1.8? 2 VMs that were cloned from each other produce the same output, but a different machine has consistently different ordering
<drags>
seems to implicate something about the system itself influences it
<drags>
(consistently different even across processes, reboots, etc)
<fowl>
drags: hashes are not ordered in 1.8
tymat has left #ruby [#ruby]
<fowl>
drags: so they could be in any order
Hanmac1 has joined #ruby
<drags>
fowl: yarr I picked up on that from the docs, it's just that it's consistent
<drags>
between runs
<fowl>
dgs: i only have experience with udp sockets where youw ould use recv_from for that, I dont think recv_from exists for tcp sockets
<banisterfiend>
drags: read the source:)
* drags
is running into a test-suite that works on the 2 incumbent devs cloned VMs, but produces about 1500 failures on mine :(
<drags>
banisterfiend: was hoping for a pointer
hadees has quit [Quit: hadees]
kiyoura has joined #ruby
<banisterfiend>
drags: you'll find plenty in the source, especially of the (VALUE *) variety ;)
<drags>
it's just the consistency that's grinding my gears, each machine produces the same order at every execution on that machine, but it differs between machines
havenn has quit [Ping timeout: 260 seconds]
<drags>
if I could influence it I would save myself a bunch of time rewriting tests :)
williamherry has quit [Ping timeout: 264 seconds]
<banisterfiend>
drags: i wouldn't rely on that btw, as u'd also have to check ordering wasnt changed in point releases
<banisterfiend>
since there's no guarantee they would remain consistent
<fowl>
drags: or you could 1) accept that hashes are unordered in 1.8 so dont rely on that happening or 2) use the orderedhash gem
havenn has joined #ruby
uris has joined #ruby
Axsuul has quit [Read error: Connection reset by peer]
Axsuul has joined #ruby
jorge_ has quit [Remote host closed the connection]
jorge_ has joined #ruby
Criztian has quit []
jtgiri_ has quit [Quit: jtgiri_]
savage- has quit [Remote host closed the connection]
JonnieCache has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
nnv7 has joined #ruby
nnv7 has quit [Client Quit]
seanstickle has quit [Quit: seanstickle]
sailias has quit [Read error: Operation timed out]
dpk has quit [Quit: Asleep at the keyboard.]
linoj has joined #ruby
phanousit has joined #ruby
phanousit is now known as siameseguy
banisterfiend has quit [Remote host closed the connection]
jorge_ has quit [Remote host closed the connection]
dmiller has joined #ruby
<mistergibson>
Anyone know the rationale on this? I create a StringIO with "test", then upon the first :write of a string "this" it *replaces* the init text with the :write data. Any clues are helpful.
Banistergalaxy has joined #ruby
w400z has quit [Quit: Computer has gone to sleep.]
maletor has quit [Quit: Computer has gone to sleep.]
apok has quit [Ping timeout: 244 seconds]
<siameseguy>
is it possible to put methods in arrays and them call on them?
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
<mistergibson>
siameseguy: you could put procs in arrays and call them
<siameseguy>
i can use the procs to call the methods?
<siameseguy>
ok, now can i put a proc in a method?
alexy has joined #ruby
iori has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 245 seconds]
iori has joined #ruby
mikepack has quit [Remote host closed the connection]
LorentzFactor has joined #ruby
alexy has left #ruby ["Leaving"]
_iori_ has quit [Ping timeout: 252 seconds]
sn0wb1rd has joined #ruby
<mistergibson>
siameseguy: (if I understand the question) - within method definition : my_proc = Proc.new {|n| puts n.inspect }
<mistergibson>
you simply put it in a local variable
<mistergibson>
... see?
t61225 has quit [Remote host closed the connection]
t47471 has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<siameseguy>
thanks
<mistergibson>
siameseguy: I use procs a lot - I really like them
beneggett has quit [Quit: Computer has gone to sleep.]
daniel_hinojosa has joined #ruby
sailias has joined #ruby
<siameseguy>
what I'm trying to do is have the proc call my methods and keep it flexible enough that i don't have to keep writing procs for each method i call
artOfWar has joined #ruby
mxweas has joined #ruby
artOfWar_ has joined #ruby
krz has quit [Quit: krz]
hadees has joined #ruby
rubious has joined #ruby
artOfWar has quit [Ping timeout: 245 seconds]
<siameseguy>
mistergibson: what I'm trying to do is have the proc call my methods and keep it flexible enough that i don't have to keep writing procs for each method i call
linoj has quit [Quit: linoj]
tomzx_ has joined #ruby
techsurvivor has quit [Ping timeout: 245 seconds]
<fowl>
siameseguy: store the name of the method as a symbol and use #send when you want to call ti
<bnagy>
elico: irc protip - don't ask to ask, just ask your question
mahmoudimus has quit [Quit: Computer has gone to sleep.]
rcs has joined #ruby
t77474 has quit [Remote host closed the connection]
rcs has quit [Excess Flood]
nickyhof has joined #ruby
t15633 has joined #ruby
<elico>
bnagy: thanks.
rcs has joined #ruby
<elico>
I want to connect two client sockets to each other
PhoSor has joined #ruby
<elico>
to ackt as a proxy... for both
<elico>
i have software that does it and written in perl but i want one in ruby
<elico>
my problem is with reading from sockets...
<elico>
i always get to a point it blocks
<elico>
and stuck...
ryanf has joined #ruby
CarlB_the_great has joined #ruby
darren has joined #ruby
nickyhof is now known as wo66le
<elico>
Eventmachine is great with that but i dont know how to connect two clients
tiripamwe has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
jeff_sebring has joined #ruby
bradhe has joined #ruby
<_br_>
elico: It is very difficult from your explanation to guess what is going on. Probably its a good idea to run the program in debug mode ruby -rdebug and step through to see whats going on.
mrdodo has quit [Remote host closed the connection]
cj3kim has quit [Quit: This computer has gone to sleep]
<elico>
_br_: i am sitting on some of it right now
<bnagy>
with EM I think you have to connect out with a client inside the server
infinitiguy has quit [Quit: Leaving.]
<bnagy>
someone must have done this already
wpaulson has joined #ruby
Chryson has quit [Quit: Leaving]
aristidesfl has quit []
sailias has quit []
wpaulson has quit [Client Quit]
ringotwo has joined #ruby
sn0wb1rd has quit [Read error: Connection reset by peer]
td123 has joined #ruby
mxweas has quit [Quit: Leaving...]
sn0wb1rd has joined #ruby
sirish has quit [Ping timeout: 265 seconds]
ananthakumaran has joined #ruby
mohits has joined #ruby
enherit has joined #ruby
areil has joined #ruby
tompsony has joined #ruby
kiyoura has quit [Quit: Leaving]
Taichouc_ has quit [Remote host closed the connection]
<tompsony>
I am looking for someone with skills to do a job ... preferably someone who agrees bitcoins as payment.
t15633 has quit [Remote host closed the connection]
t10386 has joined #ruby
sixtycakes has quit [Remote host closed the connection]
<ryanf>
s
<ryanf>
haha wrong window :(
<bnagy>
tompsony: dude I got mad skills. I got nunchuck skills, bo skills...
<rubious>
tompsony: PM
<rubious>
(just cause I'm super curious)
<tompsony>
[rubious]: the problem is that serious talk with you is practically impossible
guns has joined #ruby
guns is now known as Guest44905
Guest44905 has quit [Client Quit]
<rubious>
tompsony: A little humor never hurt anyone. PM if you actually have work.
savage- has joined #ruby
wo66le has quit [Quit: Computer has gone to sleep.]
adamkittelson has quit [Remote host closed the connection]
<tompsony>
[rubious]: I have work but I'm not fichando portfolio or adding anything to their curricula
<tompsony>
pm
<rubious>
Hey, sorry for lol
<rubious>
lol.
jcromartie has left #ruby [#ruby]
banghouse2 has joined #ruby
pingfloyd has joined #ruby
datapolitical has joined #ruby
pingfloyd has quit [Client Quit]
pingfloyd has joined #ruby
jenrzzz has joined #ruby
aantix has joined #ruby
noyb has joined #ruby
techsurvivor has joined #ruby
JonnieCa1he|home has joined #ruby
<elico>
bnagy: i got to a point which i kind of know what the problem basically
rakunHo has joined #ruby
JonnieCache|home has quit [Ping timeout: 240 seconds]
<elico>
i need some way to read from the tcp socket into a buffer and to recognize that the reading ended
dmiller has quit [Remote host closed the connection]
<bnagy>
read(n)
enherit has quit [Ping timeout: 268 seconds]
<elico>
yes but how would i know it end of write?
mohits has quit [Read error: Connection reset by peer]
<elico>
like end of data that was sent?
<bnagy>
read without an argument will read everything
<elico>
but get stuck...
<bnagy>
til EOF
<bnagy>
yeah cause the connection is still open
<bnagy>
so read(n)
<elico>
but i need the connection to stay alive and just to read and pass it to other socket..
<bnagy>
...
<bnagy>
I can't repeat myself anymore, sorry
<elico>
it goes like this:
<bnagy>
stop
mohits has joined #ruby
<elico>
ok
mohits has quit [Changing host]
mohits has joined #ruby
<elico>
but i dont know the size of the packet? so how can i predict it?
<bnagy>
you're not reading packets
<bnagy>
you're reading data, when you use TCPSocket
<bnagy>
if you want to relay packets you will need to go down to Socket
<elico>
thanks
<bnagy>
but you probably don't
x77686d has joined #ruby
<elico>
yes i know
<elico>
it's kind of works manually
<bnagy>
think of a TCP connection as a data firehose
banghouse2 has quit [Remote host closed the connection]
<bnagy>
the client app doesn't know how big the packets are either, and it shouldn't
tiripamwe has quit [Ping timeout: 252 seconds]
joshman_ has quit [Quit: Computer has gone to sleep.]
<bnagy>
it just expects some amount of a data stream, in order
<bnagy>
so you can read / relay whatever chunk size you want and the other end will deal withit
<bnagy>
when you do read wih no arg you try and drink the whole firehose in one go
mahmoudimus has joined #ruby
techsurvivor has quit [Ping timeout: 265 seconds]
<elico>
ye was thinking of it...
GeekOnCoffee has joined #ruby
banisterfiend has joined #ruby
Progster has joined #ruby
datapolitical has quit [Quit: This computer has gone to sleep]
CarlB_the_great has quit [Remote host closed the connection]
Taichouchou2 has joined #ruby
neutrinos has joined #ruby
Banistergalaxy has quit [Ping timeout: 264 seconds]
<rubious>
bnagy: great metaphor, btw.
jenrzzz has quit [Ping timeout: 240 seconds]
tompsony has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
neutrinos is now known as tompsony
seanwash has joined #ruby
<seanwash>
Hey
neutrinos has joined #ruby
neutrinos has left #ruby [#ruby]
tompsony has quit [Ping timeout: 264 seconds]
tekacs has quit [Quit: Disappearing... *poof*]
t10386 has quit [Remote host closed the connection]
t27430 has joined #ruby
Taichouchou2 has quit [Remote host closed the connection]
siameseguy has quit [Quit: siameseguy]
x77686d has quit [Quit: x77686d]
ghanima has joined #ruby
<ghanima>
hello all
<ghanima>
question... I have a function def sample(op)
tekacs has joined #ruby
mohits has quit [Ping timeout: 245 seconds]
<ghanima>
inside this function I have declared a rest function but the argument that I have passsed to the function I need to pass it to the Rest Method like so
coyo has quit [Quit: Heaven is not a place, it's being with people who love you.]
resure has joined #ruby
aantix has quit [Quit: aantix]
ph^_ has quit [Remote host closed the connection]
chimkan has joined #ruby
sepp2k has joined #ruby
<n_blownapart>
bnagy: oh thanks I was on the right track then. thanks I'm trying to minimize my reliance on the chatroom. pax
dgs has joined #ruby
ph^ has joined #ruby
Z_Mass has joined #ruby
resure is now known as resure_away
Eldariof-ru has joined #ruby
mrdodo has joined #ruby
luist has quit [Quit: luist]
banisterfiend has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 248 seconds]
heisenmink has quit [Remote host closed the connection]
luist has joined #ruby
PhoSor has joined #ruby
PhoSor has quit [Client Quit]
PhoSor has joined #ruby
nazty has quit [Ping timeout: 260 seconds]
enherit has joined #ruby
Morkel has joined #ruby
uris has quit [Quit: leaving]
ph^ has quit [Remote host closed the connection]
JStoker has joined #ruby
Banistergalaxy has joined #ruby
freeayu has joined #ruby
a_a_g has quit [Quit: Leaving.]
maletor has joined #ruby
timonv has joined #ruby
tcopp has quit [Quit: Lost terminal]
datapolitical has quit [Quit: This computer has gone to sleep]
ryanf has joined #ruby
reset has quit [Ping timeout: 248 seconds]
n_blownapart has quit [Remote host closed the connection]
allyraza has quit [Ping timeout: 264 seconds]
datapolitical has joined #ruby
a_a_g has joined #ruby
senny has joined #ruby
tonini has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
enherit has quit [Remote host closed the connection]
tonini has quit [Remote host closed the connection]
stuartrexking has quit [Quit: Leaving...]
Sykamore has quit [Remote host closed the connection]
steven- has joined #ruby
tonini has joined #ruby
JarJar has joined #ruby
ghanima has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
t27430 has quit [Remote host closed the connection]
t27850 has joined #ruby
arturaz has joined #ruby
ghanima has joined #ruby
aantix has joined #ruby
timonv has quit [Remote host closed the connection]
aantix has quit [Client Quit]
seanwash has quit [Quit: Leaving.]
fantazo has quit [Remote host closed the connection]
td123 has quit [Quit: WeeChat 0.3.8]
tagrudev has joined #ruby
banisterfiend has joined #ruby
swair has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
burgestrand has joined #ruby
thunderstrike has joined #ruby
Banistergalaxy has joined #ruby
stuartrexking has joined #ruby
__class__ has quit [Ping timeout: 265 seconds]
darren has quit [Remote host closed the connection]
Takehiro has quit [Remote host closed the connection]
datapolitical has quit [Quit: This computer has gone to sleep]
swair has quit [Quit: Konversation terminated!]
mxweas has joined #ruby
Guest65367 has quit [Read error: Operation timed out]
datapolitical has joined #ruby
__class__ has joined #ruby
mc0e has joined #ruby
maesbn has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
G has quit [Ping timeout: 260 seconds]
iori has quit [Read error: No route to host]
timonv has joined #ruby
heisenmink has joined #ruby
manizzle has joined #ruby
mrdodo has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
vlad_sta_ has joined #ruby
chimkan has quit [Quit: chimkan]
senny has quit [Remote host closed the connection]
daniel_hinojosa has quit [Quit: Leaving.]
jprovazn_away is now known as jprovazn
iori has joined #ruby
senny has joined #ruby
vlad_starkov has quit [Ping timeout: 244 seconds]
mrdodo has joined #ruby
t27850 has quit [Remote host closed the connection]
fearoffish has quit [Quit: Computer has gone to sleep.]
t57793 has joined #ruby
Guest5516 has joined #ruby
vlad_sta_ has quit [Read error: Connection reset by peer]
senny_ has joined #ruby
mrdodo has quit [Remote host closed the connection]
senny has quit [Ping timeout: 268 seconds]
aantix has joined #ruby
chimkan has joined #ruby
robustus has joined #ruby
iori has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
bradhe has joined #ruby
mrdodo has joined #ruby
mrdodo has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
Hanmac1 is now known as Hanmac
timonv has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
fyolnish_ has joined #ruby
und3f has joined #ruby
dhruvasagar has joined #ruby
jeff_sebring has quit [Quit: Leaving]
Takehiro has joined #ruby
elhu has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
dhruvasagar has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 244 seconds]
Eldariof-ru has quit []
artOfWar_ has quit [Ping timeout: 264 seconds]
chimkan has quit [Quit: chimkan]
G has joined #ruby
Takehiro has quit [Ping timeout: 268 seconds]
Banistergalaxy has joined #ruby
dhruvasagar has joined #ruby
murthyteja has joined #ruby
aantix has quit [Quit: aantix]
saschagehlich has joined #ruby
hollymann has joined #ruby
aantix has joined #ruby
aantix has quit [Client Quit]
murthyteja has quit [Client Quit]
Musfuut has joined #ruby
murthyteja has joined #ruby
<murthyteja>
Hi
headius has joined #ruby
<davidcelis>
hi
zommi has joined #ruby
schaerli has joined #ruby
JarJar has quit [Quit: Leaving]
ph^ has joined #ruby
vitenberg has joined #ruby
jgrevich_ has joined #ruby
hollymann has left #ruby [#ruby]
vitenberg has quit [Client Quit]
ghanima1 has joined #ruby
Takehiro has joined #ruby
murthyteja has quit [Quit: Page closed]
g_rotbart has quit [Remote host closed the connection]
s1n4 has joined #ruby
ghanima has quit [Ping timeout: 260 seconds]
g_rotbart has joined #ruby
jgrevich has quit [Ping timeout: 244 seconds]
jgrevich_ is now known as jgrevich
Abbas| has quit [Ping timeout: 246 seconds]
Zespre has quit [Ping timeout: 256 seconds]
Zespre has joined #ruby
LouisGB has joined #ruby
nilg has joined #ruby
aganov has joined #ruby
xorigin has joined #ruby
g_rotbart has quit [Ping timeout: 245 seconds]
justsee has quit [Quit: Leaving...]
ghanima1 has quit [Ping timeout: 248 seconds]
aidanna has joined #ruby
dangerousdave has joined #ruby
Takehiro_ has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
Takehiro has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 245 seconds]
answer_42 has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
mneorr has quit [Remote host closed the connection]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
ghanima has joined #ruby
mneorr has joined #ruby
Russell^^ has quit [Quit: Russell^^]
jgrevich has quit [Quit: jgrevich]
hoelzro|away is now known as hoelzro
arkiver has joined #ruby
elhu has joined #ruby
LouisGB has quit []
elhu has quit [Client Quit]
ph^ has quit [Remote host closed the connection]
LouisGB has joined #ruby
chichou has joined #ruby
wallerdev has quit [Quit: wallerdev]
ph^ has joined #ruby
__class__ has quit [Ping timeout: 245 seconds]
Morkel has quit [Quit: Morkel]
emdub has quit [Quit: .]
thone_ has joined #ruby
krz has quit [Quit: krz]
wobr has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
emdub has joined #ruby
djdb has joined #ruby
busybox42 has quit [Ping timeout: 272 seconds]
Z_Mass has quit [Quit: Leaving]
__class__ has joined #ruby
thone has quit [Ping timeout: 252 seconds]
saschagehlich has quit [Quit: saschagehlich]
t57793 has quit [Remote host closed the connection]
t63481 has joined #ruby
Takehiro_ has quit [Remote host closed the connection]
Takehiro has joined #ruby
jeff_sebring has joined #ruby
Criztian has joined #ruby
w400z has joined #ruby
cezar has joined #ruby
cezar has quit [Remote host closed the connection]
chichou has quit [Remote host closed the connection]
wallerdev has joined #ruby
arkiver has quit [Quit: Leaving]
quazimodo has quit [Ping timeout: 264 seconds]
eldariof has joined #ruby
sn0wb1rd has quit [Quit: I will be right back]
Musfuut has quit [Read error: Operation timed out]
Criztian has quit [Remote host closed the connection]
IPGlider has joined #ruby
mistergibson has left #ruby ["PING 1346226957"]
G has quit [Ping timeout: 246 seconds]
dangerousdave has quit [Quit: Leaving...]
pskosinski has joined #ruby
mrdodo has joined #ruby
BiHi has joined #ruby
mc0e has quit [Ping timeout: 252 seconds]
elhu has joined #ruby
ringotwo has quit [Remote host closed the connection]
ph^ has quit [Remote host closed the connection]
mrdodo has quit [Ping timeout: 252 seconds]
Musfuut has joined #ruby
Musfuut is now known as Guest19822
ringotwo has joined #ruby
G has joined #ruby
pskosinski has quit [Ping timeout: 252 seconds]
wallerdev has quit [Quit: wallerdev]
charliesome has joined #ruby
timonv has joined #ruby
timonv has quit [Remote host closed the connection]
Adran has quit [Read error: Operation timed out]
pdelgallego has joined #ruby
timonv has joined #ruby
tiripamwe has quit [Ping timeout: 264 seconds]
phrame has quit [Ping timeout: 240 seconds]
busybox42 has joined #ruby
lahwran has quit [Ping timeout: 276 seconds]
asteve has joined #ruby
asteve has left #ruby [#ruby]
timonv has quit [Remote host closed the connection]
nick_h has quit [Ping timeout: 246 seconds]
Vert has joined #ruby
cout has quit [Ping timeout: 252 seconds]
inimino has quit [Ping timeout: 252 seconds]
ringotwo has quit [Remote host closed the connection]
t63481 has quit [Remote host closed the connection]
namidark has quit [Ping timeout: 265 seconds]
t51740 has joined #ruby
rking has quit [Ping timeout: 272 seconds]
lorn_ has quit [Ping timeout: 265 seconds]
Beoran_ has joined #ruby
tdubz has joined #ruby
chaplain has quit [Read error: Connection reset by peer]
noam has joined #ruby
ph^ has joined #ruby
Beoran__ has quit [Ping timeout: 244 seconds]
timonv has joined #ruby
pikitgb has joined #ruby
phrame has joined #ruby
lorn has joined #ruby
rking has joined #ruby
cout has joined #ruby
<pikitgb>
Hi i'm new in Ruby and my english is not very well i'm from Cuba. Please i need help for build an application to Connect to GCM(Google Cloud Messag..) any have an example or something ?
Quadrant_ has quit [Read error: Connection reset by peer]
ghanima has quit [Quit: Leaving.]
Quadrant_ has joined #ruby
namidark has joined #ruby
tdubz is now known as chaplain
Xeago has quit [Remote host closed the connection]
graspee has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
forexwaldo has joined #ruby
gloomer has quit [Ping timeout: 252 seconds]
phrame has quit [Ping timeout: 245 seconds]
forexwaldo is now known as gloomer
dekroning has joined #ruby
lorn has quit [Ping timeout: 252 seconds]
richwestcoast has quit [Ping timeout: 252 seconds]
richwestcoast has joined #ruby
rking has quit [Ping timeout: 265 seconds]
namidark has quit [Ping timeout: 264 seconds]
cout has quit [Ping timeout: 268 seconds]
saispo has quit [*.net *.split]
Affix has quit [*.net *.split]
Hanmac has joined #ruby
cout has joined #ruby
phrame has joined #ruby
pikitgb has quit [Remote host closed the connection]
M- has quit [Quit: This computer has gone to sleep]
haxrbyte has joined #ruby
geoffr has joined #ruby
rakunHo has quit [Read error: Connection reset by peer]
s1n4 has left #ruby ["leaving"]
<geoffr>
Hi all, I'm trying out Goliath for a web service but need a route mapper, any suggestions ? I keep seeing examples for "map" in the Goliath::API but according to the dev it's been dropped in 1.0
burgestrand1 has joined #ruby
Banistergalaxy has quit [Ping timeout: 244 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
Seich has quit [Ping timeout: 252 seconds]
mengu has quit [Quit: Konversation terminated!]
<Muz>
fowl: hahah.
lkba has quit [Quit: Bye]
burgestrand has quit [Ping timeout: 245 seconds]
sgmac has joined #ruby
sgmac has left #ruby [#ruby]
ringotwo has joined #ruby
Adran has quit [Read error: Operation timed out]
Affix has joined #ruby
saispo has joined #ruby
Affix has quit [Max SendQ exceeded]
phrame has quit [Ping timeout: 252 seconds]
Affix has joined #ruby
lorn has quit [Ping timeout: 252 seconds]
nick_h has quit [Ping timeout: 244 seconds]
cout has quit [Ping timeout: 245 seconds]
rking has quit [Ping timeout: 264 seconds]
namidark has quit [Ping timeout: 268 seconds]
inimino has quit [Ping timeout: 264 seconds]
atmosx has joined #ruby
JonnieCa1he|home has quit [Quit: Lost terminal]
mneorr has quit [Remote host closed the connection]
seich- has joined #ruby
mneorr has joined #ruby
cout has joined #ruby
nick_h has joined #ruby
mneorr has quit [Remote host closed the connection]
phrame has joined #ruby
mneorr has joined #ruby
lorn has joined #ruby
rking has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
namidark has joined #ruby
<matti>
]
<matti>
Oh dear.
<matti>
;]
inimino has joined #ruby
<banisterfiend>
matti: your smiley needs urgent cataract surgery
<atmosx>
Twitter::Search has changed on the latest twitter gem, doesn't exists hmm
<banisterfiend>
atmosx: part of twitters evil plan to only let you use their twitter.com for all your tweeting needs
<atmosx>
banisterfiend: … which means?
<banisterfiend>
atmosx: it's a joke... :) but twitter keep restricting 3rd party twitter stuff
<atmosx>
yes, I've read about it a lot
haxrbyte has quit [Remote host closed the connection]
<atmosx>
they did not receive a serious outrage from devs though
freeayu has quit [Ping timeout: 265 seconds]
haxrbyte has joined #ruby
<banisterfiend>
twitter has such an annoying UI, a competitor could probably clean up if they did a decent job
<Hanmac>
matti: neko-smily Σ:3 casing mouse ~€:>
dgs|2 has joined #ruby
dgs has quit [Ping timeout: 260 seconds]
<bnagy>
TIL Hanmac is a 15 year old japanese girl
jeff_sebring has quit [Remote host closed the connection]
rking has quit [Read error: Operation timed out]
<shevy>
hmm
<shevy>
he likes anime
<shevy>
and his english is about as good as the average japanese girl as well
<shevy>
*girl's english
<banisterfiend>
bnagy: sup nags
lorn has quit [Ping timeout: 246 seconds]
<shevy>
just woke up! sleepy in my head still :(
<bnagy>
nm, banisterfiend
<banisterfiend>
>> "hi"
<al2o3cr>
(String) "hi"
<bnagy>
going over 2 years of windows privesc bugs
haxrbyte has quit [Ping timeout: 245 seconds]
lorn has joined #ruby
namidark has quit [Ping timeout: 246 seconds]
rking has joined #ruby
<banisterfiend>
bnagy: do you use "ronin" ?
<bnagy>
not any more than the last time you asked me, no :)
<banisterfiend>
oh..
<matti>
Hanmac: Little mouse is so kawaii :)
<banisterfiend>
bnagy: sorry, too much pot as a teenager has ruined my memory
<matti>
shevy: Hi hi
<matti>
banisterfiend: I also require a glass of Port.
namidark has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
Adran has joined #ruby
<bnagy>
yeah too much Port as a teenager just leads to bathrooms that look like murder scenes
<bnagy>
they used to do $5 flagons, BYO flagon, at the local bottle shop when I was ~17
<bnagy>
dear god.
banisterfiend has joined #ruby
matrixise has joined #ruby
datapolitical has joined #ruby
<atmosx>
banisterfiend: competitor like friendfeed?
<banisterfiend>
atmosx: i dont know, never used that
w400z has quit [Quit: Computer has gone to sleep.]
nick_h has quit [Ping timeout: 245 seconds]
lorn has quit [Ping timeout: 252 seconds]
dgs|2 has quit [Read error: Connection reset by peer]
cout has quit [Ping timeout: 246 seconds]
inimino has quit [Ping timeout: 260 seconds]
<banisterfiend>
bnagy: im trying to mess with calcc so i can get it to save continuations on arbitrary stack frames
mattsmith_ has quit [Read error: Connection reset by peer]
zhouqz has quit [Quit: Page closed]
<Mon_Ouie>
JonnieCache: The funny thing is, that seems to get it stuck
<JonnieCache>
lol yeah i just tried it, request is hanging
phrame has joined #ruby
<JonnieCache>
and now all requests are hanging
<JonnieCache>
oops
<JonnieCache>
do you want to email him or should I? you could probably include more detail...
rking has joined #ruby
<banisterfiend>
Mon_Ouie: JonnieCache: i guess they didnt forsee hackers of such skill breaking their systems
inimino has joined #ruby
mattsmith has quit [Ping timeout: 248 seconds]
mattsmith__ is now known as mattsmith
lorn has joined #ruby
lahwran has joined #ruby
lahwran has quit [Excess Flood]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
namidark has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
_pdelgallego has joined #ruby
Adran has joined #ruby
<Mon_Ouie>
JonnieCache: Feel free to do it yourself ;)
<Virunga>
are you talking about exec.charlie.bz? Because it's stuck either
workmad3 has joined #ruby
<Virunga>
*stucked
cout has joined #ruby
<banisterfiend>
virunga: they used their exceptional programmers skills to bring down the system
<banisterfiend>
programming
<Virunga>
:D
<JonnieCache>
i cant remember the details of why that breaks it tbh. obviously i know why it breaks it but i cant rememebr how it manages to affect the parent VM process as well
ringotwo has quit [Remote host closed the connection]
<Mon_Ouie>
The only reason it breaks is that the loop never ends
<Virunga>
you can contact him via twitter if you want
specialGuest has quit [Ping timeout: 264 seconds]
<JonnieCache>
Mon_Ouie: yes but iirc just `loop {1}` didnt break the bot
Criztian has quit [Remote host closed the connection]
<Virunga>
he put it online exactly one hour ago LOL
nick_h has joined #ruby
<JonnieCache>
it was some combination of the sleep and the loop that buggered it
<JonnieCache>
virunga: whats his twitter?
<Virunga>
JonnieCache: @charliesome
<charliesome>
JonnieCache: hi
<Virunga>
here he is
<JonnieCache>
ah. hi. sorry for breaking execpad.
<charliesome>
JonnieCache: no problems, what did you do?
<JonnieCache>
`sleep while true
<JonnieCache>
`
<charliesome>
fuck
<charliesome>
oh well i know how to fix that
<Mon_Ouie>
Even loop {} breaks this one
<bnagy>
it's pretty obscure, not surprised you didn't think of it
<charliesome>
Mon_Ouie: shouldn't do
<charliesome>
JonnieCache: the problem is the time limiter counts cpu time instead of wall time
t30322 has quit [Remote host closed the connection]
<JonnieCache>
its the ruby executing bot in this channel, the author went through all of this last week
<JonnieCache>
he's using a chroot jail
nari has quit [Ping timeout: 245 seconds]
<charliesome>
i'm using a ptrace sandbox
<JonnieCache>
also a good idea. as long as youre not sandboxing from within the ruby vm, that was judged to be a waste of time
<charliesome>
alright, killed your script
gloomer has quit [Ping timeout: 268 seconds]
<charliesome>
it should start processing the rest of the queue now
<charliesome>
i'll add a wall time limit
Taichouchou2 has quit [Remote host closed the connection]
stuartrexking has quit [Quit: Leaving...]
<charliesome>
JonnieCache: :\ how many did you do
<JonnieCache>
just one
<JonnieCache>
i cant speak for Mon_Ouie
<banisterfiend>
charliesome: i did a hundy
Abbas5 has joined #ruby
Abbas5 is now known as Abbas-
Abbas- has quit [Changing host]
Abbas- has joined #ruby
<charliesome>
there's 11 programs in the queue
Abbas- is now known as Abbas5
stuartrexking has joined #ruby
fyolnish_ has quit [Remote host closed the connection]
saschagehlich has quit [Read error: Connection reset by peer]
<Muz>
charliesome: related to the site interface timing out and connections being reset?
<Mon_Ouie>
I had only one too
saschagehlich has joined #ruby
<charliesome>
Muz: there's a worker that runs the programs, but due to a mistake of mine it does cpu time limiting instead of wall time limiting
<charliesome>
Muz: so 'sleep while true' holds up the entire queue forever
Taichouchou2 has joined #ruby
gloomer has joined #ruby
mattsmith has quit [Remote host closed the connection]
<JonnieCache>
when we were testing the bot `sleep while true` had amazing abilities to bugger up the whole thing, not just the script-executing subprocesses
<JonnieCache>
it was quite impressive
mattsmith has joined #ruby
<charliesome>
JonnieCache: probably because of the user's process limit or something
<banisterfiend>
Mon_Ouie: do you think the weeks you've spent hacking al2o3cr prepared you for the assult on charliesome's website?
<JonnieCache>
it works now
<atmosx>
anyone worked with 'tweetstream'
<banisterfiend>
assault
<atmosx>
?
<JonnieCache>
atmosx: i think a lot of the twitter api clients are breaking right now
celinedior has joined #ruby
<JonnieCache>
because twitter took too much VC money and now they need it back ;)
<atmosx>
JonnieCache: not yet, in theory will happen in a few months
<atmosx>
JonnieCache: my question about it more straight forward though… I see that it requires user/pass (oauth/basic auth). I wonder it if can be used to gather raw tweets from all over the place...
ringotwo has joined #ruby
<banisterfiend>
JonnieCache: arey ou in on this app.net band wgaon?
<banisterfiend>
wagon
<JonnieCache>
nope
<banisterfiend>
many programmer seem to be foaming at the tits over it
<charliesome>
i don't see how it's any better than twitter tbh
<Muz>
It's yet to suffer an Eternal September.
<charliesome>
it doesn't solve the real problem
<Muz>
That's the only real appeal.
<JonnieCache>
because you have pay for it
<JonnieCache>
and therefore they wont be beholden to advertisers and partners and so on
Abbas5 is now known as Abbas|
<banisterfiend>
charliesome: because they're more accomodating to developers i think
<charliesome>
did paid accounts make something awful a paragon of quality?
<charliesome>
banisterfiend: twitter were super pro-developer in the beginning as well weren't they?
<JonnieCache>
no, but they wont have to lock off the api like twitter are doing
Takehiro has quit [Remote host closed the connection]
adambeynon has joined #ruby
ringotwo has quit [Remote host closed the connection]
<JonnieCache>
i dont even use g+ i really should get on that bandwagon
cantonic has quit [Quit: cantonic]
<JonnieCache>
the problem is i use social networks exclusively to interact with irl friends, so realisticly im not leaving facebook any time soon
bigkevmcd has quit [Ping timeout: 245 seconds]
lahwran| has joined #ruby
lahwran| has quit [Excess Flood]
lahwran| has joined #ruby
lahwran| has quit [Excess Flood]
ringotwo has joined #ruby
bigkevmcd has joined #ruby
lahwran| has joined #ruby
lahwran| has quit [Excess Flood]
lahwran| has joined #ruby
lahwran| has quit [Excess Flood]
<atmosx>
I closed facebook account for the summer and I'm not gonna open it
<nw>
not sure if's better than ack, but it's faster
<hoelzro>
it's faster, but not as flexible
<nw>
and 33% shorter, of course!
<nw>
hoelzro: okay
<hoelzro>
iirc, ag doesn't find scripts via the shebang line
<nw>
haven't really compared them too extensively
<JonnieCache>
faster? i should have asked earlier
<hoelzro>
I'm heavily biased ;)
<matti>
Don't we all ;p
<JonnieCache>
im running ack against my entire projects directory and its taking ages
<hoelzro>
JonnieCache: what version?
<JonnieCache>
dunno. the latest one
<hoelzro>
of 1.x or 2.x?
haxrbyte has quit [Ping timeout: 252 seconds]
pskosinski has joined #ruby
richwestcoast has quit [Ping timeout: 256 seconds]
<JonnieCache>
1.96
<JonnieCache>
didnt know about 2
drago757 has joined #ruby
<hoelzro>
it's still in alpha
<hoelzro>
but I've been using it as my main ack for over three months without problems
richwestcoast has joined #ruby
hackeron has quit [Ping timeout: 240 seconds]
<JonnieCache>
i have it installed through homebrew so ill probably leave it like that
<JonnieCache>
it does look good though
dmiller has joined #ruby
haxrbyte has joined #ruby
<JonnieCache>
i only really use it to search massive trees, sublime's search-in-project does fine for everyday duties
<burgestrand>
JonnieCache: git grep (:
mohits has quit [Quit: Leaving]
<JonnieCache>
there's that too. sublime's returns within about 2 seconds on even the most bloated projects so ive never had a problem
pskosinski has quit [Read error: No route to host]
<JonnieCache>
damn, ag is fast though! several orders of magnitude
<hoelzro>
JonnieCache: it's because ag doesn't open nearly as many files as ack
<hoelzro>
but ack picks up more files
<hoelzro>
it's a tradeoff
<JonnieCache>
also i used the --literal option
<hoelzro>
you can turn that feature off, though
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
<JonnieCache>
my standard use case is "search for this literal in this ill-advisedly large tree of code" so ag is perfect
<JonnieCache>
like just now i needed to find uses of an api key accross all projects
<JonnieCache>
and yes, i know i shouldnt really have api keys in code repos.
t79799 has quit [Remote host closed the connection]
t49014 has joined #ruby
burgestrand1 has joined #ruby
Virunga has quit [Read error: Connection reset by peer]
Progster has joined #ruby
burgestrand has quit [Ping timeout: 268 seconds]
heisenmink has quit [Remote host closed the connection]
atmosx has joined #ruby
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
fastred has quit [Quit: fastred]
<atmosx>
any idea how can I find the gelocation codes for a country?
<atmosx>
Entire country area
<JonnieCache>
what do you mean geolocation codes?
fastred has joined #ruby
Hanmac has joined #ruby
<johnjohnson>
latitude and longitude?
<johnjohnson>
LOL
<johnjohnson>
If so, good luck :o
<JonnieCache>
so you mean the lat/lng for each point along a country's border?
havenn has quit [Ping timeout: 244 seconds]
<JonnieCache>
yeah good luck with that one :)
<johnjohnson>
lol
<johnjohnson>
just walk the entire circumference with a GPS and log all points
<JonnieCache>
i dont think such information even exists. borders rarely work like that
cuit has joined #ruby
<johnjohnson>
I know
<JonnieCache>
even in central europe theyre disputed
iamjarvo has quit [Ping timeout: 244 seconds]
ando12345_ has joined #ruby
<cuit>
What kind of program do your peoples think is good to aspire to make properly when learning to program? for example making a syntax highlighting text editor or something, something that pulls together lots of aspects of the language and technologies
<JonnieCache>
something that you personally want to use. this will give you the insight and motivation you need to follow it through
<johnjohnson>
cuit: good luck making a GUI based text-editor in Ruby if you're just starting out :o
<JonnieCache>
otherwise, it isnt massively important what you do
<JonnieCache>
but yeah editors are HARD
sailias has quit [Ping timeout: 244 seconds]
<johnjohnson>
cuit: start simple. When I first started Ruby (not too long ago), I wrote a simple text-based game in console, and saved data into a CSV file for next run.
<cuit>
JonnieCache: yea was an example, this is why I'm asking because I'm struggling to think of something
ando12345 has quit [Ping timeout: 256 seconds]
ctwiz has joined #ruby
dmiller has quit [Ping timeout: 240 seconds]
t49014 has quit [Remote host closed the connection]
<cuit>
johnjohnson: that's a good idea
kiyoura has joined #ruby
t40437 has joined #ruby
<JonnieCache>
making simple games is rewarding and teaches a variety of skills. you can extend it in many different ways too
<johnjohnson>
cuit: yeah, it covered almost everything important within the language that you'd need to learn
<cuit>
johnjohnson: could also make it use a sqlite db untill you want to export the data to csv
<cuit>
johnjohnson: I quite like that idea, thanks
<johnjohnson>
cuit: yep, indeed
<johnjohnson>
Now, I don't mean try to go and emulate space invaders in console :D
My_Hearing has joined #ruby
<JonnieCache>
why not?
<johnjohnson>
It was a simple text-based strategy type game
<burgestrand1>
game of life
burgestrand1 is now known as burgestrand
<johnjohnson>
Like 'Press Q to walk forward and enter the room'
<workmad3>
although conway is pretty good for coding practice too :)
<johnjohnson>
well, something stupid I came up with as far as the story line
<JonnieCache>
or write a sudoku solver
<johnjohnson>
My story line was actually based on gay zombie dogs so..
<JonnieCache>
hahahaha amazing
<johnjohnson>
lol
<johnjohnson>
I can't learn when I'm doing a project someone else is trying to teach. I have to do something I'm interested in
<cuit>
alright I've written up my plan, the story is going to be about gay zombie do-.. Damn! beat me to it
<johnjohnson>
:D
Jay_Levitt has joined #ruby
<johnjohnson>
There's always cats
Mon_Ouie has quit [Ping timeout: 264 seconds]
<cuit>
It's just not the saaaame
PhoSor has left #ruby [#ruby]
enroxorz-work has joined #ruby
enroxorz-work has quit [Changing host]
enroxorz-work has joined #ruby
luist has joined #ruby
Squarepy has quit [Read error: Connection reset by peer]
ando12345_ has left #ruby [#ruby]
Faris has joined #ruby
Squarepy has joined #ruby
My_Hearing is now known as Mon_Ouie
<johnjohnson>
Do you guys know if TempFile stores the file in-memory or actually persists it to disk? I need a way to store a file in-memory only for a short amount of time.
dhruvasagar has quit [Ping timeout: 245 seconds]
<hoelzro>
johnjohnson: I'm not certain, but I would guess it creates a file in TMPDIR
<hoelzro>
which defaults to /tmp on *nix systems
<hoelzro>
which may or may not be an in-memory filesystem
heisenmink has joined #ruby
Banistergalaxy has joined #ruby
<Mon_Ouie>
If you want in-memory IO-like objects, you can use StringIO
Squarepy has quit [Changing host]
Squarepy has joined #ruby
GoGoGarrett has joined #ruby
haxrbyte has quit [Ping timeout: 245 seconds]
seanwash has joined #ruby
Takehiro has quit [Remote host closed the connection]
<johnjohnson>
StringIO eh
a_a_g has quit [Quit: Leaving.]
<johnjohnson>
That may be worth a try
<johnjohnson>
The only problem is I have to actually send the file like it's an actual file object later on
<johnjohnson>
but at the same time I can't persist it to disk :/
t40437 has quit [Remote host closed the connection]
t48295 has joined #ruby
ph^ has joined #ruby
drago757 has quit [Quit: drago757]
<libryder>
isn't NotImplementedException a valid exception?
<libryder>
i get unitialized constant NotImplementedException when i try to raise it
yasushi has quit [Remote host closed the connection]
uris has joined #ruby
mneorr has joined #ruby
yasushi has joined #ruby
Takehiro has joined #ruby
moshef has joined #ruby
Quadrant_ has joined #ruby
Quadrant has quit [Read error: Connection reset by peer]
Taichouchou2 has joined #ruby
<moshef>
is it possible to define an attribute with a case statement? so I won't have to write: when 'x' then q = 1, when 'y' then q = 2 etc. just define q = and then when 'x' then 1 etc. is it possible?
<Mon_Ouie>
Yes
<moshef>
how?
<Mon_Ouie>
Just like you said?
<moshef>
q = case … ?
<Mon_Ouie>
Yes
Taichouchou2 has quit [Remote host closed the connection]
<moshef>
looks ugly, ill confirm
<moshef>
thought there might be a better way :)
cuit has quit [Quit: Konversation terminated!]
yasushi has quit [Remote host closed the connection]
<Hanmac>
>> a = case "z"; when "x";0;when "y";1;when "z";3;end; a;
<al2o3cr>
(Fixnum) 3
ph^ has quit [Remote host closed the connection]
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Changing host]
Paul-Atreides has joined #ruby
enroxorz-work has quit [Read error: Connection reset by peer]
<lectrick>
If I define a self.included hook, does the include still proceed or do I have to do it myself?
ananthakumaran2 has quit [Quit: Leaving.]
<banisterfiend>
it proceeds
<JonnieCache>
its just a callback, you dont have to actually do the inclusion
<lectrick>
So how would I cancel the inclusion, theoreticalliy?
<banisterfiend>
you'd have to override a method called append_features i think
<lectrick>
interesting. i can take it from here. thanks banisterfiend
<lectrick>
banisterfiend: a gist just for something I just googled? :)
<banisterfiend>
lectrick: it took me 2 seconds to type: gist -d Module#append_features
<banisterfiend>
:)
iori has quit [Remote host closed the connection]
Eplemosen has joined #ruby
<lectrick>
banisterfiend: I figured. just seems wasteful of github resources haha
mahmoudimus has joined #ruby
rippa has joined #ruby
t48295 has quit [Remote host closed the connection]
<banisterfiend>
lectrick: if you used pry more u wouldn't have to google
<lectrick>
they just scored a nice funding round btw
<JonnieCache>
what, again?
t99256 has joined #ruby
<lectrick>
banisterfiend: I'm getting around to it! haha. I was actually looking through the Pry source yesterday to see how its magic worked
burgestrand has quit [Ping timeout: 265 seconds]
<banisterfiend>
lectrick: i hoped you read the source in pry itself
<lectrick>
JonnieCache: Yeah, I think so.
<banisterfiend>
if you were reading pry's source in an editor i wll slap u
noyb has quit [Ping timeout: 244 seconds]
<lectrick>
JonnieCache: Hmmm, maybe it's old news. Just saw it mentioned recently tho
<lectrick>
banisterfiend: so I should have pried pry? :)
<lectrick>
banisterfiend: i have a shortcut that opens a gem in sublime, don't hate me haha
<lectrick>
either that or I git clone it and then look
<JonnieCache>
theres `bundle open`
<banisterfiend>
hehe, just: show-source Pry
<lectrick>
yes, my shortcut uses that if available
<banisterfiend>
or show-source Pry#method_of_your_choice
<JonnieCache>
maybe theres now `gem open` too
<lectrick>
does Pry provide show-source ?
<banisterfiend>
lectrick: yes, it can show source for methods and classes/modules
ph^ has joined #ruby
chussenot has quit [Read error: Connection reset by peer]
<lectrick>
banisterfiend: I don't have show-source in my path
<banisterfiend>
lectrick: show-source is to be accessed inside pry ;)
<lectrick>
ah, duh
chussenot has joined #ruby
ph^ has quit [Remote host closed the connection]
<banisterfiend>
think of Pry as bash for ruby code, it supports cd/ls and show-source,show-doc, and so on
<lectrick>
there's a lot of nastiness it has to do to do what it does, btw. I wish ruby was even more introspective so that would be easier
<banisterfiend>
lectrick: what kidn of nastiness btw?
<lectrick>
yeah, i've used it a bit
jlebrech has joined #ruby
MarioEIU has left #ruby ["Leaving"]
<jlebrech>
#createastoryusinggemnames
jjbohn has joined #ruby
<lectrick>
banisterfiend: just the usual ruby narstiness. I'm working on implementing a functional Refinements implementation using pure Ruby so I've had my head in that stuff lately
<banisterfiend>
lectrick: just curious what specific nastiness u mean?
<lectrick>
set_trace_func
<lectrick>
instance_eval with strings
workmad3_ has joined #ruby
<lectrick>
that sort of stuff
seanwash has quit [Quit: Leaving.]
workmad3 has quit [Disconnected by services]
workmad3_ is now known as workmad3
burgestrand1 has quit [Quit: Leaving.]
<lectrick>
manipulation of binding
joephelius has joined #ruby
<banisterfiend>
lectrick: hmm, set_trace_func isn't really used afaik, i think it was used originally to backport source_location for 1.8, but shouldn't really be there anymore
<lectrick>
ah that's good then
QKO_ has joined #ruby
moshef has quit [Quit: moshef]
<lectrick>
well when I push a working version of my idea, maybe someone can help me get off of set_trace_func to implement a "class just finished being defined" callback :)
ph^ has joined #ruby
<shevy>
hmm
ThaDick has quit [Quit: zzzZZZ ...]
<shevy>
set_trace_func only works with global variables or?
<banisterfiend>
lectrick: if u dont want that to be super slow i'd probably use rb_event_hook instead
ph^ has quit [Remote host closed the connection]
<lectrick>
shevy: I overrode it to work with a stack
<shevy>
aha
<lectrick>
banisterfiend: rb_event_hook? off to google
<lectrick>
oh wait! I've seen this just yesterday!
<banisterfiend>
lectrick: also, string-based instance_eval is only used in one place, to generate a binding object in the proper scope :)
<lectrick>
Yes, I was going to move to that... after I had it passing tests
jorge_ has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
QKO has quit [Ping timeout: 252 seconds]
<banisterfiend>
lectrick: we do use Binding#eval a lot, but that's because that's the only API offered by Binding, and i think it's pretty awesome, personally :)
<lectrick>
banisterfiend: Yes, I know why it's used, having had to deal with scopes and bindings a ton lately myself... very good learning experience btw
<lectrick>
banisterfiend: It works well. I didn't say it didn't work well, I said it was kinda ugly haha
jorge has joined #ruby
seanwash has joined #ruby
krawchyk_ has joined #ruby
<banisterfiend>
lectrick: well, a REPL by definition has to use string evals :) i dont think a repl, any repl in any language (except retarded static languages that recomplie everything each time) would be using string evals i think
jorge has quit [Remote host closed the connection]
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
BrokenCog has joined #ruby
<banisterfiend>
s/by definition/by nature
<lectrick>
banisterfiend: True.
stopbit has joined #ruby
t99256 has quit [Remote host closed the connection]
t44786 has joined #ruby
rins has quit [Quit: leaving]
ThaDick has joined #ruby
krawchyk has quit [Ping timeout: 245 seconds]
<lectrick>
You know how I found event_hook? I looked through the source of set_trace_func and saw that it called rb_add_event_hook and I go, "I bet someone wrapped that sucker separately"
<lectrick>
I don't understand how it's faster tho since it seems to get the same set of args that set_trace_func does
<banisterfiend>
nah
<banisterfiend>
if u look at set_trace_func source
<lectrick>
or maybe the example is just bad
<banisterfiend>
(u can do that in pry using: show-source set_trace_func)
fearoffish has joined #ruby
<banisterfiend>
u can see set_trace_func sets up an event hook for all events
<lectrick>
no shit. ok how do I fire up a Pry REPL again?
<banisterfiend>
gem install pry pry-doc
<banisterfiend>
u need to install pry-doc for C source/docs
<banisterfiend>
then: pry
<lectrick>
it's already in the bundle. oh ok
<banisterfiend>
to start it, then show-source set_trace_func
w400z has joined #ruby
sailias has joined #ruby
nari has quit [Ping timeout: 260 seconds]
yxhuvud has joined #ruby
kvirani has joined #ruby
ryh has joined #ruby
<banisterfiend>
lectrick: anyway, the k00 thing about rb_event_hook is that you can only listen for teh events u want, rather than all of them. Also, it doesnt create binding objects each time
senny_ has quit [Remote host closed the connection]
<banisterfiend>
so it turns out to be significantly faster
<banisterfiend>
binding objects are pretty expensive to create
BSaboia has joined #ruby
i0n has quit [Quit: Lost terminal]
<lectrick>
ah, now I get it
<lectrick>
yes, I found out about this binding problem :)
specialGuest has quit [Changing host]
specialGuest has joined #ruby
burgestrand has joined #ruby
BrokenCog has quit [Quit: leaving]
<lectrick>
I installed pry-doc and show-source set_trace_func still won't work :(
richwestcoast has quit [Ping timeout: 244 seconds]
<banisterfiend>
lectrick: is pry-doc in your Gemfile etc?
<banisterfiend>
lectrick: what's the output when u try to show-source set_trace_func ?
<lectrick>
banisterfiend: It is not in the Gemfile yet.
<banisterfiend>
oh, u have to add it
<lectrick>
I installed it manually via the gem command
<lectrick>
ok
<banisterfiend>
ya but bundler will only let u require gems (even pry plugins) that are specified in Gemfile
<banisterfiend>
bundler is a pain
mahmoudimus has joined #ruby
<banisterfiend>
you could try adding pry-debundle
<banisterfiend>
whic breaks out of the bundler jail and lets u require plugins not specified in Gemfile, but probably easier to just add pry-doc for now
<Xeago>
wasn't support for gemfile.local added?
Zepo has joined #ruby
<Xeago>
I saw it flying by in some other repo recently
<Xeago>
or was that hacked in by them?
<lectrick>
adding pry-doc.
Catnaroek has joined #ruby
<lectrick>
BOOM worked.
haxrbyte has joined #ruby
ananthakumaran has joined #ruby
<banisterfiend>
lectrick: k00
pskosinski has joined #ruby
t44786 has quit [Remote host closed the connection]
t93536 has joined #ruby
tagrudev has quit [Remote host closed the connection]
<banisterfiend>
lectrick: one pretty sexy thing it can do is show (or try to anyway:P) C source of 3rd party extensions :D
<banisterfiend>
im pretty proud of that
<banisterfiend>
it works about 80% of the time :)
<Xeago>
anyone knows if it is possible to search on a github repo?
haxrbyte_ has joined #ruby
<Xeago>
from within a repo*
<banisterfiend>
for a file name?
<banisterfiend>
or for content?
<Xeago>
content
resure_away has quit [Ping timeout: 245 seconds]
<banisterfiend>
i dont think so, i think that's a thing u can only do for private repos
<banisterfiend>
it's a 'premium' feature :)
<Xeago>
blurgh, ill fork it into private then :\
hackeron has joined #ruby
<Xeago>
then again
<Xeago>
I couldn't edit on private repo's
heisenmink has quit [Remote host closed the connection]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
cakehero has quit [Quit: Leaving...]
resure_away has quit [Remote host closed the connection]
dangerousdave has joined #ruby
chimay_1 has quit [Quit: WeeChat 0.3.9-dev]
<Xeago>
shevy: what exactly do you think rubyOS would be?
jgrevich has joined #ruby
arkiver has quit [Quit: Leaving]
schaerli has quit [Remote host closed the connection]
<libryder>
an os that runs on top of a linux vm
<libryder>
lol
jlogsdon has joined #ruby
baphled has joined #ruby
dmiller has joined #ruby
<shevy>
nah, a mixture
<shevy>
ideally an operating system where ruby could be used for everything, down to the hardware level
vectorshelve has joined #ruby
<shevy>
in practice I suppose it'll boil down to a mix of ruby and C for speed
<shevy>
all the unix core tools could easily be written in ruby
<vectorshelve>
shevy: coming back to something interesting we talked about.. passing a parameter from ruby to a site and getting it's search result.. we could either parse the html using nokogiri or is there some better stable way ?
berserkr has quit [Read error: Connection reset by peer]
<shevy>
ewwww
<shevy>
nokogiri
<shevy>
don't you know that I do not use XML vectorshelve
nanderoo has joined #ruby
<shevy>
most html you can treat as a big strong and run .scan on it or similar
wmoxam has joined #ruby
wmoxam has quit [Changing host]
wmoxam has joined #ruby
maesbn has quit [Remote host closed the connection]
<shevy>
for automation, you can use mechanize
maesbn has joined #ruby
* Muz
slaps shevy.
<shevy>
ack!
chrisbolton has joined #ruby
<Muz>
Treating the HTML of a page as a string is a terrible thing to do.
t4743 has quit [Remote host closed the connection]
<shevy>
at least it was a proper sentence :)
<Muz>
Especially if you expect to test against it deterministically.
<shevy>
a string is a string is a string
t54881 has joined #ruby
<seanwash>
is a string
<shevy>
is a duck!
<vectorshelve>
shevy: yes exactly.. so that is why I considered you to be a better person to help me use something better..
<seanwash>
vectorshelve: Is there a way to quick reply to someone that mentions you in IRC?
maletor has joined #ruby
<hoelzro>
seanwash: depends on your client; I'm sure it's possible
<seanwash>
hoelzro: Alright, I'll do some googling
ph^ has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<shevy>
I usually only type the beginning of the name
<shevy>
like ve
<shevy>
then I hit <TAB> key
<shevy>
vectorshelve, hi!
<vectorshelve>
shevy: your suggestions on the code.. well my use case is that I need to pass a ten digit number to http://www.pnrstatus.info/ and get the result... for example try with 4143564057
<shevy>
vectorshelve why are you still doing rails :(
ThaDick has joined #ruby
<shevy>
well just .scan() it with a regex?
<vectorshelve>
shevy: no this is ruby.. I wanna build a gem for this :)
<shevy>
where is the info in that html string
<shevy>
the number
<shevy>
where is it hidden?
<hoelzro>
seanwash: what client are you using, btw?
<shevy>
oh
sendoushi has joined #ruby
ekaleido_ has quit [Quit: leaving]
<shevy>
you mean you want to pass a number to that site, via commandline or that script
<shevy>
all this embedded javascript for google adsense
<shevy>
the <iframe> stuff
<shevy>
ewwwww ewwww ewww
<vectorshelve>
shevy: mechanize has a lot of dependencies -> Using diff-lcs (1.1.3) Installing unf_ext (0.0.5) with native extensions Installing unf (0.0.5) Installing domain_name (0.5.3) Using mime-types (1.19) Installing net-http-digest_auth (1.2.1) Installing net-http-persistent (2.7) Using nokogiri (1.5.5) Installing ntlm-http (0.1.1) Installing webrobots (0.0.13) Installing mechanize (2.5.1) Using rspec-core (2.11.1) Using rspe
arturaz has quit [Ping timeout: 264 seconds]
<shevy>
yeah
<shevy>
that is the drawback
wvms has left #ruby [#ruby]
<shevy>
things tend to grow and grow and grow
sendoushi has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
<shevy>
it's the rails disease of things
* Hanmac
thought that iframe does either work only on IE or is an "invention" from apple
krawchyk_ has quit [Remote host closed the connection]
<shevy>
vectorshelve, mechanize used hpricot for a while
<shevy>
then they switched to nokogiri and I could not get nokogiri to work
<shevy>
vectorshelve, but now you see, there is a need for SMALL and useful gems ;)
Takehiro has quit [Remote host closed the connection]
aganov has quit [Quit: aganov]
sendoushi has joined #ruby
hukl has joined #ruby
<shevy>
yeah that is the second level of breakage
<shevy>
first it uses more and more other gems
<shevy>
then it breaks
<shevy>
:)
<shevy>
welcome to ruby!!!
jrajav has joined #ruby
Takehiro has joined #ruby
<Hanmac>
when did this room turned into a mechanize-channel?
mrsrikanth has joined #ruby
arkiver has joined #ruby
Agis__ has joined #ruby
<vectorshelve>
shevy: well I didnt like mechanize.. I mean why would I want to make a gem using gems which itself have got multiple dependencies.. native simple code would be much better.. I thing
<vectorshelve>
I think*
<shevy>
Hanmac the moment when other people didn't help vectorshelve
<Hanmac>
helping vector is not a good game ... noone chould win in this game
maletor has joined #ruby
Squarepy has quit [Quit: Leaving]
alvaro_o has joined #ruby
<vectorshelve>
shevy: :)
<invisime>
are there any ruby IPC libraries that actually work with ~> ruby 1.9? dRb (and therefore Rinda) block when you try to find a service. are there any better alternatives?
<vectorshelve>
Hanmac: you have won multiple times :)
justinmcp has quit [Remote host closed the connection]
<arkiver>
If i have an array ["foo", "bar", "baz"], How can I create variables foo_attribute, bar_attribute, baz_attribute dynamically. Basically I want to do this to DRY my code.
<arkiver>
These variables will be used later in the code
<hoelzro>
arkiver: you can just invoke attr_reader and friends
<hoelzro>
%w(foo bar baz).each do |attr| attr_accessor attr.to_sym end
<infinitiguy>
How can I stop an each do loop from exiting a method upon a certain condition.. i..e I have something like nodename.each do | address| if address == "myaddress" do some stuff.. I'd like it to stop the method after it does some stuff.. if it doesn't have a match of address =="myaddress" then continue on each nodename until it has a match.
<Hanmac>
shevy yeah but the development is currently a bit slow ... we need more man-power
<infinitiguy>
I want to stop the method - but not stop the script
zommi has quit [Quit: Leaving.]
<shevy>
Hanmac what is the scope of the project? I still maintain my bunch of RPG code in ruby for my old pen and paper group
<JonnieCache>
infinitiguy: use an `until` loop
<JonnieCache>
or while
elux has joined #ruby
<shevy>
but 50% of it is very specific to our needs in the game world, which in turn often is a bit specific to the system used (DSA mostly, sometimes DnD)
dmiller has quit [Ping timeout: 252 seconds]
mahmoudimus has joined #ruby
<JonnieCache>
or, filter your collection before you iterate it. thats probably the best
davidcelis has joined #ruby
pskosinski has quit [Remote host closed the connection]
<Hanmac>
shevy to make an new RPGMaker with new core and so on
mneorr has quit [Remote host closed the connection]
<Hanmac>
arkiver: you dont need any to_sym it still works without:
resure_away has quit [Remote host closed the connection]
<shevy>
hmm ok I'll add #OpenRubyRMK to my irc channel list
<arkiver>
Hanmac, Cool I'll try it out
bigkevmcd has joined #ruby
hoelzro is now known as hoelzro|away
_Vile has joined #ruby
_Vile has quit [Changing host]
_Vile has joined #ruby
iamjarvo has quit [Ping timeout: 244 seconds]
Goles has joined #ruby
beneggett has joined #ruby
sendoushi has quit [Remote host closed the connection]
CoolCold has joined #ruby
<CoolCold>
hello guys
xorigin has quit [Quit: leaving]
<CoolCold>
i'm a bit confused - i'm installing gitlab and it requires eventmachine
AlbireoX has joined #ruby
<CoolCold>
i'm running bundle install --without development test --deployment , and it tries to compile eventmachine, while "gem list" shows eventmachine is already installed
<JonnieCache>
it probably wants a different version to the one you have installed
<JonnieCache>
eventmachine is used for a lot of different things
<infinitiguy>
I'm a bit confused as to how until or while will help here - they don't seem to be able to iterate through a loop on their own. If I put a while or until inside of the each loop I would expect it to only break out of the while loop and the each loop would continue until the end of the list (in this case IP addresses).
robotmay_ has quit [Remote host closed the connection]
ThaDick has joined #ruby
<shevy>
infinitiguy hmm I think that depends. I think a "return" statement, for instance, may break out of all loops perhaps?
qwerxy has quit [Ping timeout: 244 seconds]
__class__ has quit [Ping timeout: 245 seconds]
pdtpatrick has joined #ruby
<infinitiguy>
return doesnt seem to do it - I think maybe break will - I'll try that next.
<JonnieCache>
infinitiguy: i was suggesting replacing each with while
<JonnieCache>
infinitiguy: but actually you should just filter the collection before you call each
<JonnieCache>
so it only contains elements you want, and you dont have to break out of the loop
<Mon_Ouie>
e.g. use take_while
qwerxy has joined #ruby
<JonnieCache>
one day i should really sit down and read through all the weird methods in enumerable
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
mneorr has joined #ruby
<shevy>
haha
<infinitiguy>
I'm not sure how to filter the collection. I get a list of ip addresses (soap objects) that are from an array. The methods that the api (f5 in this case) I'm using don't seem to allow me to say just give me this one host from the code I'm working from which is why I was taking the iteration route.
andrewstewart has joined #ruby
ckrailo has quit [Quit: Leaving...]
jamesaa has joined #ruby
t54881 has quit [Remote host closed the connection]
<shevy>
didnt they add some new ones for 1.9.x?
t13853 has joined #ruby
bradhe has joined #ruby
ckrailo has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
<shevy>
I dont think I have used take_while before
resure_away has joined #ruby
seanyo has joined #ruby
<kaleido>
the f5 api is all kinds of "fun"
CarlB_the_great has quit [Remote host closed the connection]
linoj has joined #ruby
mucker has joined #ruby
mucker has quit [Client Quit]
mucker has joined #ruby
ryk has quit [Quit: Changing server]
resure_away has quit [Remote host closed the connection]
__class__ has joined #ruby
vitoravelino is now known as vitoravelino`afk
vDubG has quit [Ping timeout: 246 seconds]
arkiver has quit [Ping timeout: 264 seconds]
senny has joined #ruby
<infinitiguy>
@kaleido - yep… I'm finding all sorts of fun things with it
<infinitiguy>
*shakes fist in anger*
alexwh has quit [Ping timeout: 252 seconds]
dahan has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
theRoUS has quit [Read error: Operation timed out]
<dahan>
that's what I mean
Guest52428 has joined #ruby
<dahan>
i have a class function in the class.
<dahan>
and I want to call it from a module that I include in the class
<dahan>
without naming it directly!
rakunHo has quit [Remote host closed the connection]
<dahan>
Planet.c_foo is what I want to achieve without using the token <Planet>
Phelps has quit [Read error: Connection reset by peer]
iamjarvo has joined #ruby
ph^ has quit [Remote host closed the connection]
recycle has joined #ruby
shevy has joined #ruby
sneakyness_wk has joined #ruby
<chimkan_>
try extend
<chimkan_>
it's because include will need you to instantiate the planet class first
<chimkan_>
p = Planet.new
<chimkan_>
then you are able to call foo from Astro
<chimkan_>
but if you use extend
<chimkan_>
foo can be called
<chimkan_>
Planet.astro
<chimkan_>
and then you are able to call the self.class.c_foo
<chimkan_>
just try
<chimkan_>
change include for extend
Agis__ has quit [Quit: Agis__]
recycle has quit [Remote host closed the connection]
koshii has joined #ruby
<koshii>
Hey guys if I have an array array = [:peanut, :butter, :and, :jelly] -- why does array[4,0] == [] ? There is no "4th place", or is the end of the array position 4?
<koshii>
Because array[5,0] == nil
Guest52428 has quit [Quit: Quitting]
khakimov has joined #ruby
<koshii>
If the above is true, it also explains why array array[0,1] == [:peanut] only, and not [:peanut, :butter] (the first "[" of the array being a position 0 in certain cases?!)
pskosinski has joined #ruby
alexwh_ has joined #ruby
<chimkan_>
koshii maybe array starts with position zero?
<chimkan_>
so array(4) doesn't have anything in it.
<koshii>
chimkan_: Yes but why would array[5,0] == nil then?
Agis__ has joined #ruby
<koshii>
chimkan_: Rather than also being []
<chimkan_>
because there's nothing
<chimkan_>
when ruby returns nothing it gives nil
<chimkan_>
always
<chimkan_>
array is referencing to variable array
<koshii>
chimkan_: So "end of the array" is a kind of character at position 4 in this case? And "start of array" is position zero?
<chimkan_>
if there's nothing that's what happens.
<koshii>
"start of array" being [ rather than :peanut
<chimkan_>
yu
<chimkan_>
yup
matrixise has quit [Ping timeout: 246 seconds]
<chimkan_>
it starts with :peanut
<chimkan_>
that's it
<koshii>
No...
<chimkan_>
and its position is zero
<koshii>
That's not what I'm asking.
<koshii>
Maybe I don't understand what array[0,1] actually does.
<koshii>
Because if the "1" position is :butter, shouldn't it return :butter?
Criztian has joined #ruby
mksm has quit [Read error: Operation timed out]
<koshii>
Do you see what I mean?
<koshii>
In C for example there is this "\0" kind of concept that is actually a character. Is it something like that?
<shevy>
koshii you gave 0 as second argument to [] method
<koshii>
a_a_g: I'm trying to understand why my array array = [:peanut, :butter, :and, :jelly] has this property -- array[4,0] == [] and array[5,0] == nil
<shevy>
try array[4,1] and notice the difference
<shevy>
eww
<shevy>
bad example from me
<shevy>
:)
<koshii>
heh
<shevy>
array[4,155] # => []
<shevy>
array[4,155562323636] # => []
<blob>
koshii: look at that link that explains the slice method
<shevy>
array[4,0] # => []
<chimkan_>
interesting
<a_a_g>
is this a bug?
<chimkan_>
so it's taking arr[5,0] example
<koshii>
blob: Weird! a[5] => nil but a[5,1] => []
<Mon_Ouie>
a_a_g: No, completely intended behavior
<chimkan_>
from the imamge
<a_a_g>
how/why is it intended?
<koshii>
I'd sure like to know.
<shevy>
yeah that is confusing
<Mon_Ouie>
See the image
<chimkan_>
so the array has six indexes
adamkittelson has joined #ruby
<chimkan_>
the last one usually shows empty because it's the end of the array
bier_ has quit [Ping timeout: 245 seconds]
<Mon_Ouie>
koshii: And no, arrays in Ruby aren't terminated by a magic element that they can't contain — the end of the array is known by keeping their size in memory.
<koshii>
OK this makes more sense. So that means array[0,0] is also []
<Mon_Ouie>
Correct
<koshii>
OK, I finally get it.
<koshii>
Thank you Mon_Ouie !
alexwh_ has quit [Quit: Quitting]
<a_a_g>
but in this case the array has 4 elements
recycle has joined #ruby
<a_a_g>
the image shows an array of 5
alexwh_ has joined #ruby
<a_a_g>
ah, sorry, my bad
alexwh_ has left #ruby [#ruby]
<koshii>
Thank god for IRC, seriously.
<koshii>
This kind of stuff is pretty incredible to me when I really start to get it. Makes me realize how insanely smart people who write programming languages have to be.
chimay has quit [Quit: WeeChat 0.3.9-dev]
<blob>
hmm thats a good image to help understand slicing. keep in mind arrays dont actually contain that extra element though
recycle has quit [Remote host closed the connection]
s1n4 has quit [Quit: leaving]
<eridani>
why are you asking for a 0 length slice of an array/
<koshii>
blob: It's just a convention? Why would it be included in the language then?
<blob>
but that behavior is caused by the valid range being the length of the array
<blob>
for slicing
<koshii>
eridani: It's part of Ruby Koans.
chimay has joined #ruby
<koshii>
eridani: Which apparently specializes in edge cases. :-)
Anonyneko has joined #ruby
aristidesfl has quit [Ping timeout: 245 seconds]
carloslopes has joined #ruby
<Mon_Ouie>
Yes, it's really just a matter a convention; you *can* argue for it returning either nil or an empty array.
robert- has joined #ruby
tommyvyo has joined #ruby
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
Takehiro has quit [Read error: Connection reset by peer]
<shevy>
hmm it's a bit odd
<shevy>
why does it return an empty array? does it make sense when looking at the arguments alone?
Takehiro has joined #ruby
<koshii>
shevy: In my opinion no.
revans has quit [Ping timeout: 265 seconds]
<koshii>
shevy: That's why I was puzzled about my results.
Morkel has joined #ruby
<shevy>
for returning something alone, [5,0] seems to never return anything useful
<shevy>
I use it for setting values though
<shevy>
array[5,0] = 'hi'
<koshii>
Whoa
<shevy>
I like this more than .insert
<Xeago>
>> ["derp"][1,0]='hey'
<al2o3cr>
(String) "hey"
<shevy>
works on strings too
Vert has joined #ruby
<Xeago>
wot
<Xeago>
?
aristidesfl has joined #ruby
mengu has joined #ruby
<a_a_g>
i still dont get why you dont go out of the array at 4, instead of 5
<Xeago>
I do not get that logic at all
<a_a_g>
saying you are past the last element but still inside the array makes no sense
khakimov has quit [Quit: Computer has gone to sleep.]
<a_a_g>
unless its like the lisp null terminated list
<Mon_Ouie>
#insert works on string too, though
areil has quit [Remote host closed the connection]
<Mon_Ouie>
a_a_g: It makes sense if you consider that each index is placed before the matching element
<koshii>
a_a_g: It doesn't make sense unless you look at that picture Mon_Ouie posted.
<koshii>
Or if you consider that fact he just stated. Heh :-)
<Mon_Ouie>
As opposed to *at* that specific element
myth17 has joined #ruby
dmiller has joined #ruby
<shevy>
koshii but why does it return an empty array? does every non-empty array include empty arrays?
<a_a_g>
so in a 4 element array, where is 4 placed?
<shevy>
at the end!
apok has joined #ruby
<shevy>
well, the index starts at 0
<a_a_g>
after the last element and before an element that does not exist
<shevy>
so 4 would be past it I suppose
bier_ has joined #ruby
ph^ has joined #ruby
<shevy>
perhaps it comes right before Infinity
<a_a_g>
why is index 4 in a 4 element array treated as being inside the array?
<shevy>
it's like a moebius strip
<a_a_g>
the array should end at the element after index 3
<shevy>
an array inside an array inside an array inside a
emmanuelux has joined #ruby
<shevy>
hmmm
<shevy>
actually
<koshii>
I see I've opened a can of worms here. :-)
<shevy>
x = "abc" # => "abc"
<koshii>
shevy: I wish I knew!
<shevy>
x[3,0] # => ""
<shevy>
this returns an empty string
<shevy>
so it is consistent with the same on array, returning an empty array
artOfWar has joined #ruby
<shevy>
and
<shevy>
x[4,0] # => nil
<shevy>
so we have the same behaviour for string and array
havenn has joined #ruby
<shevy>
that makes me feel slightly better
<a_a_g>
this feature is like some 'features' i've seen in MS Word
<koshii>
heh
<a_a_g>
no, no, no. Ruby! you are too elegant to have behave like this
resure_away has joined #ruby
jclem has joined #ruby
Phelps has joined #ruby
t13853 has quit [Remote host closed the connection]
t27415 has joined #ruby
<Mon_Ouie>
For the record, trying the same thing in other languages: Python always returns an array no matter by how much you get past the end of the array, Common Lisp raises an error
recycle has joined #ruby
bjeanes has joined #ruby
mascool has joined #ruby
recycle has quit [Remote host closed the connection]
<shevy>
cool
<shevy>
hmmm and perl?
<shevy>
I forgot how to make an array in perl :\
asuka_ has quit [Ping timeout: 240 seconds]
<a_a_g>
its the same syntax i think
<a_a_g>
at least used to be :P
<shevy>
does perl have anything like irb?
<shevy>
damn fossil language
AlbireoX has quit [Remote host closed the connection]
resure_away has quit [Remote host closed the connection]
AlbireoX has joined #ruby
<Muz>
shevy: a REPL? Of course.
<a_a_g>
whats the position based on?
bjeanes has left #ruby [#ruby]
<Xeago>
Anyone with some knowledge of Tire/elasticsearch
revans has joined #ruby
shadoi has joined #ruby
<Xeago>
how do I boost within a query
jorge_ has joined #ruby
myth17 has left #ruby ["Leaving"]
khakimov has joined #ruby
<libryder>
respond_to? checks the current class, not it's ancestor right?
myth17 has joined #ruby
<davidcelis>
yes
<fowl>
libryder: dont your objects respond_to methods they inherit?
<davidcelis>
but if it inherits the method, it responds_to it
<Muz>
You could call instance_methods(false) to get an array of methods that don't include inherited methods.
<libryder>
fowl, yes but the ancestor version of this method i'm checking for throws a not implemented and for some reason respond_to?(:method_name) is failing on the child even though it's been overridden
fearoffish has quit [Ping timeout: 246 seconds]
Takehiro has quit [Remote host closed the connection]
<davidcelis>
god why do people try to program ruby like it's java
<libryder>
*an object-oriented language
<davidcelis>
every time i see something like `def method() raise "implement in subclasses" end` i want to gouge my eyes out
<a_a_g>
class A has methods x and y, such that x calls y. class B < A and has methods x and y. B.x calls super. Which y will get called?
<libryder>
davidcelis: that's pretty standard OO design bro
theRoUS is now known as GenghisKen
AlbireoX has quit [Ping timeout: 240 seconds]
krawchyk has joined #ruby
specialGuest has joined #ruby
<davidcelis>
NoMethodError
robert- has quit [Ping timeout: 244 seconds]
<libryder>
method_defined?(:method_name) works
<libryder>
but respond_to? doesn't
dahan has quit [Quit: dahan]
resure_away has joined #ruby
ringotwo has joined #ruby
<lectrick>
Is there a shell that is written in Ruby?
<koshii>
Why would you want a shell to necessarily be in pure Ruby?
<libryder>
you still have all the regular bash stuff, this just gives you the ability to type ruby directly in the terminal
<koshii>
Wait so it's like irb but also does bash-y stuff?
<koshii>
I guess that is pretty cool if so.
w400z has quit []
bluOxigen has joined #ruby
bluOxigen has quit [Changing host]
bluOxigen has joined #ruby
<Xeago>
unfortunate it is dead
<vectorshelve>
carloslopes: hi dude :)
<carloslopes>
vectorshelve: hi man
w400z has joined #ruby
Guest40369 has joined #ruby
<davidcelis>
dude doesn't even look at the Issues
mrdodo has joined #ruby
<davidcelis>
theres one that's been open (and fixed) for three years about mongrel as a dependency
c0rn_ has joined #ruby
ShadowBelmolve_ has joined #ruby
ShadowBelmolve__ has joined #ruby
beneggett has joined #ruby
erichmenge has joined #ruby
<Muz>
Just as well, things like that Should Not Be.
<fowl>
libryder: you could use pry and dot commands to get to the shell
jorge_ has quit [Remote host closed the connection]
<davidcelis>
Muz: The Issue was to remove it as a dependency
<davidcelis>
Muz: Which is was, very shortly after. Issue is still open
<davidcelis>
it*
<davidcelis>
three years
<Muz>
davidcelis: I was commenting that it's just as well that it's dead.
<davidcelis>
ah
<davidcelis>
I don't see what the problem with rush as an idea is
<davidcelis>
Why not provide higher-level syntax for the shell?
<vectorshelve>
carloslopes: got my ping ?
<fowl>
idk why not
voodoofish430 has joined #ruby
<carloslopes>
vectorshelve: yea.. but wait a moment, i'm busy here
<Muz>
It may just be me, but the more abstraction layers there are between me and the underlying system, the more wary I get of the potential for something to go tits up.
ph^ has quit [Remote host closed the connection]
c0rn_ has quit [Ping timeout: 264 seconds]
Russell^^ has joined #ruby
<vectorshelve>
carloslopes: sure :)
<fowl>
tis up! whoop whoop!
billyjoe23 has joined #ruby
<billyjoe23>
what is this syntax? @forums.map(&:id)
recycle has quit [Remote host closed the connection]
xiaotian has joined #ruby
<billyjoe23>
i've not seen the &:id before
<fowl>
billyjoe23: & sends a param as a block
kaleido has quit [Quit: leaving]
c0rn_ has joined #ruby
<fowl>
billyjoe23: since :id isnt a block, :id.to_proc gets called
kaleido has joined #ruby
Xeago has quit [Remote host closed the connection]
Guest40369 has quit [Remote host closed the connection]
ShadowBelmolve__ has quit [Remote host closed the connection]
macmartine has quit [Quit: Computer has gone to sleep.]
<billyjoe23>
"It’s an incredibly elegant use of coercion and of closures." cool thx
_andre has joined #ruby
<_andre>
hello
<_andre>
does anyone know how to get an IO object from a C file descriptor in an extension?
<aarwine>
Regarding "gem generate_index" - The docs seem to be a bit confusing with the option "no-" you can append to either flag. --legacy seems to generate marshall indexes, does --no-legacy not generate marshall indexes? What does it do? --modern stats that it generates indexes for gems newer than 1.2; is that a gem version or a ruby version? Is that still marshall or is that the yaml indexes?
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
kvirani has joined #ruby
johnjohnson has quit []
myth17 has quit [Quit: Leaving]
juarlex_ has joined #ruby
aantix has joined #ruby
aantix has quit [Read error: Connection reset by peer]
jorge_ has joined #ruby
recycle has joined #ruby
jrist is now known as jrist-gym
c0rn__ has joined #ruby
aantix has joined #ruby
recycle has quit [Remote host closed the connection]
juarlex has quit [Ping timeout: 246 seconds]
billyjoe23 has left #ruby [#ruby]
<vectorshelve>
carloslopes: done bro ?
<davidcelis>
broooo
saschagehlich has joined #ruby
<vectorshelve>
davidcelis: :D
socialist has quit [Ping timeout: 268 seconds]
workmad3_ has joined #ruby
pskosinski has quit [Read error: Connection reset by peer]
macmartine has joined #ruby
snearch has quit [Quit: Verlassend]
c0rn__ has quit []
baphled_ has joined #ruby
chimkan_ has quit [Ping timeout: 256 seconds]
Taichouchou2 has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
<infinitiguy>
is there an easy way to turn on print statements in ruby? What I envision is something like debug = True and then would I do my print/puts statements like if !debug.nil? print "This should only be printed if debug = True
<infinitiguy>
or is there a better way to go about this
baphled has quit [Ping timeout: 244 seconds]
<libryder>
you can override puts
<libryder>
or print
elhu has joined #ruby
<infinitiguy>
there may be cases where some puts/prints might need to be displayed, but I want to be able to turn on additional information that should only be seen if given a switch (or something else similar).
<infinitiguy>
im not sure what you mean by override puts/print
sendoushi has quit [Remote host closed the connection]
jjbohn is now known as jjbohn|afk
resure_away has quit [Remote host closed the connection]
LorentzFactor has quit [Ping timeout: 264 seconds]
LorentzFactor has joined #ruby
Taichouchou2 has joined #ruby
dekroning has joined #ruby
<Spitfire>
infinitiguy, why not just add a new function called "debug".
<Spitfire>
Instead of using puts("hi there")
<Spitfire>
Use debug("hi there")
<lectrick>
holy crap, I just added instance methods and ivars to a symbol. I feel dirty
<Spitfire>
And in the debug function, check the debug var, if it's true, then print the statement, otherwise ignore it/log it.
jorum has joined #ruby
recycle has joined #ruby
<Spooner>
infinitiguy : Use log4r perhaps rather than rolling your own?
recycle has quit [Remote host closed the connection]
twigmorewelsh has quit [Quit: Leaving...]
twigmorewelsh has joined #ruby
chimkan_ has joined #ruby
t27415 has quit [Remote host closed the connection]
RichieEvan has joined #ruby
<infinitiguy>
with log4r would I be able to log as well as print to console output for only a subset of data?
t28068 has joined #ruby
<aarwine>
It's become quite obvious that --modern and --no-modern do drastically different things. Why do the docs not address it?
<Spitfire>
infinitiguy, fairly sure you should just be able to make multiple instances of the class for that, although I'm not familiar with log4r.
<Spooner>
It is more that you can set debug level and it shows only those levels. Thus #debug, #info, #error, etc, write out ouput but can be turned on and off based on logging level. A gem can't magically know which variables you want to turn on and off logging for though.
workmad3_ has quit [Ping timeout: 260 seconds]
<Spooner>
infinitiguy : Yeah, you can have multiple logger instances (I have one per class, for example, so I get the class name output as well as the debug message).
joephlius has joined #ruby
timonv has joined #ruby
csquared has joined #ruby
<Spooner>
"with log4r would I be able to log as well as print to console output" - log4r isn't about logging to a file, but managing your logging output text. It is up to you where the output goes (console and/or file).
havenn has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 244 seconds]
chrisja has joined #ruby
adambeynon has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby
vectorshelve_ has joined #ruby
vectorshelve_ is now known as newnick
wallerdev has joined #ruby
rudyl313 has quit [Ping timeout: 245 seconds]
paolooo has quit [Ping timeout: 245 seconds]
<lectrick>
i was experimenting with some dsl ideas for specifying permissions on files and wrote this monstrosity in an irb: def r;:read;end; def w;:write;end; [:read,:write].each{|f| f.send(:eval, "def &(o); self.to_s + ' and ' + o.to_s; end")}; puts r&w; puts w&r
__class__ has quit [Ping timeout: 240 seconds]
newnick has quit [Client Quit]
johnjohnson has joined #ruby
kiyoura has quit [Ping timeout: 245 seconds]
vectorshelve_ has joined #ruby
<matti>
lectrick: Files as on a file system?
vectorshelve has quit [Ping timeout: 245 seconds]
<lectrick>
Although I couldn't find a way to tell a single symbol instance to include or extend a module with that method.
vectorshelve_ has quit [Client Quit]
<lectrick>
matti: Yes, but the example doesn't show that part
<matti>
Why would you do it?
vectorshelve has joined #ruby
<matti>
Isn't that done already?
<matti>
I might be missing bigger picture.
aantix_ has joined #ruby
<lectrick>
Yes matti, it's called "rush", but I did not like the incredible verbosity of this syntax in it: file.access = { :user_can => :read_and_write, :group_and_other_can => :read }
havenn has quit [Ping timeout: 244 seconds]
__class__ has joined #ruby
<matti>
Aaa...
<matti>
Rush <3
<matti>
A real user of Rush
<matti>
Alive.
<lectrick>
I'm considering it
<lectrick>
Haven't been a "user" per se yet
<lectrick>
But I'm getting tired of bash
<lectrick>
and I keep typing ruby in my bash shell lol
aantix_ has quit [Read error: Connection reset by peer]
<matti>
;]
jerrad has joined #ruby
aantix_ has joined #ruby
paul_andrew has joined #ruby
<lectrick>
Anyway there can easily be a DSL for file access permissions that could look like this: file.access[user: r&w, group: r, world: r]
rippa has joined #ruby
<lectrick>
And that would be fucking sweeter than typing file.access = { :user_can => :read_and_write, :group_and_other_can => :read }
<matti>
Hehe
aantix has quit [Ping timeout: 264 seconds]
aantix_ has quit [Read error: Connection reset by peer]
krz has joined #ruby
<matti>
Cut it down to: file.set(:access, rw)
<lectrick>
I know 'r' and 'w' could easily be instances of some SubPermission object or something, just wondered if I could actually add methods and attributes to a symbol and I could.
aantix has joined #ruby
<matti>
Cut it down to: file.set(:owner, 'root', 'root')
<lectrick>
matti: yeah, exactly
<matti>
'rw' of course.
aantix has quit [Read error: Connection reset by peer]
qwerxy has quit [Ping timeout: 244 seconds]
<lectrick>
I mean, I could easily define rw, rwx, r, rx, etc etc but I was trying to be clever :)
aristidesfl has quit []
<matti>
lectrick: Clever == Over-Engineered ;p
<lectrick>
haha
<matti>
lectrick: KISS man, KISS.
<vectorshelve>
whats the differrne between print and pretty print ?
andrewstewart has joined #ruby
techsurvivor has quit [Read error: Connection reset by peer]
<matti>
vectorshelve: Get complex data structure and use print, and then pp.
<matti>
vectorshelve: ;]
<matti>
vectorshelve: Difference will be apparent immediately.
ScottNYC has joined #ruby
resure_away has joined #ruby
<vectorshelve>
matti: I know.. but verbally how do you define the difference :)
<Mon_Ouie>
pretty print's output is pretty
<Mon_Ouie>
print's output isn't
<matti>
Haha
<matti>
Mon_Ouie nailed it.
statarb3 has quit [Ping timeout: 264 seconds]
indian has joined #ruby
indian has quit [Changing host]
indian has joined #ruby
SirRamonGabriel has joined #ruby
burgestrand has joined #ruby
<TTilus>
file.owner = :root
<TTilus>
file.owner.access = :rw
ZachBeta has joined #ruby
geekbri has quit [Remote host closed the connection]
<matti>
TTilus: But also better than the default ;]
recycle has quit [Remote host closed the connection]
TheShadowFog has quit [Quit: pls respond]
enyo has quit [Read error: No route to host]
blazed has joined #ruby
bluOxigen has joined #ruby
chimay has quit [Remote host closed the connection]
<shevy>
RubyOS will be simple
<vectorshelve>
is anybody good in design patterns here... I wanted to do Pacman game in ruby and had confusion regarding how to go about designing the whole game
<shevy>
c
<shevy>
c .
<shevy>
c . .
<shevy>
c . . .
bluenemo has quit [Remote host closed the connection]
<shevy>
do you see where pacman has to go now vectorshelve
<shevy>
vectorshelve, I think it is simplest to start write the game map first
<shevy>
can_move or not can_move (on the game field
<shevy>
can have yellow dot
<vectorshelve>
shevy: as for the mechanize i found it interesting.. i wrote one myself.. http://pastie.org/4611933 but coincidentally the site servers are down :)
<matti>
I love git
<vectorshelve>
shevy: dude yellow dot is about the UI :D
<vectorshelve>
matti: me too
pu22l3r_ has quit [Remote host closed the connection]
<shevy>
vectorshelve if you have a ncurses layout, you would have a dot too
seich- is now known as seich
<shevy>
the dots determine whether the game was won or not
<vectorshelve>
shevy: hmm.. but in a brief..how can I define the entire thing.. any doc or something for reference
<shevy>
@game_over = true if @n_dots.empty?
<vectorshelve>
shevy: so u mean dot class has the count and it keeps reducing ?
<shevy>
where @n_dots would be an array counting the dots (or perhaps even better, query a game field class directly)
<shevy>
I dunno... the simpler, the better
answer_42 has joined #ruby
<shevy>
I usually use a @game_over variable though
<burgestrand>
lectrick: symbols are stored in a special way in MRI, same with fixnums, true, false, and nil
<burgestrand>
fsck
<shevy>
lol :)
<lectrick>
well, those last 4 things you mentioned all have object ID's
<shevy>
hmm why is there no unix command called "lol"
<lectrick>
>> def lol; "LOL!"; end; lol
<al2o3cr>
(String) "LOL!"
schaerli has quit [Ping timeout: 260 seconds]
<shevy>
well it should do something a tiny bit more useful than that
<lectrick>
>> lol #does it keep state?
<al2o3cr>
-e:1:in `eval': undefined local variable or method `lol' for main:Object (NameError), from -e:1:in `eval', from -e:1:in `<main>'
<Hanmac>
symbols and fixnums are bitshifted, true false, nil (and undefined) are constant values
pu22l3r has joined #ruby
Eldariof-ru has joined #ruby
deryl has quit [Quit: deryl]
mosheee has joined #ruby
mosheee has quit [Changing host]
mosheee has joined #ruby
geekbri has joined #ruby
blazed is now known as crixus
statarb3 has quit [Quit: Leaving]
__class__ has joined #ruby
moshee has quit [Ping timeout: 245 seconds]
Morkel has quit [Quit: Morkel]
recycle has quit [Remote host closed the connection]
elhu has quit [Quit: Computer has gone to sleep.]
melvinram has joined #ruby
<melvinram>
How do I do this encoding? I could do force_encoding but that supposedly doesn't change the underlying bytes so that seems like a bad thing, right?
xyon has joined #ruby
<melvinram>
I have a CSV file that is ASCII-8Bit encoding and I'm trying to encode it into UTF-8. string.encode('UTF-8') gives this error: Encoding::UndefinedConversionError: "\xA0" from ASCII-8BIT to UTF-8
<melvinram>
sorry, that went out in reverse order
<matti>
8bit ASCII?
resure_away is now known as resure
resure is now known as resure_away
<melvinram>
ASCII-8BIT
<Mon_Ouie>
Ruby calls the binary encoding ASCII-8BIT
jorge_ has quit [Remote host closed the connection]
recycle has quit [Remote host closed the connection]
erichmenge has joined #ruby
Progster has joined #ruby
sailias has quit []
recycle has joined #ruby
recycle has quit [Remote host closed the connection]
jarek has joined #ruby
<shevy>
ruby ruby ruby
fermion has joined #ruby
<workmad3>
oooeeeoooeeeooo
pnkbst has joined #ruby
socialist has joined #ruby
t39517 has quit [Remote host closed the connection]
t39201 has joined #ruby
<workmad3>
shevy: great... you just reminded me that ruby is on lego rock band... now I'm gonna have to play it :P
<shevy>
I have a question
<shevy>
I often have stuff like
socialist is now known as explody
<shevy>
case user_input
<shevy>
when :foo
<shevy>
when 'bla'
<shevy>
here is my problem, I seem to switch between these two
khakimov has quit [Ping timeout: 245 seconds]
<shevy>
not in the same case menu, but in different case menus, in different files
<shevy>
HELP!
resure_away has quit [Remote host closed the connection]
wobr has joined #ruby
<shevy>
workmad3, lego rock? what is that... danish concert where guys play music and assemble things via lego blocks? :)
<Muz>
shevy: you always want to use strings, or symbols? "case user_input.to_sym" etc.
<workmad3>
Muz: ewww
enroxorz has quit [Quit: Leaving]
<workmad3>
Muz: arbitrary user input to symbol...
<Muz>
workmad3: well, he can turn it to a downcased string, or whatever the hell he likes. :p
<shevy>
Muz I dont know! I mean, yes, I can convert... but the thing is, I do not seem to follow any concise way
<shevy>
it is as if I randomly use one or the other :(
<shevy>
I dont like this
<Muz>
workmad3: what console do you have it on?
<workmad3>
Muz: wii
<Muz>
Oh.
khakimov has joined #ruby
axl_ has joined #ruby
pskosinski has quit [Remote host closed the connection]
Guest5516 has quit [Ping timeout: 240 seconds]
pskosinski has joined #ruby
<shevy>
workmad3, when you use case
<shevy>
do you use case for strings? or symbols or how
bradhe has joined #ruby
jbw has joined #ruby
<shevy>
I mean you can use them via /\d+/ but I find that I use this only very rarely compared to strings or symbols
wobr has quit [Client Quit]
becom33 has quit [Ping timeout: 245 seconds]
becom33_ has joined #ruby
<becom33_>
in ruby slop . doesnt it generate the help option automatically ?
maletor has quit [Quit: Computer has gone to sleep.]
jorge has quit [Remote host closed the connection]
<Mon_Ouie>
It can generate it automatically, but you had to pass it a flag for it to do so last time I checked
<Mon_Ouie>
Slop.parse args, :help => true do … end
<becom33_>
Mon_Ouie, can u show me a example . Im kinda confused
bluOxigen has quit [Ping timeout: 244 seconds]
<workmad3>
shevy: last time I used case (this afternoon) it was for exception class matching...
jorge has joined #ruby
ryan0x2 has quit [Remote host closed the connection]
PythonGirl has joined #ruby
<workmad3>
shevy: I'm not sure I have a 'typical' case in all honesty... I just use whatever I need... if possible I'll try and remove it and push it into inheritance and polymorphism
<shevy>
hmm ok
<shevy>
that last bit sounds curiously complicated :)
<workmad3>
sounds more complicated than it is :)
<shevy>
hey becom33_ !!!
<shevy>
becom33_ where have you been the last months!
<becom33_>
hay bro yea shevy kinda got stuck in between studies
<workmad3>
it's actually a nice way to remove complication, but it tends to be when you're doing case statements that switch on a type (or a proxy for a type)
recycle has joined #ruby
recycle has quit [Remote host closed the connection]
<workmad3>
you just push down the logic so that rather than having a big case statement, you instead just call a method on an object and the correct value will be returned depending on the type
<Mon_Ouie>
The idea is to use method calling instead of conditions to select what portion of code should be run
hadees has quit [Quit: hadees]
<workmad3>
^^
dmiller has quit [Remote host closed the connection]
minijupe has joined #ruby
<Hanmac>
but when you use a case without a statement in it, you will lose the right for Hanmac's support
wallerdev has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby
jorge has quit [Remote host closed the connection]
uris has quit [Read error: Connection reset by peer]
uris has joined #ruby
nanderoo has quit [Quit: Leaving.]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
mikepack has joined #ruby
paul_andrew has quit [Ping timeout: 265 seconds]
havenn has joined #ruby
senny has quit [Remote host closed the connection]
recycle has joined #ruby
recycle has quit [Remote host closed the connection]
jorge has joined #ruby
t39201 has quit [Remote host closed the connection]
cantonic has joined #ruby
t94607 has joined #ruby
pu22l3r has quit [Remote host closed the connection]
sepp2k1 has quit [Remote host closed the connection]
timoshin has quit [Remote host closed the connection]
<shevy>
Hanmac do you use string or symbols for case when stuff
sirish has joined #ruby
<Hanmac>
for internal symbols for external strings ...
<kenneth>
only really looking to support xterm 256 though, this is for a demo
<kenneth>
for a talk
__class__ has quit [Ping timeout: 260 seconds]
<kenneth>
there's ansi escape code for erase the line, no?
<RubyPanther>
I use ANSI color codes in xterm, they work fine
<kenneth>
i think i can hack it together with that
<shevy>
I'd really wish ruby-ncurses would be more fun
<RubyPanther>
curses is the rather obvious choice though
<shevy>
kenneth yes
<matti>
Or, simplicity.
<matti>
With readline.
<shevy>
kenneth you can kill the full line, then start again at most-left area
<matti>
Readline is dead simple for simple cli.
<kenneth>
keep everything the user is typing in a buffer for each char, if a new message comes in, erase line, print the message, print newline, and print whatever was in the user's buffer
recycle has quit [Remote host closed the connection]
s0ber has quit [Read error: Connection reset by peer]
<kenneth>
shevy: nope
<shevy>
I still dont know of a way to read in any key for ruby
<shevy>
like "left arrow key pressed" event
<shevy>
or "shift + left arrow key pressed" event
ryan0x2 has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
<kenneth>
shevy: it's not an input / output loop, it's output may happen while i'm typing, and should start printing at the second-to-bottom line
<shevy>
odd
<shevy>
that sounds complicated
recycle has joined #ruby
recycle has quit [Remote host closed the connection]
<fowl>
shevy: look at coolline
machty has quit [Ping timeout: 264 seconds]
s0ber has joined #ruby
<fowl>
kenneth: to achieve what you want you're going to need some kind of input loop, possibly even using select() on stdin
erichmenge has quit [Quit: Be back later]
<kenneth>
yeah
<kenneth>
hmm
<kenneth>
io streams are thread-safe right?
<Hanmac>
thread-safe? maybe, but Hanmac-safe? maybe not :P
zastern has joined #ruby
machty has joined #ruby
<fowl>
never tried. i have bad luck with threads
<zastern>
Anybody know if rbenv+ruby-build is working in mountain lion, currently? I was thinking of switching, but I don't want to rvm implode unless rbenv is actually working
qwerxy has quit [Quit: offski]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
<Hanmac>
you could build your own software on osx? i didnt know apple allowed that
verto|off is now known as verto
<RubyPanther>
zastern: just try it, they don't conflict you just comment out the rvm line in .profile or wherever
<zastern>
RubyPanther: hmm. I use zsh actually, but yeah ok, thanks.
jorge has quit [Remote host closed the connection]
<RubyPanther>
I didn't implode rvm until I'd been using rbenv for a few months
verto is now known as verto|off
Guedes is now known as Guest26352
* Hanmac
uses neigher rvm nor rbenv
<RubyPanther>
Actually I still didn't, I just used rm :)
jarek has quit [Quit: jarek]
Guedes0 is now known as Guedes
Guedes has quit [Changing host]
Guedes has joined #ruby
jarek has joined #ruby
<Hanmac>
xD RubyPanther yeah, rm is all you need :D
evangelion has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
Taichouchou2 has quit [Remote host closed the connection]
__class__ has joined #ruby
Russell^^ has quit [Quit: Russell^^]
SqREL has quit [Quit: Leaving]
x77686d_ has joined #ruby
Russell^^ has joined #ruby
<RubyPanther>
evangelion: it is not obvious what is actually even getting sent, so first figure out what data you're passing in exactly and then it should be easy enough to compare the APIs
reuf has quit [Quit: Leaving]
x77686d has quit [Ping timeout: 244 seconds]
x77686d_ is now known as x77686d
carloslopes has quit [Quit: Leaving.]
sailias has joined #ruby
<evangelion>
RubyPanther: in theory i sysread the packet on computer A and then i try to push it on the tun interface created on computer B
<evangelion>
and in fact it works on 1.8
paulovittor23 has quit [Remote host closed the connection]
elux has quit [Quit: Bye!]
<evangelion>
anyway
<evangelion>
let's check
cantbecool has quit [Quit: Computer has gone to sleep.]
pdtpatrick has quit [Quit: pdtpatrick]
pskosinski has joined #ruby
pu22l3r has quit [Read error: Operation timed out]
i0n has quit [Quit: Lost terminal]
Xeago has quit [Remote host closed the connection]
vjt has joined #ruby
dekroning has quit [Quit: leaving]
atmosx has joined #ruby
qwerxy has joined #ruby
kkimlabs has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
recycle has joined #ruby
recycle has quit [Remote host closed the connection]
qwerxy has quit [Client Quit]
sailias has quit [Ping timeout: 264 seconds]
invisime has quit [Quit: Leaving.]
GenghisKen has quit [Ping timeout: 245 seconds]
gfontenot has joined #ruby
t94607 has quit [Remote host closed the connection]
<lolzie>
Doesn't specifying ClassName.method for every single class method kinda violate the whole DRY principle?
kenneth has quit [Quit: kenneth]
<lolzie>
The redundancy must be a bit problematic when you decide to refactor/change the class name
<Mon_Ouie>
def self.foo
kenneth has joined #ruby
alanp has quit [Read error: Connection reset by peer]
recycle has quit [Remote host closed the connection]
<rking>
lolzie: Like Mon_Ouie is saying — within the context of a "class" definition, "self" == the class, so you can use it instead of the literal constant.
mneorr_ has quit [Remote host closed the connection]
<lolzie>
rking: awesome, knew there was a better alternative, thanks :)
saschagehlich has joined #ruby
<rking>
Mon_Ouie: I stole yo credit, son!!
<lolzie>
Stole it with style
mneorr has joined #ruby
Wizywig has joined #ruby
Majost has quit [Ping timeout: 250 seconds]
jorge has joined #ruby
jorge has quit [Remote host closed the connection]
fearoffish has quit [Quit: Computer has gone to sleep.]
kkimlabs has quit [Ping timeout: 245 seconds]
timonv has quit [Remote host closed the connection]
LorentzFactor has quit [Read error: Connection reset by peer]
wmoxam has quit [Ping timeout: 268 seconds]
CoverSlide has quit [Ping timeout: 252 seconds]
saschagehlich_ has joined #ruby
jorge has joined #ruby
qwerxy has quit [Quit: offski]
kenneth has quit [Read error: Connection reset by peer]
seanwash has quit [Quit: Leaving.]
kenneth has joined #ruby
saschagehlich has quit [Ping timeout: 252 seconds]
saschagehlich_ is now known as saschagehlich
adeponte has quit [Remote host closed the connection]
AlbireoX has joined #ruby
jenrzzz has joined #ruby
c0rn_ has joined #ruby
dmiller has joined #ruby
<pskosinski>
How can I so something like: echo "CONSTANT no_idea_how_many_chars def" | sed 's/CONSTANT \(.*\) def/\1/' ?
jorge has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
<pskosinski>
It will give me "no_idea_how_many_chars"
<pskosinski>
I can play with index etc… but there is a one method?
<jenrzzz>
is the no_idea_how_many_chars part going to have spaces in it?