adamjleonard has quit [Read error: Connection reset by peer]
toekutr has quit [Remote host closed the connection]
<vandemar>
realDAB: okay. is there a cleaner way to do that, given that this is going to have potentially hundreds of foo_data pairs, and most of those will need their own validator functions?
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
adkron has quit [Ping timeout: 245 seconds]
takeru has joined #ruby
woolite64_ has joined #ruby
<vandemar>
realDAB: I mean, structurally
adkron_ has quit [Ping timeout: 256 seconds]
phantasm66 has quit [Client Quit]
baroquebobcat has quit [Quit: baroquebobcat]
woolite64__ has quit [Ping timeout: 252 seconds]
enroxorz has quit [Ping timeout: 245 seconds]
Mattix has joined #ruby
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
Targen has joined #ruby
Scriptonaut has quit [Quit: leaving]
takeru has quit [Ping timeout: 255 seconds]
chendo_ is now known as chendo
tcstar has quit [Remote host closed the connection]
yshh has quit [Remote host closed the connection]
__Big0__ has quit [Remote host closed the connection]
Davey has quit [Quit: Computer has gone to sleep.]
MehLaptop has joined #ruby
aedornm has quit [Quit: Leaving]
tish has joined #ruby
SDr has quit [Read error: Connection reset by peer]
karupanerura has quit [Excess Flood]
NightCreature has joined #ruby
karupanerura has joined #ruby
sambao21 has quit [Quit: sambao21]
arya has quit [Ping timeout: 245 seconds]
Virunga has quit [Remote host closed the connection]
nari has joined #ruby
mrsolo has quit [Quit: Leaving]
hogeo has joined #ruby
chrishough_ has joined #ruby
tish has quit [Quit: Leaving.]
chrishough_ has quit [Client Quit]
chrishough has quit [Ping timeout: 240 seconds]
unflores has joined #ruby
arya has joined #ruby
ckrailo has joined #ruby
idkazuma has quit [Remote host closed the connection]
znode has joined #ruby
cnrk has quit [Quit: cnrk]
<shevy>
hmm when I have "15 march 2013" as string, or perhaps "15.03.2013", is there a way in ruby to find out the weekday of that? like friday?
<X-Jester>
does anyone happen to have experience getting "await data" working with tailable cursors with mongodb in ruby? i even tried to add_options the constant, no dice
<Xeago>
my printer has a direct line feed on port 9100
<Xeago>
cool!
Gwyxx has quit [Quit: Leaving]
skattyadz has quit [Quit: skattyadz]
<shevy>
Xeago are you in love with your printer
`p- has quit [Remote host closed the connection]
epiphani has joined #ruby
<Xeago>
actually now I kinda am
ad_AA has quit [Ping timeout: 245 seconds]
<Xeago>
this means that I can pipe mroff (man pages stuff) directly into my printer :D
ffranz has joined #ruby
<epiphani>
ls
<epiphani>
heh woops
<Xeago>
neways
dougireton has quit [Quit: Leaving.]
<Xeago>
bai!
Xeago has quit [Remote host closed the connection]
<shevy>
rm -rf /
elaptics is now known as elaptics`away
<epiphani>
it would prompt you with a y / n
ffranz has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 256 seconds]
<jcsims>
lol don't count on it!
mikepack has quit [Remote host closed the connection]
<epiphani>
try it and tell me
katherinem13 has quit [Ping timeout: 252 seconds]
<epiphani>
./exec rm -rf /
<jcsims>
I'll rely on my years of experience with rm-rf that tells me no
<danneu>
this is above my head btw but i'd be interested in knowing how people solve it
<Quadlex>
Yeah, me too:P
<danneu>
in case you thought i was on the cusp of typing out some dope solution
danman has joined #ruby
<Quadlex>
Heh
nga4 has joined #ruby
<danneu>
is it possible to maintain two releases (like mygem1.0 for capy1 and mygem2.0 for capy2) that Bundler can just resolve?
danman has quit [Client Quit]
<danneu>
that's what projects like rails do
wmoxam has joined #ruby
one` has joined #ruby
johnnygoodmancpa has joined #ruby
<Quadlex>
danneu: I was thinking about it. I might actually go that way
<Quadlex>
But for now, the changes are just changes in aliasing
<Quadlex>
So I wanted to have one code base
ilyam has joined #ruby
<danneu>
yeah right
<Quadlex>
What I think I'll do is use Travis to do my builds
<Quadlex>
Develop against Capy2
<Quadlex>
And have a Travis build for Capy1
<danneu>
yeah that's what i was thinking. master against capybara latest, but have a backport branch or something
Honeycomb has joined #ruby
<Quadlex>
So gross:P
<Quadlex>
Sometimes I wish it was just a stand alone project
<danneu>
but it's proper at least
jalcine has quit [Excess Flood]
<Quadlex>
I could depricate (sp) support for Capy 1 and tell anyone who complains they're welcome to fork:P
justinmcp has joined #ruby
qubit has joined #ruby
jacky has joined #ruby
NiteRain has joined #ruby
<danneu>
yeah, i mean there's a reason you even care about capy1 support right?
<danneu>
i imagine you have capy1 users
<Quadlex>
My gem is an integration for a commercial product, where I work
<Quadlex>
And we have capy1 users... Some of the original gem authors
<Quadlex>
So it isn't just a bad idea commercially, it's rude
jacobw has joined #ruby
stopbit has joined #ruby
jacky has quit [Excess Flood]
havenwood has joined #ruby
ttt has joined #ruby
dmiller1 has joined #ruby
sn0wb1rd has quit [Quit: I will be right back]
<danneu>
yeah i wouldnt drop it
mattbl has joined #ruby
<danneu>
ok, useless statement. but i mean that even the naive solution of maintaining 2 releases is at least straightforward
chipotle_ has joined #ruby
<danneu>
but im pretty bad at testing anyways
<danneu>
so it'd just optimize for tests that suck less
gregorg has quit [Read error: Connection reset by peer]
<danneu>
:)
gregorg has joined #ruby
gregorg has quit [Changing host]
gregorg has joined #ruby
MehLaptop has joined #ruby
yacks has joined #ruby
danman has joined #ruby
nari has joined #ruby
jacky- has joined #ruby
multi_io has quit [Ping timeout: 276 seconds]
crackfu has joined #ruby
sailias has joined #ruby
rakl has quit [Quit: sleeping]
hiroyuki has joined #ruby
clooth has joined #ruby
swarley-freenode is now known as swarley
peteyg has quit [Quit: Lost terminal]
adkron has joined #ruby
adkron_ has joined #ruby
Ontolog_ has quit [Remote host closed the connection]
jacky- is now known as jacky
jacky has joined #ruby
jacky has quit [Changing host]
mootpointer has joined #ruby
clooth has quit [Client Quit]
rhinux has joined #ruby
kofno has quit [Remote host closed the connection]
danneu has quit [Ping timeout: 245 seconds]
crazymykl has quit [Read error: Connection reset by peer]
crazymykl has joined #ruby
jean-lou` has joined #ruby
jean-louis has quit [Read error: No route to host]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
samphippen has quit [Quit: Computer has gone to sleep.]
_maes_ has joined #ruby
fire has joined #ruby
marcux has quit [Quit: marcux]
angusiguess has joined #ruby
adkron has quit [Ping timeout: 245 seconds]
adkron_ has quit [Ping timeout: 245 seconds]
thinkclay has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
justinmcp has quit [Ping timeout: 245 seconds]
Voodoofish430 has quit [Quit: Leaving.]
adkron has joined #ruby
angusiguess has quit [Ping timeout: 256 seconds]
chrishunt has quit [Quit: ZzZzZz...]
<lectrick>
havenwood: Thanks, that's what I was looking for more or less!
<havenwood>
lectrick: cool, no prob :)
jdunck has quit [Quit: Computer has gone to sleep.]
v0n has joined #ruby
aedornm has joined #ruby
adkron_ has joined #ruby
jurassic has joined #ruby
johnnygoodmancpa has left #ruby [#ruby]
philcrissman has joined #ruby
dsf has joined #ruby
jetblack has quit [Quit: leaving]
deadalus has quit [Excess Flood]
tjbiddle has joined #ruby
joeycarmello has joined #ruby
sabooky has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
dankest has joined #ruby
joeycarmello has joined #ruby
c0rn has joined #ruby
<sabooky>
If I have a class with a few class methods basically a bunch of: def variable @@variable ||= (code to lookup variable) end
<sabooky>
should I be using a class or module for this kind of thing?
cyberflux has quit []
Hanmac2 has joined #ruby
<Quadlex>
sabooky: That's a stylistic question:P
<Quadlex>
What is your concern?
danneu has joined #ruby
<sabooky>
Quadlex: best practices or if it even matters
<havenwood>
sabooky: I think classes are overused a good deal more than modules. If it works as a module, I'd argue module is right.
jetblack has joined #ruby
banjara has quit [Quit: Leaving.]
squidBits has quit [Read error: Connection reset by peer]
<havenwood>
s/works/works painlessly without obvious benefit from being a class
<sabooky>
ok, just checking
petecheslock has left #ruby ["Leaving..."]
<sabooky>
thank you both
squidBits has joined #ruby
jurassic has quit [Quit: jurassic]
fire is now known as firewall
Hanmac1 has quit [Ping timeout: 276 seconds]
<Quadlex>
sabooky: Would you ever instantiate an instance of the class?
<Quadlex>
if no, that's a decent indication it's a Module
<sabooky>
Quadlex: The answer was no in this case, which is what made me think... "does this even need to be a class?" then I came and asked to be sure
<sabooky>
It does have class variables though
pdamer has joined #ruby
<sabooky>
but that should just work
<Quadlex>
Cool
tomzx_mac has joined #ruby
kofno has joined #ruby
cephalopod has joined #ruby
cantonic has quit [Read error: Operation timed out]
tjbiddle has quit [Quit: tjbiddle]
cantonic has joined #ruby
ace939 has joined #ruby
zeade has quit [Quit: Leaving.]
<ace939>
hey all i need to convert an array to a hash, but the has has already pre-defined keys.. here is a snippet that i need help with
<havenwood>
ace939: Might make a nice Struct though, rather than Hash.
predator117 has joined #ruby
verysoftoiletppr has quit []
Takehiro_ has joined #ruby
mockra has joined #ruby
tjbiddle has quit [Client Quit]
verysoftoiletppr has joined #ruby
ryanf has quit [Quit: leaving]
chipotle_ has quit [Quit: cya]
douglarek_away is now known as douglarek
douglarek is now known as douglarek_free
DrShoggoth has quit [Remote host closed the connection]
newUser1234 has joined #ruby
philcrissman has quit [Read error: Connection reset by peer]
philcrissman has joined #ruby
MehLaptop has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
ny11 has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
deadalus has joined #ruby
ny11 has quit [Read error: Connection reset by peer]
espinet has joined #ruby
nanothief has joined #ruby
ny11 has joined #ruby
sn0wb1rd has joined #ruby
philcrissman_ has joined #ruby
philcrissman has quit [Ping timeout: 272 seconds]
DrShoggoth has joined #ruby
<espinet>
i'm having an issue with define_method and an if statement. it seems to always evaluate to true… even when the conditional value is false. https://gist.github.com/espinet/5096379
havenwood has quit [Remote host closed the connection]
pepper_chico has joined #ruby
joeycarmello has joined #ruby
arya has joined #ruby
jacobw has quit [Quit: WeeChat 0.4.0]
deadalus has quit [Max SendQ exceeded]
mbduino has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
ngoldman has joined #ruby
AndChat| has quit [Ping timeout: 255 seconds]
Emplitz has joined #ruby
dsf has joined #ruby
freakazoid0223 has quit [Read error: Connection reset by peer]
Banistergalaxy has joined #ruby
<mbduino>
learning ruby takes me back to the days of learning Perl for Linux administration
sailias has joined #ruby
MehLaptop has joined #ruby
ny11 has quit [Remote host closed the connection]
ny11 has joined #ruby
petecheslock has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
Pandaen has joined #ruby
gani has joined #ruby
baroquebobcat has joined #ruby
gani|2 has joined #ruby
vagmi has joined #ruby
gani has quit [Client Quit]
deadalus has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
verysoftoiletppr has quit []
Banistergalaxy has joined #ruby
<aytch>
mbduino: except less pulling out of hair
<aytch>
and I can read ruby code the next day
twoism has quit [Remote host closed the connection]
<mbduino>
I'm headed toward rails basically, this is for web application development
angusiguess has joined #ruby
ny11 has quit [Remote host closed the connection]
<aytch>
yeah, I did the Rails tutorial, then decided I needed to learn more about Ruby and programming in general
ny11 has joined #ruby
<aytch>
I'm more of an ops person
<aytch>
I've been working through these to better understand the data types: http://rubykoans.com/
pac1 has quit [Ping timeout: 264 seconds]
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
<mbduino>
ops as in admin user type?
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
rakl has joined #ruby
espinet has quit [Quit: espinet]
angusiguess has quit [Ping timeout: 276 seconds]
jonathanwallace has quit [Ping timeout: 245 seconds]
znode has joined #ruby
rupee has quit [Quit: Leaving]
deadalus has quit [Max SendQ exceeded]
mikurubeam has quit [Ping timeout: 245 seconds]
unconsolably04 has quit [Ping timeout: 252 seconds]
JStoker has quit [Excess Flood]
aedornm has quit [Quit: Leaving]
dsf has quit [Quit: This computer has gone to sleep]
Gwyxx has joined #ruby
rocket has joined #ruby
sailias has quit [Quit: Leaving.]
Ontolog has joined #ruby
jerius has quit []
ny11 has quit [Remote host closed the connection]
ny11 has joined #ruby
joofsh has joined #ruby
Takehiro_ has quit [Remote host closed the connection]
s122 has joined #ruby
Quebert has quit [Ping timeout: 245 seconds]
newUser1234 has quit [Remote host closed the connection]
alvaro_o has quit [Quit: Ex-Chat]
ny11 has quit [Ping timeout: 256 seconds]
ny11 has joined #ruby
dankest has quit [Quit: Leaving...]
s122 has quit [Ping timeout: 256 seconds]
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
pepper_chico has quit [Quit: Computer has gone to sleep.]
locriani has joined #ruby
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
ny11 has quit [Read error: Connection reset by peer]
hbpoison has quit [Ping timeout: 276 seconds]
ny11 has joined #ruby
hbpoison has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
ny11 has quit [Read error: Connection reset by peer]
pepper_chico has joined #ruby
ny11 has joined #ruby
sambao21 has quit [Quit: sambao21]
kofno has quit [Remote host closed the connection]
s122 has joined #ruby
macmartine has joined #ruby
freeayu has joined #ruby
JStoker has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
uris has quit [Quit: Leaving]
ny11 has quit [Ping timeout: 256 seconds]
ngoldman_ has joined #ruby
ny11 has joined #ruby
Ontolog has quit [Remote host closed the connection]
s122 has quit [Ping timeout: 256 seconds]
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
lewix has quit [Remote host closed the connection]
deadalus has joined #ruby
<ace939>
you guys know if Net::POP.enable_ssl is thread safe? meaning i have to connect to some pop inboxes that are not ssl and some are.. so if i multi thread.. will it change if 1 thread sets to enable and another not?
fumbe has quit [Ping timeout: 248 seconds]
s122 has joined #ruby
znode has quit [Remote host closed the connection]
ngoldman has quit [Ping timeout: 255 seconds]
s122 has quit [Read error: Connection reset by peer]
s122 has joined #ruby
joofsh has quit [Remote host closed the connection]
s122 has quit [Read error: Connection reset by peer]
s122 has joined #ruby
sambao21 has joined #ruby
ny11 has quit [Ping timeout: 256 seconds]
tjbiddle has joined #ruby
MehLaptop has quit [Remote host closed the connection]
hashmal has joined #ruby
Domon has joined #ruby
mattbl has joined #ruby
lewix has joined #ruby
pepper_chico has quit [Quit: Computer has gone to sleep.]
crankycoder has quit [Ping timeout: 276 seconds]
aapzak has quit [Ping timeout: 255 seconds]
jeremywrowe_ has quit [Quit: jeremywrowe_]
ocnam has joined #ruby
aapzak has joined #ruby
s122 has quit [Remote host closed the connection]
CrazyDog_ has quit [Ping timeout: 245 seconds]
CrazyDog has joined #ruby
ny11 has joined #ruby
slyv has quit [Quit: Computer has gone to sleep.]
ny11 has quit [Read error: Connection reset by peer]
ny11 has quit [Read error: Connection reset by peer]
`p has joined #ruby
ny11 has joined #ruby
ny11 has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
ny11 has joined #ruby
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
SCommette has joined #ruby
SCommette has quit [Client Quit]
splud has quit [Quit: splud]
SCommette has joined #ruby
mikepack has joined #ruby
havenwood has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
MehLaptop has joined #ruby
crankycoder has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
multi_io has joined #ruby
ngoldman has joined #ruby
jurassic has joined #ruby
reset has quit [Ping timeout: 255 seconds]
rafacv has quit [Ping timeout: 264 seconds]
rezzack has quit [Quit: Leaving.]
chawstick60 has joined #ruby
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
ny11 has quit [Remote host closed the connection]
splud has joined #ruby
ny11 has joined #ruby
ngoldman has quit [Read error: Connection reset by peer]
sandGorgon has joined #ruby
ngoldman has joined #ruby
ngoldman has quit [Remote host closed the connection]
ngoldman_ has quit [Ping timeout: 260 seconds]
znode has joined #ruby
sambao21 has quit [Quit: sambao21]
tjbiddle has quit [Quit: tjbiddle]
ckrailo has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
chawstick60 has quit [Remote host closed the connection]
ny11 has quit [Remote host closed the connection]
ny11 has joined #ruby
mootpointer has quit [Quit: Computer has gone to sleep.]
ny11 has quit [Read error: Connection reset by peer]
hemanth has quit [Ping timeout: 248 seconds]
ny11 has joined #ruby
znode has quit [Ping timeout: 245 seconds]
jef_abraham has quit [Quit: jef_abraham]
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
JStoker has quit [Excess Flood]
maldives68 has joined #ruby
SCommette has quit [Quit: SCommette]
danman has quit [Quit: danman]
crankycoder has quit [Ping timeout: 252 seconds]
jonathanwallace has joined #ruby
maldives68 has quit [Remote host closed the connection]
crankycoder has joined #ruby
hbpoison has joined #ruby
diffract41 has joined #ruby
gtuckerkellogg has joined #ruby
rh1n0 has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
mikepack_ has joined #ruby
crackfu has quit [Remote host closed the connection]
girija_ has joined #ruby
Domon has quit [Remote host closed the connection]
jonathanwallace has quit [Ping timeout: 245 seconds]
digifiv5e has joined #ruby
diffract41 has quit [Remote host closed the connection]
digifiv5e is now known as Guest63384
hemanth has joined #ruby
ny11 has quit [Remote host closed the connection]
ny11 has joined #ruby
forlive18 has joined #ruby
jjjkkmm has joined #ruby
astrostl has joined #ruby
nga4 has quit []
dhruvasagar has joined #ruby
<astrostl>
defining class 'Foo' with a method 'fetch' to grab a file via http. thought i would call as Foo::fetch('url') or fetch('url') because i'm not creating an object for 'storage' - it's just triggering a download. what is the right way to do this? new an object that i'm not going to directly use?
chrishunt has joined #ruby
sabooky has quit [Ping timeout: 245 seconds]
sabooky has joined #ruby
<astrostl>
thing = Foo.new then thing.fetch('url') works, it just "feels weird" to me
rh1n0 has quit [Quit: Leaving...]
freakazoid0223 has joined #ruby
rh1n0 has joined #ruby
Guest63384 has quit [Read error: Connection reset by peer]
forlive18 has quit [Ping timeout: 256 seconds]
rh1n0 has quit [Client Quit]
JStoker has joined #ruby
generalissimo has joined #ruby
ny11 has quit [Remote host closed the connection]
jpfuentes2 has joined #ruby
ny11 has joined #ruby
ny11 has quit [Read error: Connection reset by peer]
ny11 has joined #ruby
digifiv5e_ has joined #ruby
ny11 has quit [Read error: Connection reset by peer]
jjjkkmm has left #ruby [#ruby]
ny11 has joined #ruby
jgrevich has joined #ruby
kofno has joined #ruby
wmoxam has quit [Quit: leaving]
ny11 has left #ruby [#ruby]
icole has joined #ruby
meliorable26 has joined #ruby
digifiv5e_ has quit [Quit: quit]
`p has quit [Remote host closed the connection]
d2dchat has joined #ruby
adkron has joined #ruby
adkron_ has joined #ruby
astrostl has quit []
chendo_ has quit [Ping timeout: 240 seconds]
cyong has joined #ruby
kofno has quit [Ping timeout: 260 seconds]
arya has quit []
dorei has quit []
adkron__ has joined #ruby
chendo_ has joined #ruby
meliorable26 has quit [Ping timeout: 245 seconds]
mattbl has joined #ruby
znode has joined #ruby
yewton has quit [Excess Flood]
yewton has joined #ruby
twoism has joined #ruby
zeade has joined #ruby
feedbackloop has joined #ruby
arya has joined #ruby
robbyoconnor has joined #ruby
jef_abraham has joined #ruby
jef_abraham has quit [Client Quit]
jef_abraham has joined #ruby
twoism has quit [Remote host closed the connection]
jdunck has quit [Quit: Computer has gone to sleep.]
io_syl has joined #ruby
daig0ro has joined #ruby
daig0ro has quit [Client Quit]
ryanf has quit [Ping timeout: 245 seconds]
sepp2k has quit [Remote host closed the connection]
mephux has quit [Excess Flood]
Guest63465 has joined #ruby
IonGyth has joined #ruby
jef_abraham has quit [Quit: jef_abraham]
Guest63465 has quit [Excess Flood]
jef_abraham has joined #ruby
Guest49024 has joined #ruby
marr has joined #ruby
io_syl has quit [Read error: Connection reset by peer]
elaptics`away is now known as elaptics
straind` has quit [Read error: Connection reset by peer]
straind has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
fire has joined #ruby
dhruvasagar has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
clocKwize has quit [Quit: clocKwize]
<Hanmac>
hemanth you are invented to help me with my rwx binding :P
<hemanth>
Hanmac, more info plz
dhruvasagar has joined #ruby
<hemanth>
XML-RPC Event API with Object Bindings (Java) ?! Hanmac
arya has joined #ruby
dankest has quit [Quit: Leaving...]
<Hanmac>
hemanth wxWidgets is an plattform indipent but native looking GUI toolkit ... wxRuby is an ruby binding that uses that ... rwx is its spawn because wxRuby was shitty
<hemanth>
wxRuby ha i recall
<hemanth>
Hanmac, it it work in progress?
ngotho has joined #ruby
<Clownz>
what is the var_dump version of php in ruby
<Hanmac>
hemanth ... the stuff i implemented in my rwx ruby works ... but i am not finish yet
arturaz has joined #ruby
<Clownz>
thanks but is there way to show every method in new line?
<hemanth>
Hanmac, count me in, draw few milestones
<Clownz>
instead of shoving them in whole line
includex has joined #ruby
<hemanth>
Clownz, what are you trying to do?
<Clownz>
like in metasploit it shows the current clock on each execution of something
<Clownz>
[10:5:5] exploited somehting
<Clownz>
[10:5:6] exploit success
jef_abraham has quit [Quit: jef_abraham]
<postmodern>
Clownz, sounds like you want to use a debugger
<postmodern>
Clownz, require 'debug'
<postmodern>
Clownz, set a breakpoint and step through the methods
<Hanmac>
hemanth ... okay milestones are not set yet ... first i need to find the street :P
<hemanth>
Hanmac, lol okies!
<Clownz>
postmodern, no thats not what im doing
<postmodern>
Clownz, well what are you doing?
angusiguess has quit [Ping timeout: 260 seconds]
<Clownz>
just make it output the current date and show ONLY the time
<Clownz>
including the seconds if possible
mark9 has joined #ruby
<hemanth>
Clownz, did you read the docs?
<Clownz>
searching around
<Hanmac>
hemanth my current goal is to copy the orginal wxWidgets samples into ruby code ... and while i am doing it, i try to implment missing wx functions
<Clownz>
got it
<hemanth>
Hanmac, any repo from where i can clone your progress ?
vlad_starkov has joined #ruby
<hemanth>
Clownz, reading docs really helps? :)
eval-in has quit [Remote host closed the connection]
statarb3 has quit [Read error: Connection reset by peer]
Bry8Star has quit [Remote host closed the connection]
d2dchat has quit [Remote host closed the connection]
axxT has quit [Ping timeout: 240 seconds]
[eDu] has joined #ruby
timmow has joined #ruby
rippa has joined #ruby
pyrac has quit [Read error: Connection reset by peer]
pyrac_ has joined #ruby
Neandre has quit [Ping timeout: 250 seconds]
rawler has joined #ruby
georgi is now known as Giorgio
dhruvasagar has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
swoosh has joined #ruby
dhruvasagar has joined #ruby
backjlack has joined #ruby
Neandre has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
AndChat| has joined #ruby
gyre007 has joined #ruby
vipjun has quit [Ping timeout: 260 seconds]
nari has joined #ruby
nomenkun has quit [Ping timeout: 276 seconds]
arya has quit [Ping timeout: 248 seconds]
Xeago has quit [Remote host closed the connection]
cousine has joined #ruby
lkba has quit [Ping timeout: 276 seconds]
cousine has quit [Remote host closed the connection]
<becom33>
how can I add a clipbard copy to a script ? for a example if Im doing a puts "demo code to copy" how can I add a auto copy copy that output ?
arya has joined #ruby
<hoelzro>
becom33: what's the context? from a web application? command line? GUI application?
<becom33>
hoelzro, cli
<hoelzro>
so you want to put some arbitrary text into the clipboard, then?
sayan has quit [Ping timeout: 245 seconds]
<becom33>
hoelzro, yes
<hoelzro>
if so, pbcopy or xclip
<becom33>
I'm trying less 3rd party gems :/
<hoelzro>
they're not gems
<becom33>
ahh ok
<hoelzro>
also, in my opinion, trying to avoid dependencies as a rule is cutting off your nose to spite your face
<hoelzro>
obviously don't get crazy
<hoelzro>
but leverage the work others have done for you
emocakes has joined #ruby
<becom33>
huh ?
axxT has joined #ruby
takeru has joined #ruby
<becom33>
hoelzro, what if I want to add pbcopy into the script >
<becom33>
?
<hoelzro>
becom33: what do you mean?
IonGyth has quit [Remote host closed the connection]
eka has quit [Ping timeout: 250 seconds]
chichou has joined #ruby
whitedawg has joined #ruby
nomenkun has joined #ruby
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
Takehiro has quit [Remote host closed the connection]
<becom33>
well I want to give the user to choose if he wants to do a auto copy the output of script for a example ./script.rb hello John -c
<becom33>
if the output is "Hello John" it will be auto copy in the clipboard
<hoelzro>
ok
<becom33>
so how can I do that inside the script ?
nomenkun has quit [Read error: Connection reset by peer]
takeru has quit [Ping timeout: 255 seconds]
nomenkun_ has joined #ruby
<hoelzro>
spawn pbcopy or xclip
<hoelzro>
pbcopy is for OS X
<hoelzro>
xclip is machines running the X window system
<becom33>
ok thanks
eka has joined #ruby
marcux has joined #ruby
DrCode has quit [Remote host closed the connection]
pkordel has joined #ruby
nomenkun has joined #ruby
anderse has joined #ruby
<apeiros_>
and windows?!?
statarb3 has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
<Hanmac>
apeiros_ how cares? :P
chussenot has joined #ruby
DrCode has joined #ruby
<apeiros_>
evvvvrybodddy!!!!1!
banjara has quit [Quit: Leaving.]
eka has quit [Client Quit]
carraroj has joined #ruby
nomenkun_ has quit [Ping timeout: 252 seconds]
<Hanmac>
windows are only for freshing a room with air :P
apeiros has joined #ruby
pkordel has quit [Remote host closed the connection]
apeiros_ has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Quit: Lost terminal]
dhruvasagar has joined #ruby
<hemanth>
Hanmac, no, computers are like AC they stop working once they have windows opened :D
txdv has quit [Read error: Connection reset by peer]
krz has quit [Quit: krz]
eka has joined #ruby
<Hanmac>
yeah ... or iphones stop working when its to cold outside? :D
jdunck has quit [Quit: Computer has gone to sleep.]
dayepa has quit [Quit: dayepa]
io_syl has joined #ruby
dayepa has joined #ruby
angusiguess has joined #ruby
atyz has quit [Quit: Leaving...]
statarb3 has quit [Quit: Leaving]
io_syl has quit [Client Quit]
tvw has joined #ruby
rdark has quit [Ping timeout: 245 seconds]
pkordel has joined #ruby
lemonsparrow has quit [Quit: Page closed]
angusiguess has quit [Ping timeout: 252 seconds]
<hemanth>
:D
rdark has joined #ruby
Mon_Ouie has quit [Ping timeout: 255 seconds]
jamesfung14 has quit [Ping timeout: 245 seconds]
swingha has joined #ruby
beiter has quit [Quit: beiter]
arya has quit [Ping timeout: 248 seconds]
Phoop has joined #ruby
VinceThePrince has quit [Read error: Connection reset by peer]
<vandemar>
for validating a bunch of data in a hash (hundreds of k:v pairs), is one of these approaches materially better or more idiomatic or more flexible? http://pastebin.com/4VA2Y00u (class with validation methods) vs http://pastebin.com/UbBwhhT6 (another hash with anonymous validation functions)?
marcux has quit [Quit: marcux]
arya has joined #ruby
<MrZYX>
well, the class is a bit more reusable I think
maasha has joined #ruby
lkba has joined #ruby
<MrZYX>
and you can use send instead of method.call and you usually don't need to explicitly return true or false, i.e you could just write Date.parse foo rescue false
<vandemar>
yeah I just want to do that true/false thing for clarity
<MrZYX>
still in the method the begin is implicit and I don't think that makes it more reusable
<maasha>
on the topic of unit testing. I think I am using the wrong framework simple to avoid dependencies. Test::Unit is primitive :o(
<maasha>
*simply
<MrZYX>
er, I wanted to write readable...
<maasha>
I want something a bit more advanced - even if I introduce a dependency - was it apeiros who wrote something?
<maasha>
So what is the recommended Unit Testing framework for writing non-Rails Ruby stuff?
MehLaptop has joined #ruby
grizlo42 has joined #ruby
pkordel_ has joined #ruby
<vandemar>
MrZYX: ok. what about using method_missing in that validation class and passing the external data keys directly, and using 'case' in method_missing to dispatch key:v pairs to the proper testing function? On reflection that might reduce the amount of mapping crap I have, if some keys only occur once, I won't have to have a different intermediate validating function name?
jamesfung14 has joined #ruby
Virunga has joined #ruby
wf2f has quit []
grizlo42 has left #ruby [#ruby]
sonda has joined #ruby
swoosh has quit [Quit: Computer has gone to sleep.]
k610 has joined #ruby
<MrZYX>
Hm, I'd rather would keep the mapping logic outside, maybe a module defining a validate(key, value) method which does case key; when :foo; date(value); when :bar; three_letter(value); else true; end which you can then dynamically include into your generic validator class and write as many different versions of it as you want without ever needing to touch the validators class?
rhinux has quit [Quit: Konversation terminated!]
pkordel__ has joined #ruby
hbpoison has quit [Ping timeout: 252 seconds]
<k610>
when declaring a hash on multiple lines why can't i place the separting comma at the begging of each line it seems it must strictly be place at the end of each line ?
pkordel_ has quit [Ping timeout: 245 seconds]
pkordel has quit [Ping timeout: 245 seconds]
<MrZYX>
vandemar: so the calling boils down to validator = Validator.new; validator.extend FooValidator; foo_data.each_pair { |k,v| if validator.validate(k, v); puts "pass"; else; puts "fail"; end }
<tobiasvl>
k610: yes. if you want to break the line before the comma you will have to use \
<k610>
tobiasvl, that's daunting
<vandemar>
MrZYX: interesting, I'll experiment with that, thanks
<k610>
i like to use comma on line start so i know i am not missing one but this way i also have to check if i am not missing a \
ozgura has quit [Read error: Connection reset by peer]
Squarepy has joined #ruby
<tobiasvl>
but evidently you notice when you're missing a comma on the end of a line
swingha has quit [Quit: WeeChat 0.4.0]
ozgura has joined #ruby
<tobiasvl>
seeing as you couldn't skip one
<tobiasvl>
so what's the problem? :)
<maasha>
baretest?
<maasha>
where is apeiros?
<maasha>
O_o
<maasha>
o_O
imitkit has joined #ruby
<k610>
tobiasvl, i don't believe so when lines don't have the same length it's much easier to just look at the first char of line instead
<Hanmac>
maasha he is at lunch
atyz has joined #ruby
Quebert has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<maasha>
uuuunaarrrrrmmmggrlll
<maasha>
.oO(lunch!)
rdark has quit [Ping timeout: 245 seconds]
<tobiasvl>
k610: yes, but why do you need to look at the commas at all?
<tobiasvl>
as you've already noticed, ruby checks the commas for you
rocket has joined #ruby
rdark has joined #ruby
<k610>
tobiasvl, it's just my style of writing hashes and it worked so far with stuff ... i don't understand why ruby can't be flexible in this particular case
luckyruby has quit [Remote host closed the connection]
PanPan has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0/20130215130331]]
kristofers has joined #ruby
luckyruby has joined #ruby
<tobiasvl>
i don't understand why you can't be flexible :)
<tobiasvl>
at any rate, that's the way it is
pepper_chico has joined #ruby
[eDu]_ has joined #ruby
Quebert has quit [Ping timeout: 276 seconds]
[eDu] has quit [Quit: [eDu]]
[eDu]_ is now known as [eDu]
[eDu] has quit [Client Quit]
hiroyuki has quit [Ping timeout: 276 seconds]
Virunga has quit [Remote host closed the connection]
ozgura has quit [Read error: Connection reset by peer]
ozgura has joined #ruby
<maasha>
hrm, lots of testing frameworks to consider. minitest, zentest, baretest ...
atyz has quit [Ping timeout: 276 seconds]
pepper_chico has quit [Client Quit]
<maasha>
nope, zentest is something different.
hiroyuki has joined #ruby
Kuifje has joined #ruby
Domon has quit [Remote host closed the connection]
hasimo-t has joined #ruby
VinceThePrince has joined #ruby
ngotho has quit [Read error: Connection reset by peer]
pac1 has joined #ruby
Virunga has joined #ruby
banister`sleep has quit [Remote host closed the connection]
samphippen has joined #ruby
arya has quit [Ping timeout: 248 seconds]
khismetix has joined #ruby
ozgura has quit [Read error: Connection reset by peer]
ozgura has joined #ruby
sepp2k has joined #ruby
apod has joined #ruby
<vandemar>
k610: if the hash only has simple objects like string/number/boolean, you could specify it as json (which allows commas to be at beginnings of lines) and JSON.parse it, but then you have to deal with json syntax.
hbpoison has joined #ruby
jetblack has quit [Ping timeout: 245 seconds]
beiter has joined #ruby
arya has joined #ruby
kofno has joined #ruby
wreckimnaked has quit [Ping timeout: 240 seconds]
<MrZYX>
vandemar: I played a bit since I'm bored :P https://gist.github.com/MrZYX/69243840d439fbf0fc04 this way you can easily split the whole stuff into different files, making each one more readable
pyrac_ has quit [Read error: Connection reset by peer]
pyrac has joined #ruby
<MrZYX>
just don't call .extend on an object inside a loop or so since that would slow the whole thing down too much (it voids rubys method caches)
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
arya has quit [Ping timeout: 248 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
Quebert has joined #ruby
chichou has quit [Remote host closed the connection]
chichou has joined #ruby
grizlo42 has joined #ruby
Proshot has joined #ruby
rocket has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 245 seconds]
arya has joined #ruby
himsin has quit [Remote host closed the connection]
banister`sleep has joined #ruby
himsin has joined #ruby
angusiguess has joined #ruby
Phoop has left #ruby [#ruby]
chichou has quit [Ping timeout: 250 seconds]
hiroyuki has quit [Ping timeout: 255 seconds]
monkegjinni has quit [Remote host closed the connection]
hasimo-t has quit [Remote host closed the connection]
nkr has joined #ruby
agjacome has joined #ruby
chussenot has quit [Quit: chussenot]
divout has quit [Remote host closed the connection]
Clownz has quit [Ping timeout: 255 seconds]
<vandemar>
MrZYX: oh, neat. I think it could use a regex validator type too, just for fun. :) What were you saying about using send? Did you use .call on purpose inside validate()?
blacktulip has joined #ruby
Phoop has joined #ruby
tux91 has joined #ruby
<MrZYX>
send(:foo, :bar) is equivalent to method(:foo).call(:bar) but skips the conversion to a proc
<MrZYX>
and just calls it directly
Phoop has quit [Client Quit]
<Hanmac>
... no its not so equal as you think
tux91 has quit [Remote host closed the connection]
<MrZYX>
vandemar: that .call is just so that you can pass a proc/lambda as mapping
Phoop has joined #ruby
<MrZYX>
if it's not worth having the validator in the base class
<MrZYX>
Hanmac: mind elaborating?
chussenot has joined #ruby
locriani has quit [Remote host closed the connection]
<vandemar>
oh right so send wouldn't work unless the proc was part of a class?
<MrZYX>
send calls the method on a object
hiroyuki has joined #ruby
<vandemar>
since .send has to be called on *something*
yacks has quit [Ping timeout: 255 seconds]
<MrZYX>
"foo".send(:upcase) -> "foo".upcase
<vandemar>
yeah but in this case there's no "foo", it would be like trying to call .send on nothing, and that's why it can't be used?
<MrZYX>
it's self.send
pac1 has quit [Ping timeout: 272 seconds]
jayne has joined #ruby
<MrZYX>
the self is just implicit in a method definition
<dawkirst>
hello, here's a fundamental Ruby question that I'm trying to understand. I have variable foo that I want to set to bar, unless bar is baz, then I want to set it to bacon. Can I do that in a single line?
<vandemar>
MrZYX: oh, I see, I meant line 28 (the proc one) not line 26. I hadn't even noticed the existing classes were handled using send(). What I meant was, is there an equivalent to line 28 (the anonymous function .call) that uses send, and is there any advantage to using send() if it's possible?
<realDAB>
dawkirst: foo = bar == baz ? bacon : bar
<akam_>
hello
fire has quit [Quit: WeeChat 0.4.0]
<MrZYX>
vandemar: no there isn't as far as I'm aware of
Emplitz has quit [Quit: Leaving]
<MrZYX>
I really was talking that about that obj.send(:foo) is better than ob.method(:foo).call
MehLaptop has quit [Remote host closed the connection]
drale2k has joined #ruby
DrShoggoth has quit [Ping timeout: 272 seconds]
<MrZYX>
dawkirst: foo = bar == baz ? bacon : bar
<akam_>
I have hash_array = [{:id=>1, :value=>"first"}, {:id=>2, :value=>"second"}, {:id=>3, :label=>"third"}]
keymone has joined #ruby
<akam_>
How can I get hash with id==2? something like hash_array{:id==2}?
<realDAB>
MrZYX: you didn't like it when i typed it? :-)
<MrZYX>
realDAB: woah overlooked, sorry
Spooner_ has joined #ruby
<realDAB>
MrZYX: i'm just teasing -- happens all the time
<akam_>
MrZYX, thanks! Is it the best way to emulate database structure?
grizlo42 has joined #ruby
DrShoggoth has joined #ruby
[Neurotic]_ has quit [Remote host closed the connection]
yacks has joined #ruby
guilleiguaran has quit [Remote host closed the connection]
angusiguess has quit [Ping timeout: 240 seconds]
<MrZYX>
akam_: not sure, tell more about your greater goal/project
arya has joined #ruby
realDAB has quit [Ping timeout: 272 seconds]
<vandemar>
akam_: .select is an alternative to .detect in case you have multiple hashes with the same id (e.g. not a unique primary key)
RonScagz has joined #ruby
__Big0__ has joined #ruby
F1skr has joined #ruby
elico has joined #ruby
zz_Inoperable has joined #ruby
dsf has quit [Quit: This computer has gone to sleep]
drale2k has quit [Ping timeout: 272 seconds]
hiroyuki has quit [Ping timeout: 250 seconds]
__Big0___ has joined #ruby
drale2k has joined #ruby
<vandemar>
akam_: do you need to emulate a database? Can you use something external like redis or postgresql instead?
grizlo42 has quit [Quit: Leaving.]
<akam_>
MrZYX, I just read some structured info from binary file (reverse ingineering), and I want to emulate database structure (id, title, description for example)
<akam_>
vandemar, I can not do it with hashes?
<MrZYX>
if you need a local relational database I'd look into sqlite or something
<MrZYX>
maybe a simple datamapper like sequel
__Big0__ has quit [Ping timeout: 260 seconds]
yalue has joined #ruby
<MrZYX>
if you need to run complex queries against your data, that is
<vandemar>
akam_: you can, but then you have to manage the data structure. Something like redis, sqlite, or postgres should be easy to understand and let you concentrate on other stuff rather than how to structure the data so you can access it again.
keymone has quit [Quit: keymone]
keymone has joined #ruby
atyz has joined #ruby
wallclockbuilder has joined #ruby
sailias has joined #ruby
Stilo has joined #ruby
predator117 has quit [Ping timeout: 245 seconds]
predator117 has joined #ruby
<akam_>
vandemar, I just want to read data from file and put it to mysql database, but not line for line. firstly i want to parse data to hash
takeru has joined #ruby
atyz has quit [Ping timeout: 248 seconds]
helvete has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 248 seconds]
hemanth has joined #ruby
vagmi has quit [Quit: vagmi]
daniel_- has quit [Read error: Operation timed out]
predator117 has quit [Ping timeout: 240 seconds]
<vandemar>
akam_: so what problems are you running into with your list of hashes?
predator117 has joined #ruby
thebastl has quit [Ping timeout: 255 seconds]
khismetix has quit [Quit: Computer has gone to sleep.]
<akam_>
vandemar, I asked "Is it the best way to emulate database structure?"
takeru has quit [Ping timeout: 276 seconds]
<vandemar>
akam_: what are you doing with the structure other than selecting by id?
sk87 has quit [Quit: sk87]
monkegjinni has joined #ruby
<MrZYX>
so you want to build a table, then do ???? and then add it to a MySQL database?
<akam_>
yep
<MrZYX>
so what is the ????
<vandemar>
akam_: a more basic construction would be simply { 1 => "first", 2 => "second", ... }
<akam_>
I want to assure all data is parsed without errors
<MrZYX>
can't you do that already before adding it to the array?
pavilionXP has quit [Ping timeout: 250 seconds]
<MrZYX>
like hash = read_chunk; valid_data << hash if valid(hash)
<JonnieCache>
why does the method one have to be in lowercase?
<JonnieCache>
>> puts __METHOD__
<eval-in>
JonnieCache => /tmp/execpad-ab5e559854c7/source-ab5e559854c7:2:in `<main>': undefined local variable or method `__METHOD__' for main:Object (NameError) (http://eval.in/11970)
<MrZYX>
heh, it's hard to remeber for a non native :P
iamjarvo has joined #ruby
verysoftoiletppr has joined #ruby
ngotho has joined #ruby
<apeiros>
maasha: I'm here. what's up?
_carloslopes has joined #ruby
carloslopes has quit [Read error: Connection reset by peer]
<maasha>
apeiros: hiyas. I have had it with Test::Unit - It was a mistake to stick with it just to avoid a dependency. In short I am looking for a Unit Testing framework for non-rails ruby.
<apeiros>
ah
<maasha>
apeiros: and I would think you had an opinion ...
<maasha>
IIRC
includex has quit [Quit: Computer has gone to sleep.]
<apeiros>
I wrote one, but the rewrite of it has been in the works for ~2y now. So I'd call that vaporware (unless baretest 0.4 is good enough for you - but API changes in 0.5)
iamjarvo has quit [Client Quit]
<apeiros>
other than that, I use test/unit for the moment to have a minimal dependency. but I fully understand your dissatisfaction. I have the same, after all, that's why I wrote baretest :)
dblack__ has joined #ruby
<maasha>
apeiros: I remember you suggested me baretest long time ago, but I sort of just stuck with Test::Unit.
<hoelzro>
ssm2017: are you sure it's in the right directory?
caveat- has joined #ruby
philcrissman has joined #ruby
`p has quit [Remote host closed the connection]
<hoelzro>
also, actually printing the exception details would probably help
m3pow has quit [Ping timeout: 245 seconds]
<ssm2017>
yes hoelzro i have also taken the result file path to edit it to see if it can be editable
tish has quit [Quit: Leaving.]
S1kx has quit [Quit: Leaving]
<ssm2017>
where to get the "exception details" ?
<ssm2017>
im not a ruby dev, i just would like to run an app (the app dev has left on mars)
segv- has quit [Remote host closed the connection]
d2dchat has joined #ruby
<hoelzro>
ssm2017: puts $!
<hoelzro>
in the rescue block
nachtwandler has joined #ruby
elico has quit [Quit: elico]
hasimo has quit [Ping timeout: 272 seconds]
tcstar has joined #ruby
<ssm2017>
im sorry hoelzro but what you are saying is a foreigner language
caveat- has quit [Ping timeout: 250 seconds]
soc42 has joined #ruby
<chiel>
ssm2017: put that line in the rescue block
jamescarr_ has left #ruby [#ruby]
<chiel>
to see what the actual exception is
<chiel>
puts $!
<mbduino>
anyone know of a good SSO solution (e.g. gem) for web apps in ror
Hanmac has joined #ruby
<ssm2017>
hoelzro, do i need to go to /opt/opensim/.rvm/gems/ruby-2.0.0-p0/gems/sras-2.1.5/lib/sras/helpers/config.rb and then just add $! at the end of line 22 ?
maletor has joined #ruby
apeiros_ has quit [Remote host closed the connection]
danman has quit [Quit: danman]
<ssm2017>
or create a new line with "puts $!" (i dont know if "puts" is a command or if you ask me to put $!
locriani has joined #ruby
DrShoggoth has joined #ruby
`p has joined #ruby
vagmi_ has quit [Quit: vagmi_]
alfakini has joined #ruby
sambao21 has quit [Quit: sambao21]
jgrevich has joined #ruby
danman has joined #ruby
vagmi has joined #ruby
Mo0O has quit [Ping timeout: 245 seconds]
predator117 has quit [Ping timeout: 272 seconds]
vagmi has quit [Client Quit]
johnmilton has joined #ruby
danneu has joined #ruby
Mo0O has joined #ruby
wudofyr_ has quit [Quit: wudofyr_]
wudofyr has joined #ruby
danman has quit [Client Quit]
sambao21 has joined #ruby
k610 has quit [Ping timeout: 276 seconds]
markalanevans has quit [Quit: markalanevans]
predator117 has joined #ruby
v0n has quit [Read error: Connection reset by peer]
_nitti has quit [Remote host closed the connection]
danman has joined #ruby
includex has quit [Quit: Leaving...]
_nitti has joined #ruby
_nitti has quit [Remote host closed the connection]
samphippen has quit [Quit: Computer has gone to sleep.]
mafolz has quit [Remote host closed the connection]
F1skr has quit [Quit: WeeChat 0.4.0]
samflores has joined #ruby
philcrissman has quit [Remote host closed the connection]
PragCypher has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
<samflores>
I'm not sure here's the place to talk about mruby, but can someone help me compiling it?
philcrissman has joined #ruby
wrench has joined #ruby
<wrench>
Anyone that's used the dashing gem: how can I pass a variable to the coffeescript of a widget?
philcrissman has quit [Remote host closed the connection]
<sheerun>
How to convert Proc to UnboundMethod?
sailias1 has joined #ruby
philcrissman has joined #ruby
razibog has joined #ruby
sailias has quit [Ping timeout: 245 seconds]
<Hanmac>
sheerun i dont think its possible in this direction
<sheerun>
Why?
rubarlion has joined #ruby
VinceThePrince has quit [Read error: Connection reset by peer]
ssm2017 has left #ruby ["goodbye..."]
<sheerun>
I could create blank class, define_method and call instance_method on it
_br_ has joined #ruby
<sheerun>
But that's the long way
BRMatt has quit [Quit: Leaving]
<apeiros_>
why do you want to convert it to an UnboundMethod?
<sheerun>
to bind it later
_br_ has quit [Excess Flood]
<apeiros_>
you already said the solution to that
<apeiros_>
define_method
<apeiros_>
no need to convert it first
Al____ has joined #ruby
alfakini has quit [Quit: Computer has gone to sleep.]
<sheerun>
I don't want to define_method, but call this proc in context of another object
p3rror has left #ruby ["Leaving"]
ngotho has joined #ruby
<apeiros_>
instance_eval then
<apeiros_>
or instance_exec if you want params
tobor_one has joined #ruby
<sheerun>
instance_exec does not support passing block to that proc
<sheerun>
probably?
<apeiros_>
it does.
<apeiros_>
unless you use antiquated rubies
samflores has quit []
rubarlion has quit [Remote host closed the connection]
<sheerun>
OK, I'll try this, thanks :)
<apeiros_>
but with antiquated rubies, you can't define a proc which accepts a block in the first place.
mahmoudimus has joined #ruby
Ontolog has joined #ruby
<apeiros_>
any yield within a proc would be lexical, iirc
Ontolog has quit [Remote host closed the connection]
samuelj has joined #ruby
<samuelj>
Hey guys, anyone got any recommendations on how to suppress the Float class to 2dp? I guess I could just override it's to_s, but I'd also like to only use 2dp for comparisons
<apeiros_>
2dp?
Ontolog has joined #ruby
eAlchemist has quit [Remote host closed the connection]
_br_ has joined #ruby
elkclone has joined #ruby
eAlchemist has joined #ruby
rubarlion has joined #ruby
wreckimnaked has quit [Ping timeout: 245 seconds]
daniel_- has joined #ruby
mengu_ has quit [Quit: Konversation terminated!]
<apeiros_>
nice. no answer to follow up question. well then… off I go
mbduino has quit [Read error: Connection reset by peer]
samphippen has joined #ruby
samuelj has quit [Ping timeout: 255 seconds]
rupee has joined #ruby
etcetera has joined #ruby
mark9 has left #ruby [#ruby]
sn0wb1rd has joined #ruby
ckrailo has joined #ruby
samuelj has joined #ruby
<withnale>
hello. silly question. I've got filenames that are sometimes wrapped in escaped quotes when they contain spaces( \" ). However, I need to pass it to File.stat - whats the easiest way to strip starting and ending escaped quotes? I thought I could use ^ and $ as in perl but that doesn't seem to fly.
sailias1 has quit [Ping timeout: 272 seconds]
cantonic has joined #ruby
<Spooner_>
withnale, ^ and $ work just the same as in Perl. Can you give an example of what you are doing?
carlyle has quit [Read error: Connection reset by peer]
sepp2k1 has joined #ruby
ozgura has quit [Read error: Connection reset by peer]
<Spooner_>
You shouldn't get those quotes, however, if you are reading ARGV.
sepp2k has quit [Ping timeout: 245 seconds]
ozgura has joined #ruby
carlyle has joined #ruby
<withnale>
a = "\"/var/tmp/some file with spaces.txt\"" - I want to get the unquoted filename out of the middle so I can use it with stat
<Spooner_>
The easiest way, however, is just str.gsub('"', '')
<withnale>
yeah, it's fine if i separate it out, but I'm digging into someone elses code and he's already encoded it
ozgura has quit [Remote host closed the connection]
<withnale>
I think i need \A and \Z
<Spooner_>
Or str[1..-2] if you just want to remove the first and last.
carlyle has quit [Read error: Connection reset by peer]
<Spooner_>
Why? Are you expecting quotes in the middle too?
<dblack__>
Spooner_: i thought ^ and $ were beginning and end of string in perl
<dblack__>
Spooner_: my perl memory may be rusty though
<Spooner_>
They are, but there is no real reason why you need to worry in this case.
<apeiros_>
dblack__: just checked that. it's the same as in ruby.
<apeiros_>
dblack__: at least `man perlre` says that
PragCypher has quit [Quit: Leaving]
<apeiros_>
(Perl v5.12.4)
<withnale>
Spooner: I don't want to unencode other values.
<dblack__>
apeiros_: interesting -- i wonder if that's changed recently
<withnale>
hmm. or maybe I do.
<apeiros_>
dblack__: I wonder too, because I thought ^$ were different in perl
<dblack__>
me too
<apeiros_>
and I don't think I remember \A\z. but I coded perl quite a few years back, and I only just started using regexen then.
adkron has quit [Ping timeout: 255 seconds]
<Spooner_>
Strictly ^$ are begin and end of line (but if you don't have newlines, then it is begin and end of string). \A\z are true ends of the string in all cases.
<apeiros_>
bad habit. don't.
<apeiros_>
always say what you mean. use \A and \z even for supposedly single line strings.
<apeiros_>
just my 0.02€
stonevil has quit [Quit: stonevil]
<Spooner_>
I agree, but I still use ^$ from habit :$
<dblack__>
apeiros_: see the m modifier description in perlre
<apeiros_>
the use of ^$ instead of \A\z is probably one of the more widespread vulnerabilities in validations.
filipe_ has quit [Remote host closed the connection]
yekta has quit [Ping timeout: 240 seconds]
<Spooner_>
sheerun, How can we know how to make it work if we don't know what you want to achieve withit?
<apeiros_>
dblack__: ah, I remember that. I think it was always that way.
* dblack__
also uses \A and \z habitually
<dblack__>
apeiros_: yeah. i think they are indeed different from ruby.
<apeiros_>
I remember having had difficulties with that since m/s flags are different in ruby.
<sheerun>
I'd like to pass block to procedure (named procedure there)
iamjarvo1 has quit [Quit: Leaving.]
Coolhand|laptop has quit [Read error: Operation timed out]
mpfundstein has quit [Remote host closed the connection]
<sheerun>
More exactly run procedure in context of instance of Test class with parameters and block passed.
lkba has quit [Read error: Connection reset by peer]
AndChat| has joined #ruby
Voodoofish430 has joined #ruby
AndChat| has quit [Remote host closed the connection]
jef_abraham has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
<rubarlion>
How do I scan a hash for a symbol?(key) & => value?
NightCreature is now known as SDr
SDr has quit [Changing host]
SDr has joined #ruby
lkba has joined #ruby
<Spooner_>
rubarlion, "scan"?
mikepack has joined #ruby
<rubarlion>
word = gets.chomp; if word.to_sym == list[?]
browndawg has quit [Quit: Leaving.]
<rubarlion>
i'm confused on how to call the position of the matched
<rubarlion>
key
hbpoison has joined #ruby
<Hanmac>
to_sym on userinput is UGLY
Vainoharhainen has quit [Quit: Leaving...]
atyz has joined #ruby
Mattix has joined #ruby
francisfish has quit [Remote host closed the connection]
dmiller has joined #ruby
BizarreCake has quit [Ping timeout: 276 seconds]
<workmad3>
Hanmac: and dangerous in long-running processes
francisfish has joined #ruby
QaDeS has joined #ruby
jrajav has joined #ruby
Ontolog has quit [Remote host closed the connection]
sayan has quit [Ping timeout: 245 seconds]
francisfish has quit [Ping timeout: 272 seconds]
rakl has joined #ruby
<pseudonymous>
I'm trying to monkey patch 'raise' (yes, from 'kernel') and I find that it only works for the files which has "require_relative 'common'" where 'common' is the file in which my patch is written
edemkumodzi has joined #ruby
girija has quit [Ping timeout: 245 seconds]
<pseudonymous>
Now - there's a reason why I want to do this, I want to log everything so I can send mails back to myself with what went wrong. It may be dirty, but humour me :) Is there a way to ensure any other 'raise' happening from the ruby API uses my monkey patch ?
nkts has quit [Quit: leaving]
apod has joined #ruby
<Hanmac>
pseudonymous ... i think the problem is that C-API calls to rb_raise are not captured ...
twoism has joined #ruby
edemkumodzi has quit [Remote host closed the connection]
<jrajav>
Regexes can't count, at least not like that
Goles has quit [Ping timeout: 240 seconds]
carlyle has joined #ruby
<lectrick>
Hanmac: '1'.match(/(.)\1+/) #=> nil . '222222'.match(/(.)\1+/) #=> not nil (it should be nil). ;)
<lectrick>
jrajav: is there a way to bastardize it to do so? I am purely interested in the exercise, this is not for production code
akashj87 has joined #ruby
<jrajav>
Hanmac was pointing out that you get the number of matches back
blaxter has joined #ruby
<jrajav>
lectrick: No. Pure regexes cannot do that simply by their nature (take a Formal Automata class), and as far as I'm aware of there are no extensions in any variant that would allow it either
Goles has joined #ruby
<lectrick>
jrajav: I think it only returns the first matched character, not the number of matches
ngoldman has joined #ruby
<jrajav>
You would need to use the value that you're matching to basically recompile the regex
<jrajav>
Since you want to use it as a parameter to { }
<lectrick>
jrajav: exactly. re: "take a Formal Automata class"... well, i'm outta college, maybe there's an online course I can hit up out of curiosity :)
Spooner_ has quit [Remote host closed the connection]
aedornm has joined #ruby
<epitron>
lectrick: is this a toy problem? or is there actually a problem you're trying to solve?
<jrajav>
Basically you can write a state machine to compute any known, finite pattern - you can "count" with separate states, basically
<jrajav>
So saying "2{5,54}" is possible - between 5 and 54 "2"'s
Mon_Ouie has joined #ruby
<jrajav>
But to say "2{(2)}" (dependent on the number) is impossible because the machine would have to modify itself as it runs
<jrajav>
The state machines that normal regular expressions are equivalent to is not as powerful as a computer
ngoldman_ has quit [Ping timeout: 272 seconds]
mityaz has joined #ruby
<jrajav>
The situation becomes more complicated than that due to POSIX and PCRE extensions - they become a lot more powerful - but re: this issue it's still the same story
ngoldman_ has quit [Remote host closed the connection]
<jrajav>
lectrick: It may or may not be the book I used in college (which was good).. looks like it could be... it looks fine anyway, paging through it
mahmoudimus has joined #ruby
ngoldman_ has joined #ruby
<Amnesia>
anyone using a tiling window manager over here?
pencilcheck has quit [Remote host closed the connection]
ngoldman has quit [Ping timeout: 245 seconds]
frem has joined #ruby
huoxito has joined #ruby
squidBits has joined #ruby
rubarlion has joined #ruby
<lectrick>
jrajav: "Formal Languages and Automata Theory"?
<jrajav>
Yup
dankest has joined #ruby
mahmoudi_ has joined #ruby
mpfundstein has joined #ruby
UberNerdGirl has joined #ruby
<epitron>
jrajav: heh.. saying "5th book" on google isn't very reliable :)
<epitron>
google is a filter bubble
mahmoudimus has quit [Read error: Connection reset by peer]
<jrajav>
You're saying he could have a different result from me?
<epitron>
yep
kpshek has quit []
apod has quit []
<epitron>
try searching google regularly, and then in incognito mode
<UberNerdGirl>
Hi, I have a question on inserting comma's into an array
<apeiros_>
axl_: Date.ordinal
<jrajav>
I was working in incognito mode.
plantseeker has quit [Quit: Nettalk6 - www.ntalk.de]
<epitron>
ok :)
mahmoudi_ has quit [Client Quit]
freakazoid0223 has joined #ruby
<jrajav>
I usually do unless I'm logging on to social websites and wasting time
<jrajav>
I am kind of curious what "google biases" you think would skew results for different people
<UberNerdGirl>
and threes = [3,6,9]
<jrajav>
As far as I know the "personal results" are clearly demarcated
<epitron>
google customizes your results based on what you click
<jrajav>
Are you sure about that?
<epitron>
yep
<apeiros_>
+1 @ customized google
QF-MichaelK has joined #ruby
<epitron>
i turned off my google search history once, and suddenly i couldn't find anything on ruby
<axl_>
apeiros_: interesting! thanks a bunch
jjbohn is now known as jjbohn|afk
<UberNerdGirl>
how do I get comma's inserted into "array" using each of the indices from "threes"?
soc42 has quit [Remote host closed the connection]
breakingthings has quit []
<epitron>
it took me like 2 days of clicking the right things to get it back
<epitron>
machine learning is why google is so effective
d2dchat has joined #ruby
<epitron>
but it's also a filter bubble :)
Banistergalaxy has joined #ruby
<apeiros_>
UberNerdGirl: not sure I understand your question
<havenwood>
UberNerdGirl: What should the output look like? Where do the commas go?
<apeiros_>
UberNerdGirl: what'd be the desired result?
<jrajav>
I understand that, but I don't think that they have anything in place that will key off of your personal tracking or profile
<jrajav>
That wouldn't be clearly marked, that is
<UberNerdGirl>
the desired result would be
<jrajav>
When I'm logged in to Google+ I can see Gmail and Drive results on the side, as well as results at the top that are marked with "You've visited this page 5 times. Last visit: 2/28/13"
<apeiros_>
jrajav: google even bypassed safari privacy settings (not by chance, or coincidence, that was intentional)
<QF-MichaelK>
I tried to run some ruby tk file and it's giving me errors related to `_invoke, so I tried to install libtcltk-ruby but that claimed broken packages, so I tried v 1.9.1 of that, then reinstalled ruby1.9.3... Any thoughts on how to get that to run?
<apeiros_>
so I wouldn't bet on that
<jrajav>
But other than those results (or if I click the tab to hide those) it is, as far as I can tell, precisely the same as logged-out results
<UberNerdGirl>
then I am going to move onto better ways
rezzack has joined #ruby
samuelj_ has joined #ruby
<UberNerdGirl>
Hanmac: what does |c,i| stand for?
<lectrick>
UberNerdGirl: "optimize my code with current methods"... ok, let's run with that. how are the current methods more optimal than other methods?
<UberNerdGirl>
lectrick: i didn't say my current methods are more optimal
samuelj_ has left #ruby [#ruby]
<UberNerdGirl>
before i move onto truly more sophisticated strategies, there are some basic mistakes on my current code that I'd like to fix first
<Hanmac>
UberNerdGirl c is the char of the array, and i is the index
<UberNerdGirl>
once I fix my basic mistakes and get it actually _working_, then I'd like to move onto more efficient solutions
Bry8Star has quit [Remote host closed the connection]
predator117 has quit [Ping timeout: 250 seconds]
mrsolo has joined #ruby
c0rn has quit [Client Quit]
stkowski has joined #ruby
<UberNerdGirl>
Hanmac: hm, what do you mean by char?
akashj87 has joined #ruby
<havenwood>
UberNerdGirl: A single letter is a char. Like "9" or "h".
predator117 has joined #ruby
ilyam has joined #ruby
predator117 has quit [Client Quit]
<UberNerdGirl>
havenwood: oh, so the first 'char' of [9,8,7,6] is the value returned when we take index 0 of it?
predator117 has joined #ruby
<UberNerdGirl>
["dog", "muffin", "cat"]
<UberNerdGirl>
oops, i meant to say
<UberNerdGirl>
random = ["dog", "muffin", "cat"]
<havenwood>
UberNerdGirl: On line 6, i'd drop [1..-1] and just do 1.upto instead of 0.upto
<UberNerdGirl>
random[0] is the first 'char' of that array?
carlyle has quit [Read error: Connection reset by peer]
Bry8Star has joined #ruby
<havenwood>
UberNerdGirl: First element of the array. ?d is the first char of the first element
<Hanmac>
lectrick and your sample does look bad when the old_array is accact %3 size big, so [1,2,3,4,5,6] is turned into [1,2,3,",",4,5,6,","] i think the last of the "," is wrong
_nitti has quit [Remote host closed the connection]
<fivethre1o>
nvmn, each works better than for :)
<apeiros_>
maasha: what?
tenmilestereo has joined #ruby
rburton- has joined #ruby
<havenwood>
fivethre1o: what is the =begin =end about in the salt_minions array?
<maasha>
apeiros_: hey there, I have been studying some more unit testing framework stuff. What is exactly the problem with DSL style?
<fivethre1o>
commented out
predator117 has quit [Ping timeout: 256 seconds]
<apeiros_>
maasha: with DSL itself nothing
predator117 has joined #ruby
adkron has joined #ruby
<havenwood>
fivethre1o: Definitely more Ruby to use `salt_minions.each do salt_minion` but with your for loop I still get: database1web1
<maasha>
apeiros_: so DSL for unit testing then?
<apeiros_>
maasha: I have problems with a) frameworks which are invasive (i.e., "contaminate" your unit under test)
<havenwood>
fivethre1o: (First element printed then second.)
<fivethre1o>
as i expect
<Hanmac>
havenwood you forgot the ||
<apeiros_>
and b) with frameworks which are so vast, that you need serious knowledge in order to use and/or understand them
Mattix has quit [Quit: Leaving]
<lectrick>
Hanmac: good point re: extra comma. sigh
<havenwood>
<3 MiniTest
<maasha>
apeiros_: I am totally following you on those issues. Also, I really like the test "description" { } that you have (was also in barewords?).
<apeiros_>
baretest, not barewords ;-)
<apeiros_>
and yes, that's how baretest started. with 38 LoC, and suite/test do :)
QF-MichaelK has left #ruby [#ruby]
Ontolog has joined #ruby
<maasha>
apeiros_: right, so how do your tests look like when run (ok and fail)?
<maasha>
the output of the testing suite
<apeiros_>
with baretest? or with my test/unit extension?
<maasha>
apeiros_: the latter
<apeiros_>
my test/unit extension doesn't change the output format
<apeiros_>
I sometimes run them with the "turn" gem
codecop has joined #ruby
ry4nn has quit [Ping timeout: 255 seconds]
<maasha>
apeiros_: so the description in test "description" {} is not shown if a test fails?
<apeiros_>
that's with turn. without turn it's just the good old dots.
<UberNerdGirl>
gee thank you for your eloquent tidbits and advice :D :D
<maasha>
apeiros_: that looks very nice.
pygmael has quit [Quit: pygmael]
<UberNerdGirl>
Hanmac: I always had a "fetish" for ternaries so I think yours was neat
Catbuntu has joined #ruby
<Catbuntu>
Hi
R_Macy has joined #ruby
<UberNerdGirl>
Catbuntu: hi, what a cute name you have
<Catbuntu>
Yes haha
* UberNerdGirl
obviously has AHDH :P
<maasha>
apeiros_: so you have me pretty much convinced that your way is most excellent
yekta has quit [Quit: yekta]
<apeiros_>
maasha: funny, I consider it a stop-gap :D
<maasha>
apeiros_: well, what else? like if you were to allow a dependency?
mercwithamouth has quit [Ping timeout: 256 seconds]
<maasha>
I was looking at wrong, but I miss the description
<apeiros_>
I'd want what baretest should become
<apeiros_>
anything less, I'm not interested in.
<maasha>
Same for minitest
<banisterfiend>
apeiros_: what are the k00 features of baretest
<maasha>
apeiros_: and we are back to the stop-gap ...
<apeiros_>
banisterfiend: proper separation of the test phases. multiple isolated verifications against the same exercise. nice, intuitive DSL without polluting the unit under test.
sepp2k1 has quit [Remote host closed the connection]
<maasha>
banisterfiend: that it is not maintained :o/
<apeiros_>
and the issue would be that it isn't done :)
rdark has quit [Quit: leaving]
_jc has quit [Quit: Computer has gone to sleep.]
<apeiros_>
oh, also a nice test-runner (works in 0.4 already), which allows you to only run failed tests, and/or new tests or pretty much any selector you want.
djwonk has quit []
<apeiros_>
and through the test-runner a nice boilerplate-free (no yucky "require_relative '../../../../test_helper'"!) test suite
mikurubeam has joined #ruby
Bry8Star has quit [Remote host closed the connection]
mattbl has quit [Quit: This computer has gone to sleep]
lewix has quit [Remote host closed the connection]
<maasha>
yeah, that stinks
<apeiros_>
that's why I have test/runner.rb in my stop-gap :)
mattbl has joined #ruby
Neomex has quit [Quit: Neomex]
<apeiros_>
allows me to be boilerplate free with test/unit
<apeiros_>
I'll probably even move that little bit of code into its own gem
m8 has joined #ruby
lewix has joined #ruby
stkowski_ has joined #ruby
khismetix has joined #ruby
stkowski has quit [Ping timeout: 272 seconds]
stkowski_ is now known as stkowski
llaskin1 has joined #ruby
lewix has quit [Remote host closed the connection]
nmabry has joined #ruby
<llaskin1>
anyone here use rubymine?
<llaskin1>
I'm trying to create a file template but It for some reason keeps blowing up on a line with ":" in it
Bry8Star has joined #ruby
banjara has joined #ruby
<llaskin1>
specifically this line: "$waiter.until{ $browser.find_element(:css, "input[type='password']") }"
nmabry has quit [Client Quit]
DrShoggoth has quit [Ping timeout: 245 seconds]
JarJar has quit [Quit: Leaving]
nmabry has joined #ruby
xybre has quit [Ping timeout: 264 seconds]
shtirlic has quit [Ping timeout: 260 seconds]
<maasha>
apeiros_: yeah, I find the layout of the file tree confusing.
Kovensky has quit [Ping timeout: 248 seconds]
etcetera has quit []
sambio has quit [Ping timeout: 252 seconds]
<maasha>
apeiros_: like the helper.rb - when is that loaded?
<apeiros_>
test/unit contains all your tests
<apeiros_>
test/lib contains libs related to testing (not libs under test)
<maasha>
got that
<apeiros_>
all the rest is done by test/runner.rb
bonhoeffer has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
adkron_ has joined #ruby
adkron__ has joined #ruby
<apeiros_>
loading of helper and preparing $LOAD_PATH
Criztian has quit [Remote host closed the connection]
khismetix has quit [Ping timeout: 272 seconds]
Bry8Star has quit [Remote host closed the connection]
<bonhoeffer>
i'm in rib -- trying to test a gem -- how can i load my environment require 'lib/govtrack.rb' only causes problems because it is filled with require statements that need the correct paths
kpshek has joined #ruby
carlyle has quit [Remote host closed the connection]
mikurubeam has quit [Quit: +1 (Yes). -1 (No). i (WTF?).]
<maasha>
apeiros_: I guess I should be able to make that work. I will play with that tomorrow.
etcetera has joined #ruby
BizarreCake has quit [Ping timeout: 245 seconds]
<maasha>
apeiros_: so - I forgot - why was it that baretest is not moving forward?
kpshek has quit [Client Quit]
<bonhoeffer>
for example, i require 'rubygems', then require "/Users/tim/Sites/govtrack/lib/govtrack.rb", which produces: LoadError: cannot load such file -- govtrack/base
Bry8Star has joined #ruby
etcetera has quit [Client Quit]
v0n has joined #ruby
Kovensky has joined #ruby
xybre has joined #ruby
squidBits_ has joined #ruby
shtirlic has joined #ruby
khismetix has joined #ruby
squidBits has quit [Read error: Connection reset by peer]
squidBits_ has quit [Read error: Connection reset by peer]
mikurubeam has joined #ruby
<apeiros_>
maasha: lack of time, too many other funky stuff to do
squidBits has joined #ruby
<apeiros_>
*much
etcetera has joined #ruby
<banisterfiend>
starcraft.
<banisterfiend>
:P
monkegjinni has joined #ruby
<bonhoeffer>
i think there is some missing configuration to get the gem working -- some way to specify paths in the gem spec?
hbpoison has joined #ruby
ngoldman has joined #ruby
kirun has joined #ruby
<apeiros_>
banisterfiend: indeed, that'd be one of those funky things
<maasha>
apeiros_: hm, well, perhaps one day. Anyway, thanks for the answers.
jjbohn|afk is now known as jjbohn
dblack_ has joined #ruby
<Hanmac>
apeiros_ did you notic that in ruby2.0 little floats has fixed object ids too?
yourmysin_ has quit [Read error: Connection reset by peer]
yourmysin__ has quit [Read error: Connection reset by peer]
<maasha>
banisterfiend: startcraft written in ruby by apeiros_ ? funky!
Rioji has joined #ruby
forced_request has joined #ruby
yourmysin has joined #ruby
yekta has joined #ruby
Choobie has quit [Quit: End]
killer-dinosaur has joined #ruby
ngoldman_ has quit [Ping timeout: 276 seconds]
jerius has quit [Ping timeout: 245 seconds]
ngoldman has quit [Ping timeout: 250 seconds]
chussenot has joined #ruby
_nitti has joined #ruby
<Hanmac>
banisterfiend ... floats does have fixed object_ids now ... does you like that? :D
apod has quit []
UberNerdGirl has quit [Ping timeout: 245 seconds]
killer-dinosaur is now known as UberNerdGirl
dougireton has joined #ruby
<banisterfiend>
Hanmac: good for ruby game developers
m3pow has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0/20130227155931]]
<bonhoeffer>
maybe i should modify $LOAD_PATH?
m3pow has joined #ruby
carlyle has joined #ruby
nachtwandler has quit [Quit: leaving]
Criztian has joined #ruby
<Hanmac>
bonhoeffer require_relative
sailias has quit [Ping timeout: 276 seconds]
alvaro_o_ has quit [Read error: Connection reset by peer]
<bonhoeffer>
Hanmac: ok
alvaro_o has joined #ruby
FailDrain has left #ruby ["Leaving"]
<bonhoeffer>
ah -- i also did $LOAD_PATH.push(Dir.pwd + "/lib/") -- then my require worked
<bonhoeffer>
i guess otherwise, i would have to set the basepath
endzyme has quit [Remote host closed the connection]
_nitti has quit [Ping timeout: 256 seconds]
ssm2017 has left #ruby ["goodbye..."]
frem has joined #ruby
frem has quit [Excess Flood]
jerius has joined #ruby
bean__ has joined #ruby
chrishough has quit [Quit: chrishough]
bean__ has quit [Max SendQ exceeded]
chussenot has quit [Ping timeout: 272 seconds]
bean__ has joined #ruby
bean__ has quit [Max SendQ exceeded]
alvaro_o has quit [Client Quit]
<bonhoeffer>
works well with irb -I .
bean__ has joined #ruby
mattbl has joined #ruby
rheoli has quit [Quit: Computer has gone to sleep.]
axl__ has joined #ruby
llaskin1 has left #ruby [#ruby]
pseudonymous has quit [Ping timeout: 255 seconds]
Mon_Ouie has quit [Ping timeout: 260 seconds]
kpshek has joined #ruby
kpshek has quit [Remote host closed the connection]
tvw has joined #ruby
yacks has quit [Quit: Leaving]
ilyam has joined #ruby
rezzack has quit [Quit: Leaving.]
mercwithamouth has quit [Ping timeout: 260 seconds]
generalissimo has quit [Remote host closed the connection]
danneu has joined #ruby
axl_ has quit [Ping timeout: 264 seconds]
axl__ is now known as axl_
breakingthings has joined #ruby
<Hanmac>
bonoeffer ... manipulating the $LOAD_PATH is a no-go .. it can BITE you in your ass
mattbl has quit [Ping timeout: 276 seconds]
elaptics is now known as elaptics`away
mattbl has joined #ruby
dustint has quit [Quit: Leaving]
<Hanmac>
i wonder why NO ONE UNDERSTANDS that its a security risk to add "." to the load path ... and then they are also to dump to google why its a risk
<banisterfiend>
Hanmac: some people pay good money to be bitten in the ass
chrishough has joined #ruby
danneu has quit [Client Quit]
<Hanmac>
yeah ... apple users :P
threesome has joined #ruby
ryanf has joined #ruby
dustint has joined #ruby
EPIK has joined #ruby
reset has joined #ruby
Goles has quit [Ping timeout: 240 seconds]
dougireton has quit [Quit: Leaving.]
Goles has joined #ruby
jrajav has joined #ruby
<ddd>
yet to be bit in the ass by any of my apple products
maasha has quit [Ping timeout: 245 seconds]
Eldariof-ru has joined #ruby
khismetix has quit [Ping timeout: 245 seconds]
<aedornm>
hmmmm... I don't see anything wrong with '.' in the load path. But then I tend to sandbox a lot
khismetix has joined #ruby
<whitequark>
aedornm: same reason why PATH=. is bad
sambao21 has joined #ruby
<whitequark>
anyone who can plant a file in your fs might trick you into code execution
DrShoggoth has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
<whitequark>
like by calling a script `ls` and +x'ing it
jurassic has quit [Quit: jurassic]
dblack_ has quit [Quit: dblack_]
<aedornm>
Oh I understand the reason, but I don't understand why anyone would let it do anything to begin with.
<whitequark>
'it'?
<zastern>
Is there a reason why this code isn't succesfully printing REDACTED when I expect it to?
<zastern>
E.g. if I set text to foo bar foo bar foo bar, and then set redact to foo and redact2 to bar, it still just prints out foo bar foo bar foo bar
Xeago has joined #ruby
<aedornm>
Yeah, you can't do anything to the file system if it's in a sandbox (or jail if we're running BSD, generally.) You also can't do anything if permissions are correct. I suppose if you're running a service specifically as root, but then.. why?
rismoney has joined #ruby
<whitequark>
aedornm: it's designed to prevent privilege escalation in multiuser systems
artofraw has joined #ruby
<whitequark>
besides, there isn't really a _reason_ to keep . in any load paths
<Hanmac>
aedornm information: EVERY sandbox can be broken ...
<shevy>
ddd I want a RubyOS!
<ddd>
shevy: Build it and they will come!
frem has joined #ruby
jurassic has joined #ruby
<shevy>
hehe
<aedornm>
hmmmm..
<whitequark>
Hanmac: it's really freaking hard to climb out of a hardware vm
<whitequark>
to the point where it's easier to exploit
<aedornm>
Hanmac: I'll concede to that, but if they're breaking your sandbox you probably have bigger problems.
_nitti has joined #ruby
<whitequark>
other OSes as if they were on network
Eldariof93-ru has joined #ruby
blaxter has quit [Quit: foo]
<Hanmac>
aedornm if you can make solid sandboxes you should go to #java and ask then why they didnt get it currect
<zastern>
I think I need AND not OR
<zastern>
ok
rubarlion has joined #ruby
blaxter has joined #ruby
Eldariof-ru has quit [Ping timeout: 245 seconds]
<interactionjaxsn>
zastern: right
Radnor has joined #ruby
asdfqwer has joined #ruby
elkclone has quit [Quit: It's never too late to unplug and run.]
jimeh has quit [Quit: Computer has gone to sleep.]
rubarlion has quit [Ping timeout: 240 seconds]
sayan has quit [Ping timeout: 250 seconds]
chussenot has joined #ruby
horofox has joined #ruby
slainer68 has joined #ruby
neku has joined #ruby
emmanuelux has joined #ruby
dougireton has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
qubit has quit [Ping timeout: 245 seconds]
maxmanders has joined #ruby
Xeago has quit [Remote host closed the connection]
eka has quit [Read error: Connection reset by peer]
dougireton has quit [Client Quit]
alexim has joined #ruby
<zastern>
Ok, another maybe dumb question - why doesn't my if statement match the downcase things? Doing the operations individually in irb tells me they should, but I'm stil seeing things like FOO in my string if i set the redact var to foo. https://gist.github.com/5102492
icole has joined #ruby
eka has joined #ruby
nomenkun has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<zastern>
e.g. if text = "foo bar foo bar FOO bar", and redact = "foo" and redact2 = "bar" then I end up with the string REDACTED REDACTED REDACTED REDACTED FOO REDACTED
Takehiro has joined #ruby
jurassic has quit [Quit: jurassic]
carloslopes has quit [Read error: Connection reset by peer]
rburton- has quit [Quit: Leaving...]
<aedornm>
Hanmac: I don't think we can compare the JVM sandbox with something at the OS level that would have to encompass a user running a Ruby script. You are correct, nothing is infallible
Ontolog_ has joined #ruby
kpshek has joined #ruby
enebo_ has joined #ruby
Goles has quit [Read error: Connection reset by peer]
Ontolog has quit [Ping timeout: 248 seconds]
Catbuntu has quit [Quit: Leaving]
Goles has joined #ruby
sonda has quit [Remote host closed the connection]
Takehiro has quit [Ping timeout: 255 seconds]
allaire has quit []
markalanevans has quit [Ping timeout: 240 seconds]
enebo has quit [Ping timeout: 240 seconds]
enebo_ is now known as enebo
DoctorWedgeworth has joined #ruby
<MrZYX>
zastern: I got that right you wonder why "FOO" != "foo".downcase is true?
pygmael has joined #ruby
bapa has left #ruby [#ruby]
Hanmac has quit [Ping timeout: 240 seconds]
Giorgio has joined #ruby
<DoctorWedgeworth>
hey, sorry if this a stupid question (I'm new to Ruby and trying to learn by doing), but if I do some_object.function and then inside that function add a 'puts "hello"' it works, but if I try to use sprintf it seems to get lost somewhere. What am I doing wrong?
generalissimo has joined #ruby
Hanmac has joined #ruby
<DoctorWedgeworth>
eg. if the last two lines of the function are sprintf("%s", "sprintf test") \n puts("puts test") I'll see output of "puts test" only
Eldariof93-ru has quit []
Goles_ has joined #ruby
huoxito has quit [Quit: Leaving]
havenwood has quit [Remote host closed the connection]
mattbl has quit [Quit: This computer has gone to sleep]
XVirus has quit [Quit: I was somebody who, is no business of yours ...]
eka has joined #ruby
eindoofus has joined #ruby
eka has quit [Client Quit]
mercwithamouth has quit [Ping timeout: 255 seconds]
Stilo has joined #ruby
tonini has joined #ruby
Splacknuck is now known as Nuck
<eindoofus>
hi, I'm going through "The Well-Grounded Rubyist" and when I do "require 'stacklike'" from "cargohold.rb" I get some error about custom_require.rb:36 even though "stacklike.rb" exists in that same directory. What am I doing wrong?
<eindoofus>
I have ruby version 1.9.3p385 installed through rvm
<Hanmac>
eindoofus require_relative
<TTilus>
eindoofus: 1.8 had . in default loadpath, 1.9 does not
<eindoofus>
Hanmac, thanks. is this something that is new? is my book outdated? It says it's for Ruby 1.9
swills has left #ruby [#ruby]
<Hanmac>
hm it was changed in 1.9.2 ... maybe your book was for 1.9.1
* bean__
is not a big fan of books for learning programming
<Hanmac>
i use require and require_relative in the same way like #include <> and #include "" in C/C++
<eindoofus>
so in order to achieve . in the loadpath it is customary to use require_relative?
<bean__>
especially because stuff changes
beiter has quit [Quit: beiter]
<whitequark>
bean__: well it's a reference, not a tutorial
<bean__>
require "./cargohold.rb" would work too i think
<TTilus>
oh, it was only 1.9.2 that changed default loadpath
<whitequark>
you don't learn programming by reading a reference
<Hanmac>
eindoofus require_relative loads relative the the file, not to the current dir, thats why its better
<Hanmac>
bean__ yeah, but not allways ...
<bean__>
fact.
<eindoofus>
good to know, thanks guys
DoctorWedgeworth has quit [Read error: Connection reset by peer]
rafacv has quit [Remote host closed the connection]
rburton- has joined #ruby
rburton- has quit [Remote host closed the connection]
rburton- has joined #ruby
eka has joined #ruby
<TTilus>
eindoofus: require_relative replaces the require File.join(File.dirname(__FILE__), 'foo') idiom
<shevy>
hmm guys, say you have a text file with 10 lines
<Hanmac>
C has two different #include too
tonini has quit []
tonini has joined #ruby
<shevy>
you want to append a string to line 5, string would be ' []'
<shevy>
is it worth to turn such an action into a standalone gem?
<TTilus>
no
<eindoofus>
TTilus, thanks. I'll try to remember that for the future
tonini has quit [Client Quit]
eka has quit [Client Quit]
bonhoeffer has quit [Quit: bonhoeffer]
tonini has joined #ruby
tonini has quit [Remote host closed the connection]
zastav has joined #ruby
zastav has quit [Remote host closed the connection]
tonini has joined #ruby
Xeago has joined #ruby
<Blaze_Boy>
#webdevelopment
_nitti has quit [Read error: Connection reset by peer]
_nitti has joined #ruby
* Blaze_Boy
sorry
tvw has quit [Ping timeout: 248 seconds]
eka has joined #ruby
motto has joined #ruby
programmerq has joined #ruby
adamjleonard has quit [Quit: Leaving...]
<TTilus>
shevy: those who would be likely to install such a gem most likely already have sed ;)
dougireton has joined #ruby
m8 has quit [Ping timeout: 240 seconds]
eka has quit [Client Quit]
<shevy>
unbelievers!!!!!
<shevy>
there shall be only ruby
<Hanmac>
shevy your problem can be done in one line with one command ... :P
sirish has joined #ruby
<Hanmac>
shevy: look at str[/(\n.+){5-1}()/,2]=" []"
chrishough has quit [Quit: chrishough]
<Hanmac>
ups its : str[/(\n.+){4}()/,2]=" []"
vierja has joined #ruby
<shevy>
Hanmac I am sorry
sambao21 has quit [Quit: sambao21]
<shevy>
I can't use code like that
<Hanmac>
why? :(
<shevy>
it's like cryptic alien grunts to me
sn0wb1rd has quit [Read error: Connection reset by peer]
eka has joined #ruby
eliasp has joined #ruby
<shevy>
you do this on purpose :)
eka has quit [Client Quit]
<shevy>
"There is more than one way to solve something - and Hanmac will find the most cryptic way."
<programmerq>
I'm trying to use ruby's net/ldap to do some queries against my corporate ldap. ldapsearch -h ldap.example.com -x -b ou=People,o=example.com '(uid=me@example.com)' does work. Every time we try to do a search with Net::LDAP, it says Net::LDAP::LdapError: no connection to server. Here's the code I'm using: Net::LDAP.new(:host => 'ldap.example.com', :base => 'o=example.com').search(:filter => 'uid=me@example.com')
lewix has joined #ruby
<Hanmac>
shevy its the only way to manipulate the string directly without calling each_line and join
chrishough has joined #ruby
<Hanmac>
without each_line, map, join
<lewix>
hi
<shevy>
hmm
<lewix>
Hanmac: what is
ryannielson has quit [Quit: ryannielson]
<Hanmac>
lewix: shevy wants to add something to line n in string str
dougireton has quit [Remote host closed the connection]
dougireton has joined #ruby
eka has joined #ruby
Quebert has joined #ruby
sn0wb1rd has joined #ruby
<Hanmac>
my code was str[/(\n?.*){#{nr}}()/,2]=ctr
<Hanmac>
lewix and now say it into my face that you understand my code :P
codecop has quit [Quit: Išeinu]
<lewix>
Hanmac: just what i wanted to say. how straight forward it is
Rioji has joined #ruby
eka has quit [Client Quit]
<lewix>
Hanmac: it reads like plain english
philcrissman has quit [Remote host closed the connection]
<Hanmac>
my regex too? :D47
axhlf has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
<lewix>
Hanmac: I don't understand it at all. =)
Rioji has quit [Remote host closed the connection]
Rioji has joined #ruby
Quebert has quit [Ping timeout: 248 seconds]
Goles_ has quit [Remote host closed the connection]
fuzai has quit [Read error: Connection reset by peer]
slainer68 has quit [Remote host closed the connection]
jrajav has quit [Quit: I tend to be neutral about apples]
tvw has joined #ruby
slainer68 has joined #ruby
<TTilus>
shevy: with sed it is nice and clean, heavens sake, it is Stream EDitor \o/
tonini has quit [Remote host closed the connection]
testingb0t has joined #ruby
Trudko has joined #ruby
<Trudko>
guys in ruby 1.9.3 I use # encoding: UTF-8 for file encoding what is alternative in 1.8.7?
<TTilus>
shevy: sed '5 s/$/[]/'
<TTilus>
shevy: reads nicely too: put '[]' at the end of 5th line
<whitequark>
Trudko: nothing, 1.8.7 is strictly ASCII
Davey has joined #ruby
neku has quit [Read error: Connection reset by peer]
<Hanmac>
TTilus but what if he wants it platform Indipend? then he cant use sed
dougireton has quit [Quit: Leaving.]
dougireton has joined #ruby
<Trudko>
whitequark: wait so i cant have ruby 1.8.7 with spec characters?
tenmilestereo has quit [Quit: Leaving]
spider-mario has joined #ruby
jerius has quit []
<whitequark>
Trudko: spec characters?
<Trudko>
special characters
philcrissman has joined #ruby
<whitequark>
you can write them
<Hanmac>
Trudko: you can, but you can not trust your files
<whitequark>
but don't expect ruby to understand you
jjbohn is now known as jjbohn|afk
<whitequark>
ie "ä"[0] will return bullshit
<Trudko>
and what am I expect to do ? I have strings (for rails apps)
elux has quit [Quit: Bye!]
<Trudko>
sorry that i did not metnioned it , i use special characters only for strings. not for name of variables etc
eka has joined #ruby
eka has quit [Client Quit]
noop has quit [Ping timeout: 256 seconds]
<Hanmac>
whitequark you are very right ... oO ...
<baroquebobcat>
Trudko: what kind of special characters? I think 1.8.7 should be ok. Earlier versions might have issues.
<Trudko>
baroquebobcat: slovak characters š ť, č ô etc
<Hanmac>
Trudko 1.8 is dead ... it only gets "life-supporting" for at least 3 months ... then it will DIE
<Trudko>
and that is great :)
Honeycomb has joined #ruby
<Trudko>
but i have hosting for rails app which refuse to upgrade it
<baroquebobcat>
that should be fine I think. You might have to do some funny things as the encoding stuff is different between the two
<baroquebobcat>
"ä"[0] being a good example
<whitequark>
Trudko: google for mb_chars
tjbiddle has joined #ruby
<Hanmac>
Turdko: because of what?? it should be updateable, newer rails versions does exist, when your users dont want to update, they will get what they deserved
<Trudko>
baroquebobcat: unfortunatelly if i just delete # encoding: UTF-8 i get error and I think that is ruby problem.
<baroquebobcat>
whitequark: slovak chars are not multi byte
<Trudko>
Hanmac not sure situation is complicatad dont want to explain trust me i would love to be on 1.9.3
<baroquebobcat>
encoding: UTF-8 works
<baroquebobcat>
or should
<Trudko>
crappy project stupid people etc
<Trudko>
baroquebobcat: should work but not for 1.8.7 ?!
zaltekk has quit [Read error: Connection reset by peer]
<whitequark>
baroquebobcat: ok. never had a clue
<Hanmac>
Trudko information: on ruby2.0 you dont need encoding: UTF-8 anymore because this is the default
mityaz has quit [Quit: See ya!]
adambeynon has joined #ruby
motto has quit [Quit: Sto andando via]
<Trudko>
Hanmac good to know seemed bit odd to have to use it explicitly , so what can i do on 1.8.7
ngoldman has joined #ruby
jjbohn|afk is now known as jjbohn
Mattix has quit [Quit: Leaving]
<Hanmac>
" baroquebobcat: whitequark: slovak chars are not multi byte" wrong
dankest has joined #ruby
<baroquebobcat>
Hanmac: the more accurate answer is, as always, it depends.
<Hanmac>
"ô" for sample is multibyte
<TTilus>
Hanmac: if thats what counts, more platforms have sed available out of box
<Trudko>
so i cant use special characters as strings in ruby 1.8.7 at all?
m8 has joined #ruby
pyrac has quit [Quit: pyrac]
alexim has quit [Read error: Connection reset by peer]
lewix has quit [Remote host closed the connection]
Hanmac1 has quit [Quit: Leaving.]
jerius has joined #ruby
<TTilus>
Trudko: you can put _anything_ in strings in ruby 1.8.7 and it wont care :)
Beoran_ has joined #ruby
<Trudko>
,,awesome" love this project more and more
Hanmac1 has joined #ruby
zaltekk has joined #ruby
dustint has quit [Quit: Leaving]
Morkel has joined #ruby
dougireton has quit [Remote host closed the connection]
<TTilus>
Trudko: you definitely should also read hudakatz.com/2010/05/05/ruby-1-9-encodings-a-primer-and-the-solution-for-rails/ "Postscript: What Happened in 1.8!?" onwards
<scrogson>
I'm developing an asset gem which specifies bootstrap-sass as dependency. How can I access the scss files from bootstrap-sass within my gem (i.e @import "bootstrap";)
<whitequark>
;)
<whitequark>
sneaky
<Trudko>
TTilus: i will but i just want to know if there is solution / workaround in that article?
Beoran__ has quit [Ping timeout: 252 seconds]
<TTilus>
Trudko: in 1.8.7 theres nothing to solve
testingb0t has quit [Quit: Leaving.]
Blaze_Boy has quit [Ping timeout: 245 seconds]
<Trudko>
i am confused what i see from start of article i need to set encoding manulay or something like thet
<Trudko>
i also found iconv gem
carlyle has quit [Ping timeout: 245 seconds]
xiphiasx_ has quit [Ping timeout: 276 seconds]
DoctorWedgeworth has joined #ruby
xiphiasx_ has joined #ruby
tonini has joined #ruby
carlyle has joined #ruby
<TTilus>
Trudko: what exactly is your problem
<DoctorWedgeworth>
you guys are amazing. I've been struggling with something for 15 minutes, and just joining this channel made the solution come to me
<apeiros_>
TTilus: you can put anything in strings in 1.9 too
<Hanmac>
1.8 :P
Mattix has joined #ruby
<TTilus>
apeiros_: ok, yes
Hanmac1 has quit [Read error: Connection reset by peer]
<TTilus>
DoctorWedgeworth: np
<TTilus>
=D
<apeiros_>
and if anybody really craves the retarded standard that was 1.8, just set every encoding to binary
Hanmac1 has joined #ruby
<Trudko>
TTilus: well i i have syntax error with rails apps. You question seems to imply that spec. chars should not be problem at all
razibog has quit [Ping timeout: 272 seconds]
rezzack has joined #ruby
mercwithamouth has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
<TTilus>
Trudko: could you possibly pastie/gist that erraneous code and the error?
axhlf has joined #ruby
chomp has quit [Quit: Leaving]
<TTilus>
Trudko: non-ascii character (sequences) within string literal should really not be a source of syntax error
tonini has quit [Remote host closed the connection]
<Trudko>
ok i will check it then
<TTilus>
or comments for that matter
EPIK has quit [Ping timeout: 240 seconds]
<apeiros_>
especially since SyntaxError is something entirely different from ArgumentError
artofraw has quit [Remote host closed the connection]
<apeiros_>
(srsly? they didn't bother to make a separate EncodingError? OO)
<TTilus>
Trudko: it would be leaps and bounds easier to help you if we just knew the exact error
<Hanmac>
i think the problem is in a case when like case obj; when 14:
* TTilus
clearly missed something, was the code+error pastied already?
lewix has joined #ruby
* Hanmac
has a great crystal ball :P
<apeiros_>
TTilus: no, you didn't miss a thing
wmoxam has quit [Ping timeout: 272 seconds]
geekbri has quit [Remote host closed the connection]
* TTilus
wants one too, would be immensely useful at work
<apeiros_>
TTilus: maybe you're missing a nose-hook, by which to pull information…
<Hanmac>
TTilus: i have a extension for my IRC client where i can use /8ball :P
<apeiros_>
TTilus: just spend some time in this channel. your latent psychic abilities will waken by all those poorly based questions
<TTilus>
apeiros_: maybe a skull drill? "Sinuhe the Egyptian" -style
<apeiros_>
^^
<apeiros_>
now did I miss something?
motto has joined #ruby
<apeiros_>
I thought Trudko had an encoding issue?
bonhoeffer has joined #ruby
motto has quit [Read error: Connection reset by peer]
hybris has joined #ruby
<apeiros_>
Trudko: that's not the full code.
<TTilus>
apeiros_: nose-hook just brought skull-drilling into my mind, somehow
<TTilus>
Trudko: it says "unexpected kEND"
<apeiros_>
that code says "Syntax OK"
<Hanmac>
... the code is valid for all of my rubies (1.9 has a encoding problem but nothing wrong)
rburton- has joined #ruby
julianxk has joined #ruby
<apeiros_>
so we have 2 things - a) Syntax errors have nothing to do with encodings, b) this code is in all likeliness not the offending code (or not the complete)
ngotho has quit [Ping timeout: 259 seconds]
<Hanmac>
i get "syntax error, unexpected $end, expecting keyword_end" only for 1.9.1
marcux has joined #ruby
m8 has quit [Ping timeout: 276 seconds]
v0n has quit [Ping timeout: 250 seconds]
<julianxk>
class Foo; end; Foo::ARGV => "warning: toplevel constant ARGV referenced by Foo::ARGV" what is the thinking behind this warning? what is the problem? what does Ruby mean by top-level constants? don't all constants live in some object? ARGV lives in Object doesn't it? Any thoughts?
* apeiros_
thinks TTilus is already fully in the game of pulling stuff out of the nose, and therefore leaves that noble task up to him :D
markalanevans has joined #ruby
<TTilus>
Syntax OK for 1.8.7
yalue has quit [Quit: Leaving]
Giorgio has quit [Remote host closed the connection]
tobor_one has quit [Quit: tobor_one]
<apeiros_>
julianxk: it means that there is no Foo::ARGV
<apeiros_>
julianxk: but that ruby will give assume that you want ::ARGV and gives you that.
c0rn has joined #ruby
flip_dig_ has joined #ruby
flip_dig_ is now known as flip_digits
carlyle has quit [Ping timeout: 245 seconds]
<apeiros_>
(technicalities are slightly different, but that's the gist of it)
jdunck has quit [Quit: Computer has gone to sleep.]
carlyle has joined #ruby
<julianxk>
apeiros_: it seems to be this is normal operation for constant lookup - constants can be looked up through subclasses, eg "class Bar; X = 14; end; class Baz < Bar; end; Baz::X", so why is ARGV given a special warning?
<apeiros_>
it's not ARGV being special
<apeiros_>
try Array::Array
<apeiros_>
or Array::String::Object::Hash
pygmael has joined #ruby
<TTilus>
Trudko: what ruby is it that says "syntax error, unexpected kEND, expecting $end" for that player.rb?
<julianxk>
apeiros_: yeah, i don't mean ARGV is special, why are these constants, defined in Object, treated different to my constant X in the second example? there's no semantic difference is there?
<apeiros_>
julianxk: because you fully qualify it
<apeiros_>
and there's nothing there.
<apeiros_>
so you either screwed up or don't understand constants. which is why ruby warns you.
Atrophius has joined #ruby
<julianxk>
apeiros_: but i get no warning when I fully qualify in the example "class Bar; X = 14; end; class Baz < Bar; end; Baz::X"
<lectrick>
What is the best way to ask, "do any of my superclasses respond_to this method?"
lsoa has joined #ruby
<lectrick>
or ancestors, rather
<apeiros_>
lectrick: superclass.method_defined?
<lsoa>
gentlemen, any recommended reading on ruby C extensions?
<lectrick>
apeiros_: would that return true if the superclass' superclass defined the method?
<apeiros_>
since it checks ancestry by default too
<apeiros_>
lectrick: docs :-p
aaronmcadam has joined #ruby
<lectrick>
apeiros_: on it, ty
hbpoison has joined #ruby
tenmilestereo has joined #ruby
kpshek has quit []
ebobby has quit [Ping timeout: 272 seconds]
miskander has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
m8 has joined #ruby
pdamer has quit [Quit: pdamer]
jdunck has joined #ruby
zodiak has quit [Remote host closed the connection]
stkowski has quit [Quit: stkowski]
pygmael has quit [Client Quit]
mark_locklear has quit [Ping timeout: 255 seconds]
kenneth has joined #ruby
dankest has quit [Quit: Leaving...]
poikon has joined #ruby
<kenneth>
hey, is there a way to wrap a string with an IO object?
<lectrick>
apeiros_: close but no cigar- i want to test whether the method is defined on any ancestors, basically. superclass doesn't include methods from modules
<Hanmac>
lsoa: do you want to read C exts or do you want to write C exts?
<Hanmac>
kenneth: stringIO ?
carlyle has joined #ruby
<apeiros_>
lectrick: wrong
pygmael has joined #ruby
<apeiros_>
>> class Z < Array; end; Z.superclass.method_defined?(:any?)
blacktulip has quit [Remote host closed the connection]
<apeiros_>
unless you mean modules in the current class. in that case your question was wrongly worded :-p
<lectrick>
apeiros_: I want something like a "super if defined_in_super?" sort of call
<lectrick>
apeiros_: It may have been poorly worded :)
<Trudko>
TTilus: what do you mean?
<apeiros_>
super if defined? super
havenwood has joined #ruby
tommyvyo has quit [Quit:]
kpshek has joined #ruby
<TTilus>
Trudko: ruby --version
<apeiros_>
and yes, that actually works. I use that somewhere.
<lectrick>
apeiros_: oh nice
<apeiros_>
(I have no idea anymore where I do)
<julianxk>
apeiros_: thanks for your help - but I'm pretty sure you're wrong on this - constant lookup works just fine though a subclass, and it actually looks like for some reason in 1.8.0 they specifically added this warning just for constants defined in Object. I've got no idea why they did this though
<apeiros_>
lectrick: next time, maybe tell what problem you try to solve instead of asking how to fix your "solution" :-p
<Hanmac>
>> class E; def abc; end; end; class A < E; alias xyz abc;end; A.instance_method(:xyz)
<apeiros_>
lectrick: however, it's always a good idea to present your incomplete/partial solution along with it, if only to show that you tried yourself.
_jc has joined #ruby
<lectrick>
apeiros_: sigh, sometimes phrasing the question properly is difficult due to not knowing the answer lol
<lectrick>
apeiros_: "super rescue someotherval" was the best I had but I didn't like that
nomenkun has quit [Remote host closed the connection]
tcstar has quit [Ping timeout: 245 seconds]
<apeiros_>
lectrick: well, you wanted to call the super method if present - and in that the question lies already.
<apeiros_>
julianxk: I didn't say constant lookup wouldn't work through subclasses.
<Trudko>
TTilus: ruby 1.8.7
<apeiros_>
julianxk: I said it's silly to use Array::Array instead of plain Array, and indicative of you doing something wrong, and that's why ruby warns you.
Morkel has quit [Quit: Morkel]
<apeiros_>
don't put words into my mouth I didn't say.
<lsoa>
Hanmac: that main.cpp is clearer than the explanations I found so far
pygmael has quit [Quit: pygmael]
<julianxk>
apeiros_: why anyone would want to do it is irrelevant if it's valid semantically. you said when it looks up Foo::ARGV there's nothing there, but constant lookup semantics say that it is found via the superclass
<lsoa>
if only I had searched ruby-doc first, instead of googling ruby C extensions
kevinfagan has quit [Quit: Leaving...]
clooth has quit [Quit: clooth]
<lsoa>
the docs are reasonably good as well
<Hanmac>
lsoa, you mean more clean than the other *.cpp files? :P
dankest has joined #ruby
<apeiros_>
julianxk: you wanted to know why, I told you why. If you now refuse it, well, duh. end of discussion I'd say, there's no point.
<TTilus>
julianxk: well, it _does_ find Foo::ARGV, it only _warns_ you
<apeiros_>
^
<TTilus>
julianxk: and imo theres pretty valid reason to warn
<julianxk>
ok, but still why does it warn only for some arbitrary constants - those defined in Object?
<julianxk>
if it's a valid warning, why not for any constant found through a superclass?
Spooner has joined #ruby
Virunga has joined #ruby
tommyvyo has quit [Client Quit]
<TTilus>
julianxk: Object happens to be the main level, it is not "arbitrary" by any standard i can come up with
ferdev has joined #ruby
adamjleonard has joined #ruby
ner0x has quit [Quit: Leaving]
poikon has quit [Read error: Connection reset by peer]
<apeiros_>
because "why anyone would do it" *IS* relevant
<apeiros_>
one thing makes sense, the other doesn't.
poikon has joined #ruby
<TTilus>
julianxk: if you explicitly reach "global" constant via subclass, theres pretty damn good chance it was not what you inteded
<lsoa>
Hanmac: no, cleaner than the first hits on google
poikon has quit [Remote host closed the connection]
<lsoa>
Hanmac: I read fast, but not THAT fast :D
<julianxk>
TTilus: but you're using a concept in your argument that doesn't exist in Ruby - there are no global constants. there's absolutely no semantic difference between Object::ARGV and Foo::Bar, but the interpreter is inventing a difference with this warning
carlyle has quit [Remote host closed the connection]
<TTilus>
julianxk: that's why i said "global" not global
<TTilus>
julianxk: theres importat practical difference between Object and Foo
locriani has quit [Remote host closed the connection]
fugetsu has joined #ruby
<Hanmac>
lsoa if you try to understand the code, macro_attr is an combined constuct of multible C macros that generates attr_accessor methods for me ... _self is a macro defined per file that unwraps the self object, and wrap/unwrap are template and overloaded functions that does the C++ <-> Ruby for you (with addional features)
<julianxk>
TTilus: there are no operational semantic difference at all
<TTilus>
julianxk: ...and thats why they both work the same way
kofno has quit [Remote host closed the connection]
fugetsu has joined #ruby
locriani has joined #ruby
idkazuma has joined #ruby
<TTilus>
julianxk: the practical difference makes the warning userfull
<apeiros_>
yes, there is an operational difference. while Object::ARGV is the same as ::ARGV, Foo::ARGV isn't. Object is the root namespace (toplevel), Foo isn't.
dmiller has quit [Ping timeout: 264 seconds]
<apeiros_>
and that's also why you don't get a warning for Object::ARGV
<TTilus>
apeiros_: well, yes, you are right as allways, Object being toplevel is operational difference ... too
<apeiros_>
in fact, you won't get a warning for ::Object::Object::Object::Object::Object::ARGV either.
<julianxk>
but that's an operational semantic property of the :: operator, which isn't involved in an evaluation of the semantics of Object::ARGV and Foo::ARGV
<apeiros_>
julianxk: are you intentionally making up things in order to prove that your question has no answer?
alexim has joined #ruby
<TTilus>
the warning really boils down to the "why anyone would do it"
<apeiros_>
TTilus: noooo! that's irrelevant!
dankest has quit [Quit: Leaving...]
adamjleonard has quit [Quit: Leaving...]
* apeiros_
walks off, could as well talk to walls…
takeru has joined #ruby
<julianxk>
apeiros_: i don't think i've made anything up - am i wrong about some semantics of ruby?
mpfundstein has quit [Remote host closed the connection]
hydrozen has joined #ruby
<TTilus>
apeiros_: =D
<julianxk>
apeiros_: look i'm not trying to be an ass, i'm just trying to think through the reason for the warning, and what it was based on
<julianxk>
and the answer seems to be idiom, rather than logic
<apeiros_>
23:16 apeiros_: because "why anyone would do it" *IS* relevant
Davey has quit [Quit: Computer has gone to sleep.]
<julianxk>
and i guess idiom is a fine reason in some sense
<aaronmcadam>
anyone know of any gems I can use to test my code against GitHub's style guide?
<Hanmac>
beware, this is valid ruby and it does not do an warning :P "Array ::ARGV"
<banisterfiend>
julianxk: same reason ruby warns you if you define a variable but dont use it
<apeiros_>
Hanmac: that's Kernel#Array, though
<lsoa>
Hanmac: I'll study your ways :D thanks for sharing that code
<banisterfiend>
"you probably didnt mean to do that"
<apeiros_>
not Kernel::Array
bricker_ has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
maxmanders has quit [Ping timeout: 252 seconds]
francisfish has joined #ruby
takeru has quit [Ping timeout: 245 seconds]
ebobby has joined #ruby
<Hanmac>
lsoa its not finish yet, and i may need to rewrite the way it does wrap and unwrap wxEventObjects to make it more safe, but its better than swig shitted code
<lewix>
banisterfiend: 17:31 banister`sleep: lewix: the strangest of all though, is this: A = 10; module M; A; end #=> 10 <--- this shouldn't work. why not if module M is mixed in Object
<lsoa>
Hanmac: it helped a lot, really.
fugetsu has joined #ruby
<banisterfiend>
lewix: it's not mixed in Object into anything in that example
<lsoa>
well, enough work for today, see you later
<banisterfiend>
lewix: it's not mixed into anything in that example*
lsoa has quit [Quit: leaving]
<Hanmac>
lewix it works because M is an Object
<banisterfiend>
Hanmac: no
bricker_ is now known as bricker
<banisterfiend>
Hanmac: it works because ruby makes an exception for modules
thomas` has quit [Ping timeout: 252 seconds]
<lewix>
banisterfiend: Hanmac
<lewix>
:
<lewix>
Ithat's what i thought Hanmac , I don't understand banisterfiend explanation
<banisterfiend>
lewix: consider BasicObject
<banisterfiend>
BasicObject is an Object yet it can't access top-level constants
gabrielrotbart has joined #ruby
<banisterfiend>
modules are objects too, yet they can, it's because ruby makes an exception
idkazuma has quit [Remote host closed the connection]
<banisterfiend>
you can actually find the exact place in the C source code where it makes the exception
_jc has quit [Quit: Computer has gone to sleep.]
nfk has quit [Quit: yawn]
<whitequark>
banisterfiend: why should it require an exception?
<banisterfiend>
but modules dont subclass Object either yet they cant access toplevel constants, like i said you can find the line in the MRI source where it makes the exception
<whitequark>
banisterfiend: if there had to be an exception it should've been BasicObject
<banisterfiend>
it has some comment like "try again from Object if it's a module" or something
idkazuma has joined #ruby
ebobby has joined #ruby
<whitequark>
banisterfiend: so that Object would always be in cref
miskander has quit [Quit: miskander]
phantasm66 has quit [Quit: *sleeeep….]
<whitequark>
actually I don't really understand why shouldn't BasicObject be able to access toplevel constants
<lectrick>
Spooner: Love it. Yeah, mine should be a ! method since it's in-place, eh?
<Spooner>
Only if there is also a non-inplace version.
axhlf has quit [Remote host closed the connection]
<aedornm>
I've been promoted to electrical engineer. And by promoted, I really mean "hey, we need these 10 things built into this case, and we saw you use some solder at some point in time! Job's yours!"
<splud>
beh. have an array ["bssid", "2455", "-64", "string", "name"]
swoosh has joined #ruby
<splud>
(actually, an array of arrays, but I'm iterating)
_nitti has quit [Remote host closed the connection]
zeade has joined #ruby
CVirus has joined #ruby
<CVirus>
What's the difference between gem 'awesome_print' and require 'awesome_print'
<splud>
a[2].to_int SHOULD be -64, right?
swoosh has quit [Client Quit]
<aedornm>
splud: a[2].to_i should be -64, yes.
zeade has quit [Client Quit]
jrajav has joined #ruby
sam113101 has joined #ruby
dawkirst has quit [Ping timeout: 260 seconds]
<splud>
I get "undefined method `to_int' for "-64":String"
<Spooner>
splud, to_i is quite different to to_int
<splud>
after using it, I see that - it _works_ <g>
<eindoofus>
He describes the class as keeping track of all "persons" but how is that possible? Does the constant "PEOPLE" act as a class variable? If so, should it be written as "@@PEOPLE" ?
rakl has joined #ruby
<Spooner>
to_int and to_str and to_float are only for objects that can be automatically type-cast into those types (For example, MyObject has to_int defined on it, you can write "MyObject.new + 2" and it will be happy with it.
kenneth has quit [Ping timeout: 260 seconds]
<Spooner>
With to_str, you can write MyObject.new + "fish" and it will work....etc, etc.
<eindoofus>
would @@classvar be accessible by instance methods, class methods, or both?
lewix has quit [Remote host closed the connection]
<Spooner>
And you can't read it from within its parent class.
<Spooner>
instance methods, class methods and my_person::PEOPLE and Person::PEOPLE
dEPy has quit []
kenneth has joined #ruby
<Spooner>
Very different to a @@class_var
<eindoofus>
what would be the case for a @@class_var ?
shevy has joined #ruby
<Spooner>
No-one uses @@ any more. We use "class instance variables".
dmiller has joined #ruby
walbert has joined #ruby
Takehiro has joined #ruby
<Spooner>
However, a class instance variable is not directly accessible from outside the class, since it is accessed via accessors rather than directly like a constant.
Takehiro has quit [Read error: Connection reset by peer]
_veer has joined #ruby
_veer has quit [Changing host]
_veer has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
zz_Inoperable is now known as Inoperable
<Quadlex>
Anyone have experience with Travis?
<Quadlex>
I just want to run two builds with two gemfiles but it's not... doing that.
ad_AA has joined #ruby
rgbdev has left #ruby [#ruby]
cflux has joined #ruby
apeiros_ has joined #ruby
<eindoofus>
Spooner, are constants almost like global variables, except that they shouldn't be changed?
dawkirst has joined #ruby
sambio_ has joined #ruby
dmiller has quit [Ping timeout: 250 seconds]
felipe has quit [Ping timeout: 248 seconds]
kstephens_ has joined #ruby
lupine has quit [Ping timeout: 264 seconds]
XVirus has joined #ruby
adkron has joined #ruby
<Spooner>
Not really. Globals only exist in the main scope. A constant is accessible from whatever scope it is created in (for example, within that class).
Mch1 has joined #ruby
wildcard1 has joined #ruby
emocakes has joined #ruby
tommyvyo_ has joined #ruby
<Spooner>
Admittedly, a constant defined in the main scope is pretty much the same a global (except giving a warning on changing it, of course).
walbert has quit [Read error: Operation timed out]
sambio has quit [Ping timeout: 252 seconds]
tommyvyo_ is now known as tommyvyo
walbert has joined #ruby
vereteran has joined #ruby
nari has joined #ruby
yekta has quit [Quit: yekta]
<lectrick>
Spooner: I added a clever recursive version which cleans up the state maintenance quite a bit (by embedding it in the stack of course): https://gist.github.com/pmarreck/5103911
<eindoofus>
There is nothing like a constant in C# or Java, is there? I don't remember anything that is accessible by both static and instance methods.
maxmanders has quit [Quit: Computer has gone to sleep.]
crankycoder has quit [Ping timeout: 276 seconds]
lupine has joined #ruby
CVirus has quit [Ping timeout: 252 seconds]
<eindoofus>
Then again, my memory is fuzzy. I'm going to get back to this book. Thanks for you help
walbert has quit [Read error: Operation timed out]
jlast has quit [Remote host closed the connection]
<Spooner>
Note though, that you are mixing Ruby 1.8 and 1.9 hash formatting in that.
<Spooner>
Which works, but is a bit ugly :D
walbert1 has quit [Read error: Connection reset by peer]
jacky is now known as jalcine
stkowski has quit [Client Quit]
stkowski has joined #ruby
arya has quit [Ping timeout: 248 seconds]
walbert has joined #ruby
mockra_ has joined #ruby
walbert has quit [Client Quit]
<Spooner>
That is, for consistency, it should be " url: ", not " :url => "
jstultz has joined #ruby
<eindoofus>
Spooner, so as new "Person"s are created, does each get a constant "PEOPLE" along with the class object? If not, then does "PEOPLE" just live in the class object? Are there multiple "PERSON" arrays existing after new instances are created?
mattbl has joined #ruby
apeiros_ has quit [Ping timeout: 245 seconds]
walbert has joined #ruby
mockra has quit [Ping timeout: 255 seconds]
admitted_limited has joined #ruby
kirun has quit [Quit: Client exiting]
seanmccann has joined #ruby
arya has joined #ruby
dpn` has quit [Excess Flood]
<eindoofus>
You said in the scope, would that mean that a constant declared in an instance variable can multiply with instances? and a constant declared only in the class exists only in the class object?
<jstultz>
immediate suspicion of course is that rd.read is hanging because the write half of the pipe is still open, but... it's not
<Spooner>
eindoofus, No, PEOPLE is on the class.
<jstultz>
(lsof verifies that it is, in fact, closed)
mercwithamouth has joined #ruby
<eindoofus>
thanks Spooner
<Spooner>
eindoofus, Every Person ever created will be in Person::PEOPLE in the order of their creation.
<lectrick>
Spooner: range stepping. brilliant. :)
<Spooner>
eindoofus, Instances can't have constants on them (well, you could put them on their metaclass, but that is something different :D).
arya has quit [Client Quit]
apok has joined #ruby
SCommette has quit [Quit: SCommette]
spider-mario has quit [Read error: Connection reset by peer]
<eindoofus>
ahhh. That simplifies things a bit
garbagecollectio has quit [Quit: garbagecollectio]
adkron has quit [Ping timeout: 276 seconds]
malte_ has joined #ruby
R_Macy_ has joined #ruby
<Spooner>
lectrick, To be consistent with other ! methods, I wonder if it should return nil if the array size is <= skip? (that is, no change will occur).
emocakes has quit [Quit: emocakes]
zeade has joined #ruby
chipotle_ has joined #ruby
otherj has quit []
<lectrick>
Spooner: Yeah, possibly
<lectrick>
Spooner: Also there's only one solution now: Benchmarking those motherf***ers
mattbl has quit [Quit: This computer has gone to sleep]
<Spooner>
You feel free to go to town with benching them :D
<lectrick>
That could actually be a cool Ruby site- Come up with an algorithm for a simple problem, and the site scores it based on runtime and resource utilizaiton
bobdobbs has joined #ruby
R_Macy has quit [Ping timeout: 256 seconds]
<Spooner>
It exists. rubygame.org
<Spooner>
Ranks both on number of characters and run-time, I think.