<havenwood>
wayne__: From the manpage: -e command Specifies script from command-line while telling Ruby not to search the rest of the arguments for a script file name.
<wayne__>
woop de friggin doo
<wayne__>
lol thanks a bunch
<havenwood>
no prob
heidi has joined #ruby
<wayne__>
very nice, but looks like it could be annoying if I wanted to test multi-line code, no?
<havenwood>
wayne__: You'd likely want to use a REPL.
<havenwood>
wayne__: Ruby ships with `irb` but just grab the gem called Pry and use `pry` instead.
<jberlinsky>
Was moving from ::Enumerator.new(self, :materialize_hits, hits) due to deprecation warnings
<jberlinsky>
Wound up having to use the nested blocks to avoid errors
werdnativ has joined #ruby
dma_ has quit [Remote host closed the connection]
dma_ has joined #ruby
iamjarvo_ has joined #ruby
DonRichie has quit [Quit: Verlassend]
vlad_starkov has quit [Read error: Connection reset by peer]
peregrine81 has joined #ruby
timonv has joined #ruby
dma_ has quit [Ping timeout: 240 seconds]
dmiller has joined #ruby
lyanchih has joined #ruby
fmcgeough has joined #ruby
rickruby has quit [Remote host closed the connection]
werdnativ has quit [Quit: werdnativ]
predator217 has joined #ruby
ageis has joined #ruby
rickruby has joined #ruby
am3n has joined #ruby
capicue has quit [Read error: Connection reset by peer]
Soda has quit [Read error: Connection reset by peer]
ageis is now known as Guest46584
rickruby has quit [Read error: Connection reset by peer]
mmcdaris has quit [Quit: mmcdaris]
rickruby has joined #ruby
timonv has quit [Ping timeout: 246 seconds]
s2013 has quit [Ping timeout: 245 seconds]
Foredoomed has joined #ruby
hiroyuki has joined #ruby
predator117 has quit [Ping timeout: 272 seconds]
echevemaster has joined #ruby
am3n has quit [Ping timeout: 256 seconds]
lyanchih has quit [Quit: lyanchih]
mmcdaris has joined #ruby
sevenseacat has joined #ruby
marr has quit []
iliketurtles has quit [Quit: zzzzz…..]
Jeticus has quit []
pu22l3r has joined #ruby
zipper_ has joined #ruby
sailias has joined #ruby
havenwood has quit [Remote host closed the connection]
dmiller has quit [Remote host closed the connection]
<zipper_>
Uh how can I install ruby 1.8.3 or 1.8.6 The following isn't working `ruby-build 1.8.6-p111 /opt/rubies/ruby-1.8.6-p111`
havenwood has joined #ruby
dmiller has joined #ruby
<sevenseacat>
ouch
<zipper_>
I know 1.8.3 is old and unsupported but I did the koans on it and now ruby 2.0 has just confused the whole thing up.
<shevy>
zipper_ I use versioned appdirs for that. in order to recover, I just change one symlink to point at the version of the program I want to use
<sevenseacat>
you really should not be using 1.8.3 or 1.8.6 under any circumstance
<zipper_>
I did it on ubuntu 12.04 LTS in ruby 1.8.3 but just migrated to arch which is on 2.0 I'm using chruby but can't find 1.8.3 to install it in /opt
<sevenseacat>
even 1.8.7 is past EOL
CaptainJet has joined #ruby
<shevy>
I have no idea what ruby-build is though, perhaps you can compile 1.8.7 from source: ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.bz2
<zipper_>
shevy: the problem is that I can't find ruby 1.8.* anywhere.
<dcope>
the server is definitely sending back a 301
tonni has quit [Read error: Connection reset by peer]
tonni has joined #ruby
jonahR has quit [Quit: jonahR]
bugsinlights has joined #ruby
nazty has joined #ruby
Methylated has joined #ruby
DanKnox_away is now known as DanKnox
<poutine>
wow, that's really unprofessional to use your pastebin site to beg for money
mmcdaris has quit [Quit: mmcdaris]
mercwithamouth has quit [Ping timeout: 260 seconds]
kil0byte has quit [Ping timeout: 272 seconds]
* Spitfire
shrugs
gregorg has quit [Ping timeout: 272 seconds]
ZadYree has quit [Ping timeout: 272 seconds]
jglauche has quit [Ping timeout: 272 seconds]
contradictioned_ has quit [Ping timeout: 272 seconds]
jglauche has joined #ruby
<Spitfire>
Didn't know there was a professional code of conduct for the people who run pastebin sites.
gregorg has joined #ruby
|jemc| has joined #ruby
<poutine>
You should just feel bad if you're soliciting internet strangers to give you money with a sob story, knowing the reason they use your site has nothing to do with their cause
contradictioned has joined #ruby
<dcope>
poutine: meh, he's family member needs money for medical bills and pastie.org has never had ads / charged
<dcope>
seems fine to me
ZadYree has joined #ruby
s3itz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fmcgeough has quit [Quit: fmcgeough]
kil0byte has joined #ruby
zipper has quit [Quit: bye bros]
* sevenseacat
hides all of the messages
<dcope>
anyways, i don't get why this isn't redirecting
rickruby has quit [Remote host closed the connection]
tsykoduk is now known as zz_tsykoduk
jlast has quit [Remote host closed the connection]
Shidash has quit [Quit: Leaving.]
jlast has joined #ruby
RichardBaker has joined #ruby
freerobby has quit [Quit: Leaving.]
Zeeraw has joined #ruby
natevick has joined #ruby
allaire has joined #ruby
Methylated has quit [Quit: Leaving.]
mfridh has quit [Read error: Connection reset by peer]
mmcdaris has joined #ruby
jlast has quit [Ping timeout: 260 seconds]
natevick has quit [Client Quit]
coderhs has quit [Ping timeout: 245 seconds]
<volty>
the world is free and should remain free: everybody free to beg in whatever way he feels right // it all depends on the respective needs, on which we know nothing
Guest37773 has quit [Ping timeout: 248 seconds]
<unstable>
Is there an addressable gem but for file names/directories?
<volty>
attributing «unprofessional» is snobby
<banisterfiend>
volty go to sleep
<banisterfiend>
it's late where you are ;)
otherj has joined #ruby
<volty>
in few minutes, dear :)
zz_tsykoduk is now known as tsykoduk
otherj has quit [Max SendQ exceeded]
justsee has joined #ruby
otherj has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
otherj has quit [Max SendQ exceeded]
Zeeraw has quit [Read error: Connection reset by peer]
otherj has joined #ruby
otherj has quit [Max SendQ exceeded]
psyl0n has quit [Quit: psyl0n]
mercwithamouth has joined #ruby
<volty>
before I want to say goodbye to coin souls that spit sentences and judgements -- the understairs intelligence :)
mois3x_ has joined #ruby
<volty>
do the opposite: be professional! Open you own pastebin free of beg site!
mois3x_ has left #ruby [#ruby]
<volty>
but you won't! you wake up just to spit on others
<volty>
misery
volty has quit [Quit: Konversation terminated!]
schickung has quit [Quit: schickung]
kil0byte has quit [Remote host closed the connection]
heidi has joined #ruby
vlad_starkov has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
heftig_ has joined #ruby
rickruby has joined #ruby
nutella has joined #ruby
nutella is now known as Guest64979
am3n has joined #ruby
Hanmac has quit [Ping timeout: 240 seconds]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
Hanmac has joined #ruby
iamjarvo_ has quit [Remote host closed the connection]
petey___ has joined #ruby
<dcope>
i figured out the problem
tsykoduk is now known as zz_tsykoduk
zz_tsykoduk is now known as tsykoduk
<dcope>
why in the ever loving hell is #code on net http response object a string?!
varfoo has joined #ruby
thepumpkin has joined #ruby
pu22l3r has quit [Remote host closed the connection]
am3n has quit [Ping timeout: 256 seconds]
pu22l3r has joined #ruby
petey__ has quit [Read error: Operation timed out]
gyre007 has quit [Remote host closed the connection]
<shiney>
i'd guess it's because the error code is a string of numbers, and has no meaning as a numeric value
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shiney>
code + 1 really doesn't mean anything
mengu has joined #ruby
sailias has quit [Ping timeout: 245 seconds]
<dcope>
shiney: it's not an error code, it's a response code
jaimef has quit [Excess Flood]
<dcope>
i guess the 'ruby' way to do this is to compare classes to see if the response is a HTTPRedirection
<shiney>
i stand by what i said, even though i used the wrong word
thepumpkin has quit [Ping timeout: 248 seconds]
<shiney>
it's just a rationalization though
<shiney>
i'm not vouching for the decision
pu22l3r has quit [Ping timeout: 268 seconds]
mmcdaris has quit [Quit: mmcdaris]
smathieu has joined #ruby
mmcdaris has joined #ruby
jlast has joined #ruby
<unstable>
How can I read all the elements in an array except the last one?
mengu has quit [Ping timeout: 246 seconds]
<unstable>
Array[0..-2].each
<unstable>
That works, nevermind.
freerobby has joined #ruby
randomnick_ has quit [Quit: Leaving]
jaimef has joined #ruby
mercwithamouth has quit [Ping timeout: 272 seconds]
smathieu has quit [Ping timeout: 260 seconds]
pu22l3r has joined #ruby
earthquake has quit [Quit: earthquake]
freerobby has quit [Ping timeout: 240 seconds]
timonv has joined #ruby
adjo_ has quit [Ping timeout: 240 seconds]
adjo has quit [Ping timeout: 240 seconds]
Guest64979 has quit [Ping timeout: 245 seconds]
jlast has quit [Ping timeout: 240 seconds]
earthquake has joined #ruby
mmcdaris has quit [Quit: mmcdaris]
petey___ has quit [Remote host closed the connection]
Hobogrammer has quit [Read error: Connection reset by peer]
mary5030 has quit [Remote host closed the connection]
ixti has quit [Ping timeout: 240 seconds]
Hobogrammer has joined #ruby
fixl has joined #ruby
brianpWins has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
coca_rails has joined #ruby
tsykoduk is now known as zz_tsykoduk
nisstyre has quit [Quit: Leaving]
edwardly has quit [Read error: Operation timed out]
mixel has quit [Quit: mixel]
<bnagy>
dcope: the ruby way is pretty much never to compare classes
<dcope>
bnagy: ok so you can either convert response code from a string to an int (which is stupid and just awful) or you can to see if the response falls within a class
<dcope>
which has full inheritence of different response types... so, that's what is suppsoed to be done
<poutine>
Most novelty languages leave you with some particular aspect that sticks with you, like, "Oh in TCL everything in a string", "I can't believe how much you can do all that with 8 chracters, and it's slightly more readable than perl", or "Common LISP is a cool concept, but I don't think I'll get much done in it". With Ruby, that thing that sits with me is, "This language is horrible, it reeks of someone going 'hey it can't do
<poutine>
this', and someone randomly coming up with a way of making it work, like encodings in comments, specifying quote style with %q/%Q, making dedicated keywords for simple negation. This is just horrible, and you should all feel bad. Both the people creating this ecosystem, and the people who feed off of it, you're all terrible terrible people"
<poutine>
OOps the 8 characters thing was about brainf**k
sailias has quit [Quit: Leaving.]
banisterfiend has quit [Quit: Computer has gone to sleep.]
hiyosi has quit [Ping timeout: 245 seconds]
pr0ggie has joined #ruby
yacks has quit [Ping timeout: 240 seconds]
am3n has joined #ruby
axl_ has quit [Ping timeout: 240 seconds]
<bnagy>
uh...
<zzak>
wi 1
<bnagy>
cool story?
ananthakumaran has quit [Quit: Leaving.]
am3n has quit [Ping timeout: 256 seconds]
fboudreau has joined #ruby
fboudreau has left #ruby [#ruby]
<jblack>
No doubt he'll explain how ruby is a leftover ww2 german plot.
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
duracrisis has joined #ruby
<poutine>
jblack, Do you have anything to do with ruby development?
<poutine>
I remember when you owned DALnet's #linux and lost time after time to me in chess about 10 years ago
<jblack>
nope. I just use the language.
<poutine>
also seem to remember you having some involvement with ubuntu
dmiller has joined #ruby
<jblack>
Yeah, I worked there for about a year and a half
vlad_starkov has joined #ruby
hiyosi has joined #ruby
<jblack>
I didn't use ruby back then.
sevenseacat has quit [Remote host closed the connection]
sevenseacat has joined #ruby
sorbo_ has quit [Quit: sorbo_]
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
cburyta_ has quit [Remote host closed the connection]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cburyta has joined #ruby
samfisher has quit [Read error: Operation timed out]
Monie has joined #ruby
osvico has joined #ruby
ewnd9 has joined #ruby
thepumpkin has joined #ruby
bklane has quit [Remote host closed the connection]
pu22l3r has quit [Ping timeout: 268 seconds]
pu22l3r has joined #ruby
cburyta has quit [Ping timeout: 245 seconds]
timonv has joined #ruby
freerobby has joined #ruby
<shevy>
we all did mistakes when we were young
thepumpkin has quit [Ping timeout: 240 seconds]
znode has joined #ruby
petey__ has quit [Ping timeout: 245 seconds]
petey__ has joined #ruby
baroquebobcat has joined #ruby
noop has joined #ruby
timonv has quit [Ping timeout: 246 seconds]
<jblack>
=)
baroquebobcat has quit [Client Quit]
ewnd9 has quit [Max SendQ exceeded]
smathieu has joined #ruby
burgess has quit [Quit: ^zzz]
Tearan has quit [Quit: Sleepy Badger....]
godd2 has quit [Ping timeout: 250 seconds]
mary5030 has joined #ruby
smathieu has quit [Ping timeout: 240 seconds]
rickruby has joined #ruby
rickruby has quit [Remote host closed the connection]
epta has quit [Ping timeout: 265 seconds]
epta has joined #ruby
rickruby has joined #ruby
tonni_ has joined #ruby
tonni has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Quit: Leaving.]
pdimitrov has quit [Read error: Operation timed out]
<dzan>
apeiros, ok i'll look for some flag adding method :)
<hoelzro>
that looks like uncontrolled recrusion to me
<hoelzro>
*recursion
<apeiros>
^
<dzan>
hoelzro, yeah and it's the grep for some reason I don't see
<hoelzro>
dzan: could you paste the full source?
<apeiros>
regexen do not call methods dzan
<apeiros>
they are not responsible for your recursion
<dzan>
hoelzro, I rewind because I had trouble with that before, I used .find twice and the second time without rewind it would start from where the last left off
<hoelzro>
right
<hoelzro>
but now you're opening the file, and calling rewind on it right away
<hoelzro>
which will be a no-op, and a wasted system cal
<hoelzro>
*call
<hoelzro>
it's not *that* big a deal, but I just thought I'd point it out =)
<dzan>
hoelzro, I cut out some stuff in my paste :p
<RubyPanther>
that would be a recursive descent engine instead of a regex
<bnagy>
plus creating a new regexp evey time, which is wasteful
weeb1e has quit [Read error: Connection reset by peer]
threesome has joined #ruby
<hoelzro>
bnagy: ah, good call!
weeb1e has joined #ruby
ItSANg___ has quit [Ping timeout: 265 seconds]
<dzan>
apeiros, so I'd best join my array strings into 1 with '|' and then create a new regex?
<bnagy>
plus I don't know what list_files does but it's suspicious when it's trivial to do that with builtins
cburyta has quit [Remote host closed the connection]
rickmasta has quit [Quit: Leaving...]
Mekkis has joined #ruby
azerton has joined #ruby
Zeeraw has joined #ruby
dv__ has quit [Ping timeout: 272 seconds]
Mekkis has quit [Max SendQ exceeded]
Mekkis has joined #ruby
shredding has quit [Quit: shredding]
Rocksurf70 has joined #ruby
asuka has quit [Ping timeout: 240 seconds]
fightback has quit [Quit: blackbagged]
sayan has joined #ruby
Rocksurf70 has left #ruby [#ruby]
azerton has quit [Read error: Connection reset by peer]
osvico has joined #ruby
shredding has joined #ruby
shredding has quit [Client Quit]
dv_ has joined #ruby
tonni has joined #ruby
Zeeraw has quit [Ping timeout: 240 seconds]
petey__ has quit [Remote host closed the connection]
asuka has joined #ruby
rickruby has quit [Remote host closed the connection]
Astralum has joined #ruby
azerton has joined #ruby
freerobby has joined #ruby
tsykoduk is now known as zz_tsykoduk
Astral_ has quit [Ping timeout: 248 seconds]
banisterfiend has quit [Quit: Computer has gone to sleep.]
danshultz has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
am3n has joined #ruby
pipecloud has quit [Read error: Connection reset by peer]
pipework has joined #ruby
Zeeraw has joined #ruby
dyyylan has joined #ruby
am3n has quit [Ping timeout: 256 seconds]
taternuts has joined #ruby
p7r has joined #ruby
noop has quit [Ping timeout: 245 seconds]
Zeeraw has quit [Client Quit]
shaunbak_ has quit [Remote host closed the connection]
Zeeraw has joined #ruby
thepumpkin has joined #ruby
shaunbaker has joined #ruby
Zeeraw has quit [Client Quit]
Zeeraw has joined #ruby
Zeeraw is now known as zeeraw
jkamenik has joined #ruby
mephux has quit [Ping timeout: 245 seconds]
osvico has quit [Ping timeout: 246 seconds]
mephux has joined #ruby
shaunbaker has quit [Ping timeout: 245 seconds]
am3n has joined #ruby
schickung has joined #ruby
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
thepumpkin has quit [Ping timeout: 272 seconds]
thyagobr has joined #ruby
larissa has joined #ruby
SilverKey has quit [Remote host closed the connection]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mercwithamouth has quit [Ping timeout: 246 seconds]
azerton has quit [Read error: Connection reset by peer]
robert_ has joined #ruby
ravster has joined #ruby
VTLob has quit [Quit: VTLob]
varfoo has quit [Quit: WeeChat 0.4.0]
colonolGron has quit [Quit: Lost terminal]
smathieu has joined #ruby
Clooth has quit [Ping timeout: 272 seconds]
am3n has quit [Remote host closed the connection]
smathieu has quit [Ping timeout: 248 seconds]
banisterfiend has joined #ruby
Bry8Star{T2 has joined #ruby
popl has quit [Quit: We must make an idol of our fear, and call it God.]
vlad_starkov has joined #ruby
azerton has joined #ruby
sayan has quit [Ping timeout: 272 seconds]
azerton has quit [Client Quit]
tjad_ has joined #ruby
maveonair has joined #ruby
mercwithamouth has joined #ruby
tjad has quit [Ping timeout: 260 seconds]
heftig has quit [Ping timeout: 248 seconds]
jonathanwallace1 has quit [Ping timeout: 245 seconds]
eka has joined #ruby
pyrac has joined #ruby
fgh has quit [Quit: Leaving]
freerobby has quit [Quit: Leaving.]
gyre007 has quit [Ping timeout: 240 seconds]
madb055 has joined #ruby
nerium has joined #ruby
<nerium>
Anyone know how to install ruby-prof under osx 10.9?
cads has joined #ruby
yalue has joined #ruby
psyl0n has quit [Quit: psyl0n]
ace_striker has quit [Ping timeout: 250 seconds]
kaspergrubbe has joined #ruby
mikecmpbll has joined #ruby
tommyblue has quit [Ping timeout: 264 seconds]
h_kon has joined #ruby
newbiehacker has quit [Ping timeout: 245 seconds]
tommyblue has joined #ruby
_maes_ has quit [Read error: Connection reset by peer]
shredding has joined #ruby
hiroyuki has joined #ruby
am3n has joined #ruby
zz_tsykoduk is now known as tsykoduk
VTLob has joined #ruby
ixti has joined #ruby
pothibo has joined #ruby
xk_id has joined #ruby
ArchBeOS has joined #ruby
achru has quit [Remote host closed the connection]
achru has joined #ruby
xk_id has quit [Client Quit]
maveonair has quit [Ping timeout: 272 seconds]
ArchBeOS has quit [Read error: Connection reset by peer]
ArchBeOS has joined #ruby
achru has quit [Ping timeout: 240 seconds]
zipper has quit [Ping timeout: 260 seconds]
samfisher has quit [Ping timeout: 260 seconds]
xk_id has joined #ruby
elux has joined #ruby
am3n has quit [Remote host closed the connection]
t_p has joined #ruby
taternuts has quit [Ping timeout: 246 seconds]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ffranz has joined #ruby
psyl0n has joined #ruby
am3n has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
justsee has quit [Ping timeout: 248 seconds]
zipper has joined #ruby
krawchyk has joined #ruby
psyl0n has quit [Client Quit]
havenwood has joined #ruby
pipework has quit [Disconnected by services]
kaspergrubbe has quit [Remote host closed the connection]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 246 seconds]
elux has quit [Quit: Leaving...]
tjad_ has quit [Quit: No Ping reply in 180 seconds.]
tsykoduk is now known as zz_tsykoduk
tjad has joined #ruby
shaunbaker has joined #ruby
iaj has quit [Ping timeout: 272 seconds]
am3n has quit [Remote host closed the connection]
MrZYX is now known as MrZYX|off
derebos has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
lsmola has quit [Ping timeout: 240 seconds]
heftig has joined #ruby
IceDragon has joined #ruby
stringoO has joined #ruby
iaj has joined #ruby
aspires has quit [Quit: sudo making a sandwich]
mark_locklear has joined #ruby
coderhs has quit [Quit: Leaving]
gyre007 has joined #ruby
smathieu has joined #ruby
maveonair has joined #ruby
zigomir has quit [Quit: zigomir]
Lewix has joined #ruby
lewis has joined #ruby
t_p has quit [Ping timeout: 245 seconds]
ArchBeOS has quit [Quit: ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]]
maycon has joined #ruby
nonamehero has quit [Ping timeout: 245 seconds]
gyre007 has quit [Ping timeout: 272 seconds]
smathieu has quit [Ping timeout: 272 seconds]
polaco_zZz is now known as polaco
iamjarvo has joined #ruby
shadoi has quit [Ping timeout: 245 seconds]
Aryasam has joined #ruby
kaldrenon has joined #ruby
binaryplease has joined #ruby
cody-- has joined #ruby
wallerdev has joined #ruby
iamjarvo has quit [Remote host closed the connection]
ahawkins|swim has quit [Ping timeout: 246 seconds]
shadoi has joined #ruby
iamjarvo has joined #ruby
nerium has quit [Quit: nerium]
platzhirsch1 has joined #ruby
fuhgeddaboudit has quit [Read error: Operation timed out]
jerius has joined #ruby
<platzhirsch1>
Any good idea to change the formatting of YAML.dump? I have an array of hashes and if I write it myself I add an extra new line after each hash
gtsiftsis has joined #ruby
allaire has joined #ruby
AndChat| has joined #ruby
nonamehero has joined #ruby
iamjarvo has quit [Ping timeout: 272 seconds]
adjo has joined #ruby
Banistergalaxy has quit [Ping timeout: 248 seconds]
adjo_ has joined #ruby
shaunbaker has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 240 seconds]
devoldmx has joined #ruby
shaunbaker has joined #ruby
Aryasam has quit [Ping timeout: 245 seconds]
himsin has joined #ruby
chinychinchin has quit [Read error: Connection reset by peer]
ahawkins|swim has joined #ruby
chinychinchin has joined #ruby
fightback has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
fightback has quit [Max SendQ exceeded]
breakingthings has joined #ruby
randomnick_ has joined #ruby
kaspergrubbe has joined #ruby
Catie has quit [Ping timeout: 272 seconds]
shaunbaker has quit [Ping timeout: 245 seconds]
t_p has joined #ruby
vpretzel has joined #ruby
Catie has joined #ruby
elux has joined #ruby
chinychinchin has quit [Ping timeout: 245 seconds]
nucatus has joined #ruby
dhilipsiva has quit [Remote host closed the connection]
dhilipsiva has joined #ruby
Monie has joined #ruby
kaspergrubbe has quit [Read error: Operation timed out]
rickmasta has joined #ruby
gasbakid_ has joined #ruby
relix has joined #ruby
burlyscudd has joined #ruby
gasbakid has quit [Ping timeout: 240 seconds]
dhilipsiva has quit [Ping timeout: 245 seconds]
h_kon has quit [Remote host closed the connection]
casad has quit [Remote host closed the connection]
tomzx_mac has joined #ruby
burlyscudd has quit [Client Quit]
schickung_ has joined #ruby
rickmasta has quit [Remote host closed the connection]
jibi has joined #ruby
tjad has quit [Ping timeout: 272 seconds]
devoldmx has quit [Ping timeout: 272 seconds]
mlpinit has joined #ruby
MrZYX|off is now known as MrZYX
freerobby has joined #ruby
devoldmx has joined #ruby
schickung has quit [Ping timeout: 245 seconds]
schickung_ is now known as schickung
devoldmx has quit [Read error: Connection reset by peer]
am3n has joined #ruby
sambao21 has joined #ruby
devoldmx has joined #ruby
fveillette has joined #ruby
<fveillette>
Hii
<hoelzro>
fveillette: hello
<fveillette>
I'm working with chef server and i search a class or a method in ruby to check if a windows service running
<fveillette>
does anybody here have a clue about that?
lfox has joined #ruby
freerobby has quit [Quit: Leaving.]
<platzhirsch1>
How can I substitute a string with a regular expression by itself plus some addition characters to add
chinychinchin has quit [Quit: Konversation terminated!]
chinychinchin has joined #ruby
Guest3813 has quit [Ping timeout: 246 seconds]
chandlermelton1 has joined #ruby
chandlermelton1 has left #ruby [#ruby]
rehat has joined #ruby
shaunbak_ has joined #ruby
robbyoconnor has quit [Ping timeout: 245 seconds]
flops has joined #ruby
Davey has joined #ruby
nerium has quit [Quit: nerium]
CaptainJet has joined #ruby
MrZYX|off is now known as MrZYX
nerium has joined #ruby
niklasb_ has joined #ruby
hashpuppy has joined #ruby
s2013 has joined #ruby
kevind has joined #ruby
<hashpuppy>
does BigDecimal solve the rounding error that occurs with float?
polymar has joined #ruby
bean__ has joined #ruby
chinychinchin has quit [Ping timeout: 272 seconds]
axl_ has joined #ruby
zigomir has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
niklasb has quit [Ping timeout: 246 seconds]
<Mon_Ouie>
Those errors won't happen for computations that you perform with them. Keep in mind that you still can't represent sqrt(2) or π exactly with them.
IceyEC has joined #ruby
chuk has joined #ruby
ahawkins|swim is now known as ahawkins
maveonair has quit [Ping timeout: 240 seconds]
maveonair has joined #ruby
interactionjaxsn has joined #ruby
<hashpuppy>
thanks
aspires has quit [Quit: Adios]
maletor has joined #ruby
freezey has joined #ruby
xk_id has joined #ruby
LarsSmit has quit [Quit: Leaving.]
jbpros has joined #ruby
pyrac has joined #ruby
NutsEverywhere has joined #ruby
apeiros_ has quit [Remote host closed the connection]
simplex_ has quit [Quit: simplex_]
apeiros has joined #ruby
nerium has quit [Quit: nerium]
derebos has quit [Ping timeout: 245 seconds]
xk_id has quit [Client Quit]
skaflem has quit [Quit: This computer has gone to sleep]
nerium has joined #ruby
jibi has joined #ruby
tagrudev has quit [Read error: Connection reset by peer]
rickmasta has quit [Quit: Leaving...]
apeiros has quit [Ping timeout: 272 seconds]
wildroman has quit [Remote host closed the connection]
epta has quit [Quit: leaving]
wildroman has joined #ruby
gtsiftsis has quit [Quit: Leaving]
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
wildroman has quit [Read error: Connection reset by peer]
Advocation has joined #ruby
hello_world_ has quit [Ping timeout: 250 seconds]
rickruby has joined #ruby
lsmola has joined #ruby
wildroman has joined #ruby
<jxf>
Given a string of arbitrary, well-formed HTML text, how might I extract all <a> tags which are not inside parentheses?
lmickh has joined #ruby
Xeago has joined #ruby
_md has joined #ruby
_md has quit [Client Quit]
<havenwood>
jxf: I'm curious why a tag would ever be in parens?
jonathanwallace1 has joined #ruby
<jxf>
havenwood: I think you might be misunderstanding me. Consider, e.g., the fragment "Science (from Latin scientia, meaning "knowledge"[1])" where "knowledge" and "Latin" are a-tagged.
avril14th has quit [Remote host closed the connection]
Squarepy has quit [Ping timeout: 272 seconds]
<havenwood>
jxf: ah, gotcha
<danielshi>
jxf: are the parentheses also well-formed?
<jxf>
danielshi: Yes.
<danielshi>
I guess the most correct way is to use a proper HTML parser like nokogiri and check the text nodes
nerium has quit [Quit: nerium]
<jxf>
danielshi: Well, one problem I had with Nokogiri is that I can't seem to find a way to get "<a> which are not in parentheses".
jkamenik has quit [Quit: Leaving.]
nerium has joined #ruby
<jxf>
danielshi: There are a few naive approaches, like "regex-match each <a>-text and see if it's not in parentheses in the document, and if so accept that link".
jamblack has joined #ruby
<jxf>
danielshi: But those fail pretty frequently. For example, if you do that on this sentence (where {}'s are links): "{Science} (from Latin scientia, meaning "knowledge") is a systematic enterprise that builds and organizes {knowledge} in the form of testable explanations and predictions about the {universe}."
maycon_ has joined #ruby
<danielshi>
How about using a Nokogiri SAX parser and setting state on whether or not you're in a paren when you encounter text nodes?
aryaching has quit [Ping timeout: 272 seconds]
<jxf>
danielshi: Then you'll accept "Science" and "universe" (correct), but reject "knowledge" (incorrect).
polymar has quit [Remote host closed the connection]
maycon has quit [Ping timeout: 272 seconds]
<jxf>
danielshi: Yeah, I was hoping that "build your own parser" wasn't step #1 here. :)
<danielshi>
You should be able to add a few lines to `start_element` to handle text nodes and <a> elements
<Cope>
I want to parse an XML document, very simply - just pull out the ontents of an element
<jxf>
danielshi: Alrighty. So, something like "read every <p>, set a bit if you reached an open-paren, unset bit if you reached a close-paren, report every <a> when bit is unset"?
<Cope>
I would like to use standard library 1.9.3
<Cope>
ie not install nokogiri / someothergem
Czupa has joined #ruby
<Cope>
is this a hiding to nothing? or is there now someing in core ruby that would be useful (and not too ugly / painful)
derebos has joined #ruby
<danielshi>
jxf: yep. When a text node has multiple parens it might get a bit messy though, but it should work.
<jxf>
Cope: REXML is part of the standard library.
xk_id has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
atmosx has joined #ruby
ananthakumaran has joined #ruby
<jxf>
Cope: d = REXML::Document.new(xml); movies = d.elements.each('Results/Movies/Title').map(&:text); puts movies
<jxf>
Cope: ^^ gets all the movies from a made-up document.
<Cope>
ah ace
tsykoduk is now known as zz_tsykoduk
<jxf>
well, a real document would probably be more like "Results/Movies/Movie/Title", but you get the picture.
Guest22245 has quit [Ping timeout: 245 seconds]
lethjakman has joined #ruby
simplex_ has joined #ruby
<atmosx>
Anyone faimilar with http sessions and how do they work with rack-based servers?
Squarepy has joined #ruby
lectrick_ is now known as lectrick
lectrick has quit [Changing host]
lectrick has joined #ruby
nerium has quit [Quit: nerium]
Theravadan has joined #ruby
xk_id has quit [Quit:
rrichardsr3 has joined #ruby
nerium has joined #ruby
mrfoto has quit []
<_br_>
atmosx: What do you mean by "how do they work" ?
<atmosx>
_br_: First, why is it considered secure to setup a predefined string as secret?
diegoviola has joined #ruby
danielshi has quit [Quit: danielshi]
rickmasta has joined #ruby
<havenwood>
hanmac: i've wished in the past that &:to_s(2) type syntax was possible, i dunno about the '.'
Squarepy has quit [Ping timeout: 245 seconds]
<_br_>
atmosx: Well, normally session cookie just contains some unique string to indentify users, what do you mean by "secret" ? see eg. http://guides.rubyonrails.org/security.html
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
jbpros has quit [Quit: jbpros]
<shevy>
hanmac awful
<Hanmac>
havenwood: i make a comment under the ticket to show that &:to_s.(2) might be possible
Methylated has quit [Quit: Leaving.]
<havenwood>
hanmac: hmm, interesting
jbpros has joined #ruby
maletor has joined #ruby
<Hanmac>
its not chainable yet, but that was a first test
<atmosx>
_br_: this string is the same for all users?
i_s has joined #ruby
<_br_>
atmosx: No, its something unqiue for each user.
i_s has quit [Remote host closed the connection]
i_s has joined #ruby
<_br_>
atmosx: e.g. some hash from time and salt etc.
<atmosx>
_br_: okay make sense. Are you familiar with rack?
b00stfr3ak has joined #ruby
b00stfr3ak has joined #ruby
b00stfr3ak has quit [Changing host]
i_s has quit [Read error: Connection reset by peer]
<atmosx>
which apparently enables sessions mechanism, then there's session_secret, 'some-string-looking-like-hash', this string should change or no? Because in all online code example I've seen it's there.
<atmosx>
_br_: I'm using sinatra yes, but these options are Rack based... Rack::Sessions::Cookie, secret: "hash-like-thnig"
<_br_>
session secret is probably just a unique salt you can set
burlyscudd has quit [Quit: Leaving.]
tjbarber has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
<_br_>
it should be unique yes. its used as a salt for the session id generation
<atmosx>
aaah
<atmosx>
okay.
<atmosx>
I'm beginning to understand now. So this key is used in generation of each sessions unique id
axl_ has quit [Quit: axl_]
<_br_>
bingo
<atmosx>
awesome
pu22l3r has quit [Remote host closed the connection]
lyanchih has quit [Quit: lyanchih]
tjbarber has left #ruby [#ruby]
pu22l3r has joined #ruby
marr has quit [Ping timeout: 248 seconds]
lsmola has quit [Ping timeout: 245 seconds]
mengu has quit []
maletor has quit [Quit: Computer has gone to sleep.]
derebos has quit [Ping timeout: 272 seconds]
adjo_ has quit [Read error: Connection reset by peer]
adjo has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
pu22l3r has quit [Ping timeout: 268 seconds]
aspires has joined #ruby
zipper has quit [Ping timeout: 240 seconds]
cads has quit [Ping timeout: 245 seconds]
<havenwood>
hanmac: Then once you've implemented your version, you can reimplement it using itself: proc &:public_send.(self,*args)
<havenwood>
:P
vlad_starkov has quit [Remote host closed the connection]
pu22l3r has joined #ruby
<Hanmac>
hm i dont think that would work because of recusive … ;P
skaflem has joined #ruby
digital-ghost has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
zipper has joined #ruby
mahlon has joined #ruby
lstefani has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
inad922 has joined #ruby
jbpros has quit [Quit: jbpros]
shawnjgoff has joined #ruby
<inad922>
hello
<inad922>
Anyone using the RestClient library?
ReachingFarr has joined #ruby
<inad922>
When I make a request against an endpoint and the response code is 4xx does it raise an Exception?
<apeiros>
hanmac: yeah, it's a nice one. I have one to use before 2.1
chrrz has quit [Client Quit]
<shevy>
hehe
<shevy>
stupid encoding
patteh has joined #ruby
<shevy>
to what version does this apply? is there some version reference on that website?
fijimunkii has joined #ruby
Methylated has quit [Quit: Leaving.]
derebos has joined #ruby
IceyEC has quit [Quit: IceyEC]
VTLob has quit [Read error: Operation timed out]
derebos has quit [Remote host closed the connection]
TheMoonMaster has quit [Excess Flood]
<Hanmac>
shevy: do you mean scrub? look at the link name, it says "core-trunk"
<shevy>
I dont know what that means
<shevy>
is this 2.1
<Hanmac>
currently yes
<_br_>
Probably no, but does anyone know if its possible to send a message to a skype user via e.g. Ruby without a separate bridge etc. ?
baroquebobcat has joined #ruby
zeropx has joined #ruby
Targen has joined #ruby
TheMoonMaster has joined #ruby
<breakingthings>
You'd want to look up if there are any publicly accessible skype apis.
<breakingthings>
You could probably set up a simple networksomethingorrather to send some JSON to an API endpoint.
<atmosx>
Awesome hehe
<_br_>
interesting idea
<havenwood>
"Skype has announced it will end its desktop API in December, 2013 - after seven years of availability."
* atmosx
build his first web based encrypted/salted login system
shredding has quit [Quit: shredding]
<breakingthings>
havenwood: 10/10 great job microsoft
<_br_>
Well sorry to say, but skype should die anyway. Its time for WebRTC.
<breakingthings>
atmosx: I hope you really mean you used bcrypt
<breakingthings>
or similar algorithm
axl_ has joined #ruby
<atmosx>
breakingthings: bcrypt yes
<breakingthings>
good job then
<breakingthings>
you are credit to internet
<breakingthings>
much securities
hiroyuki has quit [Remote host closed the connection]
<_br_>
well scrypt is nice too
<_br_>
and has a memory working factor :)
<breakingthings>
Indeed
hiroyuki has joined #ruby
<fveillette>
windows chef user here?
BizarreCake has joined #ruby
<atmosx>
_br_: what is a memory working factor?
<breakingthings>
Which is why I caveat-ed that 'similar algorithm' bit
<_br_>
atmosx: Look up the scrypt paper, its well explained there.
<workmad3>
atmosx: scales the amount of memory needed to calculate the hash
<atmosx>
bcrypt automagically encrypts and salts the password right?
kaspergrubbe has quit [Ping timeout: 246 seconds]
<breakingthings>
yes
zeeraw has quit [Quit: Computer has gone to sleep.]
<breakingthings>
several times
<breakingthings>
Bcrypt/Scrypt etc have work factor
<atmosx>
workmad3: hm, using software? how?
psyl0n has joined #ruby
<workmad3>
atmosx: the same way the bcrypt working factor scales the CPU load needed to calc the hash
<atmosx>
_br_: k
<breakingthings>
work factor is basically how many times it repeats the encryption
<workmad3>
atmosx: you'd need to read the scrypt paper for how :)
<breakingthings>
which makes it take exponentially longer for a legitimate crack to break through the extra layers of that security onion
<_br_>
(using FPGA's)
<breakingthings>
laymanssecurity.exe
cfi30 has joined #ruby
simplex_ has joined #ruby
VTLob has joined #ruby
<workmad3>
there should be more certificate authentication on the interwebs :(
Methylated has joined #ruby
<workmad3>
sign up for account == upload your certificate
<_br_>
OpenSSL not already enough of that?
CreativeEmbassy has joined #ruby
<_br_>
The whole DNS system is broken security wise, lets start there first.
<workmad3>
then sign-in == SSL client auth
<_br_>
Persona looks nice though.
<workmad3>
at the very least, can websites stop using password strength checkers that claim that a 12-character password with no special chars is 'strong' :(
m8 has joined #ruby
<_br_>
well, entropy wise it is ^^
<breakingthings>
or having >maximums
<Hanmac>
shevy: did you see the youtube clip?
simplex_ has quit [Client Quit]
<breakingthings>
or having special character restrictions
<workmad3>
breakingthings: yeah... that sort of thing just disturbs me
<breakingthings>
I couldn't use anything other than alphanumerics
<shevy>
hanmac I am scared of strange cartoon voices screaming
leonidlm has quit [Ping timeout: 245 seconds]
<workmad3>
hanmac: :D
<atmosx>
breakingthings: change bank
<Hanmac>
shevy: its a trailer from a sony movie, so there cant be much evil? ;P
<breakingthings>
atmosx: I did :)
<atmosx>
breakingthings: all banking systems I know, and I have used quite a lot, use two-factor auth
<atmosx>
some give token-devices other send sms on your mobile
<atmosx>
so having your password alone won't cut it.
<breakingthings>
I'm not aware of many that do.
<breakingthings>
I was with Chase bank before
<workmad3>
breakingthings: my business account has a nice 30 character random password + a separate token :)
<breakingthings>
neveragain.png
noname001 has quit [Ping timeout: 272 seconds]
<atmosx>
breakingthings: in Greece all of them do it. In Czech Republic at least two of them do it.
<atmosx>
breakingthings: either the one or other
<workmad3>
breakingthings: and my personal account has a security question and a pin-protected token
IcyDragon has joined #ruby
<breakingthings>
atmosx: well you see, I live in the land of the free… and surveillance.
<atmosx>
breakingthings: so you can login and send money (say 5.000 USD) with just user/pass in usa bank?
<breakingthings>
so you know
<breakingthings>
we don't have smart people
simplex_ has quit [Client Quit]
sambao21 has quit [Quit: Computer has gone to sleep.]
<breakingthings>
atmosx: Usually there is a block on high amounts of dosh being moved
<breakingthings>
like, daily limit of $500 or whatever
<_br_>
Bitcoins! :D
<workmad3>
breakingthings: and I need to generate a separate token (based off half the target account#) if I want to send to a new person
<breakingthings>
workmad3: That's some hardcore shit man.
<breakingthings>
I will never feel that secure.
IceDragon has quit [Ping timeout: 240 seconds]
lethjakman has quit [Ping timeout: 240 seconds]
<krz>
how do you use gsub with a var? i.e. gsub(/foo/, 'bar')
<workmad3>
breakingthings: that particular one stopped me doing a stupid once :)
<atmosx>
breakingthings: omg, that's very low
<workmad3>
breakingthings: where I put in my account number rather than the one I wanted to pay to
<breakingthings>
atmosx: But, given that you work with the average shit american bank, and you increase your daily spending limit (most people do, I imagine)
<atmosx>
krz: "#{bar}" ?
<workmad3>
breakingthings: then generated based off the correct account # and got a 'this security number is wrong'
thepumpkin has quit [Ping timeout: 240 seconds]
codeFiend has quit [Quit: codeFiend]
<breakingthings>
atmosx: Then yes, you could do that, without any advance notice to the owner.
<krz>
gsub(/"#{foo}"/ 'bar') ?
<krz>
atmosx: ^
<krz>
with a comma
<atmosx>
krz: don't know, try it out :-P
<shevy>
krz didn't you want to avoid gsub :P
mahlon has joined #ruby
<krz>
no
<krz>
tell me
<krz>
lol
<breakingthings>
atmosx: Although, they'll try to also stop that if it looks like you aren't the owner (eg. in a different location)
<atmosx>
krz: I should perform some test, and I'm too bored to do that :-P
<shevy>
krz you can use "#{name_of_variable}" inside .gsub just fine
Kabaka has quit [Remote host closed the connection]
dmyers has joined #ruby
_maes_ has joined #ruby
<shevy>
wait
<workmad3>
breakingthings: what I don't know is how strong the algorithm in the token really is
<shevy>
without "" I think
n4dir has joined #ruby
<shevy>
>> x = 'def'; "abcdef".gsub(/#{x}/,' hi krz! ')
<breakingthings>
workmad3: probably still a whole lot stronger than most American banks, so if an American attacks you they'll have no idea what to do.
<shevy>
yep, without ""
RichardBaker has joined #ruby
<shevy>
americans just ask the NSA for the passwords
<breakingthings>
^
<breakingthings>
Hey NSA
<breakingthings>
I forgot my password
<breakingthings>
can you send it to me pls
<breakingthings>
thx
<atmosx>
breakingthings: actually. I know what to do. Get the target's phone or token-device
sambao21 has joined #ruby
Kabaka has joined #ruby
<atmosx>
breakingthings: the NSA thing will work also :-P
TheShaun is now known as TheShaun|AFK
brianpWins has quit [Quit: brianpWins]
MrZYX is now known as MrZYX|off
<krz>
shevy: hm you need ""
fridim_ has joined #ruby
elux has quit [Quit: Leaving...]
Czupa has quit [Ping timeout: 240 seconds]
thams has quit [Quit: thams]
maletor has joined #ruby
coldmethod has joined #ruby
<shevy>
why
<krz>
bar = 'bar'; 'foobarbaz'.gsub(/"#{bar}"/, '..') dont work
<shevy>
yes, you do not need the ""
<Hanmac>
krz he means the "" inside the // which should be removed
<krz>
but then thats not evaluating bar, the var
<breakingthings>
>> bar = 'bar'; 'foobarbaz'.gsub(/#{bar}/, '..')
<breakingthings>
have you been hugging since before it was cool
<shevy>
with style ^^^
<shevy>
I have been hugging before I was even born man
<breakingthings>
woah man that's some underground shiz
<coldmethod>
shevy: i guess i got addicted to cold sometime in my childhood LOL
<shevy>
brrr
<shevy>
I hate coldness
<coldmethod>
I love it
<shevy>
I always imagine me as rich and on tropical islands one day
<shevy>
instead I end up poor in cold places :(
smathieu has joined #ruby
notworthy has joined #ruby
diegoviola has quit [Ping timeout: 246 seconds]
gasbakid_ has quit [Ping timeout: 272 seconds]
nutella has joined #ruby
aspires has quit [Quit: sudo making a sandwich]
<hiall>
Could I loop through the following hash and get the array object where id == X http://paste2.org/gBtU5vVk I've been attempting with the use of object.select{ |f| f['id'] == X }.first but says first doesn't exist?
nutella is now known as Guest30606
<coldmethod>
ironically, i live in a tropics country, yet spend half of the year in extreme hot weather and other half, in the treacherous cold mountains
notworthy has quit [Client Quit]
<coldmethod>
what's "the most" resource for learning Ruby?
* coldmethod
coming off Python environment
jonathanwallace2 has quit [Ping timeout: 246 seconds]
<shevy>
coldmethod I'd wish ruby would have an optional indent mode, on a per file basis, settable in shebang-like lines
<coldmethod>
shey i am thinking that 'ends' would be really cool because in python with multiple functions/subfunctions and classes (usually longer than 50 lines), it becomes hard to understand where each one ends, locally
<coldmethod>
by locally, i mean, without help of the text editor
<coldmethod>
*shevy
CaptainJet has quit []
Czupa has joined #ruby
samfisher has quit [Quit: Lost terminal]
<shevy>
in ruby it can become hard too
nism has joined #ruby
<shevy>
I have only one class in any given .rb file though
tonni has quit [Remote host closed the connection]
CaptainJet has joined #ruby
<shevy>
my gripe with end is that it gives me no real extra information
tonni has joined #ruby
<shevy>
def foo
<shevy>
puts 'hi from foo'
<shevy>
end
<shevy>
(newline here)
<shevy>
def bar
<shevy>
puts 'hi from bar'
<_br_>
It solves the dangling else problem doesn't it?
<shevy>
end
strk has joined #ruby
<shevy>
dunno, most of my if/else are one lines, like
<shevy>
if @game_over
<shevy>
finish_game
<strk>
what's the difference between `def fun` and `def fun!` ?
<shevy>
else
burlyscudd has joined #ruby
<shevy>
do_whatever_method_here
<shevy>
strk you can use ! for all methods as last char
<coldmethod>
seems logical though.. i am (currently) finishing writing a python tool for zfs automation and ends seem quite intriguing to me because python lacks them.. but who knows.. i am just here to test my taste
<shevy>
it modifies self
<strk>
ah, what's the convension shevy ?
<strk>
! is a mutator, ok
<workmad3>
not quite
<shevy>
strk it signals to you "this may be dangerous or have some specific side effects"
<workmad3>
^^
<shevy>
strk I hate methods with !
<strk>
use with care
<shevy>
the only times I use them is to save some characters
<shevy>
x = x.gsub()
<shevy>
vs
<shevy>
x.gsub!()
thams has joined #ruby
<shevy>
or .strip!
<shevy>
strk ruby is cool if you use only the things you like :D
<lectrick>
anyone else going to rubyconf miami this year?
zz_tsykoduk is now known as tsykoduk
<coldmethod>
atmosx, thanks for the rescr.io link.. that's the most extensive list i have ever seen
Hydhen has quit [Quit: Quitte]
<shevy>
miami ... now that would be tropical...
tonni has quit [Ping timeout: 240 seconds]
<Hanmac>
strk: be VERY careful wen you use the return value of ! methods, most of them can return nil
<atmosx>
coldmethod: yes.
jkhwan has joined #ruby
gasbakid__ has quit [Ping timeout: 245 seconds]
jonahR has quit [Quit: jonahR]
`Chris` has joined #ruby
<shevy>
strk hanmac gives you more reasons to hate !
<workmad3>
shevy: well, many of them will return original values that have changed :)
<shevy>
one day I must build a method that combines everything that should be hated in ruby
<shevy>
! and @@ and -> all in one method
<workmad3>
shevy: and nil if nothing changed
ahawkins has joined #ruby
<Hanmac>
strk & shevy for what the return is used:
<Hanmac>
shevy for some reason i had thought that in some version ? only picks the first char ...
yfeldblum has joined #ruby
mtfOO_ has joined #ruby
maletor has joined #ruby
<strk>
this seems to work: next if db && ! ( id.start_with? "#{db}:" )
mun has joined #ruby
<mun>
hi
<mun>
i'm trying to install mongo3 using 'sudo gem install mongo3' but it keeps saying it requires ruby version >= 1.9.2. however, ruby -v already shows ruby 2.0.0p247. am i doing something wrong?
<Hanmac>
mun let me guess, ubuntu user?
kevind has quit [Ping timeout: 272 seconds]
kevind_ is now known as kevind
<mun>
hanmac, osx actually
<Hanmac>
mun check "gem env" and "sudo gem env" and look if there are differences
<workmad3>
mun: don't use 'sudo'
sambao21 has quit [Quit: Computer has gone to sleep.]
danman has joined #ruby
<Hanmac>
workmad3: depends how he has installed ruby
nucatus has quit [Ping timeout: 240 seconds]
<mun>
hanmac, hm mindeed.. it shows 1.8.7
<workmad3>
mun: that strips away the environment configs that things like rbenv, rvm and chruby use, and drops you back to the system ruby (1.8.7 on many mac os x installs)
<mun>
workmad3, the installation seems to be going slowly.. but seems to be working
<mun>
workmad3, thanks!
<Hanmac>
coldmethod: for sample there is a C/C++ lib … and then there is a python binding so you can use it in python … there is no problem to make the same in ruby too so you can use it in ruby
TMM has quit [Quit: Ex-Chat]
<coldmethod>
hmm let's see how do my fingers feel the syntax
<_br_>
yes... yes.... very good... join the dark side.
<coldmethod>
haha
echevemaster has quit [Ping timeout: 240 seconds]
ephemerian has quit [Quit: Leaving.]
joost_like_toast has quit [Ping timeout: 272 seconds]
CaptainJet has quit [Read error: No route to host]
* coldmethod
thinking about selling his python soul
`Chris` has quit [Read error: Connection reset by peer]
`Chris` has joined #ruby
newton is now known as Frankfort
Frankfort is now known as newton
ahawkins has quit [Read error: Connection reset by peer]
pipecloud has joined #ruby
einarj has quit [Remote host closed the connection]
ghr has quit [Quit: Computer has gone to sleep.]
DropsOfSerenity has joined #ruby
chrisja has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tonni has joined #ruby
saarinen has joined #ruby
carraroj has joined #ruby
amk has quit [Quit: Page closed]
DouweM has quit [Ping timeout: 246 seconds]
rehat has quit [Remote host closed the connection]
smathieu has joined #ruby
saarinen has quit [Client Quit]
camilasa_ has quit []
d45h has joined #ruby
timonv has quit [Remote host closed the connection]
gregj has joined #ruby
saarinen has joined #ruby
gcds has joined #ruby
cfi30 has quit [Ping timeout: 272 seconds]
dhruvasagar has quit [Ping timeout: 272 seconds]
<gcds>
Hello, maybe someone has idea how to make a proxy server which serves a website which was logged before accessing it and hiding all cookies from the user? Like browsing a website without any way to reset/get password from original ?
pu22l3r_ has joined #ruby
diegoviola has joined #ruby
smathieu has quit [Ping timeout: 248 seconds]
<gcds>
Like every user has separate session which only html, img and other stuff gets showed except session data
iliketurtles has joined #ruby
dyyylan has quit [Ping timeout: 260 seconds]
<gregj>
what's the best way to run rbenv in shell script folks ?
<_br_>
Sounds less like a Ruby problem and more like a e.g. Squid/mitmproxy/browser config issue.
<gregj>
I need to set 2.0 enviroment, usually I call 'rbenv shell 2.0.-....'
<gregj>
but doing that inside bash script, it complains that 'shell' doesn't exist
<gcds>
_br_: I am going to do it with ruby so I was asking here :D
|jemc| has joined #ruby
tylersmith has joined #ruby
dr_bob has joined #ruby
brennanMKE has joined #ruby
pu22l3r has quit [Ping timeout: 268 seconds]
tylersmith has quit [Remote host closed the connection]
<gcds>
I am thinking about TCPServer & client with storing cookies session and other sensitive stuff
<havenwood>
gcds: So you want to create some Rack middleware?
carlyle has quit [Remote host closed the connection]
<gcds>
havenwood: maybe I thinking about it :)
<havenwood>
oh
carlyle has joined #ruby
<gcds>
havenwood: I dont want user see sensitive stuff only browse without any authorizations and other stuff
pu22l3r_ has quit [Ping timeout: 268 seconds]
CaptainJet has quit [Read error: Connection reset by peer]
obs has quit [Quit: ChatZilla 0.9.87 [Iceape 2.7.12/20130119095535]]
x1337807x has joined #ruby
CaptainJet has joined #ruby
noop has quit [Ping timeout: 240 seconds]
tylersmith has joined #ruby
<gcds>
thinking like storing each connection session data on redis and on every request sending to that website :)
yfeldblu_ has joined #ruby
jhaals has joined #ruby
strk has left #ruby [#ruby]
earthquake has joined #ruby
burlyscudd has joined #ruby
icecandy has joined #ruby
rickruby has joined #ruby
x1337807x has quit [Client Quit]
carraroj has quit [Ping timeout: 240 seconds]
heidi has quit [Quit: Leaving.]
baroquebobcat has quit [Quit: baroquebobcat]
carlyle has quit [Ping timeout: 245 seconds]
raphaelivan has joined #ruby
Spami has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
gcds has quit [Read error: Connection reset by peer]
krz has quit [Quit: krz]
lfox has joined #ruby
anderse has joined #ruby
iamjarvo has joined #ruby
psyl0n has quit [Quit: psyl0n]
s2013 has joined #ruby
gcds has joined #ruby
itissid has joined #ruby
chinychinchin has quit [Read error: Connection reset by peer]
chinychinchin has joined #ruby
x1337807x has joined #ruby
gregj has left #ruby [#ruby]
DrShoggoth has joined #ruby
Stygia has quit [Quit: Leaving]
zodiak has quit [Quit: Leaving]
<_br_>
what place executes the JS code? Your proxy?
<_br_>
Thats sounds a bit like Opera Mini's execution model.
zodiak has joined #ruby
mun has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
shaunbak_ has quit [Remote host closed the connection]
<_br_>
.oO(Messes up websites to some extent)
Monie has joined #ruby
shaunbaker has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
icecandy has quit [Quit: Going offline, see ya! (www.adiirc.com)]
diegoviola has quit [Ping timeout: 245 seconds]
leonidlm has joined #ruby
chinychinchin has quit [Read error: Operation timed out]
brtdv has joined #ruby
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jxf has joined #ruby
icecandy has joined #ruby
schickung has quit [Quit: schickung]
tonni has quit [Read error: Connection reset by peer]
<gcds>
_br_: I only need to hide session data (cookies) and pages which lead to account page :)
shaunbaker has quit [Ping timeout: 245 seconds]
<gcds>
the last one is not a problem
pdimitrov has quit [Read error: Operation timed out]
achru has quit [Remote host closed the connection]
pu22l3r has joined #ruby
CaptainJet has quit [Read error: No route to host]
<gcds>
but currently I am thinking about storing session in redis and how to expire that session for user or keep it forever or work like browser expire it when it needs?
achru has joined #ruby
rickruby has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
ZenGuy311 has quit [Ping timeout: 245 seconds]
pdimitrov has joined #ruby
<_br_>
sessions are invalidated on the server side. You can't control the "session time" really client side. You might be able to manipulate it by having refresh intervals to keep it active. But some sites have a session max-time etc.
Loaft has joined #ruby
pr0ggie has quit [Ping timeout: 245 seconds]
fightback has joined #ruby
fightback has quit [Max SendQ exceeded]
<gcds>
_br_: no no i mean storing session which should be stored in browser on server
ZenGuy311 has joined #ruby
OdNairy has joined #ruby
maletor has joined #ruby
heidi has joined #ruby
fightback has joined #ruby
iamjarvo_ has joined #ruby
fightback has quit [Max SendQ exceeded]
hiall has quit [Ping timeout: 245 seconds]
CaptainJet has joined #ruby
mikeg has joined #ruby
fightback has joined #ruby
fightback has quit [Max SendQ exceeded]
<_br_>
people will access the server side browser via VNC or something?
nutella_ has quit [Ping timeout: 272 seconds]
achru has quit [Ping timeout: 272 seconds]
jkhwan has quit [Remote host closed the connection]
petey__ has quit [Remote host closed the connection]
<_br_>
Where is JS executed?
jonahR has joined #ruby
<_br_>
Client side?
Kabaka has joined #ruby
raphaelivan has quit [Quit: Leaving.]
tonni has joined #ruby
petey__ has joined #ruby
<_br_>
Isn't that causing issues if you eval js and have possibly async calls with ip X and proxy session with ip y
ReachingFarr has quit [Ping timeout: 246 seconds]
jonathanwallace2 has joined #ruby
nism has quit [Quit: Page closed]
<Hanmac>
hm it would be also possible that the proxy execute the javascript of the website ;P
<_br_>
yes. exactly as I asked before, that is current opera minis execution model.
vlad_starkov has joined #ruby
reset has joined #ruby
<gcds>
_br_: my server will by middle man so every request client made goes through my server and then to server
<_br_>
that makes sense, but splitting the two will probably cause errors.
<_br_>
gcds: I see
<gcds>
so all ajax request gets relayed :)
iamjarvo_ has quit [Remote host closed the connection]
neonlex has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_br_>
well in that case it should be ok
<gcds>
:)
zz_tsykoduk is now known as tsykoduk
OdNairy has joined #ruby
iamjarvo has joined #ruby
c0rn has joined #ruby
<gcds>
thanks god where is already done solutions like WEBrick::HTTPRequest :D
<Hanmac>
it would be also fun when the "proxy" is a http crawler that visit the website and change some facts … (that can be used for good and for bad)
verto has joined #ruby
<_br_>
yeah exactly. thats what you use e.g. squid or snort for
fightback has quit [Quit: Bye.]
pr0ggie has joined #ruby
<gcds>
hanmac: It kind is replaces all account information to prevent end user of knowing anything about that user :)
petey__ has quit [Ping timeout: 272 seconds]
<shevy>
do you guys use a specific gem for colour-related things you do with ruby?
jonahR has quit [Quit: jonahR]
neonlex has quit [Ping timeout: 272 seconds]
nucatus has joined #ruby
icecandy has joined #ruby
rickmasta has quit [Quit: Leaving...]
duggiefresh has joined #ruby
cody-- has quit [Quit: derp]
Zai00 has quit [Quit: Zai00]
jhulten has joined #ruby
ReachingFarr has joined #ruby
rezzack has joined #ruby
carlyle has joined #ruby
cody-- has joined #ruby
<Hanmac>
shevy most of my libs has own color classes, with "color-related things"
<wgosling>
Hi. I have a script that is dying with an error 'invalid byte sequence in US-ASCII' the line that causes that is checking a string against a regex. Is it possible to force ruby into considering all strings to be UTF-8
<Hanmac>
wgosling: hm yes it is possible to overwrite it, but to understand where it was done we need a pastie or gist of your code
mansi has quit [Ping timeout: 240 seconds]
colonolGron has joined #ruby
maycon has quit [Quit: Saindo]
soheil has joined #ruby
notworthy has joined #ruby
reset has quit [Quit: Leaving...]
notworthy has quit [Client Quit]
notworthy has joined #ruby
notworthy has quit [Remote host closed the connection]
wgosling has left #ruby ["Konversation terminated!"]
Eiam has joined #ruby
hp_ has joined #ruby
TDJACR has joined #ruby
Igneous has joined #ruby
baroquebobcat has joined #ruby
pragmatism has quit [Ping timeout: 240 seconds]
devoldmx has quit [Read error: Connection reset by peer]
gcds has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
mikeg has quit [Remote host closed the connection]
hp_ is now known as TMM
gcds has joined #ruby
TMM has quit [Changing host]
TMM has joined #ruby
<Rylee>
So, question
<Rylee>
Are you able to do something like
<Rylee>
2.0.0p247 :018 > File.methods.each { |x| puts x }
<Rylee>
with the unary & operator?
<Rylee>
Much like [1, 2, 3, 4, 5,].map(&:to_s)
icecandy has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<Hanmac>
Rylee look at the #display method
codeFiend has joined #ruby
<Hanmac>
if it does not suits you use &method(:puts)
psyl0n has joined #ruby
<MrZYX>
but the common sense so far is that you don't want to shortcut that
araujo has quit [Read error: Connection reset by peer]
msplain has joined #ruby
cfi30 has joined #ruby
araujo has joined #ruby
<Hanmac>
pah there is no sense in common sense ;P
<Igneous>
Hey guys, I have a stupid question about this code: http://dpaste.com/1441652/ . I guess the block of code above the initialize method definition gets evaluated immediately after the class is instantiated, and _then_ the block inside initialize gets evaluated.
einarj has joined #ruby
btanaka has joined #ruby
colonolGron has quit [Read error: Connection timed out]
zeeraw has quit [Quit: Computer has gone to sleep.]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
DrShoggoth has quit [Remote host closed the connection]
pyrac has joined #ruby
CreativeEmbassy has joined #ruby
<Igneous>
Yeah, the idea is to call Perfmon.new and manage perfmon connections to multiple servers through multiple client objects
<jxf>
Is there an Enumerable method that's "#select, but stop after N elements"?
<Igneous>
since savon can't really handle multiple endpoints like that
<Hanmac>
Igneous: when you want multible servers then @@variables is the veryveryvery wrong idea
<MrZYX>
jxf: you could make the enumerator lazy and .take(n) after the select
DrShoggoth has joined #ruby
<jxf>
MrZYX: Sorry, I didn't phrase that well. I didn't mean "only try the first N elements". I meant, "keep trying to #select until you have N elements".
<Hanmac>
_br_ i planed to make an free ruby RPG maker … similar to the one from Enterbrain … but i thought it would be fun if you can use "finite State Machines" for the Events and the Enemies in the BattleSystem ;P … or would that be overkill? :D
<gcds>
hmm i dont get any good luck of parsing http request
zz_jrhorn424 is now known as jrhorn424
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
Monie has quit [Ping timeout: 272 seconds]
simplex_ has joined #ruby
<_br_>
hanmac: hehe.. I see your motivation... well happy hacking :)
elaptics is now known as elaptics`away
IcyDragon has joined #ruby
<gcds>
could someone describe that for is rack ?
<a1ph4g33k>
gcds: the ragel message was for you ...
<gcds>
a1ph4g33k: I know but i dont find anything good about it
Monie has joined #ruby
<a1ph4g33k>
you don't find anything good ? or you don't find something that does all of the work for you ?
<_br_>
hanmac: I'm just curious how to express "good ai" in non fuzzy system such as a parser. That approach was used maybe decades ago and failed for AI purposes. Hence the more statistical, neural inspired directions.
gasbakid has joined #ruby
IceDragon_ has quit [Ping timeout: 272 seconds]
kevinykchan has quit [Quit: Computer has gone to sleep.]
blaxter has quit [Quit: foo]
i_s has quit [Remote host closed the connection]
<gcds>
a1ph4g33k: I dont find any good example of code example how to use it
leonidlm has joined #ruby
i_s has joined #ruby
BizarreCake has quit [Quit: Leaving]
i_s has quit [Read error: Connection reset by peer]
nari has quit [Ping timeout: 240 seconds]
i_s_ has joined #ruby
<Hanmac>
_br_ i think state based would be more cool then the current event command system of the older makers, but neural system would to much complicated for my customers ;P (maybe later as addional addon)
gasbakid has quit [Read error: Connection reset by peer]
<_br_>
Ruby and Ragel is fun, but for such things you break out Haskell :)
habanany has joined #ruby
zeeraw has joined #ruby
timonv has quit [Read error: Operation timed out]
leonidlm has quit [Ping timeout: 245 seconds]
<gcds>
hmm I am thinking that is better for proxy server
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gcds>
ruby or erlang (elixir)
jkhwan_ has joined #ruby
<_br_>
erlang is nice for custom protocol creation
mrsolo has joined #ruby
habanany has quit [Client Quit]
<a1ph4g33k>
... you could always head over to ruby-toolbox.com and just go find an existing library ... oh ... like http_parser or ruby_http_parser or http-parser-lite or ffi-http-parser or http_tools ... ( you should really always start at ruby-toolbox ... if you want to see what other people have built )
colonolGron has joined #ruby
mansi has quit [Ping timeout: 245 seconds]
einarj has joined #ruby
gcds has quit [Read error: Connection reset by peer]
DropsOfSerenity has quit [Quit: Peace.]
zarubin has quit [Ping timeout: 240 seconds]
jkhwan has quit [Ping timeout: 272 seconds]
zeade has quit [Quit: Leaving.]
jkhwan has joined #ruby
kevinykchan has joined #ruby
einarj has quit [Remote host closed the connection]
gcds has joined #ruby
derebos has joined #ruby
nari has joined #ruby
jerius has quit [Ping timeout: 272 seconds]
zipper has quit [Ping timeout: 246 seconds]
Uranio has joined #ruby
bean__ has joined #ruby
jerius has joined #ruby
jkhwan_ has quit [Ping timeout: 272 seconds]
jerius has quit [Client Quit]
jerius has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
devoldmx3 has joined #ruby
pyrac has quit [Quit: pyrac]
codeFiend has quit [Quit: codeFiend]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robustus has quit [Ping timeout: 264 seconds]
simplex_ has quit [Quit: simplex_]
robustus has joined #ruby
earthquake has quit [Quit: earthquake]
maasha has joined #ruby
petey__ has joined #ruby
pyrac has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
sayan has joined #ruby
kobain_ has joined #ruby
maasha has quit [Client Quit]
kobain has quit [Read error: Connection timed out]
jhulten has quit [Remote host closed the connection]
Es0teric has joined #ruby
jhulten has joined #ruby
zeade has joined #ruby
devoldmx3 has quit [Read error: Connection reset by peer]
pyrac has quit [Ping timeout: 272 seconds]
rickmasta has joined #ruby
devoldmx has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jhaals has joined #ruby
g0bl1n has quit [Quit: g0bl1n]
psyl0n has quit [Quit: psyl0n]
alup has quit [Quit: Leaving]
jhulten_ has joined #ruby
Andrevan has quit [Ping timeout: 245 seconds]
jhulten has quit [Read error: Connection reset by peer]
gcds has quit [Read error: Connection reset by peer]
Advocation has quit [Quit: Advocation]
xk_id has joined #ruby
leonidlm has joined #ruby
gcds has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
yacks has joined #ruby
devoldmx has joined #ruby
thams has quit [Quit: thams]
gcds has quit [Read error: Connection reset by peer]
jkhwan has quit [Remote host closed the connection]
jkhwan has joined #ruby
nari has quit [Ping timeout: 246 seconds]
hiyosi has quit [Ping timeout: 245 seconds]
Vivekananda has joined #ruby
braincrash has joined #ruby
kobain has joined #ruby
gcds has joined #ruby
carraroj has joined #ruby
aryaching_ has joined #ruby
cody-- has joined #ruby
jerius has quit [Ping timeout: 240 seconds]
devoldmx has quit [Read error: Connection reset by peer]
aryaching has quit [Ping timeout: 272 seconds]
devoldmx has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
kobain_ has quit [Ping timeout: 256 seconds]
zipper has joined #ruby
jkhwan has quit [Read error: Connection reset by peer]
gcds has quit [Read error: Connection reset by peer]
jerius has joined #ruby
leonidlm has quit [Ping timeout: 245 seconds]
SHyx0rmZ has joined #ruby
gcds has joined #ruby
snkcld has joined #ruby
devoldmx3 has joined #ruby
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<snkcld>
if im working on a gem, when i want to test it, do i need to recompile each time, then "gem install" each time, or is there a better approach to testing gems being developed?
gcds has quit [Read error: Connection reset by peer]
mansi has joined #ruby
shaunbaker has joined #ruby
shaunbaker has quit [Remote host closed the connection]
devoldmx3 has quit [Ping timeout: 240 seconds]
<a1ph4g33k>
hanmac, I always wanted to build a state machine ... that included event handlers ... right so you would have "sound_event" within idle and "sound_event" within "alert" ... etc.
coca_rails has quit [Ping timeout: 260 seconds]
huttan has quit [Read error: Connection reset by peer]
<a1ph4g33k>
( kinda like the programming language built into SecondLife. )
pyrac has joined #ruby
gcds has joined #ruby
sayan has quit [Ping timeout: 245 seconds]
<shevy>
it had a programming language inbuilt?
<gcds>
snkcld: go to the dir of installed gem and edit there, it will work out of box without gem install
reset has joined #ruby
<snkcld>
"go to" the dir?
<a1ph4g33k>
oh yeah ... you could make an income just building & scripting in-game objects to sell to other people.
kaspergrubbe has quit [Remote host closed the connection]
freerobby has quit [Read error: Connection reset by peer]
<a1ph4g33k>
so, folks would build alarm systems for people to install in their SL homes, etc ... pretty cool stuff ... slot machines ... all sorts of interesting stuff.
beepbeep_ has joined #ruby
kaspergrubbe has joined #ruby
<a1ph4g33k>
used to be a big fan ... haven't touched it in years though.
<gcds>
that is fastest way to receive http request parse it and resend it to another client? (this is proxy server)
robonerd is now known as testr0n
achru has joined #ruby
flops has joined #ruby
Azulinho has quit [Ping timeout: 252 seconds]
beepbeep_ has left #ruby [#ruby]
itissid has quit [Quit: Leaving.]
DrShoggoth has quit [Remote host closed the connection]
pyrac has quit [Ping timeout: 252 seconds]
RichardBaker has joined #ruby
RichardBaker has quit [Client Quit]
coca_rails has joined #ruby
zeeraw has quit [Quit: Computer has gone to sleep.]
sambao21 has quit [Quit: Computer has gone to sleep.]
<havenwood>
^ idiomatic Ruby if i dare say? >.>
drumusician has quit [Ping timeout: 240 seconds]
lectrick has joined #ruby
davidboy has joined #ruby
mary5030 has joined #ruby
xerxas has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
ziyadb has joined #ruby
tommyvyo_ has joined #ruby
pipecloud has joined #ruby
im0b has joined #ruby
mattyohe has joined #ruby
randym_ has joined #ruby
kaldrenon has quit [Ping timeout: 265 seconds]
sec_ has joined #ruby
jamblack has quit [Quit: jamblack]
angusiguess has quit [Ping timeout: 245 seconds]
mary5030_ has quit [Ping timeout: 252 seconds]
hiyosi has quit [Ping timeout: 264 seconds]
CaptainJet has quit []
<havenwood>
`&` doesn't like being separated from `:to_s`
<havenwood>
hanmac: I stabby lambda'd your `proc` :P, but I like the idea, gunna go read the thread now and see what the feedback was, i'm curious
sambao21 has joined #ruby
<Hanmac>
yeah they are childhold-buddies ;P
nerium has joined #ruby
karl___ has joined #ruby
zero7 has joined #ruby
heidi has joined #ruby
hiyosi has joined #ruby
rndstr has joined #ruby
xk_id has quit [Ping timeout: 246 seconds]
danman has quit [Quit: danman]
drag00n has quit [Ping timeout: 245 seconds]
rubyguy has joined #ruby
<karl___>
I have two files ("FILE A" and "FILE B") containing lines of IP addresses. I want to check each IP address in FILE B to determine if it exists in FILE A. Is there a more efficient method than just doing nested .each_line loops?
axl_ has left #ruby [#ruby]
pdimitrov has quit [Ping timeout: 245 seconds]
pr0ggie has quit [Ping timeout: 240 seconds]
Liquid-- has joined #ruby
<a1ph4g33k>
karl ... do you want the intersection ? or the difference ?
<testr0n>
who was i chatting with last night about thin?
<testr0n>
and webmachine
pr0ggie has joined #ruby
pdimitrov has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
<karl___>
a1ph4g33k: the difference; I want to return all lines (IP addresses) that are in FILE B that are not in FILE A
<havenwood>
karl___: Are the ip addresses sorted or in a random order?
Stygia has joined #ruby
<apeiros>
karl___: set operations
<karl___>
havenwood: I can sort them using gnu sort
<apeiros>
see Array#- e.g.
Speed has joined #ruby
akhkharu has joined #ruby
Bry8Star{T2_ has joined #ruby
<Hanmac>
apeiros what about this? lines = File.readlines(fileA); File.foreach(fileB).select {|addr| !lines.include?(addr) }
<apeiros>
sorted/unsorted won't matter for that
<apeiros>
hanmac: O(n^2), bad
hiyosi has quit [Ping timeout: 245 seconds]
nonamehero has quit [Ping timeout: 264 seconds]
<apeiros>
well, O(n*m)
<a1ph4g33k>
I would pull the lines from each ... then do b_lines - a_lines ... then you have the unique elements from b ... no sorting necessary.
<havenwood>
apeiros: I just asked because i considered FileUtils.identical?
ecksit has joined #ruby
petey__ has quit [Remote host closed the connection]
<apeiros>
Array#- will be O(n+m)
andrewstewart has joined #ruby
jkhwan has joined #ruby
<havenwood>
or #compare_stream
<karl___>
apeiros: thank you, that looks promising. hanmac and havenwood, thank you as well.
petey__ has joined #ruby
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
<apeiros>
havenwood: that only covers a corner case, no?
jkhwan has quit [Remote host closed the connection]
jkhwan has joined #ruby
<apeiros>
s/corner/edge/
Leandro__ has quit [Quit: Saliendo]
<a1ph4g33k>
apeiros, we were saying the same thing, correct ?
nateberkopec has joined #ruby
<apeiros>
a1ph4g33k: yes
<Hanmac>
karl___: i think apeiros says the best way would be File.readlines(fileB) - File.readlines(fileA)
<havenwood>
karl___: do you actually want to return the differing ips, or you just wanna know if they're identical or not?
simplex_ has quit [Quit: simplex_]
<ecksit>
hey, i currently have ["domains:list", "-s", "my:string"] and i am using given_args.flat_map {|e| e.split(':')} which gives me ["domains", "list", "-s", "my", "string"] however i only want the split to work on the first occurrence of the ':'. how can i achieve this?
zpinter has joined #ruby
<havenwood>
hanmac: makes sense to me
<karl___>
havenwood: actually want the differing ips to write to a new file
leonidlm has quit [Ping timeout: 240 seconds]
<karl___>
a1ph4g33k: looks like i forgot to thank you; thank you too! :)
DrShoggoth has quit [Quit: Leaving]
mikesplain has quit [Quit: WeeChat 0.4.2]
<havenwood>
karl___: then ignore my suggestions :)
<apeiros>
karl___: depending on how well or badly formatted the files are, you'll have to normalize the files to have each item in the array "look" the same
<apeiros>
e.g. not that all items have a newline in them except the last…
<rockets>
I've got an API that returns a hash of information. Past x number of items, the API becomes "paged" with a json endpoint for the next "page" as one of the keys of the hash
<rockets>
if I use standard ruby hash merge, assuming all keys are basically unique
<rockets>
is that an effective way of combining the pages?
<rockets>
or will i end up with weird data
elux has quit [Quit: Bye!]
coca_rails has joined #ruby
rockets is now known as zastern_
letstest has joined #ruby
freerobby has quit [Quit: Leaving.]
breakingthings has quit []
dr0ff has joined #ruby
earthquake has joined #ruby
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
bricker has joined #ruby
<karl___>
a1ph4g33k: what a timesaver! thank you
nateberkopec has quit [Quit: Leaving...]
leonidlm has joined #ruby
mansi has quit [Remote host closed the connection]
karl___ has left #ruby [#ruby]
atmosx has quit [Quit: Lost in trance]
xpirator has joined #ruby
Monie has joined #ruby
mansi has joined #ruby
cfi30 has left #ruby [#ruby]
wesside has joined #ruby
<MrZYX>
zastern_: should be fine if the keys really are unique, if they aren't you'll loose data without noticing
<zastern_>
MrZYX: right yeah
<zastern_>
MrZYX: I know the data well enough to know they're unique
momomomomo has joined #ruby
<a1ph4g33k>
glad to help.
<zastern_>
it would be impossible for them to be non-unique, the whole underlying system would fall apart
<a1ph4g33k>
could clean the code up a bit ... but it was meant as a quick thought.
zastern has quit [Disconnected by services]
zastern_ is now known as zastern
bricker`work has quit [Ping timeout: 248 seconds]
devoldmx has quit [Read error: Connection reset by peer]
mansi_ has joined #ruby
mansi has quit [Read error: Connection reset by peer]
<zastern>
If zendesk ticket numbers were not unique it'd be really hard to use :D
devoldmx has joined #ruby
Seich has quit [Ping timeout: 245 seconds]
zastern_ has joined #ruby
Seich has joined #ruby
Liquid-- has joined #ruby
silent_root has quit [Quit: Lost terminal]
ccolorado has joined #ruby
silent_root has joined #ruby
Stygia has quit [Quit: Leaving]
<ccolorado>
How can a string not have the method empyt? ? [ undefined method `empyt?' for "/var/www/sites/myblog.com/wp-includes/version.php\n":String (NoMethodError) ]
<a1ph4g33k>
also, you probably need to add a newline in the collect on line 22.
interactionjaxsn has quit [Remote host closed the connection]
freerobby has joined #ruby
interactionjaxsn has joined #ruby
silent_root has quit [Client Quit]
silent_root has joined #ruby
<a1ph4g33k>
ccolorado, ... typo ?
<a1ph4g33k>
empty? vs empyt?
coca_rails has quit [Remote host closed the connection]
* ccolorado
facepalms
silent_root has quit [Client Quit]
Seich has quit [Ping timeout: 245 seconds]
<ccolorado>
a1ph4g33k: thanks
Monie has quit [Ping timeout: 264 seconds]
silent_root has joined #ruby
leonidlm has quit [Ping timeout: 240 seconds]
deception has joined #ruby
kirun has quit [Quit: Client exiting]
interactionjaxsn has quit [Ping timeout: 245 seconds]
reset has quit [Quit: Leaving...]
nonamehero has joined #ruby
<zastern>
what's the name of the ruby operation that iterates through something and returns each value where thhing is true
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dflurker has joined #ruby
Seich has joined #ruby
<zastern>
i think that's the one
<zastern>
thanks
<havenwood>
zastern: There are different options depending on whether you're iterating over an Array or an Enum too. Enumerable#select, Enumerable#find_all, Array#select, Array#select! and Array#keep_if.
mansi_ has quit [Remote host closed the connection]
platypine has joined #ruby
platypine has joined #ruby
platypine has quit [Changing host]
sambao21 has quit [Quit: Computer has gone to sleep.]
mansi has joined #ruby
thams has quit [Quit: thams]
m8 has quit [Quit: Sto andando via]
gcds has quit [Read error: Connection reset by peer]
timonv has joined #ruby
ehc has joined #ruby
bean__ has joined #ruby
dr0ff has quit []
workmad3 has quit [Ping timeout: 245 seconds]
adam_ is now known as adam12
mary5030 has quit [Ping timeout: 252 seconds]
gcds has joined #ruby
hiyosi has joined #ruby
einarj has quit [Remote host closed the connection]
VTLob has quit [Quit: VTLob]
mansi has quit [Ping timeout: 246 seconds]
einarj has joined #ruby
bean__ has quit [Client Quit]
dma_ has quit [Remote host closed the connection]
mansi has joined #ruby
zarubin has quit [Ping timeout: 268 seconds]
zipper has quit [Quit: leaving]
timonv has quit [Ping timeout: 246 seconds]
ukd1 has quit [Quit: Leaving...]
akhkharu has quit [Read error: Connection reset by peer]
Liquid-- has quit [Quit: Computer has gone to sleep.]
akhkharu has joined #ruby
mercwithamouth has quit [Ping timeout: 264 seconds]
kitak has joined #ruby
mercwithamouth has joined #ruby
hiyosi has quit [Ping timeout: 245 seconds]
devoldmx has quit [Read error: Connection reset by peer]
jonathanwallace2 has quit [Ping timeout: 248 seconds]
devoldmx has joined #ruby
freerobby has quit [Quit: Leaving.]
einarj has quit [Ping timeout: 260 seconds]
a1ph4g33k has quit [Quit: Leaving]
Seich has quit [Quit: Computer has gone to sleep.]
tkuchiki has joined #ruby
t0rc has quit [Quit: WeeChat 0.4.2]
Seich has joined #ruby
barratt has quit [Quit: Leaving...]
soheil has joined #ruby
dma_ has joined #ruby
tkuchiki has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby
zastern has quit [Remote host closed the connection]
tkuchiki has quit [Read error: Connection reset by peer]
jibi has quit [Quit: .]
hiroyuki_ has joined #ruby
derebos has quit [Read error: Connection reset by peer]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zastern has joined #ruby
Seich has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Quit: Computer has gone to sleep.]
parus has joined #ruby
tkuchiki_ has joined #ruby
hiroyuki has quit [Ping timeout: 240 seconds]
Muz has quit [Ping timeout: 245 seconds]
Seich has joined #ruby
Muz has joined #ruby
frustrum has joined #ruby
gks has joined #ruby
RORgasm has quit [Remote host closed the connection]
tkuchiki has quit [Ping timeout: 246 seconds]
RORgasm has joined #ruby
Bry8Star{T2 has joined #ruby
SHyx0rmZ has quit [Ping timeout: 252 seconds]
<gks>
Hi all. So, running into an encoding issue and I have to work within Ruby 1.8.7 and 2.0… is there a way to specify File.open(filename, mode, encoding) in 1.8.7? I'm trying File.open(filename, "r", :encoding => "UTF-8") and it's giving me a "can't convert Hash into Integer" error
wallerdev has quit [Quit: wallerdev]
verto has quit [Ping timeout: 245 seconds]
tonni has joined #ruby
gcds has quit [Read error: Connection reset by peer]
tkuchiki_ has quit [Ping timeout: 268 seconds]
banisterfiend has joined #ruby
randomnick_ has quit [Read error: Connection reset by peer]
Seich has quit [Ping timeout: 260 seconds]
RORgasm has quit [Read error: Operation timed out]
Bry8Star{T2_ has quit [Ping timeout: 240 seconds]
gcds has joined #ruby
petey__ has quit [Ping timeout: 260 seconds]
<bean>
gks, in general you're going to want to avoid 1.8.7
gcds has quit [Read error: Connection reset by peer]
<gks>
bean: sorry, can't. Default in OS X 10.8 and 10.7
<gks>
my scripts must run in default environment (otherwise I have to include Ruby in my tool)
parus has quit [Ping timeout: 264 seconds]
gcds has joined #ruby
parus has joined #ruby
fuhgeddaboudit has quit [Quit: Ex-Chat]
thams has joined #ruby
devoldmx3 has joined #ruby
goleldar has joined #ruby
<gks>
believe me, wish i could ignore 1.8.7 but sadly, kinda stuck
jokke has joined #ruby
allaire has quit []
ffranz has quit [Ping timeout: 246 seconds]
carif has quit [Read error: Connection reset by peer]
devoldmx has quit [Ping timeout: 260 seconds]
tonni has quit [Remote host closed the connection]
tonni has joined #ruby
ccolorado has left #ruby [#ruby]
brtdv has quit []
<shevy>
good old 1.8 branch
<shevy>
gks does File.open even have an :encoding hash?
<shevy>
in 1.8.7
<gks>
i don't think so… which is very likely the problem :)
<gks>
I'm going to try Encoding.external_encoding="UTF-8" if RUBY_VERSION != "1.8.7"
dekz has joined #ruby
<shevy>
which version has an encoding problem?
<shevy>
and what is the encoding problem
<zastern>
MrZYX: hmm what about adding arrays of hashes?
<gks>
Ruby 2.0. Invalid byte sequence in US-ASCII
<shevy>
ok
<zastern>
e.g. each page of results is an array, of hashes.
chinychinchin has quit [Read error: Connection reset by peer]
<zastern>
and i want to concatenate the arrays but not merge any of the data
coldmethod has quit [Ping timeout: 272 seconds]
chinychinchin has joined #ruby
momomomomo has quit [Quit: momomomomo]
mroth has joined #ruby
<MrZYX>
well, just Array#+ them
thams has quit [Ping timeout: 252 seconds]
mansi has quit [Remote host closed the connection]
bigoldrock has joined #ruby
<gks>
Yea… the if RUBY_VERSION != "1.8.7" thing isn't working for me either… *sigh*
vlad_starkov has joined #ruby
<gks>
i mean, it works, but it doesn't solve the issue
<zastern>
ah ok so its safe
Vivekananda has quit [Remote host closed the connection]
mansi has joined #ruby
<zastern>
Is there an equivalent of uh
<zastern>
.merge!
<zastern>
for array1 + array2
<MrZYX>
.concat
<zastern>
i only ever want the merged one really
<zastern>
ah
<zastern>
neat1
devoldmx has joined #ruby
<shevy>
gks so your problem is an encoding problem only in 2.0
<zastern>
excellent
<zastern>
Thanks so much!
<gks>
shevy: yes
pu22l3r has joined #ruby
<shevy>
I can feel with you
<shevy>
encoding will haunt future generation of ruby users
<gks>
running a regex on the contents of a file … works great in 1.8.7, bombs in 2.0 unless i specify the encoding
<shevy>
yep
gr33n7007h has joined #ruby
ckrailo has joined #ruby
<gks>
sadly, can't easily do both due to ruby versions
vlad_sta_ has quit [Ping timeout: 252 seconds]
<shevy>
I usually set "# Encoding: ASCII-8BIT"
<gks>
top of the main ruby file?
<shevy>
yeah
silent_root has joined #ruby
<shevy>
and work always with BIT
<gks>
i have mine set to UTF-8, if i use ASCII-8BIT it should treat everything just like 1.8.7?
<shevy>
sorry no idea, I dont use UTF
<shevy>
in theory yes
devoldmx3 has quit [Ping timeout: 245 seconds]
<shevy>
unfortunately some things behave oddly, like when one uses .readline or loads a yaml file
ReachingFarr has quit [Read error: Operation timed out]
<gks>
*sigh* thanks. I'll figure something out i guess, but damn, this is a pretty horrible situation
`Chris` has quit [Remote host closed the connection]
thams has joined #ruby
DrShoggoth has joined #ruby
mansi has quit [Ping timeout: 268 seconds]
`Chris` has joined #ruby
sambao21 has joined #ruby
`Chris` has quit [Remote host closed the connection]
`Chris` has joined #ruby
<shevy>
yeah
<shevy>
at least you use UTF
chinychinchin has quit [Ping timeout: 260 seconds]
<shevy>
so you should profit more than I do :D
<shevy>
"Ruby supports per-string character encodings"
<MrZYX>
hm, wasn't in 1.8 this weird $KCODE variable to set UTF8?
<shevy>
"Encodings are represented by an instance of Encoding."
<shevy>
I never had to use $KCODE
<gks>
well, this is a diagnostics application. it basically probe's the system (OS X) and locates all of the issues related to our application … so I'm opening all kinds of files and stuff for various things (getting app versions and reading settings plists and such)
Guest46584 is now known as ageis
<shevy>
gks I am confused though
gcds has quit [Quit: gcds]
<shevy>
gks you said the error happens on 2.x yet the target computer will have 1.8.x and thus, none of those encoding errors, or?
robonerd has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
<gks>
fortunately this isn't a deal breaker, but it makes our tech support people's jobs difficult… and since Mavericks (10.9) is running Ruby 2, this is becoming a bigger deal every day
<shevy>
ArgumentError ? then you must pass in a wrong amount of arguments to a method
sambao21 has quit [Ping timeout: 240 seconds]
<shevy>
>> def foo(i); end; foo 5,6
<eval-in>
shevy => wrong number of arguments (2 for 1) (ArgumentError) ... (https://eval.in/60320)
robonerd has quit [Remote host closed the connection]
<gks>
nope, no luck there, same error
strax has joined #ruby
<gks>
so, it sounds like it just reverses it in the compiler if you type it wrong or something
pu22l3r has quit [Ping timeout: 268 seconds]
nucatus has quit [Read error: Operation timed out]
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
matchaw has joined #ruby
<gks>
guess i need to look into compiling Ruby with the application and just including Ruby 2 with all distributions of it so that all users are running Ruby 2.0 for this app… fortunately, that's probably better in the long run, unfortunately it's kind of a pita at the moment