<xargoon>
i'm trying to sanitize a html fragment with nokogiri, is there a way to validate the html to ensure there are no illegal nesting? no tr without table etc
elaptics is now known as elaptics`away
octarine has joined #ruby
notbrent_ has joined #ruby
pskosinski has quit [Ping timeout: 256 seconds]
ballmer has quit [Ping timeout: 256 seconds]
chessguy has joined #ruby
ballmer has joined #ruby
InFlames has quit [Quit: This computer has gone to sleep]
mockra has quit [Ping timeout: 252 seconds]
jamesaxl_ has joined #ruby
paolooo has joined #ruby
SDr has quit [Changing host]
SDr has joined #ruby
Reomeou has quit []
hadees has quit [Quit: hadees]
Kabaka has joined #ruby
marr has quit [Ping timeout: 256 seconds]
InFlames has joined #ruby
jamesaxl has quit [Ping timeout: 240 seconds]
SDr has quit [Read error: Connection reset by peer]
SDr_ has joined #ruby
freeayu has joined #ruby
hiroyuki has joined #ruby
SDr_ is now known as SDr
hiroyuki has quit [Read error: Connection reset by peer]
SDr has quit [Changing host]
SDr has joined #ruby
slash_nick has joined #ruby
Sicp has quit [Quit: Leaving]
tundrax has quit [Remote host closed the connection]
shammancer3 has quit [Quit: Leaving.]
cespare__ has quit [*.net *.split]
Drakevr has quit [*.net *.split]
jaybe has quit [*.net *.split]
staafl has quit [*.net *.split]
Guest60166 has quit [*.net *.split]
txdv has quit [*.net *.split]
bluOxigen has quit [*.net *.split]
taqutor has quit [*.net *.split]
Paradox has quit [*.net *.split]
apeiros has quit [*.net *.split]
yellow5 has quit [*.net *.split]
migimunz has quit [*.net *.split]
etank has quit [*.net *.split]
mogsy has quit [*.net *.split]
xargoon has quit [*.net *.split]
Spooner_ has quit [*.net *.split]
AlSquirrel has quit [*.net *.split]
nricciar has quit [*.net *.split]
wallerdev has quit [*.net *.split]
adam12 has quit [*.net *.split]
oz has quit [*.net *.split]
__main__ has quit [*.net *.split]
thejoecarroll has quit [*.net *.split]
lukekhamilton has quit [*.net *.split]
cjk101010 has quit [*.net *.split]
Ortuna has quit [*.net *.split]
moted has quit [*.net *.split]
gianlucadv has quit [*.net *.split]
DonRichie has quit [Ping timeout: 264 seconds]
InFlames has quit [Quit: This computer has gone to sleep]
shammancer has joined #ruby
DonRichie has joined #ruby
Guest79610 has quit [Changing host]
Guest79610 has joined #ruby
Guest79610 is now known as C0deMaver1ck
brum has joined #ruby
tundrax has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
jaybe has joined #ruby
InFlames has joined #ruby
etank has joined #ruby
travisjeffery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
taqutor has joined #ruby
Michae___ has quit [Remote host closed the connection]
Faris11 has quit [Ping timeout: 252 seconds]
Michae___ has joined #ruby
brum has quit [Ping timeout: 256 seconds]
nari has quit [Ping timeout: 245 seconds]
platzhirsch has left #ruby [#ruby]
tjcravey has quit [Ping timeout: 245 seconds]
InFlames has quit [Client Quit]
<rhys>
I'm writing scripts. I have a class I'm using in my main script, just off in its own file in the same directory. how can I make so the class can be imported into my scripts?
<rhys>
do i put it under ./lib/classname.rb ? I feel like this should be easy
monkegjinni has quit [Remote host closed the connection]
tundrax has quit [Remote host closed the connection]
justsee has quit [Ping timeout: 256 seconds]
apeiros has joined #ruby
tjcravey has joined #ruby
megha has joined #ruby
travisjeffery has joined #ruby
bradhe has joined #ruby
baba has quit [Ping timeout: 240 seconds]
krainboltgreene has quit [Quit: krainboltgreene]
Spami has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Michae___ has quit [Read error: Connection reset by peer]
kofno has joined #ruby
Michae___ has joined #ruby
osvico has quit [Ping timeout: 252 seconds]
<rhys>
oh. 'load'
apeiros has quit [Remote host closed the connection]
jamesaxl_ has quit [Ping timeout: 256 seconds]
apeiros has joined #ruby
mockra has joined #ruby
brianpWins has quit [Quit: brianpWins]
bradhe has quit [Ping timeout: 252 seconds]
chessguy has quit [Remote host closed the connection]
chile_andes has joined #ruby
sambao21 has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
chrishunt has joined #ruby
wedgex has quit [Remote host closed the connection]
joast has joined #ruby
ARCADIVS has quit [Quit: WeeChat 0.3.8]
DanKnox_away is now known as DanKnox
Guest78610 has quit [Quit: quit]
chessguy has joined #ruby
mercwithamouth has quit [Ping timeout: 252 seconds]
mercwith1mouth has quit [Ping timeout: 240 seconds]
xybre has joined #ruby
xybre has joined #ruby
xybre has quit [Changing host]
<reactormonk>
rhys, use 'require'
_rgn has joined #ruby
jeekl has joined #ruby
xardas has quit [Ping timeout: 245 seconds]
[Neurotic] has joined #ruby
robottinosino has joined #ruby
Tricon has joined #ruby
jimg has quit [Remote host closed the connection]
santana has joined #ruby
spanx__ has joined #ruby
cool has joined #ruby
Xeago has quit [Remote host closed the connection]
codemonkey010101 has joined #ruby
slash_nick has quit [Ping timeout: 245 seconds]
robottinosino has quit [Client Quit]
robottinosino has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<rhys>
reactormonk, require gives me an error.
<rhys>
load works fine
niklasb has quit [Ping timeout: 256 seconds]
<rhys>
i know it loads it at ever execution, but this is a script. its supposed to be run on the command line.
kemist has quit [Quit: kemist]
nignaztic has quit [Read error: Connection reset by peer]
nazty has joined #ruby
s0ber_ has joined #ruby
krisfremen has joined #ruby
krisfremen has joined #ruby
krisfremen has quit [Changing host]
_rgn_ has joined #ruby
wargasm1 has joined #ruby
welandC has joined #ruby
pcarrier has joined #ruby
pcarrier has quit [Changing host]
pcarrier has joined #ruby
brianpWins has joined #ruby
Liru_ has joined #ruby
mnemon has joined #ruby
CaptainK1ots has joined #ruby
Spaceghost|work is now known as pipework
rotor` has joined #ruby
chessguy_ has joined #ruby
flam__ has joined #ruby
jimeh has joined #ruby
Dreamer3__ has joined #ruby
uxp_ has joined #ruby
Kov|abx has joined #ruby
Sp4rKy_ has joined #ruby
Bracki_ has joined #ruby
DanKnox is now known as DanKnox_away
AllStruck_ has joined #ruby
klipeto has joined #ruby
dross_ has joined #ruby
Johbe_ has joined #ruby
kandinsk1 has joined #ruby
gianlucadv has joined #ruby
migimunz has joined #ruby
cespare__ has joined #ruby
__main__ has joined #ruby
mogsy has joined #ruby
xargoon has joined #ruby
Drakevr has joined #ruby
wallerdev has joined #ruby
oz has joined #ruby
lukekhamilton has joined #ruby
adam12 has joined #ruby
Guest60166 has joined #ruby
Ortuna has joined #ruby
thejoecarroll has joined #ruby
moted has joined #ruby
cjk101010 has joined #ruby
AlSquirrel has joined #ruby
txdv has joined #ruby
nricciar has joined #ruby
bluOxigen has joined #ruby
Paradox has joined #ruby
yellow5 has joined #ruby
staafl has joined #ruby
Spami has quit [Quit: Leaving]
mockra has joined #ruby
phrame_ has joined #ruby
tricon_ has joined #ruby
bobbyz has joined #ruby
ereslibre has joined #ruby
alo1_ has joined #ruby
Spami has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
tjcravey_ has joined #ruby
sn0wb1rdz has joined #ruby
mlue_ has joined #ruby
Davey_ has joined #ruby
Tectonic has joined #ruby
maveonair_ has joined #ruby
itman_ has joined #ruby
phreax has joined #ruby
paranos has joined #ruby
lkba has joined #ruby
flori has joined #ruby
ndngvr has joined #ruby
ndngvr has quit [Excess Flood]
wargasm has quit [Read error: Connection reset by peer]
_rgn has quit [Ping timeout: 245 seconds]
Norrin has quit [Ping timeout: 245 seconds]
jaybe has quit [Ping timeout: 245 seconds]
ndngvr` has joined #ruby
ndngvr` has quit [Excess Flood]
Dreamer3 has quit [Ping timeout: 245 seconds]
AllStruck has quit [Ping timeout: 245 seconds]
CaptainKnots has quit [Ping timeout: 245 seconds]
AllStruck_ is now known as AllStruck
wookiehangover_ has joined #ruby
Dreamer3__ is now known as Dreamer3
ballmer has quit [Ping timeout: 245 seconds]
rotor has quit [Ping timeout: 245 seconds]
brjannc has quit [Ping timeout: 245 seconds]
jimeh_ has quit [Ping timeout: 245 seconds]
rotor` is now known as rotor
flam_ has quit [Ping timeout: 245 seconds]
Liru has quit [Ping timeout: 245 seconds]
segv has quit [Ping timeout: 245 seconds]
welandB has quit [Ping timeout: 245 seconds]
rcsheets has quit [Ping timeout: 245 seconds]
AndChat| has quit [Ping timeout: 245 seconds]
moeSeth has quit [Ping timeout: 245 seconds]
dwon has quit [Ping timeout: 245 seconds]
C0deMaver1ck has quit [Ping timeout: 245 seconds]
dwcook has quit [Ping timeout: 245 seconds]
Jelco__ has quit [Ping timeout: 245 seconds]
wookiehangover has quit [Ping timeout: 245 seconds]
pcarrier_ has quit [Ping timeout: 245 seconds]
s0ber has quit [Ping timeout: 245 seconds]
bobbyz_ has quit [Ping timeout: 245 seconds]
Davey has quit [Ping timeout: 245 seconds]
Koven has quit [Ping timeout: 245 seconds]
Tectonic_ has quit [Ping timeout: 245 seconds]
maveonair has quit [Ping timeout: 245 seconds]
nick_h has quit [Ping timeout: 245 seconds]
Sp4rKy has quit [Ping timeout: 245 seconds]
DonRichie has quit [Ping timeout: 245 seconds]
rismoney has quit [Ping timeout: 245 seconds]
uxp has quit [Ping timeout: 245 seconds]
mnemon2 has quit [Ping timeout: 245 seconds]
suporte85 has quit [Ping timeout: 245 seconds]
jovy88 has quit [Ping timeout: 245 seconds]
cschneid has quit [Ping timeout: 245 seconds]
rgoodwin has quit [Ping timeout: 245 seconds]
phrame has quit [Ping timeout: 245 seconds]
Bracki has quit [Ping timeout: 245 seconds]
brian_000_ has quit [Ping timeout: 245 seconds]
tjcravey has quit [Ping timeout: 245 seconds]
s3m73x has quit [Ping timeout: 245 seconds]
chessguy has quit [Ping timeout: 245 seconds]
dross has quit [Ping timeout: 245 seconds]
jetblack_ has quit [Ping timeout: 245 seconds]
Hanmac has quit [Ping timeout: 245 seconds]
LiquidInsect has quit [Ping timeout: 245 seconds]
kandinski has quit [Ping timeout: 245 seconds]
steeve1 has quit [Ping timeout: 245 seconds]
TMM_ has quit [Ping timeout: 245 seconds]
klip has quit [Ping timeout: 245 seconds]
Johbe has quit [Ping timeout: 245 seconds]
krislappy has quit [Ping timeout: 245 seconds]
phreax_ has quit [Ping timeout: 245 seconds]
alo1 has quit [Ping timeout: 245 seconds]
thejefflarson_ has quit [Ping timeout: 245 seconds]
itman has quit [Ping timeout: 245 seconds]
alexdoom has quit [Ping timeout: 245 seconds]
Meeh_afk has quit [Ping timeout: 245 seconds]
Mattix has quit [Ping timeout: 245 seconds]
flori_ has quit [Ping timeout: 245 seconds]
nick_h has joined #ruby
otters has quit [Ping timeout: 245 seconds]
sn0wb1rdz_ has quit [Ping timeout: 245 seconds]
Guest11047 has quit [Ping timeout: 245 seconds]
kfoo has quit [Ping timeout: 245 seconds]
paranox has quit [Ping timeout: 245 seconds]
braincrash has quit [Ping timeout: 245 seconds]
jaimef_ has quit [Ping timeout: 245 seconds]
ereslibre_laptop has quit [Ping timeout: 245 seconds]
mtlatif_ has quit [Ping timeout: 245 seconds]
havenwood has quit [Ping timeout: 245 seconds]
ShapeShifter499 has quit [Ping timeout: 245 seconds]
skogis_ has quit [Ping timeout: 245 seconds]
notbrent_ has quit [Ping timeout: 245 seconds]
mlue has quit [Ping timeout: 245 seconds]
autumn has quit [Ping timeout: 245 seconds]
Tricon has quit [Ping timeout: 245 seconds]
PhilK has quit [Ping timeout: 245 seconds]
crodas has quit [Ping timeout: 245 seconds]
phrame_ is now known as phrame
wookiehangover_ is now known as wookiehangover
qubit has joined #ruby
s0ber_ is now known as s0ber
Meeh_afk has joined #ruby
oponder has joined #ruby
autumn has joined #ruby
rismoney has joined #ruby
havenwood has joined #ruby
DonRichie has joined #ruby
C0deMaver1ck has joined #ruby
alexdoom has joined #ruby
C0deMaver1ck is now known as Guest79934
Norrin has joined #ruby
rgoodwin has joined #ruby
iMadper has joined #ruby
suporte85 has joined #ruby
TMM_ has joined #ruby
jaybe has joined #ruby
brjannc has joined #ruby
otters has joined #ruby
kfoo has joined #ruby
dwcook has joined #ruby
dwcook has quit [Changing host]
dwcook has joined #ruby
marienz has quit [Ping timeout: 600 seconds]
Jelco__ has joined #ruby
segv has joined #ruby
brjannc has quit [Changing host]
brjannc has joined #ruby
braincrash has joined #ruby
Mattix has joined #ruby
mockra has quit [Ping timeout: 256 seconds]
dwon has joined #ruby
nick_h has quit [Ping timeout: 245 seconds]
PhilK has joined #ruby
Hanmac has joined #ruby
mercwithamouth has joined #ruby
mercwith1mouth has joined #ruby
LiquidInsect has joined #ruby
crodas has joined #ruby
jetblack has joined #ruby
nick_h has joined #ruby
cschneid has joined #ruby
jovy88 has joined #ruby
Targen has joined #ruby
marienz has joined #ruby
jimg has joined #ruby
jaimef has joined #ruby
<A124>
Hey.. I was wondering.. if there is any more efficient way to do: hash.each { |key, value| hash[key] += 1 }
postmodern has joined #ruby
<A124>
Thanks for suggestions.
emmanuelux has joined #ruby
heathjs is now known as heath
skogis has joined #ruby
ShapeShifter499 has joined #ruby
alexdoom has quit [Ping timeout: 245 seconds]
steeve1 has joined #ruby
migimunz has quit [Ping timeout: 264 seconds]
codemonkey010101 has quit [Quit: leaving]
s3m73x has joined #ruby
codemonkey010101 has joined #ruby
alexdoom has joined #ruby
travisjeffery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LennyLinux has quit [Remote host closed the connection]
ravster has left #ruby [#ruby]
dross_ is now known as dross
rcsheets has joined #ruby
<A124>
Could anyone suggest? :P
<reactormonk>
rhys, yeah. Get your $LOAD_PATH together
falood has joined #ruby
brum has joined #ruby
A124 has quit [Quit: Leaving.]
hiyakashi has quit [Quit: お前は知りすぎた]
A124 has joined #ruby
maycon has joined #ruby
maycon has joined #ruby
maycon has quit [Changing host]
charliesome has joined #ruby
DanKnox_away is now known as DanKnox
balr0g_ has joined #ruby
thomas` has joined #ruby
brum has quit [Ping timeout: 256 seconds]
rking1 has joined #ruby
pigoz has joined #ruby
wsterling has joined #ruby
ossareh has joined #ruby
JoeTheGuest has joined #ruby
ejnahc_ is now known as ejnahc
alanp_ is now known as alanp
greenarrow has quit [Read error: Connection reset by peer]
greenarrow has joined #ruby
emmanuelux has quit [Ping timeout: 256 seconds]
mockra has joined #ruby
<sam113101>
HELP
justsee has joined #ruby
justsee has joined #ruby
pinpin404 has quit [Remote host closed the connection]
jimg has quit [Remote host closed the connection]
<sam113101>
why can't I split arr.map { |i| puts i } on two lines?
Lemtzas has joined #ruby
codemonk_ has joined #ruby
Lemtzas_ has quit [Ping timeout: 264 seconds]
wsterling has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 264 seconds]
tundrax has joined #ruby
rakl has quit [Quit: sleeping]
codemonkey010101 has quit [Ping timeout: 264 seconds]
justsee has quit [Ping timeout: 245 seconds]
wsterling has joined #ruby
chrishunt has quit [Quit: ZzZzZz...]
eliasp has quit [Read error: Operation timed out]
dmiller has quit [Remote host closed the connection]
dmiller has joined #ruby
eliasp has joined #ruby
eka has joined #ruby
tundrax has quit [Ping timeout: 245 seconds]
davidboy has joined #ruby
codemonk_ has quit [Remote host closed the connection]
larissa has joined #ruby
<santana>
sam113101, like this?
<santana>
arr.map {|i|
<santana>
puts i }
<sam113101>
can't I split before the { ?
dmiller has quit [Ping timeout: 245 seconds]
<santana>
nope
mercwithamouth has quit [Read error: Operation timed out]
<santana>
in any case, it's a bad practice; I wonder what pushes you to do that
<sam113101>
just to save some lines
mercwith1mouth has quit [Ping timeout: 245 seconds]
<santana>
save lines? you can save lines by writing a single line as you already did
emmanuelux has joined #ruby
slyv has joined #ruby
<sam113101>
yeah, but in that case the lines become too long and exceed my (self imposed) 120 characters limit ;p
brandon_ has joined #ruby
brum has joined #ruby
r0bby_ is now known as robbyoconnor
<santana>
keeping the left brace in the same line as map doesn't help?
<sam113101>
it does, thanks
plains has joined #ruby
<sam113101>
it's a bit ugly though
Banistergalaxy has joined #ruby
rakl has joined #ruby
brianpWins has quit [Quit: brianpWins]
<santana>
you will get used to it; it's inherited from C fathers
<sam113101>
can I create options with more than one letter with optionparser?
Hanmac1 has joined #ruby
kofno has quit [Remote host closed the connection]
<sam113101>
for example, I can use -n but not -ns
chile_andes has quit [Ping timeout: 252 seconds]
<santana>
I don't know, I prefer GetoptLong
oponder_ has joined #ruby
<sam113101>
well, the way the bracket block has to be splitted is ugly, it would have been better if I could put { on a different line
Hanmac has quit [Ping timeout: 245 seconds]
<sam113101>
the ruby parser seems picky
plains has quit [Client Quit]
megha has quit [Quit: WeeChat 0.4.0]
<sam113101>
more than I'm used to with other languages
<santana>
it is, it does a lot of things
Sargun_ has quit [Changing host]
Sargun_ has joined #ruby
Sargun_ is now known as Sargun
brum has quit [Ping timeout: 256 seconds]
<santana>
when you learn more about Ruby you'll realize why it is so
plumieride01 has quit [Quit: plumieride01]
<sam113101>
I couldn't do 'something' +a_variable because the + was considered an unary operator, which didn't work with a_variable's type
<santana>
for instance, the braces are not really block delimiters as you may know them; they define an anonymous function
kenned63 has joined #ruby
oponder has quit [Ping timeout: 246 seconds]
<santana>
really? do you have th exact example at hand?
jimg has joined #ruby
<sam113101>
no I fixed it earlier
<sam113101>
why does it surprise you?
Emmanuel_Chanel has joined #ruby
Guest1416 has quit [Changing host]
Guest1416 has joined #ruby
Guest1416 is now known as z
jimg has quit [Remote host closed the connection]
ossareh has quit [Ping timeout: 264 seconds]
wsterling has quit [Remote host closed the connection]
cheese1756 has quit [Excess Flood]
<santana>
the unary part doesn't make sense
<santana>
that didn't work between objects with different types is normal behavior
nari has joined #ruby
mockra has joined #ruby
<santana>
way more sane than Perl's approach of automatically coercing types
<sam113101>
bnagy: I always forget about that (new string gets created each time)
graydog has quit [Quit: graydog]
* Olipro
thinks the Ruby interpreter could just apply to analysis to simply treat + as << in the right situation
<Olipro>
*apply analysis
adam12 has quit [Remote host closed the connection]
santana has quit [Remote host closed the connection]
dmiller has joined #ruby
dmiller has quit [Remote host closed the connection]
hamakn has joined #ruby
dmiller has joined #ruby
dmiller has quit [Remote host closed the connection]
<bnagy>
how would it do that?
dmiller has joined #ruby
<bnagy>
it has to know whether you intend to modify your original string
pcarrier_ has joined #ruby
<Olipro>
bnagy: right, so if a line is myvar = "current status is: " + status, that can self-evidently be changed
mockra has joined #ruby
pitzips has quit [Quit: Leaving]
<bnagy>
:S
<bnagy>
sounds parsetastic
pipework has quit [Remote host closed the connection]
synthetix has joined #ruby
mockra has quit [Ping timeout: 256 seconds]
timkohrumel has joined #ruby
Michae___ has joined #ruby
DanKnox_away is now known as DanKnox
wedgex has quit [Remote host closed the connection]
tiripamwe has quit [Quit: Leaving]
chessguy_ has quit [Remote host closed the connection]
freeayu has quit [Quit: 离开]
tiripamwe has joined #ruby
krz has quit [Quit: krz]
Proshot has quit [Quit: Leaving]
eka has quit [Quit: Computer has gone to sleep.]
brum has joined #ruby
bubblehead has joined #ruby
tockitj has quit [Ping timeout: 252 seconds]
kofno has joined #ruby
bubblehead has quit [Remote host closed the connection]
codemonkey010101 has joined #ruby
brum has quit [Ping timeout: 256 seconds]
codemonkey010101 has quit [Remote host closed the connection]
agjacome has quit [Quit: leaving]
codemonkey010101 has joined #ruby
DanKnox is now known as DanKnox_away
Nickwiz has joined #ruby
<Nickwiz>
How does one unset O_NONBLOCK? Oposite fo this: $stdin.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK | flags)
<Nickwiz>
of
mtlatif_ has joined #ruby
moeSeth has joined #ruby
<Nickwiz>
This doesn't work: $stdin.fcntl(Fcntl::F_SETFL, (~Fcntl::O_NONBLOCK) | flags)
<Nickwiz>
where flags is : flags = $stdin.fcntl(Fcntl::F_GETFL, 0)
chessguy has joined #ruby
thejefflarson__ has joined #ruby
notbrent_ has joined #ruby
<Nickwiz>
OK. Fixed it.
<Nickwiz>
flags &= (~Fcntl::O_NONBLOCK), if anyone wonder.
Boohbah has joined #ruby
z_ has joined #ruby
radic has joined #ruby
Guest95637 has quit [*.net *.split]
alexwh_ has quit [*.net *.split]
Vert has quit [*.net *.split]
z has quit [*.net *.split]
jimg has joined #ruby
cofin has joined #ruby
tricon_ has quit [Read error: Operation timed out]
synthetix has quit [Ping timeout: 256 seconds]
wsterling has joined #ruby
abstrusenick has joined #ruby
decentrality has joined #ruby
jimg has quit [Ping timeout: 246 seconds]
devyn_ is now known as devyn
Michae___ has quit [Remote host closed the connection]
wsterling has quit [Ping timeout: 245 seconds]
Michae___ has joined #ruby
thufir_ has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
kil0byte has quit [Remote host closed the connection]
chrishunt has quit [Quit: ZzZzZz...]
jnoob22_ has quit [Read error: Connection reset by peer]
jnoob22 has joined #ruby
kofno has quit [Remote host closed the connection]
Michae___ has quit [Ping timeout: 246 seconds]
threesome has quit [Read error: Connection reset by peer]
codemonkey010101 has quit [Remote host closed the connection]
Asher has quit [*.net *.split]
Nickwiz has quit [Quit: BB]
huoxito has quit [Quit: Leaving]
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
pcarrier_ has quit [Ping timeout: 256 seconds]
rickruby has quit [Remote host closed the connection]
Asher has joined #ruby
Villadelfia has quit [Read error: Operation timed out]
SeySayux has quit [Ping timeout: 240 seconds]
braincrash has quit [Read error: Connection reset by peer]
oponder has quit [Remote host closed the connection]
oponder has joined #ruby
alexwh has joined #ruby
mafolz has quit [Remote host closed the connection]
dayepa1 has quit [Remote host closed the connection]
mafolz has joined #ruby
SeySayux has joined #ruby
dayepa has joined #ruby
tiripamwe has quit [Ping timeout: 256 seconds]
icecandy has joined #ruby
rakl has quit [Quit: sleeping]
pcarrier_ has joined #ruby
devyn is now known as Guest12349
z_ is now known as Guest16690
Boohbah is now known as Guest47114
SeySayux has quit [Changing host]
SeySayux has joined #ruby
Villadelfia has joined #ruby
Villadelfia has quit [Changing host]
Villadelfia has joined #ruby
corehook has joined #ruby
chrishunt has joined #ruby
wallerdev has quit [Quit: wallerdev]
hiyakashi has quit [Ping timeout: 246 seconds]
paolooo has quit [Ping timeout: 245 seconds]
braincrash has joined #ruby
ehaliewicz has joined #ruby
brum has joined #ruby
tiripamwe has joined #ruby
dagnachew has joined #ruby
brum has quit [Ping timeout: 246 seconds]
dagnachew has quit [Quit: Leaving]
freakazoid0223 has quit [Ping timeout: 246 seconds]
akashj87 has joined #ruby
thufir_ has quit [Quit: Leaving.]
emmanuelux has quit [Quit: emmanuelux]
thufir_ has joined #ruby
mklappstuhl has joined #ruby
nhhagen has joined #ruby
pithagorians has joined #ruby
cofin has quit [Quit: cofin]
mklappstuhl has quit [Read error: Connection reset by peer]
mklappstuhl has joined #ruby
hiyakashi has joined #ruby
nhhagen has quit [Ping timeout: 256 seconds]
wargasm has joined #ruby
wargasm1 has quit [Ping timeout: 264 seconds]
mogsy has quit [Quit: Leaving]
mogsy has joined #ruby
Cultofmetatron has joined #ruby
oponder_ has joined #ruby
oponder has quit [Read error: Operation timed out]
chrishunt has quit [Quit: ZzZzZz...]
Davey_ has quit [Quit: Computer has gone to sleep.]
kofno has joined #ruby
krombr has quit [Read error: Operation timed out]
rickruby has joined #ruby
MrPoT4tO has joined #ruby
kofno has quit [Ping timeout: 256 seconds]
krombr has joined #ruby
Gate has quit [Remote host closed the connection]
passerine has joined #ruby
timkohrumel has quit [Remote host closed the connection]
abstrusenick has quit [Quit: abstrusenick]
wchun has joined #ruby
falood has quit [Remote host closed the connection]
travisjeffery has joined #ruby
Cultofme_ has joined #ruby
Cultofmetatron has quit [Ping timeout: 256 seconds]
mboers has joined #ruby
browndawg has joined #ruby
krombr has quit [Ping timeout: 245 seconds]
joshlegs has joined #ruby
joshlegs has joined #ruby
joshlegs has quit [Changing host]
tymat has joined #ruby
sayan has joined #ruby
IceDragon has quit [Quit: Space~~~]
<joshlegs>
so i'm writing a wrapper around the graph database neo4j, and I want to do something like Donor.find(id) andd return an instance of Donor calss
<joshlegs>
but I can't seem to get it right. i think it's a simple problem that i'm just not grokking. any suggestons how to do that?
vlad_starkov has joined #ruby
tymat has quit [Client Quit]
<r0bgl33s0n>
joshlegs: without more information or code, nope
faen has quit [Remote host closed the connection]
<joshlegs>
r0bgl33s0n: basically, emulating what ActiveRecord does when doing a database query for, like, the last (table entry, ie, Donor) created
<joshlegs>
it actually returns instancces of the rails model where it's defined, it hink
ariedler has quit [Remote host closed the connection]
sayan has quit [Read error: Connection reset by peer]
yellow5 has quit [Quit: time to go!]
io_syl has quit [Quit: Computer has gone to sleep.]
banister`tv has quit [Remote host closed the connection]
`p has joined #ruby
shock_one has quit [Ping timeout: 245 seconds]
idkazuma has joined #ruby
brum has joined #ruby
DanKnox is now known as DanKnox_away
zmike has joined #ruby
migimunz has joined #ruby
hadees has quit [Quit: hadees]
brum has quit [Ping timeout: 256 seconds]
mklappstuhl has joined #ruby
erry__ is now known as erry
DanKnox_away is now known as DanKnox
poga has quit [Remote host closed the connection]
hamed_r has quit [Quit: Leaving]
mad_hatter_ has left #ruby [#ruby]
Veejay has joined #ruby
mad_hatter_ has joined #ruby
<Veejay>
Hello everyone, I already asked on #rubyonrails but just in case somewhere here has integrated with such an API outside of Rails, I'll go at it again
tundrax has quit [Remote host closed the connection]
<Veejay>
Does anyone know of an API/library/gem/service to deal with reservice/managing/unregistering a domain name for a user?
<Veejay>
Something à la opensrs or enom
Spooner has joined #ruby
lukekhamilton has quit [Quit: lukekhamilton]
zekefast has joined #ruby
arya has joined #ruby
zekefast has quit [Client Quit]
xXxRosexXx has quit [Ping timeout: 256 seconds]
jimg has joined #ruby
atno__ has quit [Read error: Operation timed out]
idkazuma has quit [Remote host closed the connection]
kirun has joined #ruby
jimg has quit [Ping timeout: 256 seconds]
niko__ has quit [Ping timeout: 264 seconds]
arya has quit []
iMadper has joined #ruby
MrZYX has quit [Remote host closed the connection]
tiripamwe has joined #ruby
nari has joined #ruby
decentrality has joined #ruby
amarraja has joined #ruby
backjlack has quit [Remote host closed the connection]
atno has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
lyanchih has quit [Quit: lyanchih]
staafl has quit [Read error: Connection reset by peer]
tundrax has joined #ruby
xsdg_ has quit [Ping timeout: 240 seconds]
mklappstuhl has joined #ruby
tundrax has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
<eval-in>
MrZYX => /tmp/execpad-7449bfa45e95/source-7449bfa45e95:2:in `<main>': undefined local variable or method `foo' for main:Object (NameError) (http://eval.in/27640)
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
<r0bgleeson>
i dont know why you wont accept your solution a) doesn't work (and is no longer the original solution) and b) is a pile of shit.
<r0bgleeson>
shevy: same stuff as usual. you?
monkegjinni has quit [Remote host closed the connection]
tiripamwe has quit [Ping timeout: 256 seconds]
<MrZYX>
wtf, a) I just demoed you it works, prove by example it doesn't b) no reason to get personal
malte_ has joined #ruby
colonolGron has joined #ruby
<r0bgleeson>
you changed the code for it to work
<r0bgleeson>
and it is still a poor solution
arya has joined #ruby
<shevy>
hehe
pskosinski has joined #ruby
<MrZYX>
I totally admitted that my solution will raise if the path doesn't exists, I provided an alternate one that returns nil in that case, the desired behaviour was not obvious from the question
<shevy>
r0bgleeson: hmm not sure... I kinda started to make more small gems... they are not very useful to anyone else, but they help me with my larger projects (because somehow, other people need lots of things for my larger projects to work)
GeissT has joined #ruby
<shevy>
like: "gem install really_big_project", and pull in 20 small gem dependencies... hmm
sixteneighty has quit [Quit: So long, and goodbye!]
Hanmac has joined #ruby
Zelest has joined #ruby
<shevy>
I have a hard time trying to decide whether many small gems are more useful than one just really huge project, packaged as a gem
<shevy>
and, put all stuff into that large project and distribute it as-one
sixteneighty has joined #ruby
Emmanuel_Chanel_ has quit [Ping timeout: 264 seconds]
Hanmac1 has quit [Ping timeout: 264 seconds]
<MrZYX>
r0bgleeson: please provide a better alternative instead of just ranting at answers given to questions, that doesn't help the person seeking for help, that doesn't help the person giving answer to improve his answer and it doesn't help your karma either
Emmanuel_Chanel has joined #ruby
ossareh has quit [Ping timeout: 264 seconds]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
F1skr has joined #ruby
<MrZYX>
r0bgleeson: I'm still interested in some reasoning why my solution is "a pile of shit"
jamesaxl has joined #ruby
Mattix has joined #ruby
waxjar_ has quit [K-Lined]
oponder has joined #ruby
darkapex has quit [K-Lined]
thomasfedb has quit [K-Lined]
thomasfedb has joined #ruby
samuel02 has quit [Remote host closed the connection]
tiripamwe has joined #ruby
marwinis1 has quit [Ping timeout: 240 seconds]
arya has quit [Ping timeout: 264 seconds]
arya has joined #ruby
decentrality has quit [Quit: decentrality]
<Hanmac>
MrZYX: my code would be: "bar.baz.qux".split('.').inject(foo) { |hsh, key| (hsh || {})[key] } but it goes wrong at the end ;P
ksmth has quit []
<MrZYX>
yeah "foo" || {} returns "foo" ;)
nhhagen has joined #ruby
<Hanmac>
MrZYX, so in my sample this could happen: "bar.baz.qux.me.me".split('.').inject(foo) { |hsh, key| (hsh || {})[key] } #=> "me" ;P
<MrZYX>
:D
Emmanuel_Chanel has joined #ruby
<MrZYX>
Though I'm now fully convinced by r0bgleeson excellent reasoning that ruby just has no solution for this problem there and that my working example was just a quantum side effect or something strange like that
<MrZYX>
and my original solution works, the missing key behaviour is just different from the later version (ambigous behaviour/raise vs nil)
<r0bgleeson>
MrZYX: oh i see, i misunderstood his question, i thought he wanted to build the hash. yes thats a fine solution.
<r0bgleeson>
MrZYX: now im more confused. why h[k] || {} ?
<MrZYX>
so again I'd just ask you to calm down a bit and don't defame people if you're not 100% sure about the situation
<r0bgleeson>
if the key returns nil, you want its value
<r0bgleeson>
you dont want to presume it's a hash
nari has quit [Ping timeout: 246 seconds]
shock_one has quit [Ping timeout: 256 seconds]
<r0bgleeson>
id sure as hell want the value of the key and not an abritrary hash.
<r0bgleeson>
MrZYX: I "defamed" you. How?
<MrZYX>
you said I'm "a dick" and my solution is a "pile of shit"
rakl has quit [Quit: sleeping]
<r0bgleeson>
i didnt say you were a dick
<r0bgleeson>
i said your solution was a pile of shit though
nari has joined #ruby
<MrZYX>
well retard, dick, where's the difference
<r0bgleeson>
yes, im to blame, i apologize for calling you a retard.
<r0bgleeson>
i misunderstood his question.
<MrZYX>
ok, all I wanted
<apeiros>
now kiss :)
* apeiros
runs & hides, all at the same time
<MrZYX>
heh, you'd kicked him by now :P
<r0bgleeson>
MrZYX: MUUUUUAAAH.
<apeiros>
was kicking some AI's ass, sorry
thebastl has quit [Remote host closed the connection]
<r0bgleeson>
MrZYX: I still think your original soluton was better if thats the case, returning a hash instead is not what i'd want.
<MrZYX>
r0bgleeson: the alternative to hsh || {} is to break out of the iteration, or'ing the hash just ensures that #[] is always called on a hash, so if the previous iteration didn't return a hash it won't raise
<shevy>
apeiros starcraft AI?
<apeiros>
but yeah, "don't be a retard" would have gotten a warning if I'd been here. not nice. but since you've resolved your conflict already :)
<apeiros>
shevy: of course
teddyp1cker has joined #ruby
skattyadz has joined #ruby
<r0bgleeson>
apeiros: being nice all the time gets old.
<apeiros>
I should be less cowardish and play against people
<apeiros>
r0bgleeson: sure. but you can be all non-nice outside of #ruby :-p
<r0bgleeson>
ok, i will :D
nari_ has joined #ruby
<r0bgleeson>
MrZYX: ah i see, so for the key before hands, okay makes sense.
jbpros has joined #ruby
<apeiros>
preferably in places where people can respond with an appropriate face-punch :D
teddyp1cker has left #ruby [#ruby]
<r0bgleeson>
not if i can ball-kick first.
nari has quit [Ping timeout: 256 seconds]
tomzx_mac has quit [Ping timeout: 246 seconds]
<apeiros>
that's indeed non-nice
<apeiros>
sooo, finally upgrade my 10.6 work laptop to 10.8
<apeiros>
thank you oracle for updating your adapters after the teeeny tiny little bit of what, 7 years?
<r0bgleeson>
i'm still on 10.7
<r0bgleeson>
10.6 -> 10.8 is a pretty big jump
<apeiros>
ora drivers didn't work on 10.7
<r0bgleeson>
what are they for?
<apeiros>
even on 10.6 they were only working by chance. they've only been certified for 10.4 iirc.
<apeiros>
to connect to oracle databases?
<r0bgleeson>
ah, database drivers
<MrZYX>
who wants to do that anyway?
<MrZYX>
(yes, I have to too)
<apeiros>
use oracle?
<apeiros>
or do what?
<MrZYX>
yup
<apeiros>
nobody in his right mind
<MrZYX>
who decides to buy these servers anyway...
<apeiros>
f'ck, how do I mount my synology from the osx boot stick? :-S
<r0bgleeson>
enterprise department
<apeiros>
MrZYX: sadly not me. also huge legacy stuff in it. we want to migrate, but it'll probably take a couple of years…
jimg has quit [Remote host closed the connection]
<MrZYX>
guess what, my university (of applied siences) just bought a new one. Yes, for educational purposes
adit has joined #ruby
NimeshNeema_ has joined #ruby
<apeiros>
aha: sudo mount -t afp afp://user:pass@…
kofno has joined #ruby
<r0bgleeson>
MrZYX: that's not unusual
<r0bgleeson>
they teach java as well
adit is now known as Guest27667
<MrZYX>
yeah. Doesn't make it nice either
<MrZYX>
There's also still encouraged use of SVN...
<r0bgleeson>
i think there's a big chunk of companies that are afraid to go towards something that doesn't have an industry-stamp like java/oracle has for enterprise.
jamesaxl has quit [Ping timeout: 256 seconds]
<r0bgleeson>
same in .NET as well
justsee has quit [Ping timeout: 246 seconds]
arya has quit [Ping timeout: 248 seconds]
Guest27667 has quit [Ping timeout: 268 seconds]
jamesaxl has joined #ruby
banister`tv has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
dxtry has joined #ruby
havenwood has joined #ruby
arya has joined #ruby
bubblehead has joined #ruby
tiripamwe has quit [Ping timeout: 264 seconds]
colonolGron has quit [Quit: leaving]
bubblehead has quit [Read error: Connection reset by peer]
bubblehead has joined #ruby
icrazyhack has joined #ruby
horieyui has quit [Ping timeout: 256 seconds]
<shevy>
java excites the industry
browndawg has quit [Read error: Connection reset by peer]
<apeiros>
the problem I have with such things is that it makes people think that plain postgres was somehow not good enough for enterprises… *sob*
<apeiros>
(for real, "but there's enterprise postgres, therefore postgres is not enterprise ready", almost verbatim)
nyuszika7h has quit [Quit: Reconnecting with SSL]
Neomex has quit [Quit: Neomex]
chessguy has joined #ruby
<MrZYX>
respond that the enterprise version of mariadb is mysql and that mysql is slower and has less features :P
hiyakashi has quit [Ping timeout: 246 seconds]
<apeiros>
they don't know mariadb
<apeiros>
and I think they'd say "meh" when I said mysql
prime_ is now known as prime
prime has quit [Changing host]
prime has joined #ruby
<apeiros>
(and yes, I know that mariadb is a fork of mysql)
az7ar has quit [Remote host closed the connection]
<apeiros>
tbh, I'd say "meh" to mysql too :-)
alexgordon has joined #ruby
<MrZYX>
mmh, can we argue fedora vs red hat enterprise? :D
<apeiros>
though, I did mention mysql's ability to have per-column encodings when I learned that oracle has a *database wide* encoding. a single one! srslywtfbbq?!?
nyuszika7h has joined #ruby
<r0bgleeson>
hehe
<apeiros>
(you can have a second one using nvarchar2 or whatever the name was - breaking a couple of apps, though)
<MrZYX>
actually I think that's a good thing. As long as you can't change it to anything but UTF-8
<apeiros>
haahahaha
lyanchih has joined #ruby
<Hanmac>
.. mysql supports per-column encodings too
<apeiros>
I did mention that we have oracle due to legacy, right?
<MrZYX>
;P
<apeiros>
do you think at the time that legacy was "the new stuff", utf-8 even existed? :)
<r0bgleeson>
are you still working @ the same place, apeiros ?
<apeiros>
of course not… the whole db is iso-8859-1
<apeiros>
yes
<r0bgleeson>
thats cool
<r0bgleeson>
was it java that used oracle?
<apeiros>
no
<apeiros>
well, a bit java was/is there too
marr has quit [Read error: Connection reset by peer]
<apeiros>
no idea what was there at the beginning, but now it's C, C++, Perl, Java and Ruby. thankfully we didn't and won't inherit the non-ruby stuff. we will eventually replace it, though. and with every bit we replace, dependence on oracle will lower.
<apeiros>
s/will lower/lowers/
jetblack has quit [Quit: leaving]
yashshah has joined #ruby
monkegjinni has joined #ruby
<r0bgleeson>
that's a lot of different languages
<r0bgleeson>
but it makes me happy to know you're going with ruby going forward :)
<r0bgleeson>
only because it means the future for ruby is bright
eka has joined #ruby
robottinosino has joined #ruby
<r0bgleeson>
i sometimes worry Ruby will turn into a Perl :[
jetblack has joined #ruby
brum has joined #ruby
<r0bgleeson>
clojure and javascript are two languages i'd like to learn though
<r0bgleeson>
clojurescript was exciting but it turns out its quite limited and very young, even for toy projects
colonolGron has joined #ruby
browndawg has joined #ruby
jimg has joined #ruby
<apeiros>
I'd like to learn scala for some back-end stuff which needs to be *fast*
yacks has quit [Ping timeout: 240 seconds]
<r0bgleeson>
why scala? I've heard good things but never looked into it.
<r0bgleeson>
emacs lisp got me interested in clojure
<r0bgleeson>
and emacs in general
nari_ has quit [Ping timeout: 256 seconds]
<apeiros>
swiss quality, that's why ;-)
* Hanmac
sings "all you need is ruby"
<apeiros>
na, it seems to be a good balance between performance and writable/readable/maintainable. could be that there are better languages, though.
atno has quit [Remote host closed the connection]
<r0bgleeson>
Hanmac: unfortunately that's not true and the more languages you use the better.
<apeiros>
with a small team, more languages can be an issue. and we're a tiny team :(
_rgn_ is now known as _rn
_rn is now known as _rgn
<r0bgleeson>
yeah, I use Ruby/JS at work but I love to learn new languages and think different every now & then.
<r0bgleeson>
can always bring it back into ruby if it makes sense :)
<Hanmac>
you can use ruby for GUI programs and you can use ruby for 3d games
yacks has joined #ruby
jimg has quit [Ping timeout: 256 seconds]
<r0bgleeson>
Hanmac: that's not the point, or at least not mine. if you just write ruby all the time and nothing else you can become boring and comfortable.
yashshah has quit [Write error: Connection reset by peer]
<dxtry>
what editors are you using for ruby?
yashshah has joined #ruby
mad_hatter_ has joined #ruby
<r0bgleeson>
wasn't it bjarne that said you aren't a professional if you dont know 3 languages? :)
nyuszika7h has quit [Remote host closed the connection]
<r0bgleeson>
dxtry: i've used vim, sublime, & emacs.
wallerdev has joined #ruby
<apeiros>
d'oh f'ck, HD of my MBP is probably broken. I first thought it was the backup disk. but tried again on another disk and it failed with the same error.
<r0bgleeson>
that sucks
nyuszika7h has joined #ruby
<dxtry>
i have to force myself to learn vim properly :P
* apeiros
tries disk repair, maybe it's just a "soft" breakage
<apeiros>
dxtry: I tried for a week. I'm now convinced that time is better spent on other things.
<dxtry>
which editor are you using now?
<dxtry>
mainly
<Hanmac>
r0bgleeson: i know more than twice that much ;P
<apeiros>
sublime
<r0bgleeson>
vim was my editor of choice for about two years, its good, but emacs is better
<r0bgleeson>
also has a big learning curve
<apeiros>
for some use-cases still bbedit, though (multi-file regex search is still a good bit faster in bbedit)
<dxtry>
i know the basics of both vim and emacs but it feels like the learning curve gets even steeper
<dxtry>
after the basics
<dxtry>
so not sure if it's worth it learning
browndawg has quit [Ping timeout: 246 seconds]
Yakko has joined #ruby
<apeiros>
with sublime, I spend some 98% of my time writing. I don't think the other 2% can be sufficiently optimized to justify the time spent on it.
chile_andes has joined #ruby
oponder has quit [Read error: Connection reset by peer]
chile_andes has quit [Client Quit]
<r0bgleeson>
dxtry: yeah it does, but it pays off. i never leave emacs/tmux when im developing (unless I use the browser)
<r0bgleeson>
everything I want is in either tmux or emacs
oponder has joined #ruby
<r0bgleeson>
i use console emacs
<r0bgleeson>
sublime is a good editor and you can be productive with it pretty fast
vlad_starkov has quit [Remote host closed the connection]
<r0bgleeson>
it's also cross-platform
<MrZYX>
and sublime 3 is going into public beta very soon
<r0bgleeson>
a few years ago you'd hear "Textmate"
vlad_starkov has joined #ruby
<dxtry>
it's only for macs?
<r0bgleeson>
yeah, textmate is
<r0bgleeson>
sublime works on all major platforms
<apeiros>
sadly sublime is very slow when I turn my mbp retina to (emulated) 1920x1080
<apeiros>
though I should check again, maybe that's gotten better by now
Xeago has quit [Remote host closed the connection]
DonRichie has joined #ruby
kraljev2 has joined #ruby
<kraljev2>
If I want to have object initializer
`p has quit [Ping timeout: 256 seconds]
<kraljev2>
a = new Test
<kraljev2>
b = new Test(a)
<kraljev2>
performing clone
<kraljev2>
how can i do that?
<MrZYX>
I hope you mean a = Test.new; b = Test.new(a) ?
bakingbread has joined #ruby
<kraljev2>
sure :)
<r0bgleeson>
kraljev2: in ruby new is a method and not a keyword
<MrZYX>
override ::new, the standard implementation basically calls allocate, initialize and returns the new object
<kraljev2>
def initialize(obj)
<kraljev2>
if obj.kind_of? Test
<kraljev2>
....
<kraljev2>
else
NimeshNeema_ has quit []
adlongwell has quit [Quit: Sleeping]
<kraljev2>
self = Test.clone
<r0bgleeson>
cant do that
<kraljev2>
but i got error that i cannot change self
<r0bgleeson>
you cant reassign self
ananthakumaran has quit [Quit: Leaving.]
solrize has quit [Ping timeout: 256 seconds]
<MrZYX>
hm, I think you can't return the instance from the initialize method. def self.new(obj=nil); return obj.clone if obj.is_a? self; super; end (untested)
binw__ has joined #ruby
browndawg has quit [Read error: Connection reset by peer]
oponder has quit [Read error: Connection reset by peer]
Michae___ has quit [Remote host closed the connection]
browndawg has joined #ruby
oponder has joined #ruby
chrishunt has quit [Quit: ZzZzZz...]
<r0bgleeson>
you could do that but i'd ask why you'd want to do that, new shouldn't return instances of different classes.
<kraljev2>
that is just a copy initializer
NimeshNeema has joined #ruby
Michae___ has joined #ruby
<r0bgleeson>
kraljev2: what are you trying to do?
wargasm1 has joined #ruby
Hanmac1 has joined #ruby
paulswil_ has joined #ruby
binw_ has quit [Ping timeout: 252 seconds]
wargasm has quit [Ping timeout: 245 seconds]
Akuma has joined #ruby
Akuma has quit [Client Quit]
Hanmac has quit [Ping timeout: 245 seconds]
kuzushi__ has quit [Quit: Leaving]
Mon_Ouie has quit [Ping timeout: 240 seconds]
cofin has quit [Quit: cofin]
<kraljev2>
copy constructor
<kraljev2>
irb(main):021:0> a = Array[1,2,3]
<kraljev2>
=> [1, 2, 3]
<kraljev2>
irb(main):022:0> b = Array.new(a)
<kraljev2>
=> [1, 2, 3]
<kraljev2>
irb(main):023:0> b
<kraljev2>
=> [1, 2, 3]
bbttxu has quit [Ping timeout: 252 seconds]
<kraljev2>
you can pass old array to #new
<kraljev2>
to have it cloned
Davey has quit [Quit: Computer has gone to sleep.]
<r0bgleeson>
then the solution MrZYX gave you should work.
<r0bgleeson>
but i'd just call dup, personally.
<MrZYX>
hm, what's the difference anyway?
Michae___ has quit [Remote host closed the connection]
<MrZYX>
ugh, Object#initialize_dup and Object#initialize_clone have :nodoc:'s :/
<kraljev2>
it seems that return value from initialize is ignored
<MrZYX>
yes
<MrZYX>
intentionally
dross_ is now known as dross
kil0byte_ has quit [Ping timeout: 256 seconds]
<r0bgleeson>
initialize always returns self unless initialize raises an exception, in which case nil is returned.
<r0bgleeson>
hm thats not accruate, this is kinda interesting, is there a ruby bot in here?
yshh_ has quit [Remote host closed the connection]
Matt has joined #ruby
skepti has joined #ruby
atno has quit [Remote host closed the connection]
Matt is now known as Guest62163
LennyLinux has joined #ruby
mixel has joined #ruby
yshh has joined #ruby
timkohrumel has joined #ruby
timkohrumel has quit [Read error: Connection reset by peer]
r0bgleeson is now known as DomException11
chipotle_ has quit [Quit: cya]
timkohrumel has joined #ruby
chandankumar has joined #ruby
cofin has joined #ruby
jamesaxl_ has joined #ruby
baks has joined #ruby
jamesaxl has quit [Ping timeout: 256 seconds]
dagnachew has joined #ruby
curtis has joined #ruby
Drakevr has quit [Changing host]
Drakevr has joined #ruby
wmoxam has quit [Ping timeout: 256 seconds]
browndawg has quit [Ping timeout: 256 seconds]
paulswil_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
paulswilliamsesq has joined #ruby
tiripamwe has joined #ruby
cofin has quit [Quit: cofin]
banister`tv has joined #ruby
brianpWins has joined #ruby
wudofyr_ has joined #ruby
justsee has quit [Ping timeout: 256 seconds]
megha has quit [Ping timeout: 256 seconds]
jacobw has joined #ruby
wudofyr_ has quit [Remote host closed the connection]
migimunz has joined #ruby
browndawg has joined #ruby
wudofyr_ has joined #ruby
zmike has quit [Quit: Выходжу]
aqild has joined #ruby
Michae___ has quit [Remote host closed the connection]
Michae___ has joined #ruby
Michae___ has quit [Remote host closed the connection]
Michae___ has joined #ruby
roadt has quit [Ping timeout: 256 seconds]
Cultofmetatron has joined #ruby
atno has joined #ruby
DomException11 is now known as r0bgleeson
mityaz has quit [Quit: See ya!]
interactionjaxsn has joined #ruby
pagios has quit [Ping timeout: 246 seconds]
migimunz has quit [Ping timeout: 256 seconds]
chipotle_ has joined #ruby
generali_ has joined #ruby
chattmatt has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
tiripamwe has quit [Ping timeout: 256 seconds]
interactionjaxsn has joined #ruby
pskosinski has quit [Remote host closed the connection]
pskosinski_ has joined #ruby
aqild has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
pskosinski_ is now known as pskosinski
atno has quit [Remote host closed the connection]
DonVitoCorleone has joined #ruby
codemonkey010101 has joined #ruby
paulswilliamsesq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
interactionjaxsn has quit [Ping timeout: 256 seconds]
backjlack has joined #ruby
Opettaja has joined #ruby
mad_hatter_ has joined #ruby
atno has joined #ruby
poga has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
tiripamwe has joined #ruby
oponder has quit [Remote host closed the connection]
adrian_ is now known as ayonix
machuga|away is now known as zz_machuga|away
hadees has joined #ruby
arya_ has joined #ruby
banister`tv has quit [Ping timeout: 256 seconds]
vlad_starkov has quit [Ping timeout: 256 seconds]
zmike has joined #ruby
arya has quit [Ping timeout: 248 seconds]
pagios has joined #ruby
atno has quit [Read error: No route to host]
sauron has joined #ruby
atno has joined #ruby
<sauron>
wooo
<sauron>
ruby rules
solrize has joined #ruby
bradhe has joined #ruby
<epta_>
Are there any?
zmike has quit [Client Quit]
adlongwell has joined #ruby
zmike has joined #ruby
tjbiddle has joined #ruby
<waxjar>
be nice, because matz is nice?
zmike has quit [Client Quit]
enriclluelles has quit [Read error: No route to host]
enricllu_ has joined #ruby
sauron is now known as node
DanKnox_away is now known as DanKnox
faen_ is now known as faen
Vert has joined #ruby
atno has quit [Remote host closed the connection]
lyanchih_ has quit [Quit: lyanchih_]
havenwood has quit [Remote host closed the connection]
codemonkey010101 has quit [Remote host closed the connection]
Fretta has joined #ruby
atno has joined #ruby
dxtry has quit [Remote host closed the connection]
tiripamwe has quit [Ping timeout: 256 seconds]
krombr has joined #ruby
<Fretta>
Is there a ruby web framework that's a little friendlier with backwards compatibility than rails all the changes from rails 2 to 3 have scared me for good (e.g. Merely changing before_filter to before_action is silly to me...) ?
d2dchat has joined #ruby
<Fretta>
Hi Ruby folks!
atno has quit [Remote host closed the connection]
<waxjar>
Fretta, it depends on the features you want. if you want a true framework with lots of features rails would definitely be your best bet
jgrevich has joined #ruby
<MrZYX>
padrino probably the second best, though I can't say anything about API stability there
atno has joined #ruby
chipotle_ has quit [Quit: cya]
thebastl has joined #ruby
dxtry has joined #ruby
rippa has joined #ruby
Fretta has quit [Ping timeout: 256 seconds]
moeSeth has joined #ruby
Nisstyre has quit [Quit: Leaving]
v0n has joined #ruby
pagios has quit [Remote host closed the connection]
ravster has left #ruby [#ruby]
JoeTheGuest has joined #ruby
cooldman224 has joined #ruby
rking1 has joined #ruby
patricksroberts_ has joined #ruby
InFlames has joined #ruby
timkohrumel has quit [Remote host closed the connection]
paulswilliamsesq has joined #ruby
noob-hacker has joined #ruby
Astralum has quit [Ping timeout: 252 seconds]
generali_ has quit [Remote host closed the connection]
enricllu_ has quit [Read error: Connection reset by peer]
enriclluelles has joined #ruby
enriclluelles has quit [Remote host closed the connection]
jesteracer has joined #ruby
<shevy2>
let's start a new webframework
nezumi has joined #ruby
<shevy2>
one larger than sinatra but smaller than rails
bradhe has quit [Remote host closed the connection]
<node>
hola como estas
<node>
´´ólllaaa
noob-hacker has quit [Ping timeout: 245 seconds]
<epitron>
MrZYX: i used padrino. i wouldn't recommend it.
<epitron>
it does a couple nice things, like generate app scaffolding, but its internal API is as complex as rails, and with less documentation
<MrZYX>
epitron: I didn't so far but thought about it, what are your negative experiences?
node is now known as NodeJsExpertLord
<MrZYX>
oh, hmm
<MrZYX>
I tend to read the rails source already if I need clarification about what something does, so I don't think I'd have a big problem with that :P
<jacobw>
shevy2: Do not want
<epitron>
also, no asset pipeline, which is excellent
timkohrumel has quit [Remote host closed the connection]
<epitron>
MrZYX: it's about the same complexity, but different. so everything you know about rails is useless :)
<epitron>
it also doesn't come with everything baked in
<epitron>
i had to hack a few things myself
<epitron>
i think you should try it, but i found it frustrating
<epitron>
it's almost all the drawbacks of both sinatra and rails :\
bw____ is now known as bw_
<epitron>
(this was my experience in early 2012, btw. it might be better now.)
dmiller has joined #ruby
freakazoid0223 has joined #ruby
vlad_starkov has joined #ruby
nhhagen has quit [Remote host closed the connection]
<MrZYX>
does padrino still strictly do the MVC stuff? wasn't 100% clear from the overview pages for me
tiripamwe has joined #ruby
RiftyMcF3arless has joined #ruby
<r0bgleeson>
MrZYX: did it ever do MVC?
adlongwell has quit [Quit: Sleeping]
<MrZYX>
I don't know, still as in still as rails does
<MrZYX>
what I really mean is strictly abusing MVC as architecture I guess
heftig_ has joined #ruby
<epitron>
i'm not sure what your question is, but it's essentially the same as rails
dagnachew has quit [Quit: Leaving]
chandankumar has quit [Quit: Leaving]
pen has joined #ruby
<epitron>
try it out :)
<r0bgleeson>
ive never heard of MVC padrino but it tries to make programming as convient as Rails on top of Sinatra
heftig has quit [Ping timeout: 245 seconds]
<r0bgleeson>
i havent used it though
<epitron>
it has models, views, controllers, and helpers
<epitron>
they're in a folder called app
mikepack has joined #ruby
heftig_ is now known as heftig
<r0bgleeson>
interesting
<epitron>
it's basically a less mature rails, on sinatra
<r0bgleeson>
ive had enough of that though, so i think ill pass :p
<epitron>
the unique thing is that it has generators for a whack of different ORMs, testing frameworks, etc.
synthetix has quit [Ping timeout: 256 seconds]
<epitron>
i thought that was very cool
<r0bgleeson>
yeah that's cool
DanKnox is now known as DanKnox_away
jesteracer has quit [Ping timeout: 245 seconds]
<MrZYX>
hm, I guess what I really seek is a web framework that breaks out of the MVC as architecture stuff, just to get my head free of it and being able to use MVC as what it is, a pattern. Before you say Sinatra, that's just a thin routing layer, currently if I'd desgin a bigger app on top of it I fear I'd end up using it as router
adlongwell has joined #ruby
<shevy2>
well see
<shevy2>
in order to compete against rails, you need to be huge
<r0bgleeson>
MrZYX: if you want different, try webmachine-ruby or reel.
<r0bgleeson>
im building an application with both of those.
krz has quit [Quit: krz]
NodeJsExpertLord has quit [Quit: the lord of doom has quit]
<fryguy>
could always look at how things are done in other languages too. snap, seaside, yesod, flask are probably all worth looking at for comparative purposes
Beoran has joined #ruby
<r0bgleeson>
yup
<r0bgleeson>
think outside of the rails box
<waxjar>
i kinda like the idea of providing just a JSON API and writing a client with something like Backbone
<MrZYX>
yeah, that's basically what I'm trying, Django etc aren't that different from that thinking too. So thanks
<r0bgleeson>
webmachine-ruby is actually a port of webmachine, written in erlang
<waxjar>
if only there was client-side ruby :p
<r0bgleeson>
its a very different way of writing applications
<r0bgleeson>
its fun though
<MrZYX>
then you render json in the view, doesn't change anything about the server side architecture
<fryguy>
waxjar: take a look at angular and ember for doing clientside apps backed by json-style apis
chessguy has joined #ruby
DanKnox_away is now known as DanKnox
<waxjar>
fryguy: I tried ember but I really didnt like it. the docs were terrible too (at that time, anyway)
<fryguy>
the learning curve takes a while
<r0bgleeson>
fryguy: im a javascript newbie but ive found modeling backend objects on the frontend works really well, and i do that with vanilla JS.
<fryguy>
and it's so different from traditional web mvc that it can be difficult
<r0bgleeson>
well, JS+jquery.
<r0bgleeson>
im sure those frameworks are much better
<r0bgleeson>
I have a User object, Session, etc, on the client.
kraljev2 has left #ruby [#ruby]
Squarepy has quit [Remote host closed the connection]
dmiller has quit [Remote host closed the connection]
parus_ is now known as parus
vlad_starkov has quit [Remote host closed the connection]
InFlames has quit [Quit: This computer has gone to sleep]
vlad_starkov has joined #ruby
_rn is now known as _rgn
Azulinho has joined #ruby
Squarepy has joined #ruby
nathan28 has joined #ruby
kf8a has joined #ruby
icecandy has quit [Remote host closed the connection]
<nathan28>
o/ ruby, is Ruby/SerialPort still the prefered lib for sending/receiving over serial (to an arduino)
<nathan28>
?
ilyai has quit [Quit: Leaving]
Fretta has joined #ruby
Xeago has joined #ruby
<RiftyMcF3arless>
hey everyone, trying to use a different version of rake (for a legacy rails app). i need to run a rake task, so im trying bundle exec to force the usage of the rake specified in my Gemfile, but it says it "can't find the gem, install with bundler". when i run bundle install, it says the gem is installed. any ideas?
bradhe has joined #ruby
<MrZYX>
bundle show rack reports the right version?
CaptainQuirk has joined #ruby
v0n has quit [Read error: Operation timed out]
<CaptainQuirk>
Hi there !
CaptainQuirk has left #ruby ["Leaving"]
T|ASK has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
DanKnox is now known as DanKnox_away
Fretta has quit [Ping timeout: 264 seconds]
niklasb has quit [Ping timeout: 256 seconds]
bradhe has quit [Remote host closed the connection]
rhannequin has joined #ruby
malte_ has quit [Quit: malte_]
<RiftyMcF3arless>
MrZYX: i think so, let me double check
<RiftyMcF3arless>
MrZYX: yes, it shows the version specified in my Gemfile, 1.1.0
<RiftyMcF3arless>
this is the version my client specified. he gave me a list of the gems and their versions used in this Rails app.
<MrZYX>
maybe just delete that reported directory so bundler installs it again
<RiftyMcF3arless>
i keep getting an error about a 'sessions' table not being able to be found. the stack trace suggests it's to do with the hoptoad_notifier gem and/or aws-s3, which is why i think i need to run this hoptoad:deploy task
vlad_starkov has quit [Remote host closed the connection]
<MrZYX>
wait, 1.1?
<RiftyMcF3arless>
MrZYX: yep
<MrZYX>
can't even find that on rubygems.org...
<RiftyMcF3arless>
MrZYX: let me double check again :D
<RiftyMcF3arless>
ohh, you meant rake. you said rack :D
<RiftyMcF3arless>
rake is 0.8.7, it reports correctly
<RiftyMcF3arless>
this is the version my client said to use. my job is to make this rails app easier to deploy for him (i understand why now)
<MrZYX>
oh sorry, typo
<RiftyMcF3arless>
but he needs these versions to be consistent
tiripamwe has quit [Ping timeout: 246 seconds]
<RiftyMcF3arless>
the suggestion i really want to make is: "why are you using these old, old, old versions of things? we should just upgrade the app."
blandflakes has quit [Quit: Leaving]
<RiftyMcF3arless>
but, alas, his clients (who this work is ultimately for) don't want to invest in that task
<RiftyMcF3arless>
it's really costing them more, in the long run, imho
<MrZYX>
about the table not found thingy, that's because you didn't load the schema, but that's really a #rubyonrails topic
jovy88_ has quit [Read error: Connection reset by peer]
<RiftyMcF3arless>
MrZYX: AH! you just made me remember something. i have an idea. i'll try it and get back to you.
wargasm1 has quit [Ping timeout: 256 seconds]
<RiftyMcF3arless>
sorry for being off-topic, but thank you :)
ferdev has quit [Quit: ferdev]
pskosinski has quit [Remote host closed the connection]
jovy88_ has joined #ruby
T|ASK has left #ruby [#ruby]
nezumi has quit [Ping timeout: 264 seconds]
brtdv has joined #ruby
Xeago has quit [Remote host closed the connection]
adit has joined #ruby
rgrinberg has joined #ruby
jzig__ has joined #ruby
adit is now known as Guest36299
Guest62163 is now known as mattRB
mattRB is now known as MattRB
pskosinski has joined #ruby
teclator has joined #ruby
nathan28 has left #ruby [#ruby]
jamesaxl has joined #ruby
jzig has quit [Ping timeout: 264 seconds]
BizarreCake has quit [Ping timeout: 246 seconds]
<RiftyMcF3arless>
MrZYX: i was trying to use sqlite even though he uses mysql on production. probably a dumb idea all around, but i have it creating the schema now, so we'll see what happens. thanks again.
jamesaxl_ has quit [Ping timeout: 256 seconds]
Alamo777_ has joined #ruby
Alamo777 has quit [Read error: Connection reset by peer]
fridim_ has joined #ruby
toekutr has joined #ruby
Azulinho has quit [Ping timeout: 260 seconds]
wargasm has joined #ruby
Spami has quit [Read error: Connection reset by peer]
paulswilliamsesq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Spami has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
slash_nick has joined #ruby
mikepack has quit [Remote host closed the connection]
tiripamwe has joined #ruby
arya_ has quit [Disconnected by services]
dwon has quit [Quit: Leaving]
spike|spiegel has quit [Quit: WeeChat 0.4.0]
toekutr has quit [Ping timeout: 264 seconds]
kristofers has joined #ruby
whowantstolivefo has joined #ruby
paulswilliamsesq has joined #ruby
spike|spiegel has joined #ruby
rouss has quit [Ping timeout: 256 seconds]
slash_nick has quit [Ping timeout: 246 seconds]
monkegji_ has quit [Remote host closed the connection]
nhhagen has joined #ruby
bradhe has joined #ruby
atno has quit [Remote host closed the connection]
Kar- has quit [Remote host closed the connection]
tommyvyo has quit [Quit:]
MattRB has quit [Quit: This computer has gone to sleep]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
mfridh has quit [Ping timeout: 268 seconds]
bradhe_ has joined #ruby
chattmatt has quit [Quit: chattmatt]
bradhe has quit [Read error: Connection reset by peer]
slash_nick has joined #ruby
adlongwell has quit [Quit: Sleeping]
rdg has joined #ruby
atno has joined #ruby
bradhe_ has quit [Remote host closed the connection]
abstrusenick has joined #ruby
jesteracer has joined #ruby
bradhe has joined #ruby
Guest5383 is now known as mahlon
nhhagen has quit [Ping timeout: 246 seconds]
mikepack has joined #ruby
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
skattyadz has quit [Quit: skattyadz]
bradhe has quit [Remote host closed the connection]
InFlames has joined #ruby
tiripamwe has quit [Ping timeout: 260 seconds]
bradhe has joined #ruby
katsrc has joined #ruby
Caldrin has joined #ruby
Guest12509 is now known as banghouse
bradhe has quit [Remote host closed the connection]
Caldrin has left #ruby [#ruby]
Rix has quit [Ping timeout: 252 seconds]
tomzx_mac has joined #ruby
mercwithamouth has joined #ruby
Michae___ has quit [Remote host closed the connection]
sayan has joined #ruby
d2dchat has quit [Remote host closed the connection]
pandawarrior has joined #ruby
LennyLinux has quit [Remote host closed the connection]
eval-in has quit [Remote host closed the connection]
browndawg has quit [Quit: Leaving.]
<pandawarrior>
hi, i'm reading about the decorator pattern from the book: design patterns in ruby
eval-in has joined #ruby
nplusp has joined #ruby
<pandawarrior>
and got to the section about using alias method
tiripamwe has joined #ruby
<pandawarrior>
it's example is very cofusing for me
lkba has quit [Read error: Connection reset by peer]
<pandawarrior>
could anyone explain what the author is trying to convey?
<pandawarrior>
cheers
nplusp has quit [Client Quit]
Rix has joined #ruby
mixel has quit [Quit: mixel]
nplusp has joined #ruby
nplusp has quit [Client Quit]
nplusp has joined #ruby
libc has joined #ruby
teclator has quit [Ping timeout: 264 seconds]
abstrusenick has quit [Quit: abstrusenick]
Michae___ has joined #ruby
gvz has quit [Quit: bye]
<shevy2>
pandawarrior: I think he tries to add a method to object w
thecreators has joined #ruby
<shevy2>
in a very annoying way, I have no idea why he insists on doing so
<hulkmedia>
if im running a ruby app from a git console on windows os how can i output colors in the console e.g. puts "xxx" => xxx becomes green or blue, etc..
thecreators has quit [Remote host closed the connection]
kf8a has quit [Quit: Computer has gone to sleep.]
<pandawarrior>
shevy2: yeah
<libc>
I'm setting up a new rails application on my server but bundler always fails part way through checking for dependencies. I can install the missing gem and create the app again, but it'll fail on a different dependency. Is there a way to install *all* of the required gems at once so I don't have to keep doing this?
<MrZYX>
`bundle install` the error message should tell you that
<pandawarrior>
shevy2: is it some form of recursion?
ravster has joined #ruby
Mon_Ouie has quit [Read error: No route to host]
Banistergalaxy has quit [Ping timeout: 256 seconds]
<fryguy>
so it's a permission error, not a ruby error
<fryguy>
you used sudo at some point in time when you probably shouldn't have
<MrZYX>
bundler should automatically call sudo if it's available
<fryguy>
you could sudo bundle I guess
<MrZYX>
last time I was in an environment that required that, it did at least
zekefast has joined #ruby
<libc>
strange, in that case the permission error is accurate
<libc>
in the others I was seeing the file it referred to wasn't there
marcdel has joined #ruby
<libc>
I did install the mysql gem using sudo as directed by the guide I was following though
<shevy2>
pandawarrior: recursion? what do you mean, and where do you mean that?
<fryguy>
libc: you should consider using rbenv instead
<libc>
fryguy: what does that do?
jovy88_ has quit [Read error: Connection reset by peer]
<MrZYX>
gets your whole ruby installation to the user level so you don't have to worry about permissions
<pandawarrior>
shevy2: The alias keyword creates a new name for an existing method.
<pandawarrior>
so that we can refer to it as either write or old_write. Then we redefine the write method,
<pandawarrior>
In the preceding code, we start by creating an alias for the original write method,
<pandawarrior>
but— critically—old_write continues to point to the original definition."
<pandawarrior>
sounds like it's calling itself more than once?
<pandawarrior>
probably completely wrong but I'm just not getting it
nhhagen has joined #ruby
krombr has quit [Quit: krombr]
jovy88_ has joined #ruby
<MrZYX>
it's calling a different method, don't confuse the name you give to something and the actual code it's executing
<MrZYX>
you're calling the code that was previously known as the name you're redefining, but it's different code
samuel02 has joined #ruby
<pandawarrior>
MrZYX: are you talking to me?
Banistergalaxy has joined #ruby
<MrZYX>
yes
thebastl has quit [Remote host closed the connection]
<pandawarrior>
ah ok
mercwithamouth has quit [Ping timeout: 276 seconds]
rdg has quit [Quit: ttfn]
<pandawarrior>
but it's calling the same method but by a different, aliased name, no?
<MrZYX>
I'd define recursion as code calling, directly or indirectly, itself
kf8a has joined #ruby
<MrZYX>
I'd tend to say no, because it's different code. Names are just names, they're not relevant
<pandawarrior>
...
monkegjinni has joined #ruby
<MrZYX>
for the computer, names are for you
<pandawarrior>
right
<MrZYX>
recursion is something the computer does
<pandawarrior>
but the example, how is that a decorator pattern?
Proshot has joined #ruby
<MrZYX>
I'm not sure tbh
<pandawarrior>
it's not doing anything different
<pandawarrior>
umm
<pandawarrior>
ok
<MrZYX>
well, it decorates the original method
<MrZYX>
I'm not sure why he doesn't just use super in this case
<MrZYX>
you need to take this from a client (caller) side
vlad_starkov has joined #ruby
LennyLinux has joined #ruby
<pandawarrior>
so when old_wrte_line gets called it calls the original write_line
<pandawarrior>
so yeah, super
<MrZYX>
from the callers perspective you're still calling the same method as before, but it's decorated
<pandawarrior>
right
monkegjinni has quit [Read error: No route to host]
monkegjinni has joined #ruby
emmanuelux has joined #ruby
<shevy2>
pandawarrior: the alias just kept a copy to the old method, you could now remove the old method, and the aliased name would still work
Matt has joined #ruby
<pandawarrior>
okay
Matt is now known as Guest88885
<shevy2>
but I never saw someone use class << x on an object to just modify it, in fact, I rarely see any real ruby code needing that at all
<pandawarrior>
but why is this cool/good or useful
<shevy2>
to use aliases? they give you flexibility when you need it
<shevy2>
it's a feature. you don't have to use it
<shevy2>
I also don't know of a lot of ruby code out there that must use alias on an old method, then remove the old method either
<MrZYX>
I wouldn't implement it this way but with wrapper objects, but it's cool because you can inject code without modifying the caller or the code you're decorating
<pandawarrior>
have you ever used alias? any best times to use it?
<shevy2>
I think in ruby often people just use what is available, without needing it
solidus-lake has joined #ruby
<shevy2>
pandawarrior: yes, I use alias all the time
<solidus-lake>
how do i remove the begining of a word
<solidus-lake>
i want to remove /$video /
<solidus-lake>
from a string
<solidus-lake>
and i find no string methods to do that
<solidus-lake>
do i really have to go to an index?
<hoelzro>
solidus-lake: gsub?
<shevy2>
pandawarrior: I use it on classes years later when I use it from a different API perspective, and the way to call methods makes sense with the new name
<tard>
just q question is this: a=1 if not b equal to: a=1 unles b ?
<tard>
*unless
<MrZYX>
yes
<tard>
MrZYX: thank you ?
<tard>
and you
<tard>
and
<tard>
what is better ?
<tard>
which option?
<MrZYX>
I think unless is generally prefered
<tard>
ok thank you :)
<MrZYX>
requires one step less in most peoples minds
<tard>
nice thank you
shock_one has quit [Ping timeout: 252 seconds]
davetherat has quit [Ping timeout: 256 seconds]
pinpin404 has quit [Ping timeout: 246 seconds]
ilpuccio has joined #ruby
Raydiation has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
<LennyLinux>
Noob question: in production is usually the spec folder kept as part of the app (in the case of a web app maybe) ?
<Raydiation>
hi is there a good comparison between python and ruby? personally i like python but i try to get a friend into programming and i think ruby/python is kind of a personal taste decision :)
dxtry has quit [Remote host closed the connection]
<LennyLinux>
Raydiation: have you tried to google for it?
<Raydiation>
LennyLinux: yes
<canton7>
Raydiation, http://hyperpolyglot.org/scripting is extremely superficial, and inaccurate in places, but worth a glance bearing these in mind
dxtry has joined #ruby
h8R has quit [Ping timeout: 248 seconds]
<Raydiation>
canton7: thanks
travisjeffery has joined #ruby
curtis has quit [Remote host closed the connection]
<canton7>
e.g. all the `include Math` rubbish - no-one would actually do that :P
tard has quit [Ping timeout: 264 seconds]
ossareh has quit [Ping timeout: 255 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
sambao21 has joined #ruby
robottinosino has quit [Quit: WeeChat 0.4.0]
sambao21 has quit [Client Quit]
pcarrier_ has joined #ruby
<LennyLinux>
Related to my previous question, in your opinion, is adding the spec group examples to the module of the class you're testing a good thing?
ChronocityLC has joined #ruby
mklappstuhl has joined #ruby
dxtry has quit [Client Quit]
jamesaxl has joined #ruby
travisjeffery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
osvico has quit [Ping timeout: 256 seconds]
freerobby1 has quit [Quit: Leaving.]
marcdel has quit [Read error: Connection reset by peer]
Hanmac1 is now known as Hanmac
sambao21 has joined #ruby
ChronocityLC has quit [Ping timeout: 252 seconds]
kf8a has quit [Quit: Computer has gone to sleep.]
osvico has joined #ruby
marcdel_ has joined #ruby
zekefast1 has joined #ruby
pandawarrior has joined #ruby
pandawarrior has quit [Client Quit]
Azulinho has quit [Ping timeout: 264 seconds]
zekefast1 has quit [Client Quit]
pinage404 has joined #ruby
dxtry has joined #ruby
casheew has quit [Read error: Connection reset by peer]
baks has quit [Quit: Bye.]
zekefast1 has joined #ruby
casheew has joined #ruby
zekefast has quit [Ping timeout: 264 seconds]
nhhagen has joined #ruby
sambao21_ has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
sambao21_ is now known as sambao21
chipotle_ has joined #ruby
banister`tv has joined #ruby
havenwood has joined #ruby
Michae___ has quit [Remote host closed the connection]
Michae___ has joined #ruby
sambao21 has quit [Ping timeout: 264 seconds]
Nisstyre has joined #ruby
Xeago has quit [Remote host closed the connection]
jaimef has quit [Excess Flood]
bluOxigen has quit [Ping timeout: 264 seconds]
arya has quit [Ping timeout: 248 seconds]
mklappstuhl has quit [Remote host closed the connection]
chessguy_ has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
pinage404 has quit [Quit: No Ping reply in 180 seconds.]
workmad3 has joined #ruby
pinage404 has joined #ruby
jaimef has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
osvico has quit [Ping timeout: 260 seconds]
wmoxam has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
Michae___ has quit [Remote host closed the connection]
Michae___ has joined #ruby
heath is now known as data_scientist
data_scientist is now known as data_astronaut
cheese1756 has quit [Ping timeout: 256 seconds]
kristofers has quit []
data_astronaut is now known as heath
Z_Mass has joined #ruby
nhhagen has quit [Remote host closed the connection]
brianpWins has joined #ruby
cheese1756 has joined #ruby
synthetix has joined #ruby
Azulinho has joined #ruby
mercwithamouth has joined #ruby
wmoxam has quit [Ping timeout: 255 seconds]
freerobby has joined #ruby
pinage404 has quit [Quit: No Ping reply in 180 seconds.]
synthetix has quit [Remote host closed the connection]
InFlames has quit [Quit: This computer has gone to sleep]
pinage404 has joined #ruby
Swarley__ has joined #ruby
malte_ has quit [Quit: malte_]
malte_ has joined #ruby
ToApolytoXaos has quit [Quit: Leaving]
InFlames has joined #ruby
h8R has joined #ruby
skattyadz has joined #ruby
d2dchat has joined #ruby
jan1337z is now known as Jan
k610 has quit [Ping timeout: 245 seconds]
Jan is now known as Guest53120
sambao21 has joined #ruby
Azulinho has quit [Ping timeout: 276 seconds]
Guest53120 is now known as jan1337z
dxtry has quit [Remote host closed the connection]
chipotle_ has quit [Quit: cya]
freerobby has quit [Ping timeout: 255 seconds]
JimmyNeutron has joined #ruby
Swarley__ has quit [Quit: Leaving]
atno has joined #ruby
Michae___ is now known as Johnson
tockitj has quit [Ping timeout: 256 seconds]
whowantstolivefo has quit [Quit: quit]
pinage404 has quit [Quit: No Ping reply in 210 seconds.]
pinage404 has joined #ruby
<ritek>
is it really necessary to add "require 'bundler/setup'" to a project that uses bundler (Gemfile, Gemfile.lock)?
<MrZYX>
only if you want to force it's usage
<ritek>
MrZYX: for example?
<MrZYX>
you can as well prefix all commands with bundle exec which basically does the same thing
<MrZYX>
but then it works as well without bundler and you get the most recent versions of the installed gems
<ritek>
MrZYX: got it, thanks!
nplusp has quit [Ping timeout: 246 seconds]
JimmyNeutron has quit [Quit: Leaving]
MattRB has quit [Quit: This computer has gone to sleep]
skattyadz has quit [Quit: skattyadz]
solidus-lake has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
thufir_ has quit [Quit: Leaving.]
ossareh has joined #ruby
skattyadz has joined #ruby
arya has joined #ruby
Bry8Star3 has quit [Quit: EliteBNC free bnc service. http://elitebnc.org - be a part of the Elite!]
v0n has joined #ruby
Bry8Star3 has joined #ruby
atno has quit [Remote host closed the connection]
cofin has joined #ruby
lkba has joined #ruby
solidus-lake has quit [Quit: Leaving.]
Matt has joined #ruby
ossareh has quit [Ping timeout: 255 seconds]
Matt is now known as Guest36887
backjlack has quit [Remote host closed the connection]
zekefast1 has quit [Quit: Leaving.]
codecop has quit [Remote host closed the connection]
mixel has quit [Quit: mixel]
backjlack has joined #ruby
Bry8Star3 has quit [Excess Flood]
<pskosinski>
class Car; @@color = red; def get_color; @@color; end; end <= Why can I initialize like this class variables but not instance variables…?
<Spooner>
ritek, You can also use: require "bundler"; Bundler.require :default
workmad3 has quit [Ping timeout: 260 seconds]
<Spooner>
Rather than requiring all the gems separately.
backjlack has quit [Remote host closed the connection]
<Spooner>
pskosinski, Because the class exists when the code is run. You do the same in an instance's initialize.
spacemud has quit [Ping timeout: 245 seconds]
arya has quit [Ping timeout: 264 seconds]
<Spooner>
pskosinski, But we don't use @@cvars any more. Look up "class instance variables".
ilpuccio has quit [Quit: This computer has gone to sleep]
thone has joined #ruby
backjlack has joined #ruby
rakl has joined #ruby
thone_ has quit [Ping timeout: 252 seconds]
slash_nick has quit [Ping timeout: 248 seconds]
<ritek>
Spooner: so using: require 'bundler'; Bundler.require :default in my main Ruby file is the same as require 'foo'; require 'bar' .... ?
<ritek>
where 'foo' and 'bar' are defined in the Gemfile
<ritek>
?
Johnson has quit [Remote host closed the connection]
banister`tv has quit [Ping timeout: 245 seconds]
InFlames has quit [Quit: This computer has gone to sleep]
<Spooner>
ritek assuming that tfoo and bar are in the outer scope of the Gemfile (that is, not inside a specific #group)
wildcard1 is now known as wildcard0
epta_ has quit [Quit: leaving]
brotatos has joined #ruby
epta has joined #ruby
<ritek>
Spooner: I see, thanks for the info!
<Spooner>
require 'bundler/setup' just ensures that _only_ the gems in the Gemfile are available (and only at the correct versions).
bean has joined #ruby
xardas has quit [Ping timeout: 245 seconds]
robottinosino has joined #ruby
<ritek>
interesting
arya has joined #ruby
kirun has quit [Quit: Client exiting]
Johnson has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
mlue_ is now known as mlue
mlue has quit [Changing host]
mlue has joined #ruby
<pskosinski>
Spooner: So simply every @var inside a method will be instance variable and if not in any method then class variable…? So to access a class variable inside an instance method I need to use self.class.var?
<pskosinski>
Well, will be @@var dropped? Because if not, in case of my simple scripts, @@var looks easier…
solidus-lake has joined #ruby
<Spooner>
pskosinski, I doubt it will be removed. In most cases, it works just as well.
icecandy has quit [Remote host closed the connection]
<pskosinski>
ok, thank you :)
brianpWins has quit [Quit: brianpWins]
icecandy has joined #ruby
<taec>
If I use have an instance variable of @name, have attr_accessor :name defined in my class but I define def name(arg) [ note: that overrides the default getter ], is there any way to access @name outside of the class aside from using instance_variable_get ?
<taec>
s/use//
<Spooner>
Nope. There can only be one method with a specific name.
<MrZYX>
.instance_eval { @name }
arya has quit [Ping timeout: 248 seconds]
<MrZYX>
but no reason to use that over instance_variable_get
<Spooner>
taec, Don't define name(arg) and you'll be fine ;)
<MrZYX>
or alias the old one
rgrinberg has joined #ruby
<MrZYX>
or get a better name for the overriding one
<taec>
Yeh, I defined that because I'm creating a DSL like syntax so I can say. MyClass do; name "blah"; end ... wasn't until afterwards I realised the consequences on conventions for getters. Eek
<MrZYX>
does it have to accept nil values?
skattyadz has quit [Quit: skattyadz]
<Spooner>
You could def name(arg=nil); arg ? @arg = arg : @arg; end
icecandy has quit [Ping timeout: 276 seconds]
<Spooner>
I've used a syntax like that in config_leaf
skattyadz has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
Matriks has quit [Remote host closed the connection]
<taec>
Yeh, that means rewriting every getter/setter - definitely considering it. Might be easier to define get_* dynamically
tylersmith has quit [Remote host closed the connection]
nhhagen has joined #ruby
Sicp has joined #ruby
<Spooner>
You could just use instance_eval too, but then you expose a lot of things (private methods and instance vars).
solidus-lake has quit [Quit: Leaving.]
<MrZYX>
another approach is to do a config object that does _nothing_ except storing configuration, defie a nice [] for it and define delegators in your main DSL class and instance_eval inside the config object
spacemud has joined #ruby
<Sicp>
say I have a stack that has abbc and I say "while @stack[-1] != 'b' @stack.pop", would there be any confusion as to having 2 b's?
osvico has joined #ruby
<Sicp>
won't it have to stop at the first occurrence of a 'b'?
<Spooner>
That is what config_leaf does. Gives you a wrapper for a "full" class.
<MrZYX>
Spooner: nice, your readme lacks ```ruby though ;)
<MrZYX>
(and ```bash)
Bry8Star3 has joined #ruby
zigomir_ has quit [Ping timeout: 246 seconds]
<Spooner>
Oh, good point :$
<apeiros>
Sicp: yes, that would stop at the first b
arya has joined #ruby
<Sicp>
naturally..
<apeiros>
or
<Spooner>
Not sure I care about bash highlighting though!
<MrZYX>
you should!
<apeiros>
assuming you meant ['a', 'b', 'b', 'c'], not 'abbc' (as there's no String#pop)
io2 has quit []
robbyoconnor has joined #ruby
<Sicp>
no I meant a stack, yea
teclator has quit [Ping timeout: 260 seconds]
freerobby has joined #ruby
sambao21 has joined #ruby
<Sicp>
I mean of course it's going to be what is naturally expected, it's just that I am wondering now since I have really looked at its behavior elsewhere and it's fine, yet in this case I have it just won't pop
nhhagen has quit [Ping timeout: 264 seconds]
monkegji_ has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
sayan has quit [Quit: Leaving]
<Spooner>
MrZYX, There you go. Don't say I never did anything for you!
<MrZYX>
:)
osvico has quit [Ping timeout: 248 seconds]
<MrZYX>
a lot better, thanks
Rumsteak has quit [Quit: Rumsteak]
<taec>
Colours!
wargasm1 has joined #ruby
<Spooner>
MrZYX, Just don't complain about all my other READMEs *coughs*
arya has quit [Ping timeout: 245 seconds]
<MrZYX>
just don't mention them here ;D
solidus-lake has joined #ruby
solidus-lake has left #ruby [#ruby]
wargasm has quit [Ping timeout: 252 seconds]
osvico has joined #ruby
freerobby has quit [Ping timeout: 248 seconds]
Guest36887 is now known as MattRB
libc has quit [Quit: Leaving.]
agjacome has joined #ruby
arya has joined #ruby
arya has quit [Client Quit]
jimg has joined #ruby
arya has joined #ruby
fridim_ has quit [Ping timeout: 252 seconds]
mklappstuhl has quit [Remote host closed the connection]
m8 has quit [Quit: Sto andando via]
Spami has quit [Quit: This computer has gone to sleep]
eliasp has quit [Ping timeout: 256 seconds]
MattRB has quit [Quit: This computer has gone to sleep]
mklappstuhl has joined #ruby
kil0byte has quit [Remote host closed the connection]
Bry8Star3 has quit [Quit: EliteBNC free bnc service. http://elitebnc.org - be a part of the Elite!]
Sicp has quit [Ping timeout: 256 seconds]
pskosinski has quit [Ping timeout: 246 seconds]
tjbiddle has quit [Quit: tjbiddle]
Proshot has joined #ruby
ariedler has quit [Read error: Connection reset by peer]
ariedler has joined #ruby
blandflakes_ has quit [Ping timeout: 245 seconds]
mad_hatter_ has quit [Quit: Leaving.]
MattRB has joined #ruby
arya has quit [Ping timeout: 248 seconds]
blandflakes_ has joined #ruby
rgrinberg has quit [Quit: WeeChat 0.4.0]
jimg has quit [Remote host closed the connection]
nfk has quit [Quit: yawn]
pcarrier_ has quit [Ping timeout: 276 seconds]
wargasm1 has quit [Ping timeout: 264 seconds]
arya has joined #ruby
DonVitoCorleone has quit [Quit: Ojsaaaaaaaaaaaaaaaaaaaaaaa]
tiripamwe has quit [Ping timeout: 264 seconds]
eliasp has joined #ruby
pcarrier_ has joined #ruby
jbueza has joined #ruby
pipework has quit [Remote host closed the connection]
pipework has joined #ruby
freerobby has joined #ruby
Xeago has joined #ruby
lukekhamilton has quit [Ping timeout: 245 seconds]
pevjan has joined #ruby
thufir_ has joined #ruby
gstamp has joined #ruby
rickruby has quit [Remote host closed the connection]
staafl has joined #ruby
lukekhamilton has joined #ruby
Cultofmetatron has quit [Read error: Connection reset by peer]
malte_ has quit [Quit: malte_]
Cultofmetatron has joined #ruby
lukekhamilton has quit [Remote host closed the connection]
mfridh has joined #ruby
MrZYX is now known as MrZYX|off
pinage404 has quit [Read error: Connection reset by peer]
wargasm has joined #ruby
fivethre1o has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
jovy88_ has quit [Read error: Connection reset by peer]
emmanuelux has quit [Remote host closed the connection]
fivethreeo has quit [Ping timeout: 264 seconds]
tiripamwe has joined #ruby
v0n has quit [Ping timeout: 252 seconds]
jovy88_ has joined #ruby
havenwood has quit [Remote host closed the connection]
brotatos has quit [Quit: WeeChat 0.4.1-dev]
v0n has joined #ruby
maycon has quit [Ping timeout: 256 seconds]
agjacome has quit [Quit: leaving]
Mattix has quit [Ping timeout: 256 seconds]
katsrc has quit [Quit: leaving]
thufir_ has quit [Quit: Leaving.]
jan1337z has left #ruby ["Verlassend"]
thufir_ has joined #ruby
threesome has quit [Ping timeout: 245 seconds]
brotatos has joined #ruby
atno has joined #ruby
sepp2k1 has joined #ruby
mixel has joined #ruby
ipalaus has quit [Quit: Computer has gone to sleep.]
tylersmith has joined #ruby
DonVitoCorleone has joined #ruby
sepp2k has quit [Ping timeout: 248 seconds]
brotatos has quit [Client Quit]
Johnson has quit [Remote host closed the connection]
Johnson has joined #ruby
sivoais has quit [Quit: leaving]
thufir_ has quit [Quit: Leaving.]
sivoais has joined #ruby
thufir_ has joined #ruby
thufir_ has quit [Max SendQ exceeded]
thufir_ has joined #ruby
maycon has joined #ruby
maycon has joined #ruby
maycon has quit [Changing host]
thufir_ has quit [Max SendQ exceeded]
thufir_ has joined #ruby
tylersmith has quit [Ping timeout: 255 seconds]
Mattix has joined #ruby
thufir_ has quit [Max SendQ exceeded]
havenwood has joined #ruby
monkegji_ has quit [Remote host closed the connection]
roadt has joined #ruby
sivoais has quit [Ping timeout: 255 seconds]
Vivekananda has joined #ruby
sivoais has joined #ruby
thufir_ has joined #ruby
robert___ is now known as robert_
chrishunt has joined #ruby
Johnson has quit [Ping timeout: 252 seconds]
Guest36299 has quit [Remote host closed the connection]
d11wtq_ has quit [Ping timeout: 245 seconds]
adit has joined #ruby
ravster1 has left #ruby [#ruby]
adit is now known as Guest6060
bobbyz_ is now known as bobbyz
slainer6_ has quit [Remote host closed the connection]
Guest6060 has quit [Ping timeout: 268 seconds]
arya has quit [Ping timeout: 248 seconds]
kf8a has joined #ruby
Johnson has joined #ruby
cofin has quit [Ping timeout: 264 seconds]
predator117 has quit [Ping timeout: 256 seconds]
hadees has quit [Read error: Operation timed out]
arya has joined #ruby
LennyLinux has quit [Remote host closed the connection]
hadees has joined #ruby
Ripp__ has joined #ruby
hadees has left #ruby [#ruby]
timkohrumel has joined #ruby
predator117 has joined #ruby
kil0byte has joined #ruby
pevjan has quit [Read error: Connection reset by peer]
pevjan_ has joined #ruby
idkazuma has joined #ruby
pevjan_ has quit [Read error: Connection reset by peer]