apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste >3 lines of text on gist.github.com || Rails is in #rubyonrails || Log: http://irclog.whitequark.org/ruby
g_rotbart has joined #ruby
niklasb has quit [Read error: Operation timed out]
baroquebobcat has joined #ruby
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
blazes816 has quit [Quit: Leaving]
niklasb has joined #ruby
nari has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
igotnolegs has joined #ruby
vectorshelve has quit [Ping timeout: 245 seconds]
banisterfiend has quit [Ping timeout: 246 seconds]
shellox_ has quit [Ping timeout: 245 seconds]
Z_Mass has quit [Quit: Leaving]
blownapart has quit [Remote host closed the connection]
chriskk has quit [Ping timeout: 246 seconds]
Spooner has quit [Ping timeout: 252 seconds]
khakimov has quit [Ping timeout: 252 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Ping timeout: 244 seconds]
khakimov has joined #ruby
banisterfiend has joined #ruby
neku has quit [Read error: Connection reset by peer]
chriskk has joined #ruby
minijupe has joined #ruby
AndChat| has quit [Ping timeout: 250 seconds]
maletor has joined #ruby
nwest has joined #ruby
CodeVision has quit [Ping timeout: 248 seconds]
bricker88 has quit [Quit: Leaving.]
yugui_zzz is now known as yugui
CodeVision has joined #ruby
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
indian has quit [Read error: Connection reset by peer]
niklasb has quit [Read error: Operation timed out]
owned_ has quit [Read error: Connection reset by peer]
cloud|windoze has joined #ruby
guns has joined #ruby
GarethAdams has quit [Quit: Leaving...]
<guns> Is there a way to run the syntax checker `ruby -c` from within a running ruby interpreter (ie without shelling out)?
<guns> My guess is "no" since the syntax checking option is handled directly in process_options() in ruby.c
<guns> but perhaps someone has a clever trick
yonggu has joined #ruby
cloud|windoze1 has joined #ruby
cloud|windoze has quit [Ping timeout: 246 seconds]
emmanuelux has quit [Ping timeout: 246 seconds]
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
akem has joined #ruby
justsee has joined #ruby
kah_ has joined #ruby
kah_ has quit [Client Quit]
Stalkr_ has quit [Quit: Leaving...]
seanstickle has joined #ruby
undersc0re has quit [Quit: *poof*]
ryanf has joined #ruby
yugui is now known as yugui_zzz
etank has quit [Quit: WeeChat 0.3.8]
nari has quit [Ping timeout: 252 seconds]
etank has joined #ruby
mockra has joined #ruby
Draco_ has quit [Remote host closed the connection]
yoklov has joined #ruby
bricker88 has joined #ruby
bricker88 has quit [Client Quit]
zodiac1111 has joined #ruby
Draco_ has joined #ruby
alek_b has quit [Ping timeout: 248 seconds]
alek_b has joined #ruby
tommyvyo has joined #ruby
Cooper_ has joined #ruby
Draco_ has quit [Ping timeout: 244 seconds]
perry is now known as perryh_away
sdwrage has joined #ruby
mockra has quit [Remote host closed the connection]
sdwrage has quit [Client Quit]
yoklov has quit [Quit: computer sleeping]
apok has joined #ruby
akem has quit [Ping timeout: 240 seconds]
greasegum has joined #ruby
yoklov has joined #ruby
byronb has quit [Ping timeout: 255 seconds]
kedai has quit [Ping timeout: 246 seconds]
justsee has quit [Quit: Leaving...]
kedai has joined #ruby
yoklov has quit [Client Quit]
baroquebobcat has quit [Quit: baroquebobcat]
jimeh has quit [Ping timeout: 246 seconds]
oscardelben has joined #ruby
Draco_ has joined #ruby
justsee has joined #ruby
elvis4526 has joined #ruby
EPIK has quit []
RORgasm has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
<elvis4526> Is there something simpler then optparse to use in ruby?
<elvis4526> Something less pain in the ass
`brendan has quit [Read error: Connection reset by peer]
bglusman_ has joined #ruby
bradhe has joined #ruby
RORgasm has quit [Ping timeout: 246 seconds]
<seanstickle> elvis4526: Thor, maybe
<seanstickle> elvis4526: depends on what kind of thing you are making
<elvis4526> I just want a SIMPLE way to do, when i put this flag, you do this.
bglusman has quit [Ping timeout: 265 seconds]
<elvis4526> Something like getopts in bash would be nice
<elvis4526> and I can play with the argument with $optarg
<seanstickle> Check the ARGV would be the simplest
<elvis4526> I did not see any doc about it
<seanstickle> You know what ARGV is?
baroquebobcat has joined #ruby
<elvis4526> I read that it is like optparse, but less powerful
<seanstickle> Uh, you might want to read it again.
Hanmac1 has joined #ruby
<elvis4526> There is no beginner tutorial about this
<seanstickle> If you don't know ARGV, you'll be in a weird situation writing Ruby apps
<elvis4526> I know a little bit what it is, but I just don't understand
Hanmac has quit [Ping timeout: 252 seconds]
Cooper_ has quit [Ping timeout: 255 seconds]
yoklov has joined #ruby
mockra has joined #ruby
<elvis4526> In fact, all the argument are in an array and the arraw is name ARGV?<
ken_barber has joined #ruby
_justin has joined #ruby
<seanstickle> Yup
<seanstickle> ARGument Values
<seanstickle> => ARGV
<elvis4526> Hmm... Okay. It is a little bit more clear now. So how do i do to make it print "prout" when he see the -i argument for instance
linoj has quit [Read error: Connection reset by peer]
<elvis4526> It is this kind of thing I want to do
linoj has joined #ruby
greasegum has quit [Ping timeout: 250 seconds]
L-----D has joined #ruby
Cooper_ has joined #ruby
mpereira has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
bradhe_ has joined #ruby
bradhe has quit [Ping timeout: 244 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
davidpk has joined #ruby
tewecske has quit [Quit: Leaving.]
cpruitt has quit [Quit: cpruitt]
mxweas_ has joined #ruby
banisterfiend has quit [Remote host closed the connection]
mxweas_ has quit [Client Quit]
mockra has quit [Remote host closed the connection]
seanstickle has quit [Quit: seanstickle]
banisterfiend` has joined #ruby
ryanf has quit [Ping timeout: 265 seconds]
hunglin has joined #ruby
jfelchner has joined #ruby
meskyanichi has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
Vert has quit [Ping timeout: 252 seconds]
AlbireoX has joined #ruby
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
baroquebobcat has quit [Quit: baroquebobcat]
baroquebobcat has joined #ruby
greasegum has joined #ruby
cloud|windoze1 has quit [Quit: Leaving.]
crankycoder has joined #ruby
noganex has quit [Read error: Operation timed out]
hunglin has quit [Quit: Leaving.]
tomb has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
hunglin has joined #ruby
noganex has joined #ruby
<rking> Hrm. Is there a clean idiom to say "if x.nil? or <there was an exception>" ?
<rking> I'm drawing a bit of a blank trying to make my "rescue" chunk the same as my "else" chunk
<rking> I could say fail 'adsf' if x.nil? then the rescue would catch it, but that seems silly.
awarner has joined #ruby
patient has quit [Quit: leaving]
zeromodulus has quit [Remote host closed the connection]
Draco___ has joined #ruby
Draco_ has quit [Ping timeout: 248 seconds]
Boondox has quit [Quit: Leaving]
icy` has quit [Quit: .: adios :.]
apok has quit [Quit: apok]
Cooper_ has quit [Ping timeout: 265 seconds]
Cooper_ has joined #ruby
Draco___ has quit [Ping timeout: 240 seconds]
nari has joined #ruby
mockra has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
linoj has quit [Quit: linoj]
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
TheHypnotist-lhs has quit [Ping timeout: 265 seconds]
kidoz has quit [Read error: Connection reset by peer]
g_rotbart has quit [Remote host closed the connection]
Sweet-P has quit [Remote host closed the connection]
Sweet-P has joined #ruby
kidoz has joined #ruby
mpereira has quit [Ping timeout: 250 seconds]
* mdszy feels like he just made the most awesome thing in the world, even though it's just something really simple.
verto is now known as verto|off
<mdszy> http://hastebin.com/timavuruho.c in case anyone wants to see, an extremely simple C function for counting the digits in an integer using recursion
iamjarvo has joined #ruby
stefanp_ has joined #ruby
wataken44 has quit [Remote host closed the connection]
Draco_ has joined #ruby
Draco_ has quit [Read error: Connection reset by peer]
wataken44 has joined #ruby
Draco_ has joined #ruby
stefanp has quit [Ping timeout: 265 seconds]
vlad_starkov has joined #ruby
greasegum has left #ruby ["Leaving"]
Progster has joined #ruby
awarner has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 244 seconds]
IceDragon has quit [Ping timeout: 265 seconds]
Draco_ has quit [Ping timeout: 252 seconds]
justsee is now known as justsee|away
g_rotbart has joined #ruby
<dekz> Anyone had any problems with starting up ruby objects which have a trap call in a multithreaded environment on jruby? I'm getting no such method errors on __jtrap from Ruby Kernel
IceDragon has joined #ruby
jeff_sebring has quit [Quit: Leaving]
Cooper_ has quit [Ping timeout: 252 seconds]
obryan1 has quit [Quit: Konversation terminated!]
mdszy_ has joined #ruby
mdszy has quit [Disconnected by services]
tcopp_ has joined #ruby
mdszy_ is now known as mdszy
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
justsee|away has quit [Quit: Leaving...]
baroquebobcat has joined #ruby
tcopp_ has left #ruby [#ruby]
Cooper_ has joined #ruby
baroquebobcat has quit [Client Quit]
maek has quit [Quit: Leaving.]
<dekz> https://gist.github.com/3120249 Here is what I'm tlaking about
chrxn_ has joined #ruby
kedai has quit [Ping timeout: 248 seconds]
tommyvyo has joined #ruby
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
maek has joined #ruby
tcopp_ has joined #ruby
hunglin has quit [Quit: Leaving.]
maek has quit [Client Quit]
tcopp_ has left #ruby [#ruby]
tcopp_ has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
tcopp has quit [Disconnected by services]
tcopp_ has left #ruby [#ruby]
CaptainJet has joined #ruby
philips_ has quit [Excess Flood]
RORgasm has joined #ruby
emmanuelux has joined #ruby
Guest44160 has quit [Ping timeout: 248 seconds]
pedm has joined #ruby
philips_ has joined #ruby
savage- has joined #ruby
RORgasm has quit [Ping timeout: 246 seconds]
mucker has quit [Ping timeout: 240 seconds]
dhodgkin has quit [Read error: Operation timed out]
Draco_ has joined #ruby
bradhe_ has quit [Remote host closed the connection]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
perryh_away is now known as perryh
vitoravelino is now known as vitoravelino`afk
perryh is now known as perry
baphled has quit [Ping timeout: 248 seconds]
ananthakumaran has joined #ruby
mockra has quit [Remote host closed the connection]
mmsequeira_ has joined #ruby
nai has joined #ruby
mrdodo has joined #ruby
mahmoudimus has joined #ruby
webusnix has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
mmsequeira has quit [Ping timeout: 252 seconds]
banisterfiend` has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
headius has joined #ruby
krz has quit [Quit: krz]
nai has quit [Remote host closed the connection]
tomb has joined #ruby
mxweas_ has joined #ruby
Banistergalaxy has joined #ruby
td123 has quit [Ping timeout: 244 seconds]
vitor-br has quit [Read error: Connection reset by peer]
mdszy has quit [Quit: nini]
tomb has quit [Client Quit]
pedm has quit [Quit: pedm]
mockra has joined #ruby
diegoviola has quit [Quit: leaving]
null- has left #ruby [#ruby]
eph3meral has joined #ruby
mockra has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
mockra has joined #ruby
j01 has quit [Quit: j01]
\13k has quit [Quit: Leaving]
khakimov has joined #ruby
CaptainJet has quit []
headius has quit [Quit: headius]
wargasm has quit [Read error: Connection reset by peer]
cdavaz has quit [Quit: cdavaz]
_justin has quit [Ping timeout: 250 seconds]
cdavaz has joined #ruby
Jackneill has joined #ruby
Jackneill is now known as Guest75326
L-----D has quit [Ping timeout: 246 seconds]
elrond255 has joined #ruby
nai has joined #ruby
iamjarvo has quit [Quit: Computer has gone to sleep.]
RichieEvan has quit [Quit: RichieEvan]
andrewhl has joined #ruby
dhruvasagar has joined #ruby
luckyruby has joined #ruby
banisterfiend has joined #ruby
xpot-station has quit [Ping timeout: 244 seconds]
nai has quit [Remote host closed the connection]
xscc has joined #ruby
emmanuelux has quit [Remote host closed the connection]
<elrond255> I'm having a syntax problem. in https://gist.github.com/3120460 I've copied the class I'm using (validator.rb), the test driver I wrote (validate_test.rb) and the result of executing the command (validate_test.rb.txt). Can anyone point me to the mistakes that are causing the error?
_justin has joined #ruby
g_rotbart has quit [Remote host closed the connection]
xscc has quit [Client Quit]
nai has joined #ruby
oscardelben has quit [Quit: oscardelben]
guns has quit [Ping timeout: 255 seconds]
RichieEvan has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
igotnolegs has joined #ruby
igotnolegs has quit [Client Quit]
savage- has quit [Remote host closed the connection]
Cooper_ has quit [Read error: Connection reset by peer]
Cooper_ has joined #ruby
igotnolegs has joined #ruby
Icoin has quit [Quit: Icoin]
nai has quit [Remote host closed the connection]
AndChat| has joined #ruby
Banistergalaxy has quit [Ping timeout: 248 seconds]
vertroa has quit [Read error: Connection reset by peer]
Ethan has joined #ruby
thecreators has quit [Quit: thecreators]
vertroa has joined #ruby
mockra has quit [Remote host closed the connection]
hemanth has joined #ruby
Cooper_ has quit [Read error: Connection reset by peer]
Cooper_ has joined #ruby
mockra has joined #ruby
andrewhl has quit [Remote host closed the connection]
noyb has joined #ruby
cantonic_ has joined #ruby
lion|wrk has left #ruby ["WeeChat 0.3.8"]
mockra has quit [Ping timeout: 248 seconds]
cantonic has quit [Ping timeout: 255 seconds]
cantonic_ is now known as cantonic
mockra has joined #ruby
crankycoder has quit [Remote host closed the connection]
Draco_ has quit [Ping timeout: 246 seconds]
Progster has quit [Ping timeout: 260 seconds]
thatRD has quit [Read error: Operation timed out]
syamajala has joined #ruby
artOfWar has joined #ruby
artOfWar_ has quit [Read error: Connection reset by peer]
artOfWar_ has joined #ruby
tonini has joined #ruby
csprite has joined #ruby
mxweas_ has quit [Quit: Computer has gone to sleep.]
artOfWar has quit [Ping timeout: 240 seconds]
davidpk has quit [Quit: Computer has gone to sleep.]
mxweas_ has joined #ruby
mockra has quit [Remote host closed the connection]
<elrond255>
<elrond255> I'm having a syntax problem. in https://gist.github.com/3120460 I've copied the class I'm using (validator.rb), the test driver I wrote (validate_test.rb) and the result of executing the command (validate_test.rb.txt). Can anyone point me to the mistakes that are causing the error?
justsee has joined #ruby
mockra has joined #ruby
mrdodo has quit [Remote host closed the connection]
nai has joined #ruby
elrond255 has quit [Quit: elrond255]
mockra has quit [Remote host closed the connection]
yoklov has quit [Quit: computer sleeping]
RichieEvan has quit [Ping timeout: 244 seconds]
bglusman_ has quit [Remote host closed the connection]
cdavaz is now known as Ontolog
justsee has quit [Quit: Leaving...]
krz has joined #ruby
Draco_ has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
baroquebobcat has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
thatRD has joined #ruby
oxyxian has quit [Quit: oxyxian]
greyEAX has quit [Read error: Connection reset by peer]
nai has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
syamajala has quit [Remote host closed the connection]
ananthakumaran has quit [Quit: Leaving.]
RORgasm has joined #ruby
yugui_zzz is now known as yugui
a_a_g has joined #ruby
yugui is now known as yugui_zzz
RORgasm has quit [Ping timeout: 246 seconds]
undersc0re has joined #ruby
headius has joined #ruby
Ethan has quit [Read error: Operation timed out]
kylemcgill has quit [Remote host closed the connection]
undersc0re is now known as Ethan
vertroa has quit [Read error: Connection reset by peer]
vertroa has joined #ruby
headius has quit [Ping timeout: 255 seconds]
csprite has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0.1/20120614114901]]
mxweas_ has quit [Quit: Computer has gone to sleep.]
grantbdev has quit [Quit: Leaving]
IceDragon has quit [Quit: ~ヾ(^∇^)]
savage- has joined #ruby
alek_b has quit [Remote host closed the connection]
alek_b has joined #ruby
alek_b has quit [Remote host closed the connection]
alek_b has joined #ruby
alek_b has quit [Remote host closed the connection]
twinturbo has joined #ruby
alek_b has joined #ruby
ianbrandt has quit [Quit: ianbrandt]
lolmaus has joined #ruby
minijupe has quit [Quit: minijupe]
JohnBat26 has joined #ruby
mxweas_ has joined #ruby
federic has joined #ruby
brg has joined #ruby
Bosma has joined #ruby
Ionic` has quit [Ping timeout: 246 seconds]
yxhuvud has joined #ruby
Cooper_ has quit [Ping timeout: 248 seconds]
djdb has joined #ruby
nej has joined #ruby
<brg> hi i am beginner in ruby
<brg> any idea of knowing gud ruby skills?
Hanmac1 is now known as Hanmac
MOTION4_ has joined #ruby
arturas has joined #ruby
nej has quit [Client Quit]
tagrudev has joined #ruby
<brg> Hanmac: i have tried this one .. nice quick start!!
wallerdev has quit [Quit: wallerdev]
<brg> but i really want to dig more onto ruby
subbyyy has quit [Quit: Leaving.]
justsee has joined #ruby
<brg> like multi-threading, inheritance,
<brg> etc
<brg> or any hidden ruby concepts!!
<Hanmac> http://www.ruby-lang.org/en/documentation/ << there is more to read
<brg> ok Hanmac thnks for help will check others too!!
timonv has joined #ruby
<brg> hope it would help!
Cooper has joined #ruby
ananthakumaran has joined #ruby
MOTION4_ has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
fridim_ has joined #ruby
subbyyy has joined #ruby
tvw has joined #ruby
zodiac1111 has quit [Ping timeout: 240 seconds]
kylemcgill has joined #ruby
kylemcgill has quit [Remote host closed the connection]
lolmaus has quit []
maletor has quit [Quit: Computer has gone to sleep.]
Chryson has quit [Quit: Leaving]
subbyyy has quit [Quit: Leaving.]
maletor has joined #ruby
fridim_ has quit [Ping timeout: 246 seconds]
hoelzro|away is now known as hoelzro
wagle has quit [Ping timeout: 264 seconds]
ryanf has joined #ruby
<banisterfiend> ryanf: hey bro
wagle has joined #ruby
thecreators has joined #ruby
bigkevmcd has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
maletor has quit [Quit: Computer has gone to sleep.]
<ryanf> hey brah
Gavilan has left #ruby [#ruby]
wagle has quit [Ping timeout: 246 seconds]
MOTION4 has joined #ruby
lolmaus has joined #ruby
wagle has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
dangerousdave has joined #ruby
kidoz has quit [Quit: Ухожу я от вас]
zodiac1111 has joined #ruby
GarethAdams has joined #ruby
timonv has quit [Remote host closed the connection]
zommi has joined #ruby
Cache_Money has quit [Ping timeout: 244 seconds]
sepp2k has quit [Remote host closed the connection]
Rochefort has joined #ruby
elvis4526 has quit [Remote host closed the connection]
Draco_ has quit [Ping timeout: 255 seconds]
tvw has quit [Remote host closed the connection]
zodiac1111 has quit [Ping timeout: 244 seconds]
gtuckerkellogg has joined #ruby
mrdodo has joined #ruby
workmad3 has joined #ruby
nilg has joined #ruby
tagrudev has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 255 seconds]
gilead has joined #ruby
mneorr has joined #ruby
Jan_ has joined #ruby
tagrudev has joined #ruby
Jan_ has left #ruby [#ruby]
Draco_ has joined #ruby
DefV has joined #ruby
tagrudev has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
tagrudev has joined #ruby
dhruvasagar has quit [Client Quit]
tagrudev has quit [Remote host closed the connection]
tagrudev has joined #ruby
mobilegamelabs has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
nopolitica has quit [Quit: Leaving.]
apeiros_ has joined #ruby
Draco_ has quit [Read error: Connection reset by peer]
TPFC-SYSTEM has joined #ruby
Draco_ has joined #ruby
d3vic3 has joined #ruby
afd__ has quit [Read error: Connection reset by peer]
mengu has joined #ruby
tagrudev has quit [Read error: Connection reset by peer]
arturas has quit [Remote host closed the connection]
mohits has joined #ruby
mohits has joined #ruby
tagrudev has joined #ruby
eph3meral has quit [Quit: Leaving]
lovelace_ has joined #ruby
dangerousdave has quit [Quit: Linkinus - http://linkinus.com]
noyb_ has joined #ruby
RORgasm has joined #ruby
noyb_ has quit [Client Quit]
noyb has quit [Quit: Leaving]
flippingbits has joined #ruby
dhruvasagar has joined #ruby
Morkel has joined #ruby
hashar has joined #ruby
RORgasm has quit [Ping timeout: 246 seconds]
maahes has quit [Ping timeout: 252 seconds]
locriani_ has joined #ruby
bradhe has joined #ruby
Tearan has quit [Ping timeout: 248 seconds]
Cooper has quit [Ping timeout: 240 seconds]
Sweet-P has quit [Remote host closed the connection]
locriani has quit [Ping timeout: 246 seconds]
wobr has joined #ruby
Sweet-P has joined #ruby
Cooper has joined #ruby
mrdodo has quit [Remote host closed the connection]
Eldariof-ru has joined #ruby
arturas_ has joined #ruby
arturaz has quit [Read error: Connection reset by peer]
Ethan has quit [Quit: *poof*]
elhu has joined #ruby
huhongbo has joined #ruby
locriani has joined #ruby
locriani_ has quit [Ping timeout: 256 seconds]
<huhongbo> seems ruby 1.9.3 remove URI::REGEXP::UNSAFE ,any replace ?
Criztian has joined #ruby
thecreators has quit [Remote host closed the connection]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
Criztian has quit [Remote host closed the connection]
mobilegamelabs has quit [Quit: http://youtu.be/Tu-mSpFmx7g http://www.MGGGGG.com/ap Angry Polygon - my first Android/iOS/Mac game!]
maahes has joined #ruby
Tearan has joined #ruby
jimeh has joined #ruby
Tricks_ has quit [Read error: Connection reset by peer]
kanzeon has joined #ruby
newb_ has joined #ruby
newb_ has quit [Client Quit]
<kanzeon> #join coffeescript
noyb has joined #ruby
zodiac1111 has joined #ruby
snearch has joined #ruby
tagrudev has quit [Remote host closed the connection]
noyb has quit [Client Quit]
noyb has joined #ruby
luckman212_ has quit [Ping timeout: 248 seconds]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
wobr has quit [Read error: Connection reset by peer]
wobr has joined #ruby
andoriyu_ has joined #ruby
Draco_ has quit [Remote host closed the connection]
tagrudev has joined #ruby
andoriyu has quit [Ping timeout: 246 seconds]
mxweas_ has quit [Quit: Computer has gone to sleep.]
stefi has joined #ruby
<stefi> ciao
<stefi> !list
stefi has left #ruby [#ruby]
nari has quit [Quit: Ex-Chat]
Drakx has quit [Quit: leaving]
luckyruby has quit [Remote host closed the connection]
etehtsea has joined #ruby
Drakx has joined #ruby
blacktulip has joined #ruby
<kiela> anyone from australia?
bluOxigen has joined #ruby
akem has quit [Ping timeout: 246 seconds]
Sweet-P has quit [Remote host closed the connection]
GarethAdams has quit [Quit: Leaving...]
Sweet-P has joined #ruby
<Quadlex> kiela: Yup
<kiela> Quadlex: got a minut to talk ?
mxweas_ has joined #ruby
mxweas_ has quit [Client Quit]
jhunter has quit [Ping timeout: 244 seconds]
cezar has joined #ruby
BiHi has joined #ruby
noyb has quit [Quit: leaving]
tvw has joined #ruby
cezar has quit [Client Quit]
federic has quit [Remote host closed the connection]
jhunter has joined #ruby
Shahor has joined #ruby
fixl has joined #ruby
_bart has quit [Quit: _bart]
king313 has joined #ruby
<Quadlex> kiela: Sure
wrapids has joined #ruby
workmad3 has joined #ruby
huhongbo has quit [Remote host closed the connection]
_justin has quit [Ping timeout: 240 seconds]
Tearan has quit [Ping timeout: 248 seconds]
Cooper has quit [Ping timeout: 248 seconds]
<king313> syn to all freaks of the sexiest language ever
maahes has quit [Read error: Operation timed out]
mneorr has quit [Ping timeout: 248 seconds]
<apeiros_> ack
timonv has joined #ruby
lkba has quit [Ping timeout: 248 seconds]
GarethAdams has joined #ruby
kevinfagan has joined #ruby
Guest51050 has quit [Ping timeout: 244 seconds]
chrxn_ has quit [Ping timeout: 265 seconds]
Berglund has quit [Quit: Computer died.]
tatsuya_o has joined #ruby
tiripamwe has joined #ruby
EddieS has joined #ruby
MOTION4 has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
EddieS is now known as Guest93229
AndChat| has quit [Remote host closed the connection]
lovelace_ has left #ruby ["Leaving"]
<wrapids> scaffolding is rediculous.
tayy has joined #ruby
<apeiros_> speeling
Tearan has joined #ruby
<wrapids> ridiculous*
<ij> rediculous is ridiculous.
thone has joined #ruby
<ij> Are ruby's sdl binding docs up to date?
maahes has joined #ruby
<banisterfiend> ij: why would u wanna use sdl ? :)
<ij> Why not? What would I want to use instead?
<banisterfiend> ij: there's hardware accelerated alternatives like gosu
<banisterfiend> ij: because it's old fashioned and slow :)
<ij> Well I haven't done much graph, ever. So at the time I did everyone told me to use sdl, because it's "Easy".
<ij> So I remembered sdl. :]
<ij> But I'll checkout gosu. :]
<banisterfiend> gosu is easier
<banisterfiend> iirc sdl is a thin wrapper about the C
<ij> Yeah and a sorta broken one.
Ethan has joined #ruby
<fowl> ij, ruby-sdl-ffi is in better shape than ruby-sdl
<ij> What's ffi?
<ij> foreign function interface?
<oddmunds> yes
<fowl> foreign function interface i think
<fowl> gosu is still better tho
<ij> Badass, it looks like I'll use gosu. :]
thone_ has quit [Ping timeout: 248 seconds]
noyb has joined #ruby
akem has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
Spooner has joined #ruby
djdb has quit [Remote host closed the connection]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
tagrudev has quit [Remote host closed the connection]
hemanth has joined #ruby
tayy_ has joined #ruby
tayy has quit [Ping timeout: 250 seconds]
noyb has quit [Quit: leaving]
hemanth has quit [Read error: Connection reset by peer]
noyb has joined #ruby
hemanth has joined #ruby
tuxaddicted has joined #ruby
tuxaddic1ed has joined #ruby
nemesit has joined #ruby
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
Mchl has joined #ruby
yugui_zzz is now known as yugui
zz_chrismcg is now known as chrismcg
mahmoudimus has joined #ruby
joma has joined #ruby
<hakunin> does somebody know why to_yaml inserts \n chars into long strings in ruby 1.9.3?
<hakunin> and how to make it stop
<joma> test
<joma> Hello everyone. How to get more information about RSpec's 'get' method?
<joma> i couldn't find the code from github...
trivol has joined #ruby
heeton has joined #ruby
joma has quit [Quit: Leaving]
<hakunin> here's an example, but need to do some scrolling sideways: https://gist.github.com/09a5d7cd214be45f6248
joma has joined #ruby
noyb has quit [Ping timeout: 246 seconds]
heisenmink has joined #ruby
<joma> thank you Muz. But that is not the get method I search. I'm searching a controller helper methods: 'get', 'post' to make a request
danguita has joined #ruby
heeton has quit [Ping timeout: 244 seconds]
heeton has joined #ruby
<workmad3> joma: they aren't from rspec, which is your problem
_justin has joined #ruby
<workmad3> joma: they're from rails' controller testing methods (which are, I believe, built on the rack-test methods)
danielpunt has joined #ruby
<workmad3> joma: you can pretty much just reason about them though... '<method> <action>, <options>'
<joma> <workmad3> Oh, thank you. I understand. I want to know more about than method
<joma> about that method, what parameter I can pass **
MOTION4 has joined #ruby
RORgasm has joined #ruby
heeton has left #ruby [#ruby]
tagrudev has joined #ruby
perry is now known as perryh_away
<Muz> Sounds rails related at this point joma, you're better off asking in #rubyonrails
RORgasm has quit [Ping timeout: 246 seconds]
ZachBeta has joined #ruby
tagrudev has quit [Remote host closed the connection]
cresso has left #ruby [#ruby]
Berglund has joined #ruby
Shrink has quit [Read error: Connection reset by peer]
Shrink has joined #ruby
_bart has joined #ruby
tagrudev has joined #ruby
freeayu has joined #ruby
mongag has joined #ruby
tagrudev has quit [Remote host closed the connection]
Cooper has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
gry has quit [Quit: ZNC - http://znc.in]
tagrudev has joined #ruby
workmad3 has joined #ruby
<_bart> Hi I get "`downcase': invalid byte sequence in UTF-8" when I try to downcast a large chunk of data.
Rochefort has quit [Remote host closed the connection]
Cooper has quit [Ping timeout: 240 seconds]
<_bart> how do I force it to work?
<hoelzro> _bart: is your data actually UTF-8?
<apeiros_> you either specify the correct encoding
<apeiros_> or you remove the offending bytes
<apeiros_> because either what you have is not utf-8, or the utf-8 you have is broken
<_bart> #<Encoding:UTF-8>
bluenemo has joined #ruby
<apeiros_> _bart: yes, that's what *you* tell ruby that your string is
<apeiros_> ruby does not (and can not) detect the encoding of a string by its own.
<_bart> no the string I'm down casing might have chinese characters of weird stuff like that, I don't mind if they don't downcase along.
<apeiros_> that's not the point
<_bart> it's a Nokogiri node
<_bart> that I call .to_s upon
danguita has quit [Ping timeout: 248 seconds]
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
<apeiros_> the point is that your text contains byte sequences that are *not* valid utf-8. so I repeat: either your string does *not* contain utf-8, so you shouldn't tell ruby it was. or your string contains broken utf-8.
<apeiros_> if it is the latter, you'll have to devise a clean-up strategy.
fermion has joined #ruby
bluenemo has quit [Remote host closed the connection]
mobilegamelabs has joined #ruby
Speed has quit [Remote host closed the connection]
wrapids has quit [Ping timeout: 240 seconds]
<_bart> apeiros_: isn't there a quick and dirty clean up method?
<apeiros_> _bart: if you don't know what you want then there is none.
<apeiros_> since String#downcase will only downcase A-Z, you can force_encode to binary and downcase that.
mdstunthamster has joined #ruby
<apeiros_> but that doesn't relieve you from having to learn and understand how encodings work.
myth17 has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
myth17 has quit [Changing host]
myth17 has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<shevy> hehe
myth17 has left #ruby [#ruby]
<_bart> apeiros_: but I mean, the string is always different, what should I do?
<Muz> Run your string through a sanitizer, or clean up method that outputs valid UTF-8, or change the encoding that Ruby thinks your string is.
<apeiros_> _bart: you should figure out what encoding your string is
<apeiros_> and you should figure out, why it is broken
<apeiros_> there's no plain-jane recipe for that kind of things.
tatsuya_o has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
monkegjinni has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
danguita has joined #ruby
cloud|windoze has joined #ruby
tatsuya_o has quit [Read error: Connection reset by peer]
tatsuya_o has joined #ruby
<_bart> apeiros_: this does work: valid_string = ic.iconv(untrusted_string + ' ')[0..-2]
<_bart> apeiros_: but what is the equivalent
pk1001100011 has joined #ruby
cloud|windoze is now known as totochan
abdulkarim is now known as LalTopi
AlbireoX has quit [Remote host closed the connection]
<_justin> is there any way to prevent quoting of symbols in hashes of an array on to which .to_json is applied??
<hoelzro> _justin: you mean the hash keys?
<_justin> yea
<_justin> the hash keys gets quoted
<hoelzro> by the JSON spec, they must be quoted
<_justin> can it be overridden ??
<shevy> Encoding is a recipe for frustration
<hoelzro> _justin: it's part of the specification.
<hoelzro> unquoted hash keys would not be valid JSON
<yxhuvud> _justin: why do you want to produce broken json?
<hoelzro> shevy: indeed
<_justin> kendoui loves it
JohnBat26 has joined #ruby
<_justin> yxhuvud: its widget can accept only json of for key:"value" not "key":"value"
<hoelzro> _justin: that's not JSON.
dhruvasagar has quit [Ping timeout: 248 seconds]
<yxhuvud> then the widget is broken. I'd suggest you file a bug report.
dhruvasagar has joined #ruby
schaerli has joined #ruby
<shevy> hmm does anyone know why mirb does not know about load() or require() ?
<_justin> yxhuvud: isn't this a valid json? http://pastie.org/4265279
hashar has quit [Quit: I am a manual virus, please copy me to your quit message.]
<Spooner> _justin : JSON doesn't support symbols. You either need to use a serialisation that does support symbols or, after you load, either convert the hash or use a hash that allows you to reference string keys with symbols.
ixti has joined #ruby
<_justin> Spooner: will try, thnx
<Spooner> What are you trying to do, exactly?
<Spooner> Oh, right, interact with Kendo UI
<fowl> you can use symbols in yaml
<fowl> :key: value
<Spooner> fowl: Yes, but the external app requires normal json, so I am not sure why _justin was asking for symbols to be preserved in the .to_json.
<fowl> o
<_justin> yea, Spooner maybe i got the concept they stated there wrong, i dont think a product like kendoui can rip-off the concept json
<_justin> fowl: wen i feed data into the widget it should be key:"value"
seitensei has quit [Remote host closed the connection]
<Spooner> What widget exactly?
<_justin> they use the key to populate data
<_justin> grid
<Spooner> That isn't too specific. Are you interfacing with KendoUI directly or do you have a Ruby binding?
<_justin> directly
<_justin> i dont know about any rb binding for it
<fowl> you're saying that something that has nothing to do with ruby, requires you to use symbols?
<Spooner> .to_json produces valid json, so don't worry about it.
reuf has joined #ruby
<_justin> fowl: just to prevent key to get enclosed in quotes
<_justin> maybe the word symbol is not apt
tuxaddic1ed has quit [Read error: Operation timed out]
<Spooner> The data there isn't json - that is javascript. It will be converted into json, just like our Ruby hash { x: "y"}.to_json will become '{"x":"y"}'
<ij> When you create super-self-explanatory methods, do you put articles in their names, e.g. def can_have_a_weasel?
tuxaddicted has quit [Read error: Operation timed out]
trivol_ has joined #ruby
<fowl> i would go with can_has_weasels? that way you can anger grammar nazis
<shevy> lol
<shevy> ij: the problem is that the extra words often don't make the method read better
<Spooner> You don't usually. So you use have_a_weasel? or awake? rather than is_awake? or can_have_a_weasel?
<shevy> ij: whenever possible, try to be as short as possible
<shevy> now in this example
<shevy> _a is not that long
<shevy> but I have had examples where the method itself was already way too long, so adding more to it would make it only worse
<_justin> Spooner: yea, i tried to inject json directly, it is generating trouble
trivol has quit [Ping timeout: 248 seconds]
trivol_ is now known as trivol
<Spooner> _justin: There are a hundred other things that could be going wrong other than that the json is invalid. No idea how/what you are doing though.
tuxaddicted has joined #ruby
tuxaddic1ed has joined #ruby
jjang_ has joined #ruby
justsee has quit [Ping timeout: 250 seconds]
<_justin> Spooner: got it r8, the issue was caused coz i tried to inject json data as such
jjang_ has quit [Remote host closed the connection]
Guerrero has joined #ruby
nemesit|osx has joined #ruby
jjang has quit [Ping timeout: 252 seconds]
<JonnieCache> ij: ignore them, name your methods what you want
<JonnieCache> especially if theyre going to go in html templates or something
<JonnieCache> or a dsl
<fowl> ij, donno, can_has_weasels?
heisenmink has quit [Quit: Leaving]
<fowl> dont listen to him
nemesit has quit [Ping timeout: 265 seconds]
<fowl> use can_has_weasels?
<JonnieCache> maybe not can_has_weasels?
<fowl> he's a detractor, sent here to discourage you
<ij> fowl: haha
BiHi has quit [Quit: Computer has gone to sleep]
<ij> I wanted opinion. I got it. :]
<ij> Another #ruby's success story.
<JonnieCache> i like being able to write things like `user.can_edit? post`
<Spooner> Why you are applying weasels to some things and not to others is another question entirely.
KDr2 has joined #ruby
BiHi has joined #ruby
<JonnieCache> forget being as short as possible. use a proper editor.
<JonnieCache> you will be happy when you come back in 12 months and you can actually read the code
<ij> That makes no sense.
<ij> Having a auto-completion doesn't make me want to make giant method names.
<ij> And the long one just sometimes make the code visibly unparsable.
<JonnieCache> i didnt say "be as long as possible" just dont cut down on method names for the sake of keystrokes, its a false economy
Criztian has joined #ruby
richardStokes has joined #ruby
<JonnieCache> otherwise you may as well go back to the days of 8.3 filenames
<ij> ha
<richardStokes> anyone know a nice clean way of getting the first n digits from a large integer? i.e. get 123 from 1234567
<ij> I remember that I was five or something and dad told me that I can't make filenames longer than that.
nemesit|osx has quit [Quit: Linkinus - http://linkinus.com]
verto|off is now known as verto
nemesit has joined #ruby
KDr2 has quit [Remote host closed the connection]
LalTopi has quit [Ping timeout: 246 seconds]
nemesit has quit [Quit: Leaving...]
artm has joined #ruby
LalTopi has joined #ruby
<fowl> richardStokes, i would be lazy and int.to_s[0,3]
Sweet_P has joined #ruby
<richardStokes> thanks, that was what I was going to do until I realized that it was actually more appropriate to store the data as a string and not an integer. Thanks anyway
verto is now known as verto|off
Sweet-P has quit [Ping timeout: 250 seconds]
verto|off is now known as verto
grafthez has joined #ruby
Icoin has joined #ruby
<shevy> hehehe
<shevy> strings are quite more useful in ruby
<shevy> "123"+"123" could only mean to append two strings, consistently
<shevy> "123"+"123".to_i could not work as information would be lost. ruby can't pick a preference here randomly
<shevy> hmm
<shevy> perhaps it could make a biased favour towards strings... or integers, optionally, if set via shebang-flag or some other way
<shevy> I'd love to have such a flag to omit "end"
mengu has quit [Read error: Operation timed out]
freeayu has quit [Ping timeout: 246 seconds]
<Mon_Ouie> I though you hated indentation-based languages?
<Mon_Ouie> thought*
mengu has joined #ruby
<JonnieCache> shevy: write a preprocessor for ruby that converts significant whitespace into do-end
<JonnieCache> i double dare you
yonggu has quit [Quit: yonggu]
freeayu has joined #ruby
<shevy> haha
<shevy> Mon_Ouie: yeah, from a conceptual point of view indeed. I dont think a programming language, or the parser, should care about indentation at all
<shevy> but from looking at my own code at times, I feel that things could be more elegant when I could omit "end"
<shevy> JonnieCache: what I never understood why python required both a ':' and also indent. "def foo():, newline,INDENT"
<shevy> before that I always thought it would need only indentation
<Spooner> I do sort of feel that end is unnecessary sugar too. I'd consider a preprocessor, but then I'd also need new editor highlighters and no-one else could edit my code without also having them. Shame.
<Spooner> And yes, the : seems unnecessary too.
<shevy> yeah, indent isn't the panacea either :( I think guido once said that this would be the main thing he would change if he could redo python completely once or?
akem has quit [Ping timeout: 244 seconds]
<Mon_Ouie> In this case, yes, I think it wouldn't be hard to write a parser for just def foo() — but usually you'd need a token to know where you could find an indented block
<Mon_Ouie> (In that case, the closed paren works)
Rochefort has joined #ruby
roychri has joined #ruby
vlad_starkov has joined #ruby
MOTION4 has quit [Quit: Computer has gone to sleep.]
<roychri> Hello, I am trying to find the answer to the following issue but google keeps showing documentation about optional method parameters, which is not what I want. Is it possible with ruby to add optional values to a has, but inline. Ex: { :one => "1", :two => "2" if condition1, :three => "3" unless condition2 }
<roychri> I know this does not work (I tried).
<roychri> so maybe its possible but with a different syntax?
Targen has quit [Ping timeout: 252 seconds]
<roychri> maybe with {}.merge or something?
<Mon_Ouie> hash = {…}; hash[k1] = v1 if c1; hash[k2] = v2 unless c2
beilabs has quit [Quit: Leaving]
<Spooner> That isn't inline though, Mon_Ouie
<fowl> inlines not possible
<Mon_Ouie> It is with semi-colons
<Mon_Ouie> But doing everything in one-line is stupid anyway
<roychri> Mon_Ouie: : Thanks but the context is : <%= method "some param", :one => "1", :two => 2 %>
sapht has quit [Ping timeout: 245 seconds]
<roychri> and I only want :two to be added based on a condition
<fowl> thats bad design
<Mon_Ouie> What prevents you from doing that?
<roychri> Mon_Ouie: : Not doing EVERYTHING :)
<Spooner> Well, there is: {a:1}.tap {|h| h[:b] = 3 if c1 }.tap{|h| h[:c] = 5 if c2 }
<Spooner> Even though it is a little horrible.
<fowl> do you indend to check the conditions every time you access hash[:two] ?
<roychri> Spooner: : yeah, looks horrible. thnaks though
<fowl> intend
hemanth has quit [Read error: Connection reset by peer]
<roychri> Here is the real picture guys. <%= f.text_area :message, "data-action" => "richtext" if current_user.can_use_richtext?, :style => "width:500px" %>
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<Spooner> :one => "1", :two => condition1 ? "2" : nil, :three => condition2 ? "3" : nil
<roychri> Its a parameter to textarea helper (rails) but I want this textarea to use richtext only if the user can.
<roychri> Spooner: Thought about that
fearoffish has joined #ruby
hemanth has joined #ruby
<Mon_Ouie> You *can* store the hash in a variable for that
<roychri> Spooner: : I wantedto avoid data-action="nil" in my HTML. (if possible)
<roychri> Mon_Ouie: yeah, but that smells bad, maybe...
<roychri> hmmmmm
* roychri thinks
<Spooner> Yeah, I'd just build it elsewhere, ratehr than trying to inline it.
alup has quit [Ping timeout: 248 seconds]
alup has joined #ruby
niku4i has joined #ruby
RORgasm has joined #ruby
sapht has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
mdstunthamster has quit [Quit: Linkinus - http://linkinus.com]
tayy_ has quit [Ping timeout: 248 seconds]
tayy has joined #ruby
<roychri> Thanks!
<roychri> :)
roychri has quit [Quit: And that's the way the cookie crumbles!]
RORgasm has quit [Ping timeout: 246 seconds]
niku4i has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
SeySayux has quit [Ping timeout: 240 seconds]
Jake232 has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
verto is now known as verto|off
tatsuya_o has joined #ruby
Sweet_P has quit [Ping timeout: 260 seconds]
Sweet-P has joined #ruby
<_bart> okay so I have this regexp: (\<(/?[^\>]+)\>), how do I use it in gsub?
Jake232 has quit [*.net *.split]
vlad_starkov has quit [*.net *.split]
hemanth has quit [*.net *.split]
schaerli has quit [*.net *.split]
pk1001100011 has quit [*.net *.split]
Berglund has quit [*.net *.split]
ZachBeta has quit [*.net *.split]
_justin has quit [*.net *.split]
timonv has quit [*.net *.split]
andoriyu_ has quit [*.net *.split]
zodiac1111 has quit [*.net *.split]
brg has quit [*.net *.split]
alek_b has quit [*.net *.split]
thatRD has quit [*.net *.split]
artOfWar_ has quit [*.net *.split]
ringotwo has quit [*.net *.split]
radic has quit [*.net *.split]
mwilson_ has quit [*.net *.split]
tama has quit [*.net *.split]
classix has quit [*.net *.split]
blast_hardcheese has quit [*.net *.split]
amoe has quit [*.net *.split]
idoru has quit [*.net *.split]
alindeman has quit [*.net *.split]
sernin has quit [*.net *.split]
sei has quit [*.net *.split]
ashp has quit [*.net *.split]
Y_Ichiro has quit [*.net *.split]
zaiste has quit [*.net *.split]
Weems has quit [*.net *.split]
mahlon has quit [*.net *.split]
RubyPanther has quit [*.net *.split]
UNIXgod has quit [*.net *.split]
jmeeuwen has quit [*.net *.split]
jord has quit [*.net *.split]
rakm has quit [*.net *.split]
ping-pong has quit [*.net *.split]
ahuman has quit [*.net *.split]
thorncp has quit [*.net *.split]
Tasser has quit [*.net *.split]
tightwork has quit [*.net *.split]
tris has quit [*.net *.split]
rudle has quit [*.net *.split]
faulkner has quit [*.net *.split]
offby1 has quit [*.net *.split]
bnagy has quit [*.net *.split]
verto|off has quit [*.net *.split]
c0rn has quit [*.net *.split]
goraxe has quit [Read error: Connection reset by peer]
tama has joined #ruby
mfridh has joined #ruby
sernin has joined #ruby
Berglund has joined #ruby
awarner has joined #ruby
goraxe has joined #ruby
larissa has joined #ruby
<_bart> okay so I have this regexp: (\<(/?[^\>]+)\>), how do I use it in gsub? (netsplit)
<hoelzro> _bart: that looks like a Vim regex
alindeman has joined #ruby
Jake232 has joined #ruby
hemanth has joined #ruby
schaerli has joined #ruby
vlad_starkov has joined #ruby
pk1001100011 has joined #ruby
_justin has joined #ruby
ZachBeta has joined #ruby
timonv has joined #ruby
andoriyu_ has joined #ruby
zodiac1111 has joined #ruby
brg has joined #ruby
alek_b has joined #ruby
thatRD has joined #ruby
ringotwo has joined #ruby
radic has joined #ruby
artOfWar_ has joined #ruby
mwilson_ has joined #ruby
ashp has joined #ruby
classix has joined #ruby
amoe has joined #ruby
Weems has joined #ruby
sei has joined #ruby
jord has joined #ruby
Y_Ichiro has joined #ruby
zaiste has joined #ruby
mahlon has joined #ruby
RubyPanther has joined #ruby
jmeeuwen has joined #ruby
UNIXgod has joined #ruby
rakm has joined #ruby
ping-pong has joined #ruby
verto has joined #ruby
thorncp has joined #ruby
ahuman has joined #ruby
Tasser has joined #ruby
tightwork has joined #ruby
rudle has joined #ruby
tris has joined #ruby
faulkner has joined #ruby
offby1 has joined #ruby
bnagy has joined #ruby
c0rn has joined #ruby
ctor has quit [Excess Flood]
classix has quit [Max SendQ exceeded]
<workmad3> _bart: ye gods... please say you're not trying to 'parse' HTML or XML with a regex?
classix has joined #ruby
<workmad3> _bart: please, please, please say you're not...
alindeman is now known as Guest32778
blast_hardcheese has joined #ruby
<_bart> workmad3: it's just an example, I'm actually trying to parse a date from HTML
<workmad3> _bart: are you parsing the HTML first with something that's actually capable of doing so, not regex?
bier has quit [Remote host closed the connection]
<workmad3> _bart: or is your source data very tightly controlled?
<_bart> workmad3: yes, Nokogiri
<_bart> \
<workmad3> _bart: good :)
<_bart> :)
mobilegamelabs has quit [Quit: http://youtu.be/Tu-mSpFmx7g http://www.MGGGGG.com/ap Angry Polygon - my first Android/iOS/Mac game!]
<workmad3> _bart: ok, so now give the *actual* regex you're using please, not an example
<_bart> but now I got a div selected (it's a smart scraper), and now I need to look for a date in it
<JonnieCache> can can sometimes parse html with a regex. just not arbitrary html
richardStokes has quit [Quit: Leaving]
<JonnieCache> s/can can/you can
<workmad3> JonnieCache: hence why I asked if the source was very tightly controlled :)
hunglin has joined #ruby
<_bart> workmad3: I'm not so good at regexp, it's been awhile, so I still have to come up with the regexp
<JonnieCache> oh yeah
bier has joined #ruby
<workmad3> JonnieCache: because you can (as you said) process small subsets of HTML with regex :)
SeySayux has joined #ruby
<_bart> trying it here: http://regexpal.com/
<workmad3> I wouldn't call it parsing at that point
Progster has joined #ruby
<workmad3> _bart: rubular.com is better for ruby
peterhellberg has joined #ruby
<JonnieCache> try just pushing the whole string into Date.parse sometimes you can get away with that :)
<JonnieCache> probably not a good idea though
<_bart> the whole string is a lot of HTML ;)
<_bart> so probably a bad idea
<JonnieCache> i meant the content of the div that has the date
verto is now known as verto|off
<banisterfiend> anyone here ever had a blue margharita?
<_bart> JonnieCache: I know, but that's quite something too.
<_bart> JonnieCache: and the content of the div might also contain another div
<_bart> made my first regexp: ([0-9][0-9]-[0-9][0-9]-[0-9]+)
<_bart> catches 16-07-2012
<fowl> there is a code for numbers
<JonnieCache> \d
<workmad3> _bart: strip down the content you're processing as much as possible, and yes as fowl said, use the match groups for numbers etc
<workmad3> _bart: so (\d{1,2}-\d{1,2}
erichmenge has joined #ruby
<workmad3> -\d{2,4})
<workmad3> would capture 16-07-2012, but not 16-07-200000
<workmad3> (ignore the newline in the middle :) )
<_bart> I see
<JonnieCache> _bart: for reference nokogiri can return only the text content of a node without any descendent nodes
<workmad3> _bart: it basically all depends on what date formats you want to catch
<_bart> JonnieCache: that's why I just do div.to_s
snearch has quit [Quit: Verlassend]
<_bart> workmad3: yes I understand, thanks. I'll improve it a bit to catch all my formats
<JonnieCache> banisterfiend: dont think so
<_bart> I got a regexp cheatsheet
<JonnieCache> also: banisterfiend has ops now!
<JonnieCache> big in the game
abra has joined #ruby
<banisterfiend> JonnieCache: Yeah, im the big boss dog
<banisterfiend> 'a', actually, there's a number of ops now
awarner has quit [Remote host closed the connection]
`brendan has joined #ruby
<JonnieCache> banisterfiend: what makes it blue?
<banisterfiend> JonnieCache: haha, that's why i asked, i wanted to know :)
<_bart> so I have (\d{1,2}(-|\.)\d{1,2}(-|\.)\d{2,4}), and all my html in the var html, now how do I get the matches?
<_bart> ah .scan
<peterhellberg> _bart: I generally use the catches method
<JonnieCache> there are various ways to do it. hangovers from perl i think
kidoz has joined #ruby
danguita has quit [Ping timeout: 250 seconds]
grafthez has quit [Quit: Leaving]
<fowl> god a perl hangover has got to be the worst kind
<peterhellberg> Ehm, captures
<peterhellberg> "<div>2012-07-16</div>".match(/((\d{4})-(\d{2})-(\d{2}))/).captures #=> ["2012-07-16", "2012", "07", "16"]
<peterhellberg> Very contrived example though :)
baphled has joined #ruby
Criztian has quit []
verto|off is now known as verto
flippingbits has quit [Quit: flippingbits]
theRoUS has quit [Ping timeout: 252 seconds]
JohnBat26 has quit [Remote host closed the connection]
<peterhellberg> _bart: And yes, scan is probably your best bet if you have multiple dates in your input string
<_bart> peterhellberg: what does scan return?
<peterhellberg> An array of arrays
flippingbits has joined #ruby
gregorg has joined #ruby
<peterhellberg> "<div>2012-07-16</div><div>2001-01-01</div>".scan(/((\d{4})-(\d{2})-(\d{2}))/)
<peterhellberg> Would return [["2012-07-16", "2012", "07", "16"], ["2001-01-01", "2001", "01", "01"]]
ZachBeta has quit [Quit: Computer has gone to sleep.]
<_bart> peterhellberg: thanks!
<peterhellberg> But you probably just need the full date, right?
<peterhellberg> And then just parse it into a proper Data/Time object :)
emmanuelux has joined #ruby
flippingbits has quit [Client Quit]
MOTION4 has joined #ruby
<_bart> peterhellberg: yes using the [0][0]
DrShoggoth has quit [Read error: Connection reset by peer]
<_bart> peterhellberg: I have multiple regexpes that look for dates, how do I put the results all in the same "dates" variable?
<peterhellberg> _bart: In that case you won’t even need the extra captures
<fowl> peterhellberg, why did you add the extra stuff
<peterhellberg> fowl: It was just an example
jonathanwallace has quit [Remote host closed the connection]
<peterhellberg> (if you want multiple captures per match)
DrShoggoth has joined #ruby
<peterhellberg> _bart: Is there a reason why the dates have different formats? (User input?)
<_bart> peterhellberg: this is a tiny part of my smart scraper, it scrapes/parses html and the code is intelligent to understand the structure.
<peterhellberg> _bart: Ah, got it.
<_bart> so I can except any kind of format
<_bart> expect*
Stalkr_ has joined #ruby
jmeeuwen has quit [Ping timeout: 240 seconds]
JohnBat26 has joined #ruby
<peterhellberg> I’d write a single regex that accepts all the formats you want to support
prtksxna has joined #ruby
prtksxna has quit [Remote host closed the connection]
totochan has quit [Ping timeout: 265 seconds]
jxf has joined #ruby
<peterhellberg> I would also use ISO 8601 for output etc
gry has joined #ruby
<jxf> I have an array of strings. One of the elements in the array might be "foo". I want the value of the element that comes before "foo" if (1) there is a "foo" in the array, and (2) "foo" has an element before it (i.e. it's not the first thing in the array).
<peterhellberg> _bart: If you want to support wildly different date formats, then it might be a good idea to split it up in multiple parsers/regexen
<jxf> Is there a Ruby-ish way to pull that off?
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
<jxf> My solution winds up having a couple of `if`s.
<_bart> peterhellberg: yes that's what I want to do, but how to do that without turning into messy code?
luckman212 has joined #ruby
vjt has quit [Ping timeout: 272 seconds]
boredomist has quit [Ping timeout: 272 seconds]
Mez has quit [Ping timeout: 272 seconds]
<peterhellberg> _bart: I’d step through each regex/parser run and aggregate the results in some way (Probably a simple Array, but it could just as well push new dates on top of a redis list, etc)
<_bart> peterhellberg: alright
<hoelzro> jxf: what about index = array.index('foo'); previous = index && index != 1 ? array[index - 1] : nil
<peterhellberg> _bart: Are you also going to parse Time? (A whole can of worms considering how notoriously bad TZ-hints can be :)
croz has quit [Remote host closed the connection]
<_bart> peterhellberg: only interested in dates haha ;)
jmeeuwen has joined #ruby
<jxf> hoelzro: That looks wrong. It would return nil if 'foo' was the second thing in the array.
<peterhellberg> jxf: (i=array.index('foo'))>0?array[i-1] : nil
nemesit has joined #ruby
choffstein has quit [Remote host closed the connection]
boredomist has joined #ruby
GarethAdams has quit [Quit: Leaving...]
cloud|windoze has joined #ruby
rails has quit [Ping timeout: 272 seconds]
<jxf> peterhellberg: That looks right. I think I may have just found a better way, using take.
blueOxigen has joined #ruby
hunglin has quit [Quit: Leaving.]
<jxf> array.take(array.index 'foo').last
<jxf> (Take as many items as there are before 'foo', then pick the last one.)
bluOxigen has quit [Ping timeout: 248 seconds]
<jxf> I keep forgetting all these Enumerable methods exist. :P
krusty_ar has joined #ruby
<JonnieCache> Enumerable#sample is a good one
<peterhellberg> jxf: That will throw TypeError: no implicit conversion from nil to integer
CannedCorn has joined #ruby
Mez__ has joined #ruby
<peterhellberg> (If there isn’t a "foo" in the list)
rails has joined #ruby
<jxf> Ah, drats.
<jxf> You're right.
vjt has joined #ruby
<jxf> Guess that means it's `(i = array.index('foo')) ? array.take(i).last : nil` then.
<jxf> Which isn't that great.
<jxf> Oh well.
<peterhellberg> jxf: a2.take(a2.index("foo") || 0).last
<jxf> Ah, good call!
luckman212 has quit [Ping timeout: 248 seconds]
yugui is now known as yugui_zzz
<peterhellberg> jxf: You are welcome :)
<jxf> peterhellberg: Thanks. :D
ssspiff has joined #ruby
grekkos has joined #ruby
grekkos is now known as Guest61057
sspiff has quit [Ping timeout: 244 seconds]
Mez__ has quit [Client Quit]
grafthez has joined #ruby
flippingbits has joined #ruby
gry has quit [Quit: ZNC - http://znc.in]
<peterhellberg> Slow day at the office, pretty much everyone is on vacation :)
ctp has quit [Read error: Operation timed out]
<apeiros_> jxf: ary.each_cons(2).find { |x,y| y == "foo" }.first
<hoelzro> jxf: oops, I meant =!= 0
<apeiros_> oh, hm, needs guarding against find returning nil
<hoelzro> er, != 0
<JonnieCache> i need some way of remembering that each_cons actually means sliding_window
<apeiros_> meh, not as nice anymore:
<apeiros_> ["a","b","c","foox","d"].each_cons(2).find(proc{[nil]}) { |x,y| y == "foo" }.first
<JonnieCache> considering how many redundant aliases the stdlib has that seems an oversight
zodiac1111 has quit [Ping timeout: 240 seconds]
bruder has joined #ruby
<apeiros_> peterhellberg: same here. but sadly no slow day.
<peterhellberg> Such a hard life in a “socialist society” ;)
* apeiros_ is having fun writing a ruby API against exchange's EWS interface
<jxf> apeiros_: I wonder if that gets expensive with a big array since you wouldn't break early.
verto is now known as verto|off
<apeiros_> jxf: that one *does* break early
<apeiros_> that's the point of enumerators and find.
iamjarvo has joined #ruby
krz has quit [Quit: krz]
<jxf> Oh, I misread. `first` is just getting the first of each pair.
<jxf> Not the first of all the matches.
<peterhellberg> apeiros_: In Finland by any chance?
<apeiros_> jxf: the return value of the find is an array with [before_foo, "foo"]
<apeiros_> so you have to call .first on it to get before_foo
<apeiros_> but it does break on the first occurrence of that pattern
<jxf> Gotcha. Yes, that's what I meant by "first of each pair".
bruder has left #ruby [#ruby]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<apeiros_> peterhellberg: no, switzerland
jonathanwallace has joined #ruby
<peterhellberg> apeiros_: (I’ve only met one person that enjoys working with Exchange from Ruby… and he was working in Finland)
<peterhellberg> :)
KDr2 has joined #ruby
<apeiros_> peterhellberg: I'll rephrase: /me is having "fun" writing…
<apeiros_> iow, I'm swearing my ass off
gry has joined #ruby
<apeiros_> at least the docs are only bad, not horrible. and while the existing ruby libs are half-baked, they at least provide enough meat to scavenge and take short-cuts.
_justin has quit [Ping timeout: 240 seconds]
hashar has joined #ruby
lxsameer has quit [Max SendQ exceeded]
<apeiros_> the functionality stands already. all I'm left to do is come up with an actually enjoyable ruby API wrapper around that ugly EWS turd
rails has quit [Ping timeout: 272 seconds]
vlad_starkov has quit [Remote host closed the connection]
KDr2 has quit [Remote host closed the connection]
<peterhellberg> I’m leeching data from Google Analytics for internal processing… it’s pretty enjoyable with one of the Gattica forks and then a bunch of Map/Reduce queries in MongoDB :)
DefV has quit [Ping timeout: 272 seconds]
blueOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
DefV has joined #ruby
GarethAdams has joined #ruby
cakehero has joined #ruby
rails has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
verto|off is now known as verto
cloud|windoze has quit [Quit: Leaving.]
tommyvyo has joined #ruby
niklasb has joined #ruby
Foxandxss has joined #ruby
fantazo has quit [Remote host closed the connection]
mdszy has joined #ruby
linoj has joined #ruby
kidoz has quit [Quit: Ухожу я от вас]
fbernier has joined #ruby
obryan has joined #ruby
boredomist has quit [Ping timeout: 272 seconds]
t_j has left #ruby [#ruby]
boredomist has joined #ruby
yoklov has joined #ruby
vjt has quit [Ping timeout: 272 seconds]
oxyxian has joined #ruby
luckman212 has joined #ruby
vjt has joined #ruby
<_bart> peterhellberg: when I do Date.parse over a large string it returns the last date it found
<_bart> peterhellberg: or it skipped the very obvious first one, but that is unlikely
baphled has quit [Remote host closed the connection]
Axsuul has quit [Ping timeout: 255 seconds]
<_bart> peterhellberg: anyway, how to tell Date.parse to look for the first occurance?
statix_ has joined #ruby
hynkle has joined #ruby
Guest32778 has quit [Quit: /quit]
luckman212_ has joined #ruby
alindeman has joined #ruby
<peterhellberg> _bart: You are only supposed to parse a single date string
verto is now known as verto|off
<_bart> peterhellberg: well the large string contains more than one
<_bart> but I just want the first
luckman212 has quit [Ping timeout: 248 seconds]
<peterhellberg> Steps: find all the dates, step through them, parse each date, insert in list of parsed dates
<peterhellberg> Never pass "a large string" to Date.parse
nachtwandler has joined #ruby
<peterhellberg> Just a "string containing a date"
stat1x has quit [Ping timeout: 256 seconds]
Criztian has joined #ruby
yugui_zzz is now known as yugui
nachtwandler has quit [Client Quit]
<peterhellberg> _bart: You might also want to use the rfc2822, rfc3339 and strptime methods
My_Hearing has joined #ruby
Mon_Ouie has quit [Ping timeout: 265 seconds]
dhruvasagar has quit [Ping timeout: 250 seconds]
dhruvasagar has joined #ruby
zastaph has joined #ruby
Eldariof18-ru has joined #ruby
Eldariof-ru has quit [Ping timeout: 265 seconds]
j01 has joined #ruby
uris has joined #ruby
[Neurotic] has quit [Quit: Leaving]
dv310p3r has joined #ruby
Eldariof57-ru has joined #ruby
tayy has quit [Remote host closed the connection]
tzvi has joined #ruby
meskyanichi has quit [Ping timeout: 244 seconds]
Eldariof18-ru has quit [Ping timeout: 252 seconds]
mohits has quit [Read error: No route to host]
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
yoklov has quit [Quit: computer sleeping]
kedare has joined #ruby
jrbing has joined #ruby
fixl has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
cantbecool has joined #ruby
<_bart> peterhellberg: thanks
niklasb has quit [Ping timeout: 244 seconds]
<_bart> peterhellberg: another question, how do I strip \r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t at the beginning and edges of a string?
<gogiel> .strip?
<_bart> I want to remove all spaces, \r and \n and \t
<_bart> .strip is also for \r\n\t? I thought spaces only
geekbri has joined #ruby
<gogiel> strip is for whitespace
bluOxigen has quit [Ping timeout: 248 seconds]
<gogiel> white characters, sry
<cantbecool> _bart try using a gsub or regex
<_bart> hmm strip did work somehow!
<_bart> cool
mneorr has joined #ruby
<apeiros_> somehow…
udante has joined #ruby
<gogiel> magic
<apeiros_> awesome
<peterhellberg> _bart: Are you surprised that the method does what it is supposed to do? :)
<apeiros_> careful, maybe next time it will somehow do something else!
Targen has joined #ruby
<apeiros_> rand-lang
<apeiros_> does sometimes what you want
<workmad3> apeiros_: sounds like java2k
joast has joined #ruby
<apeiros_> that does sometimes what you want? o0
<peterhellberg> Łukasiewicz logic!
<joma> After ruby, I don't feel java as programming language. I think it is supposed to write poems
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
niklasb has joined #ruby
<apeiros_> shakespeare is for that…
TPFC-SYSTEM has joined #ruby
wangr has joined #ruby
<JonnieCache> java is the opposite of poetry
<apeiros_> (and that language is awesome and does indeed work just somehow)
nanderoo has joined #ruby
<joma> why? there is no even normal '==', you should write equals. I wont be surprised if on future versions of java instead of {} will be used begin, end
<workmad3> joma: I would be
<_bart> I'm having trouble with this regexp: http://rubular.com/r/DK6yhIAmUj
<apeiros_> java - an ode to the boilerplate?
<workmad3> joma: it's not backwards compatible :P
<_bart> it's also selecting 1223 but that's not part of the filesize
<apeiros_> _bart: hint, [0-9] == \d
<apeiros_> _bart: another hint: . is not 'dot', it is 'any character'
Doc_X has joined #ruby
<_bart> ah that did the trick
<_bart> apeiros_: thanks
dhruvasagar has quit [Ping timeout: 246 seconds]
tk_ has joined #ruby
raluxgaza has joined #ruby
<apeiros_> _bart: and last hint: use (?:expr) instead of (expr) if you don't want to capture a group.
dhruvasagar has joined #ruby
<apeiros_> /\d+(?:\.\d+)? (?:mb|gb|kb)/
<peterhellberg> _bart: ((\d+\.\d+|\d+) (mb|gb|kb)) Does this match what you want?
cantbecool has left #ruby ["Textual IRC Client: http://www.textualapp.com/"]
z1y has joined #ruby
<apeiros_> alternatively: http://rubular.com/r/6tINnzGSQI
<apeiros_> this captures size and unit
Targen_ has joined #ruby
<Spooner> My two-penneth: http://rubular.com/r/UiZOn2ipc5
<_bart> nice, it's pretty
Targen has quit [Ping timeout: 252 seconds]
<apeiros_> (\.|\,) --> [.,]
<apeiros_> within a [], you don't need to escape ., there it actually does mean 'dot'
Shrink has quit [Ping timeout: 255 seconds]
patient has joined #ruby
<_bart> okay cool
<_bart> it should also capture 2,1 mb
<_bart> but I got it now, thanks :)
joshman_ has joined #ruby
<apeiros_> Spooner: matches '200 beatles'
tayy has joined #ruby
<apeiros_> http://rubular.com/r/TpWL0G8Jtd using \b for good measure
<_bart> Alright, this is it: /(\d+(?:[.,]\d+)?) ?([ptgmk]?b)\b/i
<apeiros_> depending on the use-case, you may want a -? at the start (negative values), or even [+-]?
RORgasm has joined #ruby
<peterhellberg> Negative file size!? ;)
<_bart> it does already solve the problem :)
<apeiros_> differences
panpainter has joined #ruby
<apeiros_> hence "depending on the use-case"
<peterhellberg> Made me think of http://peetm.com/blog/?p=55
<Spooner> _bart: It isn't good enough! we could refactor it down to a 3-character regexp that matched all things in all situations...given enough time.
<peterhellberg> tl;dr: 0 byte program, sold for £5 per copy
<z1y> Hello. I try to launch a ssh tunnel in ruby: exec("ssh","remote -fN"). Unfortunately, my ruby script doesn't go in to background as expected. (The option "-fN" of ssh will bring ssh to background.). Please help.
<apeiros_> z1y: exec replaces the current process
<apeiros_> you may want to take a look at net/ssh. it's quite good.
<z1y> apeiros_: thank you. I will take a look
<peterhellberg> z1y: Yes, I’d also go for net/ssh it’s pretty nice
raluxgaza has quit [Remote host closed the connection]
liluo has joined #ruby
* apeiros_ still wants to replace his capistrano setup with a relatively simple ruby+net/ssh tool
<apeiros_> rather: ruby+net/ssh+bash
bier has quit [Read error: Operation timed out]
RORgasm has quit [Ping timeout: 246 seconds]
jayne has quit [Read error: Connection timed out]
<peterhellberg> apeiros_: I’m using Rake + rsync over ssh for one of my projects, it is working quite well :)
jayne has joined #ruby
<apeiros_> peterhellberg: the simplest setup I have uses git + post-receive hook
<apeiros_> + a single user with a single sudo-right (restart the webserver)
<peterhellberg> apeiros_: Yeah, I’ve done that too… but I don’t like to separate deployment from the application
<peterhellberg> From the application code that is
<apeiros_> the post-receive hook invokes a script in the app ;-)
<apeiros_> it's one or two lines. don't remember.
<apeiros_> and I think git-push in that setup is mostly comparable to an rsync
robbyoconnor has joined #ruby
<peterhellberg> Pretty much, except for being able to deploy to any server (even ones without access to the Git repo)
jsime has joined #ruby
<apeiros_> the server doesn't have access to the git repo. it only contains a clone of it. I push to the server.
<apeiros_> it's not pull
<apeiros_> and rsync & git-push both go (or can go) over ssh
hmans has joined #ruby
<peterhellberg> apeiros_: Yeah, that’s true
<peterhellberg> We generally use capistrano + capistrano-ext for most of our deployments (both Ruby and Java)
tayy has quit [Remote host closed the connection]
<peterhellberg> capistrano-ext is used for multiple deploy targets
tayy has joined #ruby
a_a_g has quit [Quit: Leaving.]
brg has left #ruby [#ruby]
<peterhellberg> Mina seems like a pretty neat deployment tool: http://nadarei.co/mina/
ryannielson has joined #ruby
zodiac1111 has joined #ruby
brjannc has quit [Quit: Leaving]
Shrink has joined #ruby
brjannc has joined #ruby
darthdeus has joined #ruby
jayne has quit [Quit: shutting down]
yugui is now known as yugui_zzz
caveat- has quit [Remote host closed the connection]
bier has joined #ruby
<gogiel> peterhellberg: looks promising
jumski has joined #ruby
<jumski> hi guys
yoklov has joined #ruby
jxf has quit [Ping timeout: 248 seconds]
<jumski> do you have any idea why a fresh rails app consumes ~360mb of memory?
<jumski> im using 1.9.3-p194, rails 3.2.6
g0bl1n has joined #ruby
bowlowni has joined #ruby
<hmans> Rails doesn't scale
<jumski> thought it could be somehow related to rvm, so i imploded it, removed all the gems and installed everything from scratch
<jumski> without success
<jumski> im talkin about development environment
sulaiman has joined #ruby
<jumski> yeah, but my is the only pc in the office that shows so high mem usage
<sulaiman> Greetings
<apeiros_> the dev env reloads itself upon every request. that may or may not be the cause.
<peterhellberg> jumski: You might have better luck in a RoR specific channel
<jumski> with same app
<apeiros_> run it in production setting and see if you experience the same resource load
<JonnieCache> jumski: rails can take a lot
<apeiros_> jumski: also #rubyonrails
z1y has left #ruby ["ISON zipp0"]
<JonnieCache> 360mb is too much
yoklov has quit [Client Quit]
<jumski> pererhellberg your right, sorry for bothering you here :)
<apeiros_> depends
<JonnieCache> my dev server is running a bloody massive eccommerce app and its at least 100mb less than that
<jumski> yeah but it is FRESH rails app
<peterhellberg> jumski: No problem :)
<apeiros_> while our really big app is considerably less than 360mb, I have a tiny app that consumes 600mb
<apeiros_> but that's because it keeps an index in memory…
<jumski> made by "rails new"
<apeiros_> that sounds unlikely
<apeiros_> there are memory profilers for ruby, though
<jumski> yeah
<jumski> tried gdb.rb
<jumski> but without luck
<jumski> got "Cannot access memory at address 0x29"
saaim has joined #ruby
<jumski> when run "ruby objects"
hunglin has joined #ruby
hunglin has quit [Client Quit]
schwap has quit [Read error: Operation timed out]
hunglin has joined #ruby
awarner has joined #ruby
bowlowni has quit [Ping timeout: 240 seconds]
<JonnieCache> jumski: what OS are you on? and where are you getting that 360mb figure from?
<JonnieCache> memory management is a complex issue
<jumski> ubuntu 12.04, to be more specific it is lubuntu (lxde variation)
<jumski> ive got it from resource column in htop
<saaim> hiiiii???????????
<mdszy> saaim: Calm down.
<mdszy> Goodness
<hmans> jumski, how many instances of the app are you running? Just one?
hunglin has left #ruby [#ruby]
<jumski> just one
<jumski> it is dev env
<JonnieCache> i cant remember which memory figure is the important one
<hmans> A naked Rails app should probably eat less than 50 MB per instance, or at least something roughly in that dimension.
<jumski> JonnieCache it is the right one
<JonnieCache> the private dirty set or something? all the memory management terms sound porn related
<hmans> That said, Rails is a pretty hefty beast.
<JonnieCache> increasingly so
<jumski> JonnieCache: lol
<saaim> what r u spech panjabi
sailias has joined #ruby
<jumski> but im pretty sure this figure is the right one, when i try with some other "not fresh app" it goes to 700mb, and my pc freezes when got spork, rails server, rake and console up and running (got 4gb of ram)
ephemerian has joined #ruby
Hanmac has quit [Ping timeout: 244 seconds]
<JonnieCache> shit man thats not right :)
<JonnieCache> i can do all that on my beatdown laptop at home just fine
<saaim> euby
<jumski> any ideas where to look for ore how to get that gdb.rb thing running ?
<saaim> ruby
tonini has quit [Remote host closed the connection]
<jumski> JonnieCache: yeah me too, never had a problem like this before
ackz has joined #ruby
<jumski> i feel like screwing up this ubuntu install and making a new one, feel really hopeless :p
<shevy> \o/
<JonnieCache> try it with an earlier version of rails perhaps?
<jumski> so you guys are my last resort :P
<JonnieCache> 3.1.6 rather than 3.2.6
<jumski> it is a nice idea
verto|off is now known as verto
bbttxu has joined #ruby
vjacob has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
<JonnieCache> also try using the thin server rather than the default webrick if youre not already
<JonnieCache> webrick sucks, but tbh it shouldnt have that effect
<saaim> kon sa idea
<jumski> that is not webserver related
panpainter has quit [Quit: leaving]
tayy has quit [Remote host closed the connection]
<jumski> console or any other rails-enviroment-dependent thing is going to eat 360mnb
<jumski> mb*
<JonnieCache> use some profiling tool that logs object allocation. most likely something somewhere is creating a bazillion objects that it doesnt need
saaim has left #ruby [#ruby]
<JonnieCache> most ruby, especially rails perf issues are due to too many objects
<jumski> rails do you have such a tool?
<jumski> tried memperf, not 1.9.3-compatible
MatthewGA has joined #ruby
<peterhellberg> jumski: rails profiler
reuf has quit [Quit: Leaving]
<jumski> checkin'
<jumski> is it a gem or smth?
fuleo has joined #ruby
bowlowni has joined #ruby
Hanmac has joined #ruby
<JonnieCache> theres NewRelic but thats a big fancy thing you have to sign up for
hunglin has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
<JonnieCache> free and very good, but they send you overly optimized silicon valley style marketing emails all the time
<jumski> hah Jonnie
BiHi has quit [Read error: Connection reset by peer]
<JonnieCache> i should really just ask them to stop
<jumski> fresh 3.1.6 app is 58mb
<JonnieCache> aha!
<jumski> :>
MOTION4 has quit []
croz has joined #ruby
<JonnieCache> you should still be able to run the latest version though, just find what got added and then turn it off or tweak it or whatever
brasten has joined #ruby
ssspiff has quit [Remote host closed the connection]
bigoldrock has joined #ruby
RORgasm has joined #ruby
My_Hearing is now known as Mon_Ouie
bowlowni has quit [Ping timeout: 248 seconds]
BiHi has joined #ruby
bowlowni has joined #ruby
Ionic` has joined #ruby
strife25 has joined #ruby
bbttxu has quit [Quit: bbttxu]
Targen_ has quit [Ping timeout: 255 seconds]
nemesit has quit [Quit: Leaving...]
mockra has joined #ruby
crankycoder has joined #ruby
i0n has joined #ruby
mockra has quit [Remote host closed the connection]
balki_ is now known as balki
choffstein has joined #ruby
blazes816 has joined #ruby
sterNiX has quit [Excess Flood]
grafthez has quit [Quit: Leaving]
<i0n> can someone help me out? Dir.entres(".) should make the pwd files into an array.. how do i print this array?
jstotz has joined #ruby
<i0n> can someone help me out? Dir.entres(".") should make the pwd files into an array.. how do i print this array?
mvangala has joined #ruby
<fowl> i0n, puts
<mdszy> i0n: 1. We heard you the first time. 2. `p Dir.entries(".")`.
<hoelzro> i0n: puts Dir.entries('.')?
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
zommi has quit [Read error: Connection reset by peer]
<fowl> i0n, puts
<i0n> mdszy: the first time was a typo..
<fowl> mdszy, hoelzro, today is global say-things-twice day, join in
xaq has joined #ruby
<fowl> :p
<workmad3> i0n: there was a typo both times :P
<mdszy> i0n: Then make a small correction, don't' say the whole thing over again.
<mdszy> *don't
<mdszy> see, like that
<i0n> mdszy: no thanks.
tiripamwe has quit [Ping timeout: 246 seconds]
<mdszy> i0n: Okay, then. Have fun annoying everyone.
<i0n> mdszy: have fun trolling me.
<mdszy> I'm not?
<i0n> mdszy: you done?
<fowl> geez get butthurt much
Shrink has quit [Ping timeout: 246 seconds]
<fowl> u need a tampon i0n ?
<mdszy> i0n: Calm down, goodness.
<workmad3> i0n: he isn't trolling... it's considered better practice to give a small correction than re-ask an entire question
tiripamwe has joined #ruby
vlad_starkov has joined #ruby
ben_alman has quit [Excess Flood]
<i0n> i must be using dir.entries wrong because puts dir.entries isnt printing the array.
<fowl> i0n, it didnt print the array and you didnt get an error? what happened
<mdszy> i0n: what's it printing? a newline separated list of stuff?
<mdszy> Instead of the array?
<mdszy> i0n: try doing `p` instead of `puts`.
<peterhellberg> i0n: You need to call Dir.entries, not dir.entries
the_jeebster has joined #ruby
<i0n> well so if i do my_array = Dir.entries(".") then puts my_array it will print it.,
ben_alman has joined #ruby
<mdszy> i0n: it would work the same if you did `puts Dir.entries(".")`
<mdszy> i0n: try using `p` instead of `puts`. I.e: `p Dir.entries(".")`.
grauwoelfchen has left #ruby ["WeeChat 0.3.5"]
Draco_ has joined #ruby
schwap has joined #ruby
carlyle has joined #ruby
<mdszy> i0n: no...
<mdszy> i0n: that's going to give you an ArgumentError
<i0n> yep sure did
nilg has quit [Remote host closed the connection]
<mdszy> since you're not giving any values to `Dir.entries`.
<mdszy> one sec
<mdszy> i0n: 'ere http://pastie.org/4266354
<fowl> this is another one of those situations where you would point to a book on ruby or something instead of just fixing the problem
vitoravelino`afk is now known as vitoravelino
artm has quit [Quit: artm]
<peterhellberg> mdszy: Also, syntax error on line 4 ;)
<mdszy> there :v
<mdszy> fixed now, same paste
<i0n> yeah i just typed it fast =p
apeiros_ has quit [Remote host closed the connection]
<mdszy> i0n: did that work?
minijupe has joined #ruby
jstotz has quit [Quit: jstotz]
<i0n> mdszy: yep
<mdszy> cool
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
strnx has joined #ruby
<peterhellberg> i0n: Do you want all the hidden files + . and .. in the list?
shevy has quit [Ping timeout: 265 seconds]
<i0n> peterhellberg: nah but i would like atime in a hash =)
tagrudev has quit [Quit: Me = Awesome]
<peterhellberg> i0n: Dir.glob('*') will give you all the "normal" filenames
randomautomator has joined #ruby
jeff_sebring has joined #ruby
udante has quit [Ping timeout: 244 seconds]
carlyle has quit [Remote host closed the connection]
JohnBat26 has quit [Ping timeout: 252 seconds]
niklasb has quit [Ping timeout: 252 seconds]
davidroy has joined #ruby
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<davidroy> hey folks, if i have a object that has many sub objects that i wish to output as a table. Am i best to use many each loops or a recursive function to build the table
carlyle has joined #ruby
KevinSjoberg has joined #ruby
oooPaul has joined #ruby
bbttxu has joined #ruby
<peterhellberg> i0n: I’d probably do something like Hash[Dir.glob('*').map { |f| [f,File.atime(f)] }]
<JonnieCache> well if its a table you should only need 2 loops
<JonnieCache> davidroy: one loop inside the other
<fowl> davidboy, use Enumerable#map
Shrink has joined #ruby
<davidroy> fowl and JonnieCache cheers
<fowl> or do some janky joining '<table><tr><td>'+(items.join('</td><td>'))+'</td></tr></table>'
<JonnieCache> dont do that
<fowl> do what you want*
<fowl> and never think about the consequences
<JonnieCache> yeah do what you want but try to want the right thing
verto is now known as verto|off
Targen has joined #ruby
<davidroy> well basically i have a object with a sub object, and another sub object
<davidroy> so i am most interested in the best way to output this
internet_user has joined #ruby
<fowl> well obviously you have objects, what isnt an object in ruby
<fowl> ._.
<davidroy> fowl: hmm true
<blazes816> davidroy: is there a set number of levels? or might you have 10 levels deep of object going on?
niklasb has joined #ruby
<davidroy> blazes816: set level of 3
<blazes816> davidroy: as in 1 root object, which has some objects, each of those have some?
<davidroy> each of these are to be displayed in as one row of a table
<davidroy> blazes816: 1 root object, that has a children, that has children
<blazes816> david: cool. yeah, use map. as for the format, idk. maybe use highlighting with css classes to differentiate all the different stuff you have
<i0n> peterhellberg: i see very nice
wallerdev has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
shevy has joined #ruby
<shevy> hi
<shevy> i0n: Dir.entries is not a lot of fun IMO
<davidroy> blazes816: cheers, is there a good example of using map ?
<shevy> i0n: I tend to prefer Dir.glob() or something like that
<i0n> shevy: yea thats what peterhellberg has been showing me
wallerdev has quit [Client Quit]
<blazes816> davidroy: are you using a templating engine of somekind?
<shevy> it is much more flexible than Dir.entries, I use this a lot. usually like: var = '*.rb'; Dir.glob(var)
<shevy> or if you need the array ... array = Dir.glob(var)
<shevy> etc..
<shevy> :)
<davidroy> blazes816: nope pure html.erb via rails
<blazes816> davidroy: so erb is you templating engine ;)
<davidroy> blazes816: ^_^() i guess it is
<blazes816> davidroy: In that case, probably use collection partials
ananthakumaran has quit [Quit: Leaving.]
<davidroy> blazes816: ah cheers, however partials have proved really inefficient in this case.
<peterhellberg> I know it’s decided against, but I would really like implicit block parameters in Ruby 2.0.
<blazes816> davidroy: could be. you may want to try using something a bit faster. let me work up a gist of something.
JustinCampbell has joined #ruby
seatea has quit [Ping timeout: 244 seconds]
<davidroy> blazes816: that would be great
<fowl> peterhellberg, implicit how
<shevy> peterhellberg: how would that look like?
<shevy> I mean in syntax
niklasb has quit [Ping timeout: 246 seconds]
<peterhellberg> fowl: Something like [1,2,3].each { puts it }
<fowl> peterhellberg, ah
<peterhellberg> fowl: Similar to how it works in Groovy
<shevy> "it" would become a keyword, only within blocks?
bigoldrock has quit [Quit: Leaving.]
<fowl> peterhellberg, what about blocks that send multiple vars
<shevy> it1 it2 it3 ... :)))
<shevy> or
<shevy> it,that,this,that_other,that_one
<peterhellberg> fowl: 1.9 already support the splat operator in block params
<peterhellberg> fowl: It could just capture the first as it, and then the rest in a separate array
<shevy> and this array can then be accessed how?
<fowl> ^
<fowl> it2 ?
<shevy> hehe
<shevy> well "it" alone is not so bad
<peterhellberg> shevy: I’m just speculating here :)
<shevy> peterhellberg: yeah but you need a complete proposal, even if it is just speculation that core team won't accept
<shevy> I mean, it is new to me entirely
<shevy> I never read it before :)
<peterhellberg> And it wouldn’t be too hard to just specify array.map { |my,list,of,variables| … } :)
<shevy> well that is explicit though, you give them names in ||
guns has joined #ruby
<peterhellberg> shevy: It has been proposed before and shut down by core… but that doesn’t change the fact that I _would_ like to see it in Ruby 2.0 :)
pu22l3r has joined #ruby
guns is now known as Guest19953
<fowl> you're entitled to your opinion no matter how wrong it is
<shevy> do you have the reason they gave for this?
<rking> shevy: You're off probation for saying, "shevy │ it,that,this,that_other,that_one"
Guest19953 has quit [Client Quit]
<shevy> haha
billiam has joined #ruby
<shevy> but I wanted to know the default name of the array :(
<shevy> puts it seems is ok
<peterhellberg> fowl: Yeah :)
<peterhellberg> shevy: No, It seems like a number of people have been trying to get this implemented. With varying success I might add.
<peterhellberg> Someone wanted @ and $ to be used for the "anonymous" variable, a little bit like how it works in Perl
Araxia has quit [Quit: Araxia]
rbanffy has joined #ruby
devdazed has quit [Ping timeout: 246 seconds]
PaciFisT has joined #ruby
<fowl> i wouldnt mind that
<fowl> as much as a new word
wmoxam_ has joined #ruby
<peterhellberg> I quite like the implicit scalar variable in Perl
<peterhellberg> Since you never have to actually type $_
bradhe has quit [Remote host closed the connection]
mdpatrick has joined #ruby
<peterhellberg> But this is somewhat solved by Symbol#to_proc
apeiros_ has joined #ruby
<peterhellberg> fowl: Neat, thank you :)
SQLStud has joined #ruby
nopolitica has joined #ruby
devdazed has joined #ruby
davidcelis has quit [Ping timeout: 250 seconds]
lighty has joined #ruby
mneorr1 has joined #ruby
krusty_ar has quit [Remote host closed the connection]
Gurpartap has joined #ruby
RORgasm has quit [Remote host closed the connection]
Gurpartap is now known as Guest57610
schaerli has quit [Remote host closed the connection]
Guest57610 has quit [Client Quit]
<blazes816> davidroy: working on it....
CannedCorn has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
testststst has joined #ruby
panpainter has joined #ruby
<davidroy> blazes816: cheers
mneorr has quit [Ping timeout: 246 seconds]
bowlowni has quit [Read error: Connection reset by peer]
<rking> "A syntax error is room for a feature."
bowlowni has joined #ruby
testststst is now known as Gurpartap
<rking> Anything that doesn't currently compile is something you can guarantee for use in a new program.
<hoelzro> just because you *can* add a new feature doesn't mean you *should*, though
mahmoudimus has joined #ruby
tk_ has quit [Quit: ばいばい]
<Gurpartap> morning
jumski has quit [Ping timeout: 246 seconds]
robozahn has joined #ruby
<workmad3> hoelzro: what? you mean it might not be a good idea to make every random collection of characters and spaces work as a valid ruby program?
krusty_ar has joined #ruby
tatsuya_o has joined #ruby
<hoelzro> workmad3: yes =)
fuleo has quit [Ping timeout: 260 seconds]
statix_ is now known as stat1x
ckrailo has joined #ruby
RORgasm has joined #ruby
hoelzro is now known as hoelzro|away
gilead has quit [Quit: This computer has gone to sleep]
freeayu has quit [Ping timeout: 248 seconds]
crates has quit [Ping timeout: 276 seconds]
RORgasm has quit [Remote host closed the connection]
johnernaut has joined #ruby
wallerdev has joined #ruby
wallerdev has quit [Client Quit]
wallerdev has joined #ruby
kvirani has joined #ruby
verto|off is now known as verto
Criztian has quit [Remote host closed the connection]
wvms has quit [Quit: wvms]
davidboy has quit [Ping timeout: 255 seconds]
<workmad3> hoelzro|away: lies!
davidboy has joined #ruby
stat1x has quit []
nahhh has quit [Read error: Operation timed out]
<rking> hoelzro|away: Yeah, but it's something to think about when looking for space for language ideas.
vlad_starkov has quit [Remote host closed the connection]
cjlicata has joined #ruby
baroquebobcat has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
crates has joined #ruby
freeayu has joined #ruby
abra has quit [Ping timeout: 276 seconds]
bowlowni has quit [Remote host closed the connection]
bowlowni has joined #ruby
carlyle has quit [Read error: Operation timed out]
peterhellberg has quit [Remote host closed the connection]
nahhh has joined #ruby
ryan0x2 has joined #ruby
jfelchner has quit [Quit: WeeChat 0.3.7]
<LalTopi> Can i skip 2 iterations from 'each' loop? using 'next' skips once
<LalTopi> *I am using each_cons
ChampS666 has joined #ruby
mneorr1 has quit [Quit: Leaving.]
mneorr has joined #ruby
abra has joined #ruby
wobr has quit [Ping timeout: 265 seconds]
bowlowni has quit [Read error: Connection reset by peer]
bowlowni_ has joined #ruby
fuleo has joined #ruby
JustinCampbell has quit [Remote host closed the connection]
cantbecool has joined #ruby
freeayu has quit [Quit: 离开]
Draco___ has joined #ruby
cantbecool has quit [Quit: Computer has gone to sleep.]
<blazes816> davidroy: try something like this: https://gist.github.com/3123382
<blazes816> it's pretty rough but should give you an idea
axl_ has joined #ruby
iamjarvo has joined #ruby
<LalTopi> Can i skip 2 iterations from Enumerator#each? using 'next' skips only one iteration
<davidroy> blazes816: cheers, i'll try it out and let you know how it get on. Usually i just need to see the general idea then i pick it up
jgrevich has joined #ruby
<blazes816> davidroy: it's pretty straightforward. generate a string of content_tags for each element. you shouldn't have a problem
Draco_ has quit [Ping timeout: 250 seconds]
eywu has joined #ruby
jmccune has quit [Quit: ZNC - http://znc.in]
tatsuya_o has joined #ruby
Berglund has quit [Quit: Computer died.]
mengu has quit [Quit: Konversation terminated!]
KevinSjoberg has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<apeiros_> LalTopi: use next again in the next iteration?
itnomad has joined #ruby
bradhe has joined #ruby
headius has joined #ruby
<LalTopi> apeiros_: I need to skip 2 iterations only if a condition is satisfied, not always
<apeiros_> LalTopi: yes. then codify that.
tatsuya_o has quit [Ping timeout: 248 seconds]
liluo has quit [Remote host closed the connection]
<LalTopi> using a flag variable is what I can thin of
<LalTopi> *think
saaim has joined #ruby
<apeiros_> sounds like an idea
LiquidInsect has joined #ruby
saaim has left #ruby [#ruby]
cloud|windoze has joined #ruby
stkowski has joined #ruby
<LalTopi> isn't there something like MagicNext(n) and it will skip n iterations ?
<Mon_Ouie> I did something similar not long ago, trying to parse ANSI color codes. I used Kernel#loop and Enumerator#next.
v0n has quit [Read error: Operation timed out]
RORgasm has joined #ruby
idoru has joined #ruby
v0n has joined #ruby
<cloud|windoze> http://rubymonk.com/learning/books/1/chapters/9-more-ruby/lessons/42-functional-programming-in-ruby I was able to solve the program for the first block of code titled "Lambdas", But I am not able to solve it for the second block Lambdas vs. Blocks. Any help?
bowlowni_ has quit [Read error: Connection reset by peer]
Tony_Sidaway has joined #ruby
bowlowni has joined #ruby
Fretta has joined #ruby
savage- has quit [Remote host closed the connection]
emmanuel__ has joined #ruby
liluo has joined #ruby
wrapids has joined #ruby
cantbecool has joined #ruby
nemesit has joined #ruby
davidcelis has joined #ruby
Draco___ has quit [Remote host closed the connection]
quest88 has quit [Quit: quest88]
artOfWar_ has quit [Ping timeout: 240 seconds]
DrShoggoth has quit [Remote host closed the connection]
benson has joined #ruby
<cloud|windoze> never mind, solved it.
bowlowni has quit [Read error: Connection reset by peer]
bowlowni has joined #ruby
emmanuel__ has quit [Quit: @+]
tatsuya_o has joined #ruby
vlad_starkov has joined #ruby
Rochefort has quit [Remote host closed the connection]
oscardelben has joined #ruby
Beoran__ has joined #ruby
Beoran_ has quit [Read error: Connection reset by peer]
GoGoGarrett has joined #ruby
ChampS666 has quit [Ping timeout: 248 seconds]
hynkle has quit [Quit: Computer has gone to sleep.]
verto is now known as verto|off
sulaiman has quit [Quit: Leaving]
hynkle has joined #ruby
bowlowni has quit [Read error: Connection reset by peer]
flippingbits has quit [Quit: flippingbits]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
flippingbits has joined #ruby
flippingbits has quit [Read error: Connection reset by peer]
bowlowni has joined #ruby
cantbecool has quit [Quit: Textual IRC Client: www.textualapp.com]
zodiac1111 has quit [Ping timeout: 248 seconds]
jmccune has joined #ruby
liluo has quit [Remote host closed the connection]
mxweas has left #ruby ["Leaving..."]
cloud|windoze has quit [Quit: Leaving.]
eywu has quit [Quit: Leaving.]
uris has quit [Read error: Connection reset by peer]
Spooner has quit [Ping timeout: 246 seconds]
nonotza has joined #ruby
chomp has joined #ruby
nyuszika7h is now known as pingmenextround
pingmenextround is now known as nyuszika7h
ringotwo has quit [Ping timeout: 240 seconds]
mobilegamelabs has joined #ruby
eywu has joined #ruby
wmoxam has quit [Disconnected by services]
maletor has joined #ruby
wmoxam_ is now known as wmoxam
brasten has quit [Quit: brasten]
wmoxam has quit [Changing host]
wmoxam has joined #ruby
flip_digits has joined #ruby
zrail has left #ruby [#ruby]
savage- has joined #ruby
savage- has quit [Remote host closed the connection]
Ontolog has quit [Quit: Ontolog]
verto|off is now known as verto
hmans has quit [Quit: Leaving...]
savage- has joined #ruby
cjlicata has quit [Remote host closed the connection]
cirwin has joined #ruby
fuleo has quit [Ping timeout: 260 seconds]
kvirani has quit [Remote host closed the connection]
Lachryma has quit [Ping timeout: 248 seconds]
EMarklar has joined #ruby
iamjarvo has quit [Quit: Computer has gone to sleep.]
robozahn has quit [Quit: leaving]
<EMarklar> Hi I'm running an app with Bundle exec ruby app.rb, but from within that I need to call another app which is also started with 'Bundler exec ruby other_app.rb'. The issue is that second bundler setup doesn't get loaded as I'm already locked into the original binders env. Is there a way to do this?
maletor has quit [Ping timeout: 244 seconds]
ananthakumaran has joined #ruby
ryanf has joined #ruby
<mdszy> Is it just me, or is recursion close to impossible in Ruby?
bluenemo_ has quit [Remote host closed the connection]
mpereira has joined #ruby
maletor has joined #ruby
bowlowni has quit [Read error: Connection reset by peer]
<workmad3> mdszy: err, no
<workmad3> mdszy: it's just you
bowlowni has joined #ruby
<workmad3> mdszy: or at least, on the surface, it's just you... would you care to explain your viewpoint more? :)
mucker has joined #ruby
<mdszy> workmad3: One moment, turns out my code is broken that I thought would work XD
<workmad3> mdszy: :D
lorandi has joined #ruby
<mdszy> okay, got it XD
<Speed> interesting, according to my lazyman's benchmark, if you have a string "# something", it's slightly faster to do include? "#" than str[0] == "#". Is that true or is my bench wrong?
bglusman has joined #ruby
<mdszy> workmad3: turns out, this code doesn't work: http://hastebin.com/qosiwolili.rb
<mdszy> whilewhile this does: http://hastebin.com/najekofalo.rb
<mdszy> *while
bglusman has quit [Remote host closed the connection]
bglusman has joined #ruby
<workmad3> mdszy: heh, I can't find hastebin from here... any chance you could use gist or pastie? :)
<mdszy> workmad3: One sec
bglusman has quit [Remote host closed the connection]
<mdszy> workmad3: this: https://gist.github.com/3123646
<mdszy> files are named appropriately :P
bglusman has joined #ruby
<workmad3> Speed: include and preset switch around as to which is 'faster' on my system
bglusman has quit [Remote host closed the connection]
bglusman has joined #ruby
<fowl> Speed, if you're trying to save 0.01s you're in the wrong language
oxyxian has quit [Quit: oxyxian]
<Speed> fowl, I'm just testing
niklasb has joined #ruby
khakimov has joined #ruby
<Speed> workmad3: http://pastie.org/4266947 this is on my system, Arch Linux
<workmad3> mdszy: well, yeah...
<fowl> no harm in that
philips_ has quit [Excess Flood]
bglusman has quit [Remote host closed the connection]
<Speed> fowl: I started off by comparing match and include? which is a big difference
<mdszy> workmad3: Hm?
GarethAdams has quit [Quit: Leaving...]
stat1x has joined #ruby
<workmad3> mdszy: how is the non-working one meant to know it should return '0' rather than just always execute the recursive call? :P
bglusman has joined #ruby
<Speed> fowl: just trying to eliminate bottlenecks in EventMachine :D
philips_ has joined #ruby
<workmad3> mdszy: incidentally, the explicit 'return' statements are unnecessary in the working version
Draco_ has joined #ruby
maletor has quit [Ping timeout: 255 seconds]
<mdszy> workmad3: Well, the first line of the non-working one should return 0 if it's 0.
bglusman_ has joined #ruby
<workmad3> mdszy: no
<Speed> *EventMachine application
<mdszy> workmad3: I guess I misunderstood ruby, then.
<workmad3> mdszy: the statement evaluates to 0, but it doesn't return anything
<workmad3> mdszy: it doesn't return from the method call
adeponte has joined #ruby
<mdszy> workmad3: okay, so the statement returns zero, but the method doesn't?
<workmad3> mdszy: yes, because the control flows on to the next statement
Tony_Sidaway has quit [Ping timeout: 252 seconds]
<mdszy> Ah
<workmad3> mdszy: if it *didn't* do that, you could never have a method with > 1 line...
ringotwo has joined #ruby
<mdszy> workmad3: Yeah, good point!
<mdszy> workmad3: Thanks!
<workmad3> mdszy: np :)
<workmad3> mdszy: incidentally, a third version would be 'n.zero? ? n : 1 + count_digits(n/10)'
maletor has joined #ruby
<mdszy> workmad3: true :P
kenichi has joined #ruby
bglusman_ has quit [Read error: Connection reset by peer]
bglusman_ has joined #ruby
<Speed> workmad3: wouldn't 'return 0 if n == 0; 1 + count_digits(n / 10)' work?
i0n has quit [Quit: Lost terminal]
<workmad3> Speed: yup, that's version 4 ;)
bglusma__ has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
fome has joined #ruby
bglusman has quit [Ping timeout: 245 seconds]
<workmad3> mdszy: also, I think your count is off... the number '0' has 1 digit...
brasten has joined #ruby
Tony_Sidaway has joined #ruby
bglusma__ has quit [Read error: Connection reset by peer]
<mdszy> workmad3: Yeah, true
bglusman has joined #ruby
<mdszy> so it'd probably have to keep a count somehow, which isn't possible with recursion, really
<mdszy> I was just seeing what I could implement
SegFaultAX|work2 has joined #ruby
<workmad3> mdszy: I'd probably go for something like 'n.abs < 10 ? 1 : 1 + count_digits(n / 10)'
<mdszy> yeah
fome has quit [Remote host closed the connection]
RORgasm has quit [Remote host closed the connection]
bglusma__ has joined #ruby
carloslopes has joined #ruby
fasta has left #ruby ["Part"]
<workmad3> mdszy: there's also version number 5 btw... n.abs.to_s.length
<workmad3> gotta love ruby :)
<workmad3> daily challenge - how many ways can you count the digits in a string? :)
<workmad3> *number
<mdszy> heh
bglusman_ has quit [Ping timeout: 248 seconds]
artOfWar has joined #ruby
twock has joined #ruby
sailias has quit [Ping timeout: 240 seconds]
bglusman has quit [Ping timeout: 248 seconds]
timonv has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
Lachryma has joined #ruby
Tony_Sidaway_ has joined #ruby
_bart has quit [Ping timeout: 246 seconds]
Eldariof57-ru has quit [Ping timeout: 240 seconds]
artOfWar_ has joined #ruby
Spooner has joined #ruby
Tony_Sidaway_ has quit [Read error: Connection reset by peer]
Tony_Sidaway has quit [Ping timeout: 246 seconds]
cezar has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
cezar has quit [Client Quit]
ianbrandt has joined #ruby
ryanf has quit [Ping timeout: 248 seconds]
bowlowni has quit [Read error: Connection reset by peer]
bowlowni has joined #ruby
artOfWar has quit [Ping timeout: 246 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
oxyxian has joined #ruby
shadoi has quit [Quit: Leaving.]
Ontolog has joined #ruby
etehtsea has quit []
RORgasm has joined #ruby
Tony_Sidaway has joined #ruby
jeff_sebring has quit [Quit: Leaving]
rowanu has joined #ruby
chrxn_ has joined #ruby
bowlowni has quit [Read error: Connection reset by peer]
S1kx has joined #ruby
bowlowni has joined #ruby
nopolitica has quit [Quit: Leaving.]
carlyle has joined #ruby
a_a_g has joined #ruby
Araxia has joined #ruby
davidroy has quit [Quit: davidroy]
emmanuel__ has joined #ruby
emmanuel__ has quit [Read error: Connection reset by peer]
vitoravelino is now known as vitoravelino`afk
tuxaddic1ed has quit [Read error: Operation timed out]
Tony_Sidaway has quit [Ping timeout: 250 seconds]
mneorr has quit [Quit: Leaving.]
tuxaddicted has quit [Ping timeout: 246 seconds]
kevinfagan has quit [Quit: Leaving...]
a_a_g has quit [Quit: Leaving.]
c0rn_ has joined #ruby
EMarklar has quit [Quit: Leaving]
hashar has quit [Quit: hashar]
verto is now known as verto|off
elhu has quit [Quit: Computer has gone to sleep.]
carlyle has quit [Read error: Connection reset by peer]
williamcotton__ has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
carlyle has joined #ruby
mohits has quit [Read error: Operation timed out]
chrismcg is now known as zz_chrismcg
williamcotton_ has quit [Ping timeout: 252 seconds]
TPFC-SYSTEM has joined #ruby
nilg has joined #ruby
mongag has quit [Disconnected by services]
mongag has joined #ruby
davidpk has joined #ruby
niklasb has quit [Ping timeout: 246 seconds]
LalTopi has quit [Ping timeout: 246 seconds]
LalTopi has joined #ruby
danielpunt has quit [Read error: Connection reset by peer]
fuleo has joined #ruby
danielpunt has joined #ruby
amoe has quit [Ping timeout: 240 seconds]
brasten has quit [Quit: brasten]
danielpunt has quit [Read error: Connection reset by peer]
danielpunt has joined #ruby
mahmoudimus has joined #ruby
nilg has quit [Remote host closed the connection]
niklasb has joined #ruby
davidcelis_ has joined #ruby
blazes816 has quit [Ping timeout: 244 seconds]
davidcelis has quit [Ping timeout: 240 seconds]
davidcelis_ has quit [Client Quit]
davidcelis has joined #ruby
snearch has joined #ruby
GarethAdams has joined #ruby
fuleo has quit []
tuxaddicted has joined #ruby
bbttxu has quit [Quit: bbttxu]
tuxaddic1ed has joined #ruby
tuxaddic2ed has joined #ruby
williamcotton_ has joined #ruby
iamjarvo has joined #ruby
Lachryma has quit [Ping timeout: 246 seconds]
adamkittelson has joined #ruby
williamcotton__ has quit [Ping timeout: 244 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
ctor has joined #ruby
Jake232 has quit [Quit: Computer has gone to sleep.]
chienpo has joined #ruby
shadoi has joined #ruby
mrsolo has joined #ruby
tuxaddic1ed has quit [Quit: leaving]
tuxaddicted has quit [Quit: leaving]
tuxaddic2ed has quit [Quit: leaving]
tuxaddicted has joined #ruby
Spooner has quit [Ping timeout: 248 seconds]
Morkel has quit [Quit: Morkel]
btanaka has joined #ruby
mrdodo has joined #ruby
sailias has joined #ruby
sepp2k has joined #ruby
Lachryma has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
mpereira has quit [Ping timeout: 252 seconds]
seatea has joined #ruby
cantbecool has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
<mongag> Is this properly implementation of singleton pattern in ruby ? https://gist.github.com/3123963
<apeiros_> not really
<apeiros_> Dog == Dog.instance => little sense
cj3kim has joined #ruby
<apeiros_> also, take a look at Singleton (ri Singleton, it's part of rubys stdlib)
voodoofish430 has joined #ruby
cj3kim has quit [Client Quit]
<sernin> Wondering why this gives an error. Should I be creating these arrays elsewhere? http://pastie.org/4267095
tatsuya_o has joined #ruby
yoklov has joined #ruby
gabebug has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
chrxn_ is now known as chrxn[a]
<gabebug> What's the best way to file a bug report for the std lib csv library? I'm having an issue where CSV.foreach(path, { :encoding => "iso-8859-1:utf-8" }) errors with "invalid byte sequence in UTF-8" in csv.rb:2027:in `init_separators, but setting the :encoding => "iso-8859-1", and then calling .encode('utf-8' on each cell works fine - strikes me as a bug
mahmoudimus has quit [Quit: Computer has gone to sleep.]
tatsuya_o has quit [Ping timeout: 265 seconds]
philips_ has quit [Excess Flood]
Aaton_off is now known as Aaton
hashar has joined #ruby
<fowl> csv.rb is a terrible mess
<fowl> i wanted to shoot myself after trying to debug it
sdwrage has joined #ruby
philips_ has joined #ruby
blazes816 has joined #ruby
larissa has quit [Quit: Saindo]
__Grabarz__ has joined #ruby
trivol has quit [Quit: trivol]
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
__Grabarz__ has left #ruby [#ruby]
d3vic3 has quit [Ping timeout: 255 seconds]
redgetan has joined #ruby
saschagehlich has joined #ruby
ryanf has joined #ruby
tuxaddicted has quit [Quit: leaving]
g0bl1n has quit [Ping timeout: 240 seconds]
d3vic3 has joined #ruby
cuppsy has quit [Ping timeout: 248 seconds]
snearch has quit [Quit: Verlassend]
bluenemo has quit [Remote host closed the connection]
Lachryma has quit [Read error: Connection reset by peer]
apok has joined #ruby
redgetan has quit [Quit: This computer has gone to sleep]
mohits has joined #ruby
nej has joined #ruby
oooPaul has quit [Quit: Ciao for now!]
ryanf has quit [Quit: leaving]
sdwrage has quit [Quit: geekli.st/programmer]
andoriyu has joined #ruby
etehtsea has joined #ruby
vitoravelino`afk is now known as vitoravelino
jstew has joined #ruby
bricker88 has joined #ruby
andoriyu_ has quit [Ping timeout: 240 seconds]
<bricker88> is it possible to make an HTTP request to a local URI, such as http://something.dev or http://localhost:3000 ? I am getting a SocketError when trying to send a request to a local pow URI
sdwrage has joined #ruby
bbttxu has joined #ruby
Eldariof-ru has joined #ruby
mpereira has joined #ruby
d3vic3 has quit [Ping timeout: 248 seconds]
lorandi has quit [Quit: Leaving]
<shevy> sernin: what are labels and values
lorandi has joined #ruby
d3vic3 has joined #ruby
<Mon_Ouie> bricker88: What does the error message say?
Gurpartap has quit [Quit: Page closed]
<bricker88> Mon_Ouie: "getaddrinfo: nodename nor servname provided, or not known"
odigity has joined #ruby
reuf has joined #ruby
<bricker88> I assume that means it doesn't know the ".dev" domain
<odigity> I have a method B which makes a few objects and returns them. In method A, I want to create an array, and call B a bunch of times to append those objects to my array. What's the best way? I can have B return an array, but will the << operator flatten it back out into multiple objects before appending?
NorrinRadd has joined #ruby
fermion has quit [Quit: P]
<odigity> I could use array addition (my_array += methodB()), but that seems inefficient, since it will be constantly creating new copies
<Mon_Ouie> odigity: Use Array#concat
<odigity> is there a flattening operator?
<shevy> yeah
<blazes816> odigity: Array#flatten ?
<shevy> [[1,2,3]].flatten # => [1, 2, 3]
greasegum has joined #ruby
<odigity> so, in method A, I need "myarray.concat methodB()", and in methodB, I can just return an array of objects "return mysubarray"
<Mon_Ouie> Yes
<odigity> is that the most idiomatic way, or should be I using flattening somehow?
<Mon_Ouie> I wouldn't use flatten in that case. It just sounds more natural to directly append the elements to the right array
GeekOnCoffee_ has joined #ruby
GeekOnCoffee_ is now known as GeekOnCoffee
<odigity> ok, thanks
kvirani has joined #ruby
jrajav has joined #ruby
<fowl> flatten operator would be cool
<fowl> it could be ___
<fowl> :>
mohits has quit [Read error: Connection reset by peer]
_bart has joined #ruby
syamajala has joined #ruby
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
yoklov has quit [Quit: computer sleeping]
<mrdodo> Is anybody aware of a way to collect all objects that implement a specific module?
nonotza has quit [Quit: nonotza]
nicoulaj has joined #ruby
<mdszy> fowl: alias_method :___, :flatten
<mdszy> array.____
<mdszy> :P
<mdszy> *___
<cirwin> mrdodo: you can use ObjectSpace.each_object{ |x| puts x if ModuleName === x }
EzeQL has joined #ruby
<Mon_Ouie> ObjectSpace.each_object(SomeModule)
verto|off is now known as verto
Draco_ has quit [Remote host closed the connection]
caveat- has joined #ruby
cczona has joined #ruby
cczona has left #ruby [#ruby]
<mrdodo> cirwin, Mon_Ouie: awesome, thanks a bunch I will check those out
cczona has joined #ruby
vjacob has quit [Quit: Leaving]
<lectrick> These days, is a call to "proc" similar enough to a call to "lambda" but without rigid argument handling?
ringotwo has quit [Remote host closed the connection]
<cirwin> lectrick: and return handling: https://gist.github.com/742ecc9c904b8b181288
Tomasso has joined #ruby
<lectrick> cirwin: oh wow. thanks for the heads up
mongag has quit [Quit: Leaving]
jimeh has quit [Ping timeout: 246 seconds]
mohits has joined #ruby
uris has joined #ruby
arturas_ has quit [Ping timeout: 252 seconds]
headius has quit [Quit: headius]
<apeiros_> and .lambda?
cakehero has joined #ruby
tiripamwe has quit [Ping timeout: 248 seconds]
andoriyu has quit [Quit: This computer has gone to sleep]
<lectrick> .lambda is on what objects?
<lectrick> lol i tried 5.lambda and got a private method called error
<lectrick> 5.send(:lambda), here I come
<cirwin> lambda{}.lambda?
<cirwin> proc{}.lambda?
GarethAdams has quit [Quit: Leaving...]
<cirwin> 5.send(:lambda){}.lambda? :p
c0rn_ has quit [Quit: Computer has gone to sleep.]
mneorr has joined #ruby
<lectrick> lambda{lambda.lambda}
<lectrick> /old nerd
itnomad has quit [Quit: Leaving]
ryanf has joined #ruby
webusnix has joined #ruby
<lectrick> lambda{lambda.lambda}.lambda? #=> tru dat
ryanf has quit [Client Quit]
itnomad has joined #ruby
<sernin> ...yo dawg, i heard you like lambdas...
oxyxian has quit [Quit: oxyxian]
tewecske has joined #ruby
ryanf has joined #ruby
<shevy> oh god
itnomad has quit [Client Quit]
<shevy> sernin did you figure out your problem
bradhe has quit [Remote host closed the connection]
kirun has joined #ruby
jimeh has joined #ruby
mohits has quit [Ping timeout: 250 seconds]
<sernin> I did. It seems that a,b = [] does *not* do What You Think(tm)
<apeiros_> it does exactly what I think :)
<sernin> apeiros_: Har har. :)
<sernin> But, yes, for the uninitiated like me, that does not create two empty arrays
<apeiros_> but yeah, autosplat can mess with your braaaaaains
<sernin> instead it just fails (or, succeeds in doing nothing) silently
mohits has joined #ruby
fayimora has joined #ruby
<sernin> am i correct in thinking that a = b = [] would work
<apeiros_> well… that's an odd expectation to start with
<apeiros_> that doesn't do what you think either
<apeiros_> a and b point to the *same* array that way
lighty has left #ruby ["Linkinus - http://linkinus.com"]
<sernin> Oh, wow.
<apeiros_> a = b = []; a << 1; b # => [1]
<shevy> well not fail, just nil assignment
<apeiros_> you can have multiple references to the same object.
<sernin> Well, that's handy, but how about just initializing them?
<fowl> a, b = [[]] * 2
<shevy> what do you mean with initializing
<fowl> hyuckhyuck
<sernin> Create two empty arrays.
<shevy> [] is almost the same as Array.new
<apeiros_> fowl: still the same array
<shevy> a, b = Array.new, Array.new
<fowl> oh ._.
<fowl> so it is
<shevy> a, b = [], []
<sernin> It's subtly different. Oy.
<shevy> and there is Array.new() something but I forgot what params it wants
<apeiros_> sheeeeeevy, nooooooooooo
<fowl> shevy wtf u talking about
<fowl> [] is Array.new
<shevy> oh
<shevy> Array.new 5 # => [nil, nil, nil, nil, nil]
<shevy> nope fowl, [] is faster
<apeiros_> Object.const_get(:Array).__send__(:new)
<blazes816> apeiros_: explicit is better than implicit
<shevy> I hate explicit self in python
<fowl> shevy, only because its not resolving Array and the new method
<blazes816> shevy: and how!
<blazes816> I forgive perl
<shevy> :)
bbttxu has quit [Quit: bbttxu]
<shevy> yeah fowl no idea really... I think I read it once in the old pickaxe. my brain remembers only 5% of what I read
<fowl> yea
<fowl> i tested that once..for some reason
<sernin> I recall I ran into some subtle differences between {} and Hash.new
<fowl> only diff is Hash.new lets you specify a default value, which you could do after you create the hash if you wanted
axl_ has quit [Read error: Connection reset by peer]
<apeiros_> blazes816: [] is explicit
axl_ has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<blazes816> apeiros_: I was just joking
cirwin has quit [Ping timeout: 252 seconds]
<shevy> sernin: I think Hash.new gives you a {} additionally
<shevy> with {}, I dont think you can give a block to it
emmanuelux has joined #ruby
<shevy> {}{}
<shevy> what a weird syntax
<shevy> hmm Hash.new() {}
nilg has joined #ruby
<fowl> x = Hash.new do |y, key| y[key] = key ** 2 end <- might as well use Hash#default_proc tho
<fowl> why would you send an empty block
<fowl> crazy austrian
kenichi has quit [Remote host closed the connection]
<shevy> I dunno
<shevy> I just wondered about the syntax
skryking has quit [Quit: Konversation terminated!]
<shevy> I also have to admit, I have not seen default_proc before
<shevy> I am still a noob :(
d3vic3 has quit [Ping timeout: 246 seconds]
jayne has joined #ruby
king313 has quit [Quit: .]
mohits has quit [Read error: Connection reset by peer]
zastaph has quit []
luckyruby has joined #ruby
<fowl> o Hash.new(&block) sets block to default_proc that makes sense
d3vic3 has joined #ruby
oxyxian has joined #ruby
eph3meral has joined #ruby
<eph3meral> has anyone had success getting spec to properly log in using omniauth with rspec under a modular sinatra/rack application? I googled and tried stuff for like 4 hours yesterday, nothing seemed to work - specificallly I feel like if I could set a sinatra session variable from within the test, that everything would be all good - I've got omniauth configured to use test mode in the test environment, so I think all I need to do is make sure
<eph3meral> session['user_id'] exists and is sane inside the controller action, when said action is called from a test
headius has joined #ruby
<eph3meral> the only way I've gotten my app to work is if I add a check for the test environment, and then simply bypass my authentication code (sorry for xposts btw, if anyone cares, not sure where this question belongs since so many systems/subsystems are involved)
<fowl> your problems scares, i wish you the best of luck
<fowl> scares me*
<shevy> lol
<shevy> dunno eph3meral it seems extremely specific... spec + rack app
kenichi has joined #ruby
<eph3meral> shevy, uh... rspec, rack, omniauth, capybara, sinatra <- all of the above are involved in this issue
trivol has joined #ruby
<eph3meral> well, actually I suppose maybe not so much capybara - but it's definitely a "multi thing" issue, I'm still not 100% sure which parts are required, and there's zero comprehensive docs on this
andoriyu has joined #ruby
<shevy> whoa
<shevy> complexity
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
AlbireoX has joined #ruby
<eph3meral> I've worked on a rails app that had this setup, but I didn't do the setup - I just used it to write various tests
<eph3meral> I also don't have access to that code anymore
tvw has quit [Ping timeout: 246 seconds]
headius has quit [Read error: Connection reset by peer]
fayimora has quit [Ping timeout: 250 seconds]
skryking has joined #ruby
headius has joined #ruby
cmaujean has joined #ruby
cczona has quit [Quit: cczona]
cczona has joined #ruby
Liothen has joined #ruby
vitoravelino is now known as vitoravelino`afk
cczona has quit [Client Quit]
verto is now known as verto|off
cczona has joined #ruby
apok has quit [Quit: apok]
headius has quit [Client Quit]
bbttxu has joined #ruby
mahmoudimus has joined #ruby
Guest61057 has quit [Ping timeout: 246 seconds]
g0bl1n has joined #ruby
Asher has quit [Ping timeout: 255 seconds]
cczona has quit [Client Quit]
kevinfagan has joined #ruby
cczona has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
kevinfagan has quit [Client Quit]
kevinfagan has joined #ruby
cczona has quit [Client Quit]
kevinfagan has quit [Client Quit]
verto|off is now known as verto
mmsequeira_ has quit [Quit: mmsequeira_]
kevinfagan has joined #ruby
vertroa has quit []
mxweas_ has joined #ruby
mxweas_ has quit [Client Quit]
mxweas_ has joined #ruby
kevinfagan has quit [Remote host closed the connection]
vertroa has joined #ruby
fantazo has joined #ruby
headius has joined #ruby
adamkittelson has quit [Read error: Connection reset by peer]
fayimora has joined #ruby
bglusma__ has quit [Read error: Connection reset by peer]
adamkittelson has joined #ruby
c0rn_ has joined #ruby
nilg has quit [Read error: Operation timed out]
bglusman has joined #ruby
trivol has quit [Quit: trivol]
davidpk has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
apok has joined #ruby
rasmusth has quit [Remote host closed the connection]
adamkittelson has quit [Read error: Connection reset by peer]
Eldariof-ru has quit []
adamkittelson has joined #ruby
cirwin has joined #ruby
skyjumper has joined #ruby
syamajala has quit [Remote host closed the connection]
jamesaxl has joined #ruby
Asher has joined #ruby
dankest has joined #ruby
<skyjumper> got a segfault with 1.9.3-p194: https://gist.github.com/3124652
<skyjumper> should i try a different version?
Guest75326 has quit [Quit: Guest75326]
crankycoder has quit [Remote host closed the connection]
yoklov has joined #ruby
mobilegamelabs has quit [Quit: http://youtu.be/Tu-mSpFmx7g http://www.MGGGGG.com/ap Angry Polygon - my first Android/iOS/Mac game!]
crankycoder has joined #ruby
Asher1 has joined #ruby
Asher has quit [Ping timeout: 265 seconds]
sdwrage has quit [Quit: geekli.st/programmer]
apok has quit [Quit: apok]
crankycoder has quit [Ping timeout: 250 seconds]
bradhe has joined #ruby
dankest has quit [Quit: Leaving...]
workmad3 has joined #ruby
vitoravelino`afk is now known as vitoravelino
Foxandxss has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
hashar has quit [Quit: I am a manual virus, please copy me to your quit message.]
sanitypassing has joined #ruby
nanderoo has quit [Quit: Leaving.]
GarethAdams has joined #ruby
imami|afk is now known as banseljaj
jonathanwallace has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
niklasb has quit [Quit: WeeChat 0.3.8]
mxweas_ has quit [Quit: Computer has gone to sleep.]
verto is now known as verto|off
niklasb has joined #ruby
amacgregor_osx has quit [Remote host closed the connection]
verto|off is now known as verto
jgarvey has joined #ruby
cjlicata has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
syamajala has joined #ruby
Norrin has joined #ruby
cjlicata has quit [Remote host closed the connection]
cantbecool has quit [Quit: Textual IRC Client: www.textualapp.com]
pu22l3r has quit [Ping timeout: 246 seconds]
gabebug has quit [Quit: gabebug]
carlyle has quit [Ping timeout: 246 seconds]
ctp has joined #ruby
rmc3 has joined #ruby
verto is now known as verto|off
techhelp has joined #ruby
ringotwo has joined #ruby
<NorrinRadd> trying to figure out what this does: (@events[event] ||= []) << [Regexp.new(match), block]
<NorrinRadd> currently noob status
<NorrinRadd> can't find a ||= operator in the hash class.
<skyjumper> var ||= expressoin
mneorr has quit [Quit: Leaving.]
<skyjumper> is the same as
<skyjumper> var = var || expression
<NorrinRadd> gotcha
<Mon_Ouie> Actually it's not really that
<Mon_Ouie> It's expression || (var = expression)
DrForr has joined #ruby
<Mon_Ouie> i.e. when var is a method call and doesn't return nil or false, #var= won't be called at all
hemanth has quit [Read error: Connection reset by peer]
<skyjumper> aha
<Mon_Ouie> Erm, I meant var || (var = expression)
punkrawkR has joined #ruby
pk1001100011 has quit [Remote host closed the connection]
elliottcable is now known as erparse
headius_ has joined #ruby
hemanth has joined #ruby
grekkos has joined #ruby
<NorrinRadd> same as var? var : var=expression
<NorrinRadd> this ^ ?
grekkos is now known as Guest1056
<NorrinRadd> if (!var) var = expression
ryannielson has left #ruby [#ruby]
<NorrinRadd> because using || like in your examples, it might be contruued that var ends up being 0 or 1
pk1001100011 has joined #ruby
<Mon_Ouie> Why would it end up being 0 or 1?
user__ has joined #ruby
ozy_work has joined #ruby
<NorrinRadd> because || returns 0 or 1
Targen has quit [Ping timeout: 240 seconds]
<Mon_Ouie> You mean in C?
Axsuul has joined #ruby
<NorrinRadd> yeah
<Mon_Ouie> But we're talking about Ruby, not C
<NorrinRadd> ah. so || is differently too....
<Mon_Ouie> And your former example isn't the same either, because var gets evaluated twice
<ozy_work> I'm trying to write a custom function for puppet, and I keep getting the error "Function 'lookup_instance_password' does not return a value" -- no one in the puppet channel seems to have any suggestions. Can anyone here help me?
<Mon_Ouie> (not that a getter *should* have side effects)
headius has quit [Ping timeout: 255 seconds]
headius_ is now known as headius
sanitypassing has left #ruby ["WeeChat 0.3.8"]
erparse is now known as alexgordon
<ozy_work> I am calling 'return 'foo'' at the end of my short code, so it should be returning something, right?
alexgordon has quit [Disconnected by services]
<Mon_Ouie> Depends on what the context is
elliottcable has joined #ruby
akem has quit [Ping timeout: 255 seconds]
<ozy_work> i've also tried 'puts' instead of return
<ozy_work> no difference
otters is now known as eboy
blacktulip has quit [Remote host closed the connection]
eboy is now known as otters
<Mon_Ouie> return won't work in that context
<Mon_Ouie> You'd need break to return early from the block, but you can just make sure the last expression evaluates to what you want here
g0bl1n has quit [Ping timeout: 240 seconds]
<Mon_Ouie> And if nothing gets printed, that's most likely because your block is never run
s0ber has quit [Read error: Connection reset by peer]
<ozy_work> it's throwing an error that it is not returning anything, so it looks like it is trying to run it
<ozy_work> so I should be abel to use 'puts'?
<ozy_work> or even a hash reference?
s0ber has joined #ruby
headius has quit [Read error: Connection reset by peer]
hemanth has quit [Read error: Connection reset by peer]
<Mon_Ouie> That may be related to the way you're using that library, check for examples
<Mon_Ouie> and the docs
hemanth has joined #ruby
ackz has quit [Read error: Connection reset by peer]
<ozy_work> the docs appear to be pretty.... spotty, unfortunately
tayy has joined #ruby
robert45- has joined #ruby
<robert45-> hi guys Im geting this error "/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- new_relic/recipes (LoadError)"
<robert45-> does anyone know how to fix this?
<Mon_Ouie> Change your load path or install whatever you need to get that new_relic/recipes file
Maher4Ever has joined #ruby
<robert45-> Mon_Ouie thanks, how do I need which gems does provides new_relic/recipes?
<robert45-> I know*
<Mon_Ouie> What are you trying to run?
webusnix has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<Mon_Ouie> Usually, gem names match require names, so it would be new_relic
Criztian has joined #ruby
trivol has joined #ruby
<robert45-> Mon_Ouie newscloud
<robert45-> alright, let me check
<Maher4Ever> Hey, Is there a way in the ruby C API to stop the GC from freeing a particuler ruby object?
<Mon_Ouie> And newscloud doesn't have anything to handle dependencies? A gemspec? A readme? Bundler?
<Norrin> anyone can help me figure out what this does? http://pastie.org/4268055
<Maher4Ever> I need to store a pointer to a block in my application. When it's run for a long time, the GC frees the block and I end up with a dead pointer!
<Mon_Ouie> Maher4Ever: Make sure to set ivars so that a reference to it is still visible when appropriate. Alternatively, use rb_gc_(un)register_address
<Mon_Ouie> If I wanted to keep a value object like that, I'd probably use an ivar on my module
sdwrage has joined #ruby
carloslopes has quit [Quit: Leaving.]
<shadoi> Norrin: it is a method to register an event callback
Zolrath has joined #ruby
<Maher4Ever> Mon_Ouie: Thans for the response, I'll look into those functions. I can't use ivars because each method call comes with it's own block
<shadoi> Norrin: the event is the name, match is a pattern for something in the block to use I guess, and the block is the code to call when the event is encountered.
reuf has quit [Quit: Leaving]
<fowl> Maher4Ever, does your nick reference this handsome fella: http://www.istanbul.tc/mahir/mahir/ ?
Notimik has joined #ruby
<Norrin> shadoi, thank you. i'm glad you understand it
QaDeS has joined #ruby
bglusman_ has joined #ruby
<Mon_Ouie> I think match is another condition for the block to be run
<Maher4Ever> fowl: LOL, I wish I was that much good-looking :P
<Mon_Ouie> The block is only run when the event type is some value, and its argument (whatever it is, a string it seems) matches the "match" argument
<shadoi> Norrin: it's a common pattern for event driven code.
<Norrin> i'm still trying to decipher it. can't figure out line 3
seatea has quit [Ping timeout: 240 seconds]
<Norrin> if event is not find out @events, it sets the value of that key to an empty array?
jsime has quit [Read error: Connection reset by peer]
<Mon_Ouie> Only if it's nil or false (so it's a default value)
<Norrin> and not guess what happens after that. can't imagine why a left shift is there
bglusman has quit [Ping timeout: 245 seconds]
<Mon_Ouie> It's not a left shit, it calls Array#<<, which appends a new element
jsime has joined #ruby
<Norrin> on. i tihnk @events is a hash
c0rn_ has joined #ruby
<Mon_Ouie> It most likely is
<Norrin> so it's adding key=regex and value=block ?
ozy_work has quit [Ping timeout: 244 seconds]
<Mon_Ouie> No, the key is event
<Mon_Ouie> and the value is an array, to which it adds a new element
<Norrin> I see!
<Mon_Ouie> Which itself is another array, containing two elements: the regexp and the block
hemanth has quit [Read error: Connection reset by peer]
<shevy> hmm I need help with a regex
<shevy> I have two words: SDL_tty-0.0.1 and acl_2.2.47-1
tayy has quit [Ping timeout: 248 seconds]
<shevy> for the first word, I need to split at the "-". for the second word, I actually need to split at the "_"
the_jeebster has quit [Quit: Leaving.]
<shevy> my idea was to split on the first number found hmm
minijupe has quit [Quit: minijupe]
<fowl> shevy, look for groups of numbers instead
<shadoi> shevy: you need to normalize the data first. Your work boundaries delimiter is changing.
<fowl> or trailing numbers
<shevy> oh, that is a good idea
<shadoi> s/work/word/
<fowl> shevy, i remember gobo always had problems with this especially when it was like LibXML2-version
hemanth has joined #ruby
ibash has joined #ruby
<Mon_Ouie> If there are only two elements, there's no real reason to actually split — you can match using two capture groups, one for the name and another for the version
<shevy> yeah shadoi ... trying to split up "program name" and "program version". this one is another difficult one WebKit-r116716
tayy has joined #ruby
<shevy> ok
<fowl> shevy, their solution was to name packages Libname--version--md5hash
<shadoi> There are package name normalization scripts in the debian packaging tools, but … yeah, it requires some manual massaging.
<Maher4Ever> Mon_Ouie: if I call 'rb_gc_register_address' on the block, when should I call 'rb_gc_unregister_address'? Can I assume it would be the same place rb_gc_mark was being called?
<Mon_Ouie> You call it when you won't use the reference anymore
<Mon_Ouie> Preferably as soon as you're done
<Maher4Ever> Got it, thanks
choffste_ has joined #ruby
minijupe has joined #ruby
choffstein has quit [Read error: Connection reset by peer]
andoriyu has quit [Quit: This computer has gone to sleep]
greasegum has quit [Ping timeout: 240 seconds]
snearch has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
Notimik has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
pedm has joined #ruby
fridim_ has joined #ruby
sonicpon1 has quit [Quit: leaving]
hemanth has joined #ruby
tvw has joined #ruby
tayy has quit [Ping timeout: 244 seconds]
geekbri has quit [Remote host closed the connection]
itnomad has joined #ruby
tayy has joined #ruby
Norrin has quit [Quit: Zzz]
alindeman has quit [Ping timeout: 240 seconds]
hynkle has quit []
pushp0p is now known as dawtcawm
andoriyu has joined #ruby
minijupe has quit [Quit: minijupe]
<Maher4Ever> Mon_Ouie: The functions you pointed out work like a charm, thank you. I struggled with it for quite a while :)
vertroa has quit [Ping timeout: 252 seconds]
nateberkopec has joined #ruby
mdpatrick has quit [Quit: mdpatrick]
<Maher4Ever> I have another question: Does ruby have some kind of a memory pool exposed for developers of extentions? I know about ALLOC and xfree, but these don't cache memory AFAIK
Cooper_ has joined #ruby
apok has joined #ruby
<Maher4Ever> Something like nedmalloc ?
<Foxandxss> excuse me: What's the new form :blah => "Bleh" or blah: "bleh"?
<shevy> Foxandxss: second
<shevy> the shorter
<Maher4Ever> Foxandxss: blah: "blah"
<shevy> foo: "bla"
<Foxandxss> thanks
<shevy> old form was the longer
<shevy> :)
<shevy> easy to remember
<Foxandxss> I used the first one and rails guides uses first one, but I remembered that somewhere said that second was newer, but I got confused, thanks
maahes has quit [Ping timeout: 244 seconds]
lorandi has quit [Quit: Leaving]
<Maher4Ever> I actually like the old form, I mean look at this 'method(opt: :sym, :opt2: :sym2)' doesn't look right to me :S
<ged> iset highlight
<ged> Heh, oops.
headius has joined #ruby
<shevy> hah
<shevy> after so many years of IRC!
<shevy> Maher4Ever: I like the old form too
<shevy> I am not that opposed to the new one though
<shevy> what I dont like at all is ->
<johnernaut> lambdaz
<fowl> Maher4Ever, in that case the options hash is more like a hash of enums (set symbol values)
techhelp has quit [Quit: Leaving]
<johnernaut> ->(arg)
<fowl> Maher4Ever, and i would say thats unruby
Rubinista has joined #ruby
jamesaxl has quit [Ping timeout: 240 seconds]
<Maher4Ever> shevy: yeah, I hate the new ->
kvirani has quit [Remote host closed the connection]
stewart_ has joined #ruby
<Rubinista> Does anyone know how to make an error during a test-case's self.startup method block the individual test cases? Test-Unit just tries running them anyways and they all fail for a lack of proper fixtures.
hemanth has quit [Read error: Connection reset by peer]
<Maher4Ever> fowl: I understand what you mean, I like providing options by yielding a config object in a block method {|c| c.opt = :something }
fbernier has quit [Ping timeout: 246 seconds]
DrForr has quit [Ping timeout: 246 seconds]
hemanth has joined #ruby
jakemask has joined #ruby
jstew has quit [Quit: leaving]
<jakemask> quick question, can you do #{ substitutions in a regex string?
<Maher4Ever> So does anyone knows anything about a memory pool in ruby? I have an extention that allocates a lot of memory and when it's run very fast, ruby errors on me with "[FATAL] failed to allocate memory"
<GarethAdams> jakemask: inside a /regex literal?/ yes
<Maher4Ever> jakemast: yes
nopolitica has joined #ruby
rqutab has joined #ruby
tommyvyo has quit [Ping timeout: 248 seconds]
reuf has joined #ruby
cmaujean has quit [Quit: cmaujean]
bbttxu has quit [Ping timeout: 248 seconds]
alek_b_ has joined #ruby
rowanu has quit [Remote host closed the connection]
jakemask has quit [Quit: Page closed]
nopolitica has quit [Client Quit]
alek_b has quit [Ping timeout: 240 seconds]
nopolitica has joined #ruby
Spooner has joined #ruby
jamesaxl has joined #ruby
syamajala has quit [Read error: Connection reset by peer]
linoj has quit [Ping timeout: 246 seconds]
syamajala has joined #ruby
jwg2s has joined #ruby
robert_ has joined #ruby
sailias has quit [Quit: Leaving.]
twock has quit [Quit: leaving]
wmoxam has quit [Ping timeout: 244 seconds]
robert45- has quit [Quit: • IRcap • 8.6 •]
twock has joined #ruby
jamesaxl has quit [Ping timeout: 246 seconds]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
jamesaxl has joined #ruby
RORgasm has quit [Remote host closed the connection]
luckyrub_ has joined #ruby
twinturbo has quit [Quit: twinturbo]
Berglund has joined #ruby
tommyvyo has joined #ruby
andrew has joined #ruby
andrew is now known as Guest37843
<Mon_Ouie> Maher4Ever: That's not the new hash form
<Mon_Ouie> Oh, unless it was just a typo
<Mon_Ouie> It's opt2: :sym2
IceDragon has joined #ruby
<jwg2s> I'd like to convert days 1 out of 365 to month and day, is this possible?
workmad3 has quit [Ping timeout: 244 seconds]
<Maher4Ever> Mon_Ouie: Yeah, it was a typo there
<jwg2s> I mean I know its possible, but is there a built in way with Date or Time?
<Mon_Ouie> Create a Time object for the day you're looking for, and use #mday and #month
luckyruby has quit [Ping timeout: 265 seconds]
luckyrub_ is now known as luckyruby
cantonic has quit [Quit: cantonic]
<Mon_Ouie> (You need to know the year to do this, or at least whether or not it's a leap year)
<jwg2s> i'm trying to convert a really old format from CCYYDDD to mysql
Ontolog_ has joined #ruby
<jwg2s> mysql friendly *
minijupe has joined #ruby
<Maher4Ever> Mon_Ouie: You are the guy behind coolline right? Great job man :). We just added support for it in Guard :)
<Mon_Ouie> Maher4Ever: Yep ;)
fridim_ has quit [Ping timeout: 246 seconds]
banseljaj is now known as imami|afk
oscardelben has quit [Read error: Connection reset by peer]
wvms has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
tzvi has quit [Remote host closed the connection]
cherrypeel has joined #ruby
oscardelben has joined #ruby
hemanth has joined #ruby
nopolitica has left #ruby [#ruby]
chomp has quit [Quit: Leaving]
Ontolog has quit [Ping timeout: 246 seconds]
Ontolog_ is now known as Ontolog
etehtsea has quit []
trivol has quit [Quit: trivol]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
cantonic has joined #ruby
bigoldrock has joined #ruby
_bart has quit [Quit: _bart]
hemanth has quit [Read error: Connection reset by peer]
nicoulaj has quit [Remote host closed the connection]
chrxn[a] has quit [Ping timeout: 255 seconds]
hemanth has joined #ruby
tayy has quit [Ping timeout: 265 seconds]
axl_ has quit [Quit: axl_]
tommyvyo has joined #ruby
babinho has quit [Remote host closed the connection]
vertroa has joined #ruby
chrxn[a] has joined #ruby
babinho has joined #ruby
internet_user has quit [Remote host closed the connection]
amacgregor_osx has joined #ruby
odigity has quit [Quit: Leaving]
twock has quit [Quit: Lost terminal]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
headius has quit [Quit: headius]
peterhellberg has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
greasegum has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
hemanth has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
SQLStud has quit [Quit: Leaving]
axl_ has joined #ruby
trivol has joined #ruby
AlbireoX_ has quit [Read error: Connection reset by peer]
syamajala has quit [Read error: Connection reset by peer]
bbttxu has joined #ruby
zemanel has joined #ruby
alanp has quit [Read error: Operation timed out]
rqutab has quit [Quit: rqutab]
balki_ has joined #ruby
alanp has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
balki has quit [Ping timeout: 255 seconds]
reuf has quit [Quit: Leaving]
panpaint1r has joined #ruby
panpainter has quit [Ping timeout: 248 seconds]
williamcotton has joined #ruby
rqutab has joined #ruby
LalTopi has quit [Ping timeout: 250 seconds]
minijupe has quit [Quit: minijupe]
williamcotton_ has quit [Ping timeout: 246 seconds]
PaciFisT has quit [Quit: Leaving.]
LalTopi has joined #ruby
[Neurotic] has joined #ruby
stat1x has quit [Remote host closed the connection]
stat1x has joined #ruby
<shevy> Mon_Ouie is the secret ruby master
<shevy> he even has some GUI thingy... I keep on forgetting the name :\
<shevy> I am going to call it Mon-GUI
stkowski has quit [Quit: stkowski]
sebicas has joined #ruby
wallerdev has quit [Quit: wallerdev]
jsime has quit [Quit: Leaving]
yoklov has quit [Quit: computer sleeping]
snearch has quit [Quit: Verlassend]
jwg2s has quit [Quit: jwg2s]
<Mon_Ouie> The 2D graphics library? Ray
oxyxian has quit [Ping timeout: 244 seconds]
<shevy> oh
<shevy> yeah
<Rubinista> Does anyone use self.startup/shutdown methods with TestUnit? I'm trying to figure out how to make a failure in startup prevent the methods from running (and all dying, because their fixtures aren't initialized.)
Cooper_ has quit [Ping timeout: 248 seconds]
joshman_ has quit [Quit: Computer has gone to sleep.]
<robert_> shevy :D
wvms has quit [Quit: wvms]
billiam has quit [Quit: Leaving]
wvms has joined #ruby
mengu has joined #ruby
<shevy> heya robert_
<shevy> you doing anything fun in ruby lately?
ryan0x2 has quit [Remote host closed the connection]
vitoravelino is now known as vitoravelino`afk
rbanffy has quit [Ping timeout: 246 seconds]
<robert_> yeah
<robert_> working on a padrino project. :D
<robert_> that responds to domains lol
awarner has quit [Remote host closed the connection]
wvms has quit [Remote host closed the connection]
obryan has quit [Quit: Konversation terminated!]
<shevy> hmm
wvms has joined #ruby
<shevy> is it fun?
rasbonics has joined #ruby
bradhe has quit [Remote host closed the connection]
rasbonics has quit [Client Quit]
<shevy> I am working on a collection of recipes similar to https://github.com/mxcl/homebrew/commits/master/Library/Formula
Cooper_ has joined #ruby
bradhe has joined #ruby
panpaint1r has quit [Ping timeout: 246 seconds]
dv310p3r has quit [Ping timeout: 246 seconds]
<peterhellberg> Rubinista: I’d probably exit straight from the spec_helper.rb (or similar)
Cooper_ has quit [Client Quit]
AlbireoX_ has joined #ruby
mucker has quit [Ping timeout: 240 seconds]
<peterhellberg> Rubinista: MiniTest::Unit::TestCase#setup and the equivalent before in MiniTest::Spec is run for each test, and you want to run the check once at test suite startup?
Z_Mass has joined #ruby
kirun has quit [Quit: Client exiting]
rqutab has quit [Quit: rqutab]
bradhe has quit [Ping timeout: 244 seconds]
jgarvey has quit [Quit: Leaving]
<hakunin> i have this simple ruby script that starts a resque worker https://gist.github.com/0828b60c2b2023677b4c
<hakunin> and i run it like this: >/dev/null 2>&1 LOG=log/resque.log PIDFILE=tmp/pids/resque.pid config/resque_worker &
<hakunin> when i run it manually it runs and backgrounds immediately
strife25 has quit [Ping timeout: 248 seconds]
<davidcelis> yep
<hakunin> but when I use ruby's system("...")
<hakunin> to run that same command
<hakunin> it blocks
<hakunin> and seems to be taking over the ruby process that ran it
<hakunin> and i have to ctrl+c out of it
davidw has joined #ruby
<davidw> https://rvm.io//integration/capistrano/ - anyone have any luck with this stuff?
<hakunin> i'm trying to figure out why does it block
<davidw> it simply "does not work" in that something is not picking up on the fact that I have rvm
<bperry> hakunin: because that is how threads work, if you don't want it to block make a new thread or proc
<hakunin> bperry: i thought that #system is supposed to fire a command and return a boolean based on its exit status. my command gets backgrounded, so it "exists" immediately, no?
<bperry> nope
GoGoGarrett has joined #ruby
<bperry> because it hasn't returned anything
mmokrysz has joined #ruby
<hakunin> ah
mmokrysz has left #ruby [#ruby]
<hakunin> bperry: so in my case i need more of a "fire and forget", which i'd like to work in 1.8.7,1.9.3
IcyDragon has joined #ruby
Athetiusdroid has joined #ruby
ixti has quit [Quit: So Long, and Thanks for All the Fish!]
hemanth has quit [Read error: Connection reset by peer]
nemesit has quit [Quit: Leaving...]
<Rubinista> peterhellberg: self.startup/shutdown are similar to before/after(:all) in rspec. I want to not try (silently fail) all tests in that TestSuite when they fail.
<Athetiusdroid> Hello all, I was wondering about creating a "connect" MySQL file like with PHP in ruby. If I just connect with con = Mysql.new and require_relative on the other file to call con.query it tells me that con is undefined.
<hakunin> bperry: do you know if system behavior changed from 1.8.7 to 1.9.3?
hemanth has joined #ruby
<hakunin> bperry: it used to work
mneorr has joined #ruby
<bperry> no idea
<Rubinista> peterhellberg: I can do this by having the setup (equivalent to before(:each)) check if the resources are initialized: "raise SetupError unless @resource", but I'd need to remember that for each suite...
<peterhellberg> Rubinista: There is something similar to after(:all) in minitest, but it seems like the general consensus is to do before checks in the test helper
IceDragon has quit [Ping timeout: 248 seconds]
<peterhellberg> Oh, are you using 1.8 or 1.9 btw?
bowlowni has quit [Remote host closed the connection]
bowlowni has joined #ruby
<Rubinista> peterhellberg: I guess the basic question is, "Is suite.startup raising an error but then continuing to run the individual tests, a bug?" Should I report this with a patch, or is it desired behavior?
<Rubinista> peterhellberg: 1.9, with test-unit gem 2.5.0
<peterhellberg> Rubinista: Ah, I thought you meant Minitest with the Test::Unit wrapper instead of the actual Test::Unit
<peterhellberg> Rubinista: I’ve never used Test::Unit with 1.9 so I’m not the best person to ask :)
<Rubinista> peterhellberg: No, but I am curious what it'd do - it'd help to know if this is right or not.
<Rubinista> peterhellberg: Thanks anyways!
<peterhellberg> Rubinista: np
htroyack has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
bowlowni has quit [Ping timeout: 252 seconds]
<peterhellberg> Rubinista: But I imagine that you could do something similar as you would in Minitest. That is, raising an exception/exiting from the test suite run in the test helper (before the entire suite is run)
<peterhellberg> Rubinista: startup seems to do the same job as before(:each) in RSpec and before in Minitest
hemanth has joined #ruby
yoklov has joined #ruby
pk1001100011 has quit [Ping timeout: 255 seconds]
pk1001100011 has joined #ruby
<Rubinista> peterhellberg: No, the runner silently quashes most errors. There are a few (Interrupt, SignalException, etc) it lets through, so I could throw one of those but a syntax error or div-by-zero would be hidden.
<peterhellberg> Rubinista: Ah, tricky :/
Draco_ has joined #ruby
mneorr has quit [Quit: Leaving.]
panpainter has joined #ruby
<peterhellberg> How about: exit unless fixtures_present?
jmccune has left #ruby [#ruby]
strife25 has joined #ruby
Aaton is now known as Aaton_off
<peterhellberg> Rubinista: fixtures_present? would obviously need to be written :)
sebicas has quit [Quit: sebicas]
oxyxian has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hunglin has quit [Ping timeout: 244 seconds]
hemanth has joined #ruby
Draco_ has quit [Read error: Connection reset by peer]
<Rubinista> peterhellberg: It's essentially what I do now. I require a dashboard object which is created in the startup so I just raise unless dashboard, but this is just yet another thing to forget...
Draco_ has joined #ruby
Draco___ has joined #ruby
<chiel> in ruby, is there some kinda norm on how to do TDD?
<chiel> i'm writing a rest api, and would like to take a TDD approach, but don't really know where to begin
g0bl1n has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
<Rubinista> chiel: Check out rspec or cucumber. Or do you mean something else?
<benson> chiel: read the rspec book
<peterhellberg> chiel: The norm is to do TDD/BDD in some capacity, the choice of framework to do it in, is up to each developer :)
<benson> explains TDD in depth
Draco_ has quit [Ping timeout: 248 seconds]
<benson> really great book
c0rn_ has joined #ruby
<peterhellberg> chiel: Yes, the RSpec book is very good, even if you decide to use another framework
hemanth has joined #ruby
EPIK has joined #ruby
<chiel> well, I know how tdd works, was just wondering if there's any frameworks that are considered "the norm"
iamjarvo has joined #ruby
<chiel> but i'll have a look at that rspec book :)
<chiel> thanks!
<peterhellberg> chiel: https://www.ruby-toolbox.com/categories/testing_frameworks <- RSpec is pretty popular :)
niklasb has quit [Quit: WeeChat 0.3.8]
<chiel> peterhellberg: cool thanks, will take a gander :)
bradhe has joined #ruby
<peterhellberg> chiel: I’m very happy with minitest/spec, and it doesn’t hurt that it is included in the Ruby Standard Library
bglusman_ has quit [Remote host closed the connection]
<chiel> peterhellberg: spec being rspec or?
<chiel> I just want to "do this right" (tm) etc
tvw has quit [Remote host closed the connection]
Z_Mass has quit [Ping timeout: 246 seconds]
bigoldrock has quit [Quit: Leaving.]
<peterhellberg> chiel: No, there is a "RSpec like" wrapper for Minitest::Unit
ephemerian has quit [Quit: Leaving.]
<peterhellberg> chiel: There isn’t really a single right way to do testing, and a lot of people would definitely suggest RSpec
<peterhellberg> s/testing/testing in Ruby/
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
<chiel> peterhellberg: fair enough, I'm just after something pretty minimal really. I'll mostly be doing a bunch of curl calls with various nouns to the api
<peterhellberg> chiel: Why? You should probably use rack-test and/or capybara for testing your api
rbanffy has joined #ruby
rbanffy has quit [Client Quit]
<chiel> peterhellberg: yeah that's why I was looking for suggestions, not 100% sure on how to approach it. :D
<peterhellberg> chiel: Fair enough
Z_Mass has joined #ruby
Z_Mass has quit [Read error: Connection reset by peer]
<peterhellberg> chiel: Most of my work is centered about building tested REST and Hypermedia APIs in Ruby… so you are welcome to ask questions :)
<peterhellberg> s/about/around/
<chiel> peterhellberg: oh yes, that's exactly what I am doing. trying to design a proper api for https://tinker.io
<chiel> which is basically a playground for making little snippets from html/css/js
<chiel> peterhellberg: so when you write tests for the apis you work on, what is your framework of choice?
<peterhellberg> chiel: Tend to go as minimal as possible (low number of dependencies) so I usually work with Sinatra and Minitest
baroquebobcat has quit [Quit: baroquebobcat]
<peterhellberg> chiel: http://pastie.org/4268780 <- Very trivial example of how it can look when you test an API using minitest/spec + rack-test
<chiel> peterhellberg: cool, I am writing the api in sinatra
<chiel> so all the better if I can use that to write the tests as well
uris has quit [Quit: leaving]
<peterhellberg> chiel: I generally write the business logic in PORO's (Plain old Ruby Objects) and test them separately
ringotwo has quit [Read error: Connection reset by peer]
<chiel> peterhellberg: the approach i was taking so far is basically one file, api.rb (a sinatra app) which handles all the various urls
ringotwo has joined #ruby
<chiel> and then just connects that to regular ruby classes
davidboy is now known as davidboy|alive
<peterhellberg> chiel: I’m also using JSON HAL for the representation in one of my latest projects, it’s pretty neat http://stateless.co/hal_specification.html
<peterhellberg> chiel: Yeah, that makes a lot of sense
advorak has joined #ruby
<peterhellberg> chiel: I generally want my Sinatra apps to be as simple as possible (as little logic as possible in the actual routing)
<chiel> peterhellberg: yeah, makes sense imo
<chiel> peterhellberg: hal looks nice, but you kinda want to avoid too many hits on your api, I guess
GarethAdams has quit [Quit: Leaving...]
panpainter has quit [Ping timeout: 240 seconds]
<chiel> so I guess you'll want to think about when to return nested resources and such
<peterhellberg> chiel: It depends, and HAL clients are pretty good at memoizing/caching the links
<chiel> but yeah, hyperlinking resources makes a lot of sense, imo
<chiel> peterhellberg: i have no idea about that :D
wallerdev has joined #ruby
<peterhellberg> chiel: Well, just take one step at the time. You can worry about Hypermedia later :)
eywu has quit [Quit: Leaving.]
panpainter has joined #ruby
jjang has joined #ruby
<chiel> peterhellberg: yeah tbh, my resources will be fairly flat, for now
<chiel> but I am pretty new to api design
<peterhellberg> chiel: I actually have written a gem with these kinds of applications in mind, it is called hazel
<chiel> so I will probably come running, crying :p
foohey has joined #ruby
<peterhellberg> One of my clients let me open source it recently
<chiel> ah nice :)
nej has quit [Ping timeout: 246 seconds]
trivol has quit [Quit: trivol]
sebicas has joined #ruby
bbttxu has quit [Quit: bbttxu]
Maher4Ever has quit [Quit: Ik ga weg]
Tomasso has quit [Ping timeout: 252 seconds]
hemanth has quit [Read error: Connection reset by peer]
<chiel> hm, with curl how do you send a json object as the response body?
<peterhellberg> Ehm, do you mean in the request?
<dekz> I think he does
foohey has quit [Quit: leaving]
hemanth has joined #ruby
<chiel> er yeah
<chiel> request body
<shadoi> chiel: depends if you need to send a multi-part encoded form response, or just put the body
<peterhellberg> curl -X POST -d "<JSON>" http://your.api/
wilmoore has joined #ruby
<shadoi> curl -X POST http://url -d @file.json
<chiel> peterhellberg: hmm, thought that was it, but it's showing up as a key/value pair, with the json being the key
<shadoi> yeah, @ works nice for pull in file contents
<shadoi> chiel: your app is expecting form encoded input
ringotwo has quit [Read error: Connection reset by peer]
axl_ has quit [Quit: axl_]
<chiel> shadoi: aha ok :)
<shadoi> you do that by using multiple "-d key=value"
ringotwo has joined #ruby
<chiel> shadoi: hm, yeah, but I thought it was possible to simply send an entire json object over post, or is it only possible to do key/value pairs?
ringotwo has quit [Read error: Connection reset by peer]
<shadoi> chiel: it just depends what the app expects
<shadoi> most REST services take JSON bodies
ringotwo has joined #ruby
<chiel> shadoi: yeah, that's what I am trying to achieve :D
<chiel> but I don't know how to send a json body with curl, hehe
<shadoi> yeah, we just told you
<shadoi> but you need to make your app accept it
<shadoi> or whoever controls the app
krusty_ar has quit [Ping timeout: 246 seconds]
<chiel> aha ok, perhaps i am using the wrong var then, or something.
<chiel> it's in sinatra, I was using params
<chiel> but that shows it as a key/value pair
liluo has joined #ruby
<shadoi> You don't use a var if you just want to send the whole body
<shadoi> You need to get the body from the request object
GarethAdams has joined #ruby
khakimov has joined #ruby
<shadoi> request.body.rewind / request.body.read
<chiel> ah, thanks
<peterhellberg> chiel: Check your request.body
<peterhellberg> Oh, nevermind :)
<chiel> hm
<chiel> that still shows a key/value pair.. grr
hemanth has quit [Read error: Connection reset by peer]
sepp2k has quit [Remote host closed the connection]
Chryson has joined #ruby
<chiel> $ curl -X POST -d @user.json api.tinker.dev/user
<chiel> {"{\"id\": 1, \"username\": \"chiel\"}":null}
jgrevich has quit [Quit: jgrevich]
<chiel> and that request is just returning `request.body.read`
randomautomator has quit [Remote host closed the connection]
<shadoi> looks like JSON to me?
<chiel> since I can't even handle this, maybe it's time to go to bed..
subbyyy has joined #ruby
<chiel> shadoi: yes, but it treats it as a key/value pair
<shadoi> ah
<shadoi> yes
luckyruby has quit [Remote host closed the connection]
hemanth has joined #ruby
<chiel> maybe that's how it always is, no idea, but that's what threw me off initially
<shadoi> nah, that looks fishy
<shadoi> make sure JSON.parse(request.body.read) works as expected.
pk1001100011_ has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
davidboy|alive is now known as davidboy|living
<chiel> shadoi: seems to return exactly the same response... really weird
davidboy|living is now known as davidboy
<peterhellberg> chiel: And your user.json only contains {"id":1,"username":"chiel"}?
<chiel> peterhellberg: yep
<chiel> just trying to run a quick test
<chiel> but.. failing :D
krz has joined #ruby
pk1001100011 has quit [Ping timeout: 244 seconds]
raz has joined #ruby
<peterhellberg> I’ve got JSON.parse(request.body.read).inspect in a post "/" here, and it works just fine
<raz> anyone know how to prevent rubygems from creating a wrapper for certain files in bin/ (when creating a gem)?
<chiel> probab;y just something fishy going on I guess
<shadoi> raz: don't list them as executables
<raz> i'm trying to bundle a real binary, but the wrapper tries to 'load', which obviously fails
<raz> shadoi: ah, then they will just go plain into the bin-dir?
<raz> gonna try that
hemanth has quit [Read error: Connection reset by peer]
<shadoi> raz: if you use bundler it likes to list all files in bin/ as executables by default
<shadoi> you have to change it
hemanth has joined #ruby
<raz> shadoi: yes, i'm gonna remove my binary from that now and see if that unwraps it
<shadoi> The only problem is, it won't create a symlink or anything, so it'll be in your gem path
<shadoi> kinda inconvenient.
<chiel> aha, now it works, I was being a retard
<chiel> that means, it's time to go to sleep, probably :p
<chiel> thanks for the help guys
<peterhellberg> chiel: Well, I’m heading to bed now. But you are welcome to ask me more questions about building APIs with Sinatra ( My contact info is on http://c7.se/ )
<peterhellberg> chiel: np
<chiel> ah, a swede!
<peterhellberg> chiel: yep
<chiel> I hung out there for 1 year and 8 months before moving to london
hemanth has quit [Read error: Connection reset by peer]
pk1001100011_ is now known as pk1001100011
<chiel> peterhellberg: anyway, sleep well, see you later
<peterhellberg> I see, it is a pretty nice country to live in. But I tend to escape to Asia in the darkest part of the winter :)
<peterhellberg> chiel: The same to you
sailias has joined #ruby
<chiel> peterhellberg: sweden is a bit too quiet for me
yxhuvud has quit [Ping timeout: 252 seconds]
<chiel> peterhellberg: london is more up my alley, was a nice experience though, stockholm
<chiel> i worked at spotify there
ryan0x2 has joined #ruby
hemanth has joined #ruby
axl_ has joined #ruby
<peterhellberg> Ah, I’ve some friends who have/will work there.
<chiel> peterhellberg: cool, it's a pretty popular location i guess, for tech-people in Stockholm
<GeekOnCoffee> Woo spotify
<chiel> lot of kth people roaming the halls
<peterhellberg> There are a small startup scene here, but most of the action in Europe seems to be happening in Berlin now
<peterhellberg> It used to be London, but Berlin is where its at now :)
<chiel> yeah, berlin is pretty popular now
<chiel> but... german
<chiel> i like london cause i speak the language! :D
<raz> shadoi: indeed. any idea how to locate the path where my gem was installed from inside ruby? :/
<chiel> anyway, bedtime
<chiel> see you guys
<peterhellberg> Later then