fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
MissionCritical has quit [Read error: Connection reset by peer]
theRoUS has quit [Quit: Leaving]
mrsolo has quit [Quit: Leaving]
kenichi has quit [Remote host closed the connection]
greggawatt has left #ruby [#ruby]
dr_diamond has quit [Ping timeout: 264 seconds]
Spooner_ has quit [Ping timeout: 255 seconds]
ckrailo has quit [Quit: Computer has gone to sleep.]
bglusman has joined #ruby
beneggett has quit [Ping timeout: 252 seconds]
benson has quit [Remote host closed the connection]
nedbat_ is now known as nedbat
Nanuq has quit [Ping timeout: 245 seconds]
dr_diamond has joined #ruby
dr_diamond has quit [Client Quit]
Vert has joined #ruby
Vert has quit [Read error: Connection reset by peer]
adeponte has quit [Remote host closed the connection]
jvdz has joined #ruby
beneggett has joined #ruby
jimeh has quit [Ping timeout: 272 seconds]
ianbrandt has quit [Quit: ianbrandt]
prometheus has quit [Ping timeout: 240 seconds]
MissionCritical has joined #ruby
tewecske has quit [Quit: Leaving.]
davidcelis has quit [Quit: K-Lined.]
avdotia has quit [Quit: Saliendo]
clocKwize_ has joined #ruby
manizzle has quit [Ping timeout: 264 seconds]
manizzle has joined #ruby
emmanuelux has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
jimeh has joined #ruby
hunglin has joined #ruby
pashamur has joined #ruby
_bart has quit [Quit: _bart]
aces1up has joined #ruby
khakimov has joined #ruby
cmake is now known as help2man
ken_barber1 has joined #ruby
bglusman has quit [Remote host closed the connection]
manizzle has quit [Ping timeout: 252 seconds]
bglusman has joined #ruby
manizzle has joined #ruby
aces1up has quit [Client Quit]
khakimov has quit [Client Quit]
ken_barber has quit [Ping timeout: 246 seconds]
jimeh has quit [Ping timeout: 240 seconds]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
adamkittelson has quit [Ping timeout: 246 seconds]
hsbt is now known as hsbt_away
ddouglas has quit [Ping timeout: 240 seconds]
indian has quit [Ping timeout: 255 seconds]
bglusman has quit [Ping timeout: 264 seconds]
tommyvyo has joined #ruby
mmealling has quit [Ping timeout: 276 seconds]
hsbt_away is now known as hsbt
ciopte7 has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
mmealling has joined #ruby
clocKwize has joined #ruby
<Gurpartap> what exactly is exciting about celluloid?
shadoi has quit [Quit: Leaving.]
levieraf has quit [Remote host closed the connection]
clocKwize_ has quit [Ping timeout: 250 seconds]
yxhuvud has quit [Ping timeout: 250 seconds]
dankest_ has quit [Quit: Linkinus - http://linkinus.com]
josefig has quit [Quit: Leaving]
replore_ has joined #ruby
seanstickle has joined #ruby
ciopte7 has quit [Quit: ciopte7]
beakerma_ has quit [Remote host closed the connection]
ephemerian has left #ruby [#ruby]
sent-hil has joined #ruby
ph^ has quit [Remote host closed the connection]
sent-hil has quit [Remote host closed the connection]
shadoi has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
shadoi has quit [Read error: Connection reset by peer]
shadoi has joined #ruby
akem has quit [Read error: Connection timed out]
cobragoat has joined #ruby
akem has joined #ruby
ciopte7 has joined #ruby
ciopte7 has quit [Client Quit]
fermion has joined #ruby
manizzle has quit [Ping timeout: 264 seconds]
manizzle has joined #ruby
Bosma has quit [Ping timeout: 252 seconds]
pdtpatrick_ has quit [Quit: pdtpatrick_]
khakimov has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
khakimov has quit [Ping timeout: 252 seconds]
jonathanwallace has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
jonatha__ has joined #ruby
fermion has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
manizzle has quit [Read error: Connection reset by peer]
cobragoat has quit [Ping timeout: 240 seconds]
manizzle has joined #ruby
freeayu has joined #ruby
khakimov has joined #ruby
jonathanwallace has quit [Ping timeout: 255 seconds]
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Richmond has joined #ruby
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ruby
khakimov has quit [Ping timeout: 264 seconds]
Hanmac1 has joined #ruby
savage- has quit [Ping timeout: 246 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
Hanmac has quit [Ping timeout: 264 seconds]
lorandi has joined #ruby
davidcelis has joined #ruby
seanstickle has quit [Quit: seanstickle]
two_OMind has quit [Remote host closed the connection]
manizzle has quit [Read error: Connection reset by peer]
tommyvyo has joined #ruby
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
adamkittelson has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
luckyruby has joined #ruby
brianpWins has joined #ruby
replore_ has quit [Read error: Connection reset by peer]
brianpWins has quit [Client Quit]
tonni has joined #ruby
Nanuq has joined #ruby
bradhe has quit [Remote host closed the connection]
aef has quit [Remote host closed the connection]
bradhe has joined #ruby
manizzle has joined #ruby
oscardelben has quit [Quit: oscardelben]
ozzloy has quit [Changing host]
ozzloy has joined #ruby
zeen has quit [Ping timeout: 252 seconds]
bradhe has quit [Remote host closed the connection]
chimkan has joined #ruby
bradhe has joined #ruby
banisterfiend has quit [Ping timeout: 264 seconds]
bradhe has quit [Remote host closed the connection]
SegFaultAX|work2 has quit [Quit: leaving]
sgronblom has joined #ruby
busybox42 has quit [Ping timeout: 248 seconds]
aef has joined #ruby
_justin has joined #ruby
jhunter has quit [Ping timeout: 264 seconds]
tomeo has joined #ruby
tonni has quit [Remote host closed the connection]
Rezwan has quit [Ping timeout: 276 seconds]
tonni has joined #ruby
savage- has joined #ruby
tonni has quit [Ping timeout: 246 seconds]
apok has quit [Read error: Operation timed out]
eggie5 has joined #ruby
manizzle has quit [Read error: No route to host]
codezombie has quit [Quit: Linkinus - http://linkinus.com]
luxdormiens has joined #ruby
fabioboris has joined #ruby
luxdormiens has left #ruby [#ruby]
pdtpatrick has quit [Quit: pdtpatrick]
heftig has quit [Ping timeout: 246 seconds]
<eggie5> i want to mirror a twitter user's account - what is the best data structure to do this
fabioboris has left #ruby [#ruby]
<eggie5> i want a model to show all the users friends and followers
<eggie5> and to be able to visualize when a particular user followed them or unfollowed them
<eggie5> what kind of data model would this require?
monkegjinni has quit [Remote host closed the connection]
_justin has quit [Ping timeout: 272 seconds]
darren has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
croz has quit [Excess Flood]
croz has joined #ruby
croz has quit [Max SendQ exceeded]
croz has joined #ruby
croz has quit [Max SendQ exceeded]
Axsuul has quit [Ping timeout: 246 seconds]
Rezwan has joined #ruby
croz has joined #ruby
croz has quit [Max SendQ exceeded]
liluo has joined #ruby
Axsuul has joined #ruby
croz has joined #ruby
croz has quit [Max SendQ exceeded]
croz has joined #ruby
croz has quit [Max SendQ exceeded]
croz has joined #ruby
charliesome has joined #ruby
chimkan has quit [Read error: Connection reset by peer]
shadoi has quit [Quit: Leaving.]
chimkan has joined #ruby
krz has quit [Quit: krz]
jonatha__ has quit [Remote host closed the connection]
heftig has joined #ruby
linoj has quit [Quit: linoj]
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
zeromodulus has joined #ruby
indian has joined #ruby
zeromodulus has quit [Remote host closed the connection]
ryanf has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
adamkittelson has quit [Remote host closed the connection]
adamkittelson has joined #ruby
shadoi has joined #ruby
pashamur has quit [Ping timeout: 245 seconds]
noganex has quit [Ping timeout: 246 seconds]
linoj has joined #ruby
BrokenCog has joined #ruby
noganex has joined #ruby
igotnolegs has joined #ruby
ken_barber1 has quit [Remote host closed the connection]
cakehero has joined #ruby
beneggett has quit [Ping timeout: 244 seconds]
niklasb has quit [Ping timeout: 252 seconds]
kevinbond has joined #ruby
kevinbond has left #ruby [#ruby]
beneggett has joined #ruby
yakko has joined #ruby
beneggett has quit [Client Quit]
cespare has quit [Quit: WeeChat 0.3.5]
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
cmaujean has quit [Ping timeout: 252 seconds]
devdazed has joined #ruby
ryanf has quit [Ping timeout: 252 seconds]
stefanp_ has quit [Ping timeout: 265 seconds]
shadoi has quit [Quit: Leaving.]
devdazed has quit [Client Quit]
dhodgkin has quit [Quit: WeeChat 0.3.5]
shadoi has joined #ruby
ryanf has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
rakunHo has joined #ruby
<rakunHo> !learn
balki has joined #ruby
amacgregor_osx has joined #ruby
uris has joined #ruby
shadoi has quit [Quit: Leaving.]
shadoi has joined #ruby
tomeo has quit [Remote host closed the connection]
fowl has quit [Remote host closed the connection]
cakehero has quit [Quit: Computer has gone to sleep.]
Tomasso has quit [Ping timeout: 256 seconds]
savage- has quit [Remote host closed the connection]
amacgregor_osx has quit [Remote host closed the connection]
BrokenCog has quit [Quit: leaving]
banisterfiend has joined #ruby
cakehero has joined #ruby
BrokenCog has joined #ruby
ohdae has left #ruby [#ruby]
luxdormiens has joined #ruby
luxdormiens_ has joined #ruby
shadoi has quit [Quit: Leaving.]
AlbireoX`Laptop has joined #ruby
Dreamer3 has joined #ruby
coderhut has joined #ruby
krz has joined #ruby
kvirani has quit [Remote host closed the connection]
luxdormiens has quit [Ping timeout: 272 seconds]
luxdormiens_ is now known as luxdormiens
cakehero has quit [Ping timeout: 244 seconds]
shadoi has joined #ruby
Araxia has quit [Quit: Araxia]
ZachBeta has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Ping timeout: 272 seconds]
coderhut has quit [Quit: Page closed]
ryanf has quit [Quit: broken pipes |||]
clocKwize has quit [Quit: clocKwize]
coderhut has joined #ruby
graspee has joined #ruby
justinmcp has joined #ruby
hunglin has quit [Quit: Leaving.]
tonni has joined #ruby
fowl has joined #ruby
tonni has quit [Ping timeout: 244 seconds]
freeayu has quit [Ping timeout: 240 seconds]
ryanf has joined #ruby
mmealling has quit [Quit: Leaving.]
Banistergalaxy has quit [Ping timeout: 264 seconds]
freeayu has joined #ruby
savage- has joined #ruby
Rezwan has quit [Read error: Connection reset by peer]
nedbat has quit [Ping timeout: 276 seconds]
chimkan has quit [Quit: chimkan]
beneggett has joined #ruby
uris has quit [Quit: leaving]
kidoz has quit [Quit: Ухожу я от вас]
fantazo has joined #ruby
luxdormiens has quit [Quit: luxdormiens]
shadoi has quit [Quit: Leaving.]
sailias has joined #ruby
_0riginaI is now known as _0riginaI|AFK
beneggett has quit [Ping timeout: 272 seconds]
jwmann has quit [Remote host closed the connection]
mxweas has joined #ruby
beneggett has joined #ruby
beneggett has quit [Ping timeout: 244 seconds]
Guest68799 is now known as mafs
mafs has quit [Changing host]
mafs has joined #ruby
eggie5 has quit [Quit: eggie5]
EricKamsky has quit [Quit: EricKamsky]
EricKamsky has joined #ruby
Dreamer3 has quit [Quit: Leaving...]
apok has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
noyb has joined #ruby
td123 has joined #ruby
rakunHo has quit [Remote host closed the connection]
pashamur has joined #ruby
ryanf has quit [Ping timeout: 240 seconds]
coderhut has quit [Quit: Page closed]
sailias has quit [Ping timeout: 272 seconds]
tommyvyo has joined #ruby
maxmmurphy has joined #ruby
adamkittelson has quit [Remote host closed the connection]
<odigity> why doesn't this work: def initialize(*moneys, pairs = {})
<odigity> can you not combine list and hash args?
adamkittelson has joined #ruby
tchebb1 has joined #ruby
headius has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
ananthakumaran has joined #ruby
<fowl> odigity: the array-capture has to be after normal args
tchebb has quit [Ping timeout: 272 seconds]
voodoofish has joined #ruby
adamkittelson has quit [Ping timeout: 250 seconds]
maxmmurphy has quit [Quit: maxmmurphy]
indian has quit [Ping timeout: 252 seconds]
indian has joined #ruby
sgronblo1 has joined #ruby
pashamur has quit [Ping timeout: 245 seconds]
sgronblom has quit [Ping timeout: 255 seconds]
linoj has quit [Quit: linoj]
tk__ has joined #ruby
lorandi has quit [Quit: Leaving]
shadoi has joined #ruby
xscc has joined #ruby
busybox42 has joined #ruby
minijupe has joined #ruby
williamcotton_ has joined #ruby
olrrai has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
williamcotton has quit [Ping timeout: 246 seconds]
williamcotton_ is now known as williamcotton
AlbireoX is now known as AlbireoX`Away
Ionic` has quit [Ping timeout: 255 seconds]
xscc has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
beneggett has joined #ruby
xscc has joined #ruby
zodiak has quit [Ping timeout: 272 seconds]
billiamii has joined #ruby
bradhe has joined #ruby
olrrai has quit [Ping timeout: 272 seconds]
apok_ has joined #ruby
kevinbond has joined #ruby
apok has quit [Ping timeout: 244 seconds]
apok_ is now known as apok
xscc has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
beneggett has quit [Ping timeout: 272 seconds]
tvw has joined #ruby
beneggett has joined #ruby
xscc has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
shadoi has quit [Quit: Leaving.]
bontaq has joined #ruby
ryanf has joined #ruby
xscc has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
xbob has joined #ruby
shadoi1 has joined #ruby
shadoi1 has quit [Client Quit]
headius has quit [Quit: headius]
apok has quit [Quit: apok]
bontaq has quit [Remote host closed the connection]
rippa has joined #ruby
Banistergalaxy has joined #ruby
darren has quit [Remote host closed the connection]
_0riginaI|AFK is now known as _0riginaI
minijupe has quit [Quit: minijupe]
Ionic` has joined #ruby
_justin has joined #ruby
Criztian has joined #ruby
Dreamer3 has joined #ruby
greasegum has joined #ruby
bradhe has quit [Remote host closed the connection]
Morkel has joined #ruby
tewecske has joined #ruby
tewecske has quit [Max SendQ exceeded]
Criztian has quit [Remote host closed the connection]
fantazo has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
bradhe has joined #ruby
Ionic` has quit [Ping timeout: 264 seconds]
bradhe has quit [Remote host closed the connection]
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
brianpWins has joined #ruby
manizzle has joined #ruby
manizzle has quit [Read error: No route to host]
und3f has joined #ruby
fowl has quit [Read error: Connection reset by peer]
mockra has quit [Remote host closed the connection]
fowl has joined #ruby
pdtpatrick has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
Cache_Money has joined #ruby
justinmcp has quit [Remote host closed the connection]
Richmond has quit [Quit: Leaving]
undersc0re has joined #ruby
ryanf has joined #ruby
kevinbond has quit [Quit: kevinbond]
banisterfiend has quit [Remote host closed the connection]
SCommette has joined #ruby
flip_digits has joined #ruby
<Gurpartap> enough? lol
klip has joined #ruby
* fowl dances dangerously close to Gurpartap
<flip_digits> does anyone know how to show the "exploded view" of the dom with chrome or firebug?
<Gurpartap> lol
<fowl> i'm poppin and lockin' ;)
<Paradox> flip_digits, what do you mean exploded?
SCommette has quit [Client Quit]
<flip_digits> it's like in a 3d view
<Gurpartap> flip_digits: "view source"
<Gurpartap> haha
<flip_digits> that you can rotate
<flip_digits> no not view souce
<Gurpartap> ?
<Gurpartap> so you can see what's behind source code/
<Gurpartap> :p
<Paradox> thats firefox only
<Paradox> there probably is a chrome extension
<Paradox> i dont use firefox
<Paradox> so im the wrong person to ask
* Gurpartap doesn't use firefox
<Paradox> sorry :(
<Gurpartap> sorry as well
<Gurpartap> :(
<Gurpartap> works™
<Gurpartap> left firefox for safari some 3 years ago
_justin has quit [Ping timeout: 272 seconds]
<Paradox> i left firefox for opera when 2.5 was a piece of shit
<Paradox> then very quickly jumped the boat to chrome
<Paradox> and have stayed there ever since
<Paradox> chrome web tools are better than firebug in so many cases
<Paradox> and the 3D view isn't good for much other than teaching
<graspee> i use chrome on windows and firefox on linux as they seem to have issues the other way round
greasegum has quit [Ping timeout: 272 seconds]
<Paradox> the only time i ever really use firefox anymore is for my Capybara tests
<Paradox> since i do development in chrome
<Paradox> i figure using FF for tests is good enough
flak has joined #ruby
tonni has joined #ruby
<Paradox> and thats only on CI
<Paradox> locally i run capybara with chrom
<Paradox> e
<Gurpartap> isn't the chrome's web tools inherited from webkit?
<Paradox> yup
<Gurpartap> does chrome add something new to it?
flak is now known as Guest12356
<Paradox> but google has pushed a fuckload of features into it
<Paradox> no
<Paradox> just google dumped so many features into it
<Gurpartap> lol?
CaptainJet has quit []
noyb has quit [Quit: Leaving.]
<Paradox> 1245 request spec tests takes about 4 minutes on chrome
<Paradox> 6 minutes on the latest firefox
<Paradox> and 14 minutes on 3.6
br4ndon has joined #ruby
rippa has quit [Ping timeout: 255 seconds]
<Paradox> hence
<Paradox> chrome > ff
<Paradox> or
<Paradox> to be more precise
<Paradox> chrome < ff in terms of time
<Paradox> lol
<Gurpartap> webkit++
xbob has quit [Quit: This computer has gone to sleep]
jarred has joined #ruby
yakko has quit [Remote host closed the connection]
cirwin has joined #ruby
Guest12356 has quit [Ping timeout: 250 seconds]
banisterfiend has joined #ruby
<Paradox> yup
Hanmac1 is now known as Hanmac
cj3kim has joined #ruby
mengu has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 246 seconds]
ddouglas has joined #ruby
_justin has joined #ruby
<ddouglas> NoMethodError: undefined method `string' when saving to a model...
<ddouglas> [help!]
<fowl> sounds railsy
<Paradox> #rails
<ddouglas> yes
<ddouglas> should I go to a rails chat room?
mockra has joined #ruby
<Paradox> and you have to provide more than the error message and an array with help!
<fowl> ddouglas: /join #rails
<ddouglas> thanks
mockra has quit [Remote host closed the connection]
ddouglas has quit [Client Quit]
yugui_zzz is now known as yugui
darren has joined #ruby
<Mon_Ouie> Isn't the rails channel #rubyonrails?
darren has quit [Ping timeout: 272 seconds]
<fowl> there are 3 i think
<sernin> it is, there is also a #rails channel, but the one you mentioned is the most popular
pskosinski has joined #ruby
tonni has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
mxweas has quit [Quit: Leaving...]
<ryanf> fowl: you might be thinking of #ror, but it just redirects
undersc0re has quit [Quit: *poof*]
Ethan has joined #ruby
<fowl> ah
_justin has quit [Ping timeout: 272 seconds]
<shevy> here I am!
brianpWins has quit [Quit: brianpWins]
<shevy> what have I been missing
banisterfiend has joined #ruby
<fowl> shevy: you missed a lively debate on quantum mnemonics
<Paradox> jjjjjjjjjjjjjjjjjs
brjannc has quit [Quit: Leaving]
tommyvyo has joined #ruby
asuka_ has quit [Ping timeout: 248 seconds]
ananthakumaran has quit [Ping timeout: 244 seconds]
mockra has joined #ruby
krz has quit [Quit: krz]
banisterfiend has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
asuka_ has joined #ruby
knightblader has quit [Ping timeout: 272 seconds]
_justin has joined #ruby
ananthakumaran has joined #ruby
Morkel has quit [Quit: Morkel]
mockra has quit [Ping timeout: 244 seconds]
xbob has joined #ruby
xbob has quit [Client Quit]
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<shevy> emerge --fetchonly gnumeric
<Paradox> ʕ •ᴥ•ʔ
dhruvasagar has joined #ruby
rbanffy has quit [Read error: Connection reset by peer]
xbob has joined #ruby
sent-hil has joined #ruby
<sent-hil> what's the right enumerator method if i want to delete some items from array and then return those items
<Paradox> reject
<sent-hil> right now i've to run two queries: select & delete_if with same block
knightblader has joined #ruby
<sent-hil> Paradox: that returns the deleted entries, but original array has deleted entries as well
jimeh has joined #ruby
<sent-hil> instead of the original array having the not deleted entries
<Paradox> sent-hil, reject! deletes them
<Paradox> erm
<Paradox> no
<Paradox> thats not the one you want
<Paradox> that returns the undeleted one
<sent-hil> yea
<Paradox> you probably want to run map or somesuch
<Paradox> no
<Paradox> map wouldnt do it
xbob has quit [Quit: This computer has gone to sleep]
<sent-hil> guess doing two queries isn't end of the world
<Paradox> just do map or something that modifies it in place
<sent-hil> ?
<Paradox> let me play with a few tihings
<sent-hil> sure
<fowl> sent-hil: you could use group_by first
<fowl> to separate the objects you want deleted
<sent-hil> isn't that still 2 queries
<sent-hil> fowl: ah, nice, thx
<Paradox> cant think of any
ramblex has joined #ruby
<sent-hil> Paradox: no prob, i like fowl's idea...thx for your time
<Paradox> select sort of works
<Paradox> a.select { |x| (4..6).includes? x }.each { |v| a.delete v }
<Paradox> but thats ugly
<sent-hil> yea
<Hanmac> a.delete_if {|x| (4..6).include?(x)}
<Paradox> doesn't return the array he wants
<Paradox> he wants an array of whats being deleted
<Paradox> not the final result
freeayu has quit [Ping timeout: 244 seconds]
ananthakumaran has quit [Ping timeout: 244 seconds]
sent-hil has quit [Remote host closed the connection]
freeayu has joined #ruby
ryanf has quit [Quit: broken pipes |||]
charliesome has quit [Remote host closed the connection]
charliesome has joined #ruby
workmad3 has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
Doobie has quit [Ping timeout: 272 seconds]
zeen has joined #ruby
undersc0re has joined #ruby
Doobie has joined #ruby
timonv has joined #ruby
Ethan has quit [Ping timeout: 255 seconds]
Doobie has quit [Ping timeout: 272 seconds]
mockra has joined #ruby
alek_b has joined #ruby
wallerdev has quit [Quit: wallerdev]
<shevy> dumdedum
cj3kim has quit [Quit: This computer has gone to sleep]
alek_b_ has quit [Ping timeout: 240 seconds]
mockra has quit [Ping timeout: 264 seconds]
ananthakumaran has joined #ruby
Doobie has joined #ruby
<_br_> deeedideee
davidpk has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 255 seconds]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
Emmanuel_Chanel has joined #ruby
* Hanmac says "fuga"
odinswand has joined #ruby
odinswand is now known as blanka
blanka is now known as odinswand
odinswand is now known as blanka
nari has joined #ruby
freeayu has quit [Ping timeout: 244 seconds]
Spooner has joined #ruby
cantonic has joined #ruby
graspee has quit [Quit: leaving]
timonv has quit [Remote host closed the connection]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
heftig has quit [Ping timeout: 246 seconds]
cirwin has quit [Ping timeout: 272 seconds]
blanka has quit [Quit: leaving]
heftig has joined #ruby
ramblex has quit [Ping timeout: 246 seconds]
Gab0 has quit [Remote host closed the connection]
heftig has quit [Ping timeout: 246 seconds]
lkba has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has quit [Ping timeout: 252 seconds]
d3vic3 has joined #ruby
tonni has joined #ruby
Russell^^ has joined #ruby
_justin has quit [Ping timeout: 264 seconds]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
hoelzro|away is now known as hoelzro
arturas has joined #ruby
br4ndon has joined #ruby
arturas has quit [Client Quit]
arturaz has joined #ruby
Araxia has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
beneggett has quit [Quit: Computer has gone to sleep.]
<shevy> hmmm
Araxia has quit [Client Quit]
<shevy> when I want 10 different classes to all have a @foo variable
<shevy> and this @foo variable defaults to false
<shevy> can I use a module for this? or must I subclass from a base class
<workmad3> either
<Hanmac> shevy; module ABC; attr_accessor :foo; end class XYZ; include ABC; end
<shevy> hmm no
<shevy> only a @foo variable
<shevy> is there an include hook? when module foo is included, do this and that ?
<workmad3> shevy: there is, but it's at the class level
mockra has joined #ruby
<workmad3> shevy: so it gets run when the module is included in a class
<Hanmac> module ABC; def initialize; @foo = false; end;end class XYZ; include ABC; end
Emmanuel_Chanel has joined #ruby
<workmad3> Hanmac: bad... you forgot to call 'super if defined?(super)' in your initialize :P
<shevy> whoa
<hoelzro> Hanmac: what if the consuming class defines initialize, though?
<shevy> how does that work?
<shevy> I mean that a module has a initialize method
<shevy> oh
<hoelzro> the class' initialize method takes precedence over the module's, right?
<shevy> ohhhhhhhh
<workmad3> shevy: when you include the module into the class, the class has in initialize instance method :)
<workmad3> hoelzro: yes
<shevy> yeah just realized that... hmm
<hoelzro> so that module wouldn't work if you defined your own initializer
<shevy> that's boggling the mind
<workmad3> hoelzro: unless your own initializer called 'super'
Speed has joined #ruby
<workmad3> shevy: I thought you hated modules though :P
und3f has quit [Quit: Leaving.]
<shevy> workmad3 yeah
<shevy> I think I hate subclassing even more though
mockra has quit [Ping timeout: 255 seconds]
<shevy> I find these two ways very anti-thematic to each other
<Hanmac> "ruby - full of things that shevy hate"
<shevy> somewhat yeah
tonni has quit [Remote host closed the connection]
yxhuvud has joined #ruby
<workmad3> I have stated in the past that including a module and inheriting a class have different meanings :P
<shevy> I think there could be a much simpler ruby version possible
<shevy> workmad3 when I think in terms of functionality, I feel a class is much more useful than a module
<shevy> when I subclass, I make use of the parent class functionality
<shevy> when I include a module, I make use of the module's functionality
vlad_starkov has joined #ruby
cantonic has quit [Read error: Connection timed out]
cantonic has joined #ruby
Know1edge has quit [Ping timeout: 255 seconds]
<shevy> I don't think ruby will change much anymore
Know1edge has joined #ruby
indian has quit [Ping timeout: 264 seconds]
<workmad3> shevy: remember though, you can only have one parent class for inheritance, but you can compose together as many modules as you want
<shevy> yeah, that has annoyed me a lot in the past
<shevy> I once wanted to make a biological tree-of-life
<shevy> but eventually it just sucked... class Monkey < Animal
<workmad3> shevy: ah... you've never had the fun of playing with multiple inheritance in C++ :P
<workmad3> shevy: and figuring out if you need to do virtual inheritance from X in order to safely inherit from Y, or if you're going to hit the 'diamond of death'...
<shevy> yeah, I learned only the very basics of C++
<shevy> when I saw templates, I knew it was not a language for me
<workmad3> templates are awesome :)
<workmad3> turing complete functional language that operates in the compiler...
pskosinski has quit [Ping timeout: 255 seconds]
<shevy> hmmmm
<workmad3> error messages for templates are awful... but templates themselves are great :)
timonv has joined #ruby
<shevy> hmmmmmmmm
<workmad3> shevy: still, back to the point... multiple inheritance brings a mass of nasty problems with it... plain single inheritance gives very limited scope... single inheritance with multiple interface inheritance would mean a) ruby would require a concept of a formal interface, and b) tends to (IMO) encourage non-DRY code because you need to re-implement similar features in many classes
<shevy> I must design the dumbest and simplest programming language that is still useful
<workmad3> shevy: and so ruby has single inheritance with multiple mixins, which allows code reuse like a full MI system, but without the same sort of dangers
<workmad3> shevy: but requires two separate concepts to handle inheritance and mixins
sebastorama has quit [Quit: Computer has gone to sleep.]
Emmanuel_Chanel has quit [Read error: Operation timed out]
<workmad3> shevy: the dumbest and simplest programming language that is still useful has been 'designed'... PHP :P
tagrudev has joined #ruby
tagrudev has quit [Client Quit]
xbob has joined #ruby
<shevy> hmm
<shevy> it should be elegant too
<shevy> I hate PHP syntax
<workmad3> shevy: you're moving out of 'dumb' territory, and probably a bit out of 'simple' territory now :)
<shevy> well simple in using it
<shevy> $foo = 'bla';
<shevy> I hate this
<shevy> $foo->blablabla();
<shevy> I hate this even more
<workmad3> shevy: ever considered learning smalltalk?
<shevy> workmad3, what I don't understand is... inheritance & mixin handling. Why can't this be integrated?
<shevy> only a bit. I hated its syntax :)
<shevy> I like the idea though
<workmad3> shevy: inheritance and mixins can be integrated... but you end up with full multiple inheritance
<shevy> syntax is the first thing I look at ... the Io language is nice, except that it uses that := or =: for assigning variables, that was killing me
<workmad3> shevy: which introduces more problems, and of a class that are harder to conceptualise and solve
kjellski has joined #ruby
ph^ has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<workmad3> shevy: python allows multiple inheritance... it can be a real PITA figuring out what the hell is going to be called in that, and they've actually got a setup that collapses the inheritance tree unambiguously
x0F_ is now known as x0F
<shevy> hmm
<shevy> I hate explicit self in python
nyuszika7h has quit [Ping timeout: 260 seconds]
<workmad3> shevy: everyone who isn't a pythonista does ;)
Cache_Money has quit [Ping timeout: 250 seconds]
<shevy> I am going to come up with a good idea to solve the multiple inheritance problem once and for all
<workmad3> shevy: ok... go and reinvent mixins :P
undersc0re is now known as Ethan
<workmad3> shevy: seriously though... inheritance in OO has been done to death, it isn't interesting anymore
<shevy> they all did it wrong so far
arturaz has quit [Remote host closed the connection]
<workmad3> shevy: you're assuming that a mechanism that would satisfy you exists
<workmad3> shevy: I'm pretty sure it doesn't
<workmad3> shevy: but I'm all for you attempting... start by delving into what inheritance actually is, the ins and outs of different inheritance systems... be prepared to use some C++, python and java while investigating
<shevy> ewwwwwwww
<shevy> java
<shevy> well, I'll dive deeper into python eventually
ananthakumaran has quit [Quit: Leaving.]
<Hanmac> ruby mixins are better then php interfaces :P
<shevy> pretty much everything is better than php
<workmad3> shevy: java is a lingua-franca in this sort of investigation unfortunately
<workmad3> shevy: and it's also a pretty good example of single-class, multiple-interface inheritance
<Hanmac> shevy your last line is quotable :P
vlad_starkov has quit [Remote host closed the connection]
<shevy> Hanmac one day I hope to have enough wisdom to have every of my lines become quote worthy :)
<workmad3> shevy: playing around with the OO and MOP stuff in common lisp is also a good way to learn more OO intricacies
pskosinski has joined #ruby
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
vlad_starkov has joined #ruby
ananthakumaran has joined #ruby
<Gurpartap> Hanmac++
<Gurpartap> compare this with what it would be if it was ruby : http://lithify.me/docs/manual/quickstart
<Gurpartap> it's a yet another framework in php
<Gurpartap> (figured from engineyard's blog)
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
tonni has joined #ruby
monkegjinni has joined #ruby
<Hanmac> Gurpartap, the site is feaky ... it does not work currect without javascript
workmad3 has quit [Read error: Operation timed out]
lkba has joined #ruby
mockra has joined #ruby
banisterfiend has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend` has joined #ruby
twinturbo has joined #ruby
folivora has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 255 seconds]
lkba has quit [Quit: Bye]
lkba has joined #ruby
Banistergalaxy has quit [Ping timeout: 272 seconds]
workmad3 has joined #ruby
Emmanuel_Chanel has joined #ruby
Russell^^ has quit [Quit: Russell^^]
niklasb has joined #ruby
Banistergalaxy has joined #ruby
darren has joined #ruby
areil has joined #ruby
workmad3 has quit [Read error: Operation timed out]
lxsameer has joined #ruby
lxsameer has quit [Max SendQ exceeded]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
tonni has quit [Remote host closed the connection]
br4ndon has joined #ruby
ananthakumaran has quit [Ping timeout: 244 seconds]
ananthakumaran has joined #ruby
naz has joined #ruby
hoelzro is now known as hoelzro|away
morfin has joined #ruby
mneorr has joined #ruby
morfin has left #ruby [#ruby]
darren has quit [Remote host closed the connection]
nedbat has joined #ruby
Morkel has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
arietis has joined #ruby
heftig has joined #ruby
lupine_85 has quit [Excess Flood]
mockra has joined #ruby
lupine_85 has joined #ruby
nateberkopec has joined #ruby
lkba has quit [Quit: Bye]
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
heftig has quit [Ping timeout: 246 seconds]
Spooner has quit [Read error: Connection reset by peer]
mockra has quit [Ping timeout: 255 seconds]
SeySayux has quit [Read error: Operation timed out]
workmad3 has joined #ruby
Spooner has joined #ruby
lkba has joined #ruby
bairui_ has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
_bairui has joined #ruby
bairui has quit [Ping timeout: 246 seconds]
jg has joined #ruby
<jg> hi all, why does File.exists?(soft_link_path) return false and how can i check for soft link existence?
_0riginaI has quit [Max SendQ exceeded]
bairui_ has quit [Ping timeout: 244 seconds]
_bairui is now known as bairui
<apeiros_> hu? i was going to answer that it is because no soft-link exists at soft_link_path, but it seems it indeed returns false even when it exists…
<apeiros_> I'm pretty sure that was not always the behavior…
ZachBeta has joined #ruby
<apeiros_> hm, 1.8.7 reports false too…
<jg> FileTest.symlink?(soft_link_path) seems to do the trick
<apeiros_> yeah, was going to say…
<jg> but nonetheless i would expect File.exists? to work
<apeiros_> but that's annoying behaviour… a symlink should be treated transparently as a file
<apeiros_> and sure enough, File.read(soft_link_path) will read the file…
ecksit has joined #ruby
<ecksit> morning
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
hunglin has joined #ruby
linoj has joined #ruby
jonathanwallace has joined #ruby
SeySayux has joined #ruby
heftig has joined #ruby
<ecksit> let's say i am writing a method to check if the variable the method is bring used on is a weekend. how do i get the value of the variable into my method?
<ecksit> i.e. t= Time.local(2012, 7, 28); t.is_weekend?
arkiver has joined #ruby
<banisterfiend`> ecksit: buy a basic book on ruby, it'll tell u that on about page 5 ;)
<ecksit> i have "the ruby programming language" by matz and davaid flanagan.
<Hanmac> he dont need to buy a book, he only need to read it
<apeiros_> ecksit: with t.is_weekend?, t is self. that means the method must be either in the Time class, or on t itself
_0riginaI has joined #ruby
<ecksit> actually, new idea. i will have a look at the friday? method :p
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
Gurpartap has quit [Quit: Page closed]
cloud|windoze has joined #ruby
Drager has left #ruby [#ruby]
liluo has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
zaydana has joined #ruby
ZachBeta has quit [Read error: Connection reset by peer]
ZachBeta has joined #ruby
linoj has quit [Quit: linoj]
<shevy> hehe
<ecksit> ok, still no luck.
tatsuya_o has joined #ruby
<Hanmac> class Time; def is_weekend?; saturday? || sunday?;end;end
<Hanmac> or something similar :P
<ecksit> good job spoiling my fun. didn't even think of thta :(
resure has joined #ruby
<ecksit> i was going through this giant idea of splitting strings getting the day, etc.
<apeiros_> there's also wday
<ecksit> fffuuuu
<ecksit> stupid awesomeness.
Kwpolska has quit [Quit: Lost terminal]
<ecksit> coming from php so i used to writing a class for simple shit like that
Kwpolska has joined #ruby
<apeiros_> and that with a class like Time… which is arguably one of the weaker spots of ruby
_0riginaI has quit [Ping timeout: 264 seconds]
<Hanmac> ecksit be happy that you are in ruby now ... you dont need to write php anymore :P
tatsuya_o has quit [Remote host closed the connection]
<ecksit> can you use ranges for methods like friday?...sunday?
ZachBeta has quit [Read error: Connection reset by peer]
<apeiros_> ecksit: won't make sense
<apeiros_> they return booleans
ZachBeta has joined #ruby
<ecksit> didn't think so :p
<apeiros_> and true..false - what do you want with that?
<ecksit> if they are all true, return a true
<Hanmac> (5..6).include?(t.wday)
<apeiros_> you can do t.wday.between?(4,6)
<apeiros_> or the other way round as Hanmac shows
<apeiros_> just be aware, sunday is 0
lxsameer has quit [Quit: Leaving]
<ecksit> yep, ta
<apeiros_> (you can easily shift that by doing (t.wday+6)%7 though
_0riginaI has joined #ruby
paulsherwood has joined #ruby
<Hanmac> or when you very want the symbols: [friday?,:saturday?,:sunday?].any? {|sym| t.send(sym)}
mneorr has quit [Quit: Leaving.]
tatsuya_o has joined #ruby
<paulsherwood> hi - i'm trying to build latest ruby on a basic Linux system, hitting "executable host ruby is required. use --with-baseruby option."
<paulsherwood> is there a way to build ruby without ruby installed?
mockra has joined #ruby
<Hanmac> you need ruby to build ruby :P
azm has quit [Ping timeout: 240 seconds]
<paulsherwood> i noticed http://bugs.ruby-lang.org/issues/3008 and tried the touch trick - things got further, but no cigar :)
timonv has quit [Ping timeout: 255 seconds]
<paulsherwood> Hanmac: i guess so :/
<apeiros_> paulsherwood: never did it… but doesn't --with-baseruby which it suggest do what you want?
<paulsherwood> apeiros_: possibly...
mockra has quit [Ping timeout: 272 seconds]
<ecksit> just tried loading a ruby class into my irb instance (worked fine) however i got an error "NoMethodError: private method `is_weekend?' called for 2012-07-28 00:00:00 +1000:Time"
<ecksit> my method definitely isn't marked as private though
<ecksit> NoMethodError: private method `is_weekend?' called for 2012-07-28 00:00:00 +1000:Time
<apeiros_> ecksit: where did you add the method? I mean in what file did you add it?
<ecksit> desktop
<ecksit> just created a file and loaded it (purely testing)
<apeiros_> care to paste the file? and how did you name and load the file?
Foxandxss has joined #ruby
<apeiros_> paste: gist.github.com, pastie.org or similar
Russell^^ has joined #ruby
jvdz has quit [Quit: jvdz]
<apeiros_> yeah, that's not how it works
<ecksit> ah, wait, should it be self.saturday?
<apeiros_> you added a toplevel method. those are always private and they are in *all* objects. not just time objects.
<apeiros_> you don't want that
<apeiros_> class Time« def is_weeek_end? …
<ecksit> ah, so you should extend the class?
<apeiros_> urgs? where does that « come from?
<apeiros_> class Time; def is_weeek_end? …
<paulsherwood> apeiros_: sadl/win 2
* paulsherwood fails in irssi
<apeiros_> ecksit: the technical term is 'reopen the class'
<paulsherwood> apeiros_: --with-baseruby is not a valid flag for make... am i missing something?
<ecksit> got off irssi because i kept typing in the wrong convo's.
<apeiros_> extend has its own meaning in ruby. see Object#extend
<ecksit> will look into it
jg has quit [Remote host closed the connection]
<paulsherwood> ecksit: what did you switch to? :)
<apeiros_> paulsherwood: I googled a bit. seems --with-baseruby is just there to tell ruby where ruby 1.8 is installed. sounds silly…
<ecksit> xchat
<zeen> i want to create a method that is just to do with my Company model called update_promoted which will read the table and update 2-3 records. what is the best method for this? i looked at modules but it said they should be used for none-model centric logic. i also tried putting def self.update_promoted in the Model but I'm not sure if that's correct. and advise would be great
<Mon_Ouie> btw, if condition then return true else return false is rather redundant — just the condition on its own does what you want
<paulsherwood> apeiros_: i guessed that might be the idea... doesn't work for this situation, though :)
<ecksit> mon_oule: trufact for now. i will need to handle the case later on though. thanks though.
timonv has joined #ruby
<ecksit> i love the ease of ruby. none of this inconsistent crap.
heftig has quit [Ping timeout: 246 seconds]
<ecksit> so for re-opening classes, should that be used whenever you plan on interacting classes like Time?
heftig has joined #ruby
Mon_Ouie has quit [Read error: Connection reset by peer]
<shevy> no
<shevy> use it rarely
<shevy> if you distribute projects, then you'd often have to distribute your custom modifications as well
<shevy> and that is annoying
Mon_Ouie has joined #ruby
<zeen> I'm new to RoR and would like to know if I'm going about this correctly.. http://pastebin.com/BNXie5J2
<shevy> the rails guys sit on #rubyonrails
<zeen> oh oops
<zeen> sorry wrong channel!
<zeen> my bad
<charliesome> zeen: in future, use gist, codepad or pastie instead. pastebin is awful
<zeen> twice i did that, sorry guys :)
<shevy> the code there looks a bit strange for ruby code
pskosinski has joined #ruby
<zeen> yaa i have no idea what i'm doing
<zeen> i'm just prodding things until they work and then rework them
akem has quit [Ping timeout: 272 seconds]
Ionic` has joined #ruby
<zeen> i'm from cakephp so had to reunderstand the model classes.. which in ror seem to be the correct way :)
Russell^^ has quit [Read error: Connection reset by peer]
tatsuya_o has quit [Remote host closed the connection]
Russell^^ has joined #ruby
<shevy> the first thing you should do is always get a clear picture of what you actually want to do
<shevy> and why
<shevy> you define a class method:
<shevy> def self.update_promoted
<shevy> and inside that class method, you ... try to call that same class method??
<shevy> self.update_all(:promoted => false)
<shevy> ah no
<shevy> you try to call update_all
kjellski has quit [Quit: This computer has gone to sleep]
<zeen> :)
<shevy> but you invoke that 3x times
<zeen> yaa, i see it as three queries
<zeen> 1 reset all previous, 2 promote last two, 3 promote mine
<zeen> i guess 2nd and 3rd could be togehter but i was planning to do something more with this logic later
nedbat has quit [Ping timeout: 250 seconds]
timonv has quit [Ping timeout: 240 seconds]
paradoja has joined #ruby
<ecksit> instead of re-opening a class, is applying singleton methods a better idea instead? so Time.is_weekend? instead of class Time ...
<charliesome> ecksit: adopt a "look but don't touch" policy on all classes that aren't yours
timonv has joined #ruby
<ecksit> so you would be suggesting creating all those within their own classes instead?
d3vic3 has quit [Quit: leaving]
nari has quit [Ping timeout: 272 seconds]
<Hanmac> charliesome in ruby there is nothing like in C++ the final ... and when the developer realy wants to protect the classes why didnt he freeze them? so its the class editors fault :P
Hien has quit [Quit: leaving]
<shevy> ecksit, it depends
zaydana has quit [Read error: Connection reset by peer]
zaydana_ has joined #ruby
<ecksit> Hanmac: in relation to the previous question, which way would you go?
<shevy> ecksit, if you think you are going to need something a few times, you can modify a core class
<shevy> then bundle those modifications in one file, or in one directory
<Hanmac> in this case, i would choise an instance method of Time
<shevy> you could try use a singleton method but for some reason it is not often used
niklasb has quit [Ping timeout: 246 seconds]
<charliesome> shevy: right but then developer B comes along and decides he also needs to modify a core class, uses the same method name and boom
<ecksit> docuementation charliesome?
<shevy> charliesome sure, that's what one gets when one has the feature of modifying core classes of a language. what would be needed is to restore to a tabula rasa state again cleanly
uris has joined #ruby
zaydana has joined #ruby
zaydana_ has quit [Read error: Connection reset by peer]
<charliesome> ecksit: i'm mainly thinking of patches made in two unrelated libraries
<ecksit> however, both of those methods are classified as re-opening a class though correct?
Hien has joined #ruby
Banistergalaxy has quit [Remote host closed the connection]
Hien has quit [Client Quit]
<shevy> class String; def foo; end; end
<shevy> this will always reopen
<shevy> whoever came last, wins
Hien has joined #ruby
timonv_ has joined #ruby
<Hanmac> charliesome do you use final in all of your C++ classes?
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
<charliesome> i rarely use c++
<Hanmac> or do you Freeze all your classes?
<shevy> I heard people from Mono project whine about this, they said they hate that modifications other devs can do fucks them up (or rather, can fuck them up)
<charliesome> no
<Hanmac> so you do not forbit modification in your classes but tell us we should do? ... you are like america
<charliesome> Hanmac: that analogy makes no sense
timonv has quit [Ping timeout: 264 seconds]
<charliesome> i don't forbid modification to my classes, but I'm saying it's a really bad idea
<charliesome> unless you can absolutely guarantee that you're the only one who's putting a certain method on a certain class, don't do it
liluo has joined #ruby
<charliesome> and definitely don't do it if you're developing a library
julio has joined #ruby
ecksit has quit [Quit: Laters.]
arkiver has quit [Ping timeout: 252 seconds]
liluo has quit [Remote host closed the connection]
<Hanmac> i use C macros in my libraries
pskosinski has joined #ruby
paradoja has quit [Ping timeout: 272 seconds]
tonni has joined #ruby
<banisterfiend`> charliesome: monkeypatches which fix bugs are OK IMO, also a monkeypatch that adds a feature which would be the exact same as someone else's monkeypatch is OK too IMO (i.e Object#meta or Object#singleton_class)
dagnachewa has joined #ruby
tatsuya has joined #ruby
resure has quit [Remote host closed the connection]
<banisterfiend`> charliesome: also monkeypatches which just add convenience methods to Object, where it doesnt matter too much if it's overwritten i would argue are OK too
resure has joined #ruby
<charliesome> banisterfiend`: yeah you're right, but monkey patches that go and add non-trivial functionality are a no-no in my book
<banisterfiend`> yeah
<banisterfiend`> they can be really annoying
workmad3 has joined #ruby
_justin has joined #ruby
mockra has joined #ruby
nari has joined #ruby
julio has quit [Ping timeout: 244 seconds]
timonv_ has quit [Ping timeout: 250 seconds]
macmartine has joined #ruby
akem has joined #ruby
mockra has quit [Ping timeout: 240 seconds]
<otters> cucumber's documentation is lousy
<Mon_Ouie> Pretty much the only kind of monkey patches I use in my code is methods that can be overriden by different classes to define custom behaviour
<Mon_Ouie> Kind of like Object#to_yaml
Tomasso has joined #ruby
phromo has joined #ruby
cloud|windoze has quit [Quit: Leaving.]
workmad3 has quit [Ping timeout: 244 seconds]
cantonic_ has joined #ruby
cantonic has quit [Read error: Operation timed out]
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
emmanuelux has joined #ruby
<otters> wtf
cantonic_ has quit [Ping timeout: 246 seconds]
<otters> I'm pretty sure it's impossible to define a username, password, and a port all at the same time when using Net::FTP
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
<otters> what the fuck
yugui is now known as yugui_zzz
krusty_ar has quit [Read error: Connection reset by peer]
Stalkr_ has joined #ruby
nedbat has joined #ruby
dr_diamond has joined #ruby
dr_diamond has quit [Changing host]
dr_diamond has joined #ruby
<otters> what do I require to get net/ftptls?
paradoja has joined #ruby
maxmmurphy has joined #ruby
<shevy> lol
<shevy> otter!
* shevy cuddles the otter
<shevy> never heard of ftptls before
<shevy> I dont think this is part of standard rbuy is it?
Russell^^ has quit [Quit: Russell^^]
<banisterfiend`> shevy: talk to me, like lovers do
<shevy> lol
<shevy> so who of you uses yaml config files for ruby projets?
<banisterfiend`> shevy: kyrylo does in pry-theme
beakerman has joined #ruby
twinturbo has quit [Quit: twinturbo]
<shevy> cool
<otters> waybe not
nateberkopec has quit [Quit: Leaving...]
ananthakumaran has quit [Quit: Leaving.]
ph^ has quit [Remote host closed the connection]
sepp2k has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
ph^ has joined #ruby
Dreamer3 has quit [Read error: Operation timed out]
kaichanvong has joined #ruby
maxmmurphy has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
Dreamer3 has joined #ruby
sailias has joined #ruby
workmad3 has joined #ruby
leoncamel has joined #ruby
beakerman has quit [Read error: Connection reset by peer]
zaydana has quit [Quit: zaydana]
beakerman has joined #ruby
leoncamel has quit [Client Quit]
dagnachewa has quit [Quit: Leaving]
mockra has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Ethan has quit [Ping timeout: 246 seconds]
_justin has quit [Ping timeout: 272 seconds]
nedbat has quit [Ping timeout: 244 seconds]
maxmmurphy has quit [Quit: maxmmurphy]
apeiros_ has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 264 seconds]
heftig has quit [Quit: leaving]
awarner has joined #ruby
hunglin has quit [Quit: Leaving.]
noyb has joined #ruby
heftig has joined #ruby
phromo has left #ruby [#ruby]
mockra has joined #ruby
<otters> one nice thing I have to say about ruby is that it's fantastic to be able to redefine everything in scope
_justin has joined #ruby
<shevy> ruby is poetry
<shevy> shell script writers have a hard time understanding that
<otters> need to completely change the functionality of a class? no problem!
<otters> just open it and define your own methods
shevy2 has joined #ruby
<knightblader> but be careful - monkey patching can be dangerous if you start redefining methods
emmanuelux has quit [Ping timeout: 252 seconds]
<otters> yeah
awarner has quit [Remote host closed the connection]
shevy has quit [Ping timeout: 246 seconds]
beneggett has joined #ruby
* Hanmac uses ducktyping and turn dragons into ducks
sailias has quit [Quit: Leaving.]
nedbat has joined #ruby
mucker has joined #ruby
resure has quit [Remote host closed the connection]
vjacob has joined #ruby
w400z has joined #ruby
dv310p3r has joined #ruby
hunglin has joined #ruby
jimeh has quit [Ping timeout: 240 seconds]
mockra has quit [Remote host closed the connection]
busybox42 has quit [Remote host closed the connection]
minijupe has joined #ruby
shevy2 is now known as shevy
lockweel has joined #ruby
fowl has quit [Read error: Connection reset by peer]
fowl has joined #ruby
mikepack has joined #ruby
strife25 has joined #ruby
kirun has joined #ruby
minijupe has quit [Quit: minijupe]
xbob has quit [Quit: Leaving]
kvirani has joined #ruby
xbob has joined #ruby
cakehero has joined #ruby
dv310p3r has quit [Quit: Leaving]
<Hanmac> did someone know about lite-c?
cakehero has quit [Client Quit]
w400z has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
hunglin has quit [Quit: Leaving.]
ananthakumaran has joined #ruby
kvirani has quit [Remote host closed the connection]
conor_ireland has quit [Quit: conor_ireland]
pashamur has joined #ruby
vjacob has quit [Quit: This computer has gone to sleep]
<shevy> no
nari has quit [Ping timeout: 250 seconds]
<shevy> what is that
jrajav has joined #ruby
dr_diamond has quit [Quit: Bye !]
conor_ireland has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
dv_ has quit [Read error: Connection reset by peer]
dv_ has joined #ruby
i0n has quit [Ping timeout: 252 seconds]
lockweel has quit [Ping timeout: 255 seconds]
quest88 has joined #ruby
ttilley_off is now known as ttilley
Cache_Money has joined #ruby
workmad3 has joined #ruby
jjbohn has joined #ruby
<Hanmac> shevy its an c derivate or something like that
adeponte has joined #ruby
kvirani has joined #ruby
Beoran__ has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
timonv has joined #ruby
Beoran_ has quit [Ping timeout: 252 seconds]
davidokner has joined #ruby
luckyruby has quit [Remote host closed the connection]
conor_ireland has quit [Quit: conor_ireland]
dankest has joined #ruby
i0n has joined #ruby
<davidokner> I'm trying to figure out the best way I could put "transfer from #{account_a.name} to #{account_b.name} is complete" in the Bank account example in the Pick Axe book. I want to add this feature.
<davidokner> Is there a method I could use?
PaciFisT has joined #ruby
<davidokner> It is on pg. 42 of the latest digital version of the Pick Axe book.
<Hanmac> what method?
beneggett has quit [Ping timeout: 244 seconds]
<davidokner> A method that will take the name of my variable and convert it to a string.
<shevy> davidokner hmm?
<shevy> def foo(i)
<shevy> return i.to_s
<shevy> end
<shevy> foo(your_variable_here)
<davidokner> to_s is the variable name?
<shevy> note that #{} in "" strings calls .to_s
<shevy> .to_s is a method name on class String objects
<shevy> and in other classes who want a string representation
ananthakumaran has quit [Quit: Leaving.]
<davidokner> to_s is not the contents of the variable?
<shevy> it is, in string form
<shevy> 1.to_s # => "1"
<davidokner> I don't want to the contents. I want the name of the variable.
VegetableSpoon has joined #ruby
<davidokner> That might not be the final best way to do it though.
<shevy> that info is lost
<davidokner> Ok
<shevy> x = 'foo'; call_method(x)
<shevy> perhaps you can somehow tap into the ruby internals or the parse tree or something
jrajav has quit [Quit: The best darkness is strange and surprising]
<davidokner> Do you know the example I'm talking about. Pg. 42 of Pick Axe bank example.
<davidokner> There is probably a better solution.
<shevy> I think I saw it once years ago
conor_ireland has joined #ruby
<davidokner> I should probably build the Account class out more.
adeponte has quit [Remote host closed the connection]
<davidokner> I'm going to start doing this.
conor_ireland has quit [Client Quit]
<davidokner> class Account
<davidokner> attr_accessor :balance
<davidokner> def initialize(balance, account_name)
<davidokner> @balance = balance
<davidokner> @account_name = account_name
<davidokner> end
reuf has joined #ruby
<shevy> and what is your aim?
<davidokner> I want to put the account names of a transaction when a transaction is completed.
<davidokner> I'm going to try adding an instance variable @account_name
<davidokner> That make sense
<shevy> dunno
<shevy> :)
<davidokner> I'm try some more.
<davidokner> That info would be lost though, once you pass the variable name, but when you create a variable, you would think there would be a method to get the string of the variable name?
<shevy> I do not think you can
<shevy> you also should not need it
<davidokner> That is probably not how it would be done anyway though, because you wouldn't be pulling that data from the variable name in the real world.
<shevy> the variable refers to your object
<davidokner> Right
<davidokner> I only thought of that because the data was hard coded into the program in the example.
<shevy> and your object holds the data that you need
<shevy> what does that even mean
<davidokner> In the real world it would be pulled from a database and I would store that into an instance variable int he Account class.
<shevy> just provide a way to query that data
<shevy> attr_reader :foo is the same as:
<shevy> def foo
<shevy> @foo
<shevy> end
<shevy> yeah davidokner
relix has quit [Quit: Connection closed for inactivity]
workmad3 has joined #ruby
<i0n> http://pastie.org/private/vkzbsnd2hmefb9bz8zwqda hi i have this zip method, im trying to get a list of all files its zipping up without success. I'm not sure the syntax to do this I guess.
<otters> at first I thought cucumber was dumb
<otters> but then I became addicted to making tests pass
rippa has joined #ruby
dankest has quit [Quit: Leaving...]
<davidcelis> cucumber is still dumb
<otters> too true
digitalcakestudi has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
chimkan has joined #ruby
Araxia has joined #ruby
<otters> when you spend time debugging your tests
workmad3 has quit [Ping timeout: 244 seconds]
wallerdev has joined #ruby
wallerdev has quit [Client Quit]
wallerdev has joined #ruby
dankest has joined #ruby
nateberkopec has joined #ruby
savage- has quit [Remote host closed the connection]
Hanmac has joined #ruby
VegetableSpoon has quit [Quit: Leaving]
uris has quit [Ping timeout: 246 seconds]
zemanel has quit [Quit: Remote hottie closed the connection]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
indian has joined #ruby
cornholioz has joined #ruby
<cornholioz> hey guys, why don't i see any output from running this code?
nikeita has joined #ruby
azm has quit [Ping timeout: 255 seconds]
<nikeita> hello
reuf has quit [Quit: Leaving]
<nikeita> the symbol :new is reserved in ruby?
jjbohn has quit [Quit: Leaving...]
<Mon_Ouie> cornholioz: def initalize <-- typo over here
<cornholioz> AHHHH, thank you
<Mon_Ouie> nikeita: There's no such thing as a reserved symbol. There are reserved names, but new isn't one of them.
SCommette has joined #ruby
<Mon_Ouie> Foo.new is a regular method call.
SCommette has quit [Client Quit]
chimkan has quit [Quit: chimkan]
THE_GFR|WORK has quit [Read error: Connection reset by peer]
<nikeita> someone can help…this code work for all other symbols except for :new
AlbireoX`Away is now known as AlbireoX
chimkan has joined #ruby
<Mon_Ouie> Saying that it doesn't work doesn't explain much
<nikeita> this line of code work for all symbols in the hasx ecept for the symbol :new self.send(opcode)
moon11 has joined #ruby
artOfWar_ has quit [Read error: Connection reset by peer]
<Mon_Ouie> You still didn't say explain what that means
<nikeita> opcode is nil
artOfWar has joined #ruby
<nikeita> you have looked at code?
jjbohn has joined #ruby
<nikeita> 1.cmd = cmd.to_sym
<nikeita> 2.                opcode = ( @@commands.has_key?(cmd) ? @@commands[cmd] : :unknown )
<Mon_Ouie> Well yes. And assuming @@commands didn't get changed, It means cmd.to_sym isn't :new.
SCommette has joined #ruby
zemanel has joined #ruby
<nikeita> something is weird whit this symbol
Nisstyre has quit [Quit: Leaving]
<nikeita> never min
<nikeita> d
<Hanmac> maybe the problem is the @@ ? do you use multible instances?
<nikeita> i was filtering command.length < 3
<nikeita> sorry
<nikeita> need a break
PaciFisT has quit [Quit: Leaving.]
SCommette has quit [Quit: SCommette]
sevvie has joined #ruby
blazes816 has joined #ruby
Knodi has joined #ruby
Knodi has left #ruby [#ruby]
brianpWins has joined #ruby
moon11 has quit [Quit: moon11]
moon11 has joined #ruby
Knodi has joined #ruby
azm has joined #ruby
nedbat has quit [Ping timeout: 276 seconds]
abdulkarim has joined #ruby
moon11 has quit [Client Quit]
conor_ireland has joined #ruby
greasegum has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
hunglin has joined #ruby
heftig has joined #ruby
cakehero has joined #ruby
apok has joined #ruby
kevinbond has joined #ruby
i0n has quit [Ping timeout: 246 seconds]
ini has joined #ruby
greasegum has quit [Ping timeout: 264 seconds]
_justin has quit [Ping timeout: 255 seconds]
nedbat has joined #ruby
awarner has joined #ruby
apok has quit [Quit: apok]
iniy has joined #ruby
<iniy> Hi .. is there any irc channel for ruby newbees
reuf has joined #ruby
<Hanmac> ... you are found it :P
<shevy> iniy we are all one family
<blazes816> i thought this was rockstars only...?
<shevy> as long as someone rubs my belly
<shevy> no
<shevy> rockstars are on #rubyonrails
<blazes816> oh man, then i'm in the wrong place!
<blazes816> #rails, cuz they don't actually need any help
<iniy> thanks! i just wanted to be around ppl learning ruby, i get a doubt a minute! :)
<Norrin> what is this meme about rails ppl being rockstars?
ini has quit [Ping timeout: 250 seconds]
<shevy> Norrin no idea. I think someone on the www started it once
<blazes816> Norrin: just a joke about how a large portion of developers lately act like dicks
<blazes816> by lately, I mean since math started
<Norrin> i guess i just don't know rails people or something
<blazes816> it was a big buzzword for a while that's dying out
<iniy> lol
<iniy> thanks shevy
awarner has quit [Remote host closed the connection]
<Norrin> actually i know two. and have no reason to think they're dicks. two very good friends…. basically the opposite of the meme
<iniy> it took me 10 hrs to find how to get 2 variables and do a simple math operation
<iniy> i mean there are a ton of lessons available, but practical tips is what i need
xorgnak has quit [Remote host closed the connection]
<blazes816> Norrin: it's a generalization. not a majority
conor_ireland has quit [Quit: conor_ireland]
<blazes816> hence it being a meme and not a serious issue
workmad3 has joined #ruby
<Norrin> must be an sf thing. my friends are east coast
<shevy> iniy, we are the hive brain here
hunglin has quit [Quit: Leaving.]
<shevy> math operations are in Math module
<shevy> Math.log10(10)
dagnachewa has joined #ruby
<shevy> Infinity = 1.0
<iniy> thanks
<shevy> lol scratch the last one
jbw has quit [Ping timeout: 246 seconds]
SCommette has joined #ruby
<shevy> Infinity = 1.0/0 # => Infinity
<shevy> now it's right
<blazes816> haha
<blazes816> PI = 3, because integers are faster
Knodi has quit [Quit: Knodi]
davidokner has quit [Ping timeout: 272 seconds]
areil has quit [Remote host closed the connection]
Chryson has joined #ruby
<shevy> lol
<shevy> can't deny that :)
awarner has joined #ruby
lkba has quit [Ping timeout: 272 seconds]
havenn has joined #ruby
tatsuya has quit [Remote host closed the connection]
ini has joined #ruby
dagnachewa has quit [Quit: Leaving]
iniy has quit [Ping timeout: 246 seconds]
awarner has quit [Remote host closed the connection]
lockweel has joined #ruby
SCommette has quit [Quit: SCommette]
tvw has quit [Remote host closed the connection]
jbw has joined #ruby
blazes816 has quit [Quit: Leaving]
sevvie has quit [Quit: sevvie]
br4ndon has quit [Ping timeout: 252 seconds]
k_89 has joined #ruby
nikeita has quit [Quit: sleep]
br4ndon has joined #ruby
davidokner has joined #ruby
dankest has quit [Quit: Linkinus - http://linkinus.com]
cantonic has joined #ruby
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
bluenemo has quit [Remote host closed the connection]
snearch has joined #ruby
tobago has joined #ruby
snearch has quit [Read error: Connection reset by peer]
vjacob has joined #ruby
greasegum has joined #ruby
vjacob has left #ruby [#ruby]
lkba has joined #ruby
cj3kim has joined #ruby
apok has joined #ruby
br4ndon has quit [Ping timeout: 252 seconds]
mucker has quit [Quit: leaving]
br4ndon has joined #ruby
CaptainJet has joined #ruby
ini has quit [Ping timeout: 246 seconds]
greasegum has quit [Ping timeout: 264 seconds]
br4ndon has quit [Ping timeout: 244 seconds]
sepp2k has quit [Ping timeout: 272 seconds]
sh4ring4n has joined #ruby
sh4ring4n has left #ruby ["Leaving"]
pskosinski has quit [Remote host closed the connection]
tatsuya has joined #ruby
snearch has joined #ruby
ProT-0-TypE has joined #ruby
drbawb has quit [Ping timeout: 240 seconds]
JetAway has joined #ruby
CaptainJet has quit [Disconnected by services]
JetAway is now known as CaptainJet
akem has quit [Read error: Operation timed out]
ThePicard has joined #ruby
LazyLucy has joined #ruby
<ThePicard> Hey all, is there a way to bind method calls to functions in ruby?
<ThePicard> like, in javascript you can do
<ThePicard> var id = document.getElementById.bind(document);
xorgnak has joined #ruby
<Mon_Ouie> I'm not sure what you mean
<Mon_Ouie> Firstly, ruby doesn't have "functions" — only methods
<ThePicard> Methods to other methods then, I suppose
<heftig> meth = foo.method(:bar)
<jarred> Are you asking if you can tell MRI, "When this method is called, call this other method!"
<ThePicard> jarred: yes!
<ThePicard> on a particular object though
<heftig> ThePicard: take a look at delegate.rb
<heftig> it's part of the standard library
<ThePicard> like, when this method is called, call the get method on a hash, or something
<heftig> def thismethod(*args); hash.get(*args); end
<Mon_Ouie> I'm assuming you also want to call the original implementation of that method? Or do you want to define a method that does only that?
azm has quit [Ping timeout: 240 seconds]
<xorgnak> ruby handles object creation through function very nicely actually. words = this is a string.split( )
sepp2k has joined #ruby
cj3kim has quit [Quit: Leaving]
<ThePicard> heftig: that results in two method calls, not one though
sepp2k has quit [Client Quit]
koshii has joined #ruby
<xorgnak> words.each { |w| puts w }
strife25 has joined #ruby
<xorgnak> it's handy.
greasegum has joined #ruby
<ThePicard> mhmm
Tomasso has quit [Ping timeout: 252 seconds]
<koshii> Hey do you guys mind the occasional newbie question in here, or is there a better place for that elsewhere?
<koshii> ...If I promise not to ask Rails questions ;-)
<xorgnak> and as far as I'm aware, object creation via function is faster and uses less memory.
<Mon_Ouie> Beginners questions are pretty common really — there's definitely no problem with that
williamcotton_ has joined #ruby
<Mon_Ouie> xorgnak: Faster than what?
<xorgnak> everyone's a newbie of one sort or another.
<koshii> xorgnak: Wise. :-)
williamcotton has quit [Ping timeout: 255 seconds]
williamcotton_ is now known as williamcotton
<Mon_Ouie> You can't create an object without calling a method in Ruby anyway
<ThePicard> i've looked at delegate
<xorgnak> faster than creating the boject through method calls. I watched some youtube thing on functional ruby.
<ThePicard> so then, there is no way of doing 'blah'.chars.map{|c| ahash[c]}
<ThePicard> without the block?
<Mon_Ouie> ThePicard: No. You can use method objects, but there's no real point in doing that.
<ThePicard> Mon_Ouie: what's a method object?
pskosinski has joined #ruby
<xorgnak> more like blah = chars.map {|c| ahash[c] } where chars is an array from a string that's been split into letters
dhruvasagar has quit [Ping timeout: 252 seconds]
<Mon_Ouie> (You could do &ahash.method(:[]) instead of the block, but the latter is more idiomatic and… well… clearer)
<xorgnak> what exactly are you trying to do?
<Mon_Ouie> xorgnak: No, "blah".chars returns an Enumerator on the String's characters.
<Mon_Ouie> (Which is lazy and thus better than getting an array for certain uses)
<ThePicard> ^this
<ThePicard> Mon_Ouie: indeed, it is clearer
<xorgnak> right you are. I just looked that up.
<ThePicard> would the method object be faster at all?
<xorgnak> appologies.
<ThePicard> i know it's a pretty much pointless optimization
<ThePicard> but I like to learn the internals of a language that I plan on using extensively
xorgnak_erc has joined #ruby
<Mon_Ouie> ThePicard: I'm thinking creating it is actually slower than creating a block — but I never benched it
mrwalker has joined #ruby
<Mon_Ouie> And also, "foo".split " " *is* a method call (there are no functions at all in Ruby), so… you can't say it's faster than using methods
<xorgnak_erc> it'd be worth a test. the talk I saw made a pretty good case for functions in ruby.
tommyvyo has joined #ruby
<Mon_Ouie> What people call functions, are just program-wide methods
<Mon_Ouie> (usually, that is)
<ThePicard> well, apparently ruby has a benchmark method, so it's time to find out =D
<ThePicard> er
<ThePicard> s/method/module/
tentimes has joined #ruby
mengu has joined #ruby
<ThePicard> well, not really
<ThePicard> because Method objects aren't callable
<ThePicard> so, you'd have to have a block to call .call anyway
<ThePicard> =/
<xorgnak_erc> probably more functional in the sense of creating an object from the result of the method calls. obj = "".split... still creates obj from calling the methods.
<Mon_Ouie> They are, you can use method.call(…)
<ThePicard> Mon_Ouie: i mean
<ThePicard> m = 12.method('+')
<ThePicard> m(5)
<xorgnak_erc> but try to explain that to someone who isn't exactly sure what a method is. functions we learn about in middle school math.
<ThePicard> doesn't work.
<Mon_Ouie> m.call 5
<Hanmac> try m[5]
<Mon_Ouie> That doesn't involve creating a block
<ThePicard> in context of my original problem
<Mon_Ouie> There's also m.(5)
<ThePicard> 'blah'.chars.map{|c| ahash[c]}
<xorgnak_erc> m = 12.+(5)
<Hanmac> look at this: ["a","b","c"].each(&object.method(sym))
strnx has quit [Excess Flood]
<Mon_Ouie> "blah".chars.map(&ahash.method(:[]) — although that syntax does create a proc object out of the method object
<Hanmac> hm yeah but it is not soo bad
<ThePicard> what is a proc object?
<ThePicard> also, & is what?
<Mon_Ouie> When you turn a block into an object, you get a Proc
<ThePicard> aha!
<xorgnak_erc> that tells ruby to create a proc.
LazyLucy has quit [Read error: Connection reset by peer]
wintorez has joined #ruby
<Mon_Ouie> foo(&obj) calls foo with obj as a block (obj gets converted to a proc by calling #to_prco on it)
wintorez has left #ruby [#ruby]
<xorgnak_erc> bingo. also one of the cooler things on earth.
<Mon_Ouie> def foo(&obj) — this stores the block that you get passed into a variable
duply has joined #ruby
jjbohn has quit [Quit: Leaving...]
<ThePicard> hmmm
<ThePicard> time to benchmark
<xorgnak_erc> not sure how that would work, but I could certainly see being able to create a singleton method from a block using something similar to def mkmeth name, &block; define_singleton_method name, block; end;
<xorgnak_erc> and passing in pairs of names and blocks.
<Mon_Ouie> The method you wrote is exactly the same thing as define_singleton_method though — so no need to write it :)
<ThePicard> i think i need to read more docs about procs and method objects
<ThePicard> that's what I'm getting from this XD
br4ndon has joined #ruby
havenn has quit [Remote host closed the connection]
skipper has joined #ruby
ryanf has joined #ruby
brianpWins has quit [Quit: brianpWins]
skipper has quit [Ping timeout: 246 seconds]
mehlah has joined #ruby
baroquebobcat has joined #ruby
baroquebobcat has quit [Client Quit]
apok has quit [Quit: apok]
digitalcakestudi has quit [Read error: Connection reset by peer]
mahmoudimus has joined #ruby
<ThePicard> so, other than string.chars.map{|c| hash[c]}, how would you guys map every character in a string to a number?
strnx has joined #ruby
<ThePicard> for me, vals = {'M' => 1000, 'D' => 500, 'C' => 100, 'L' => 50, 'X' => 10, 'V' => 5, 'I' => 1} =3
pashamur has quit [Ping timeout: 245 seconds]
tewecske has joined #ruby
<ThePicard> it seems like there could be a utility function for that
<Hanmac> ThePicard ... i think its not perfect ... "IV" is 4
<ThePicard> .reduce{ |l, r| r>l ? r-l : l+r}.reduce(:+)
<ThePicard> is the next part of that
<ThePicard> ah, } }.reduce(:+)
<Hanmac> i prefer inject over reduce ... reduce sounds so wrong
vlad_starkov has quit [Remote host closed the connection]
<ThePicard> Hanmac: reduce is what it is though.
<ThePicard> http://pastie.org/4349505 is the full code
<ThePicard> fold is the canonical name, but reduce is what is being used now, mostly because of google MapReduce
<ThePicard> inject is just ruby afaik
<ThePicard> ah, according to wikipedia also smalltalk and groovy, but eh.
<Mon_Ouie> inject comes from Smalltalk
<Mon_Ouie> collection inject: initial_value into: [ … ]
tentimes has quit [Quit: If you think nobody cares, try missing a few payments]
<Mon_Ouie> (well, more initialValue in Smalltalk I guess)
mockra has joined #ruby
<ThePicard> mhmm
<ThePicard> i'm too young to have even seen any code in smalltalk besides stuff on wikipedia =/
indian has quit [Ping timeout: 246 seconds]
<rking> Every time I see Smalltalk syntax I drool, but then I wipe the drool off when I remember that they require trailing "."s (which act like trailing semicolons). Newline should terminate statements by default.
chimkan___ has joined #ruby
<rking> ThePicard: Get Squeak, play with it for a weekend. It'll expand your mind.
<Mon_Ouie> rking: But in Smalltalk a single method call can expand on more than a single line
<Mon_Ouie> The most obvious example of that would be an ifTrue: … ifFalse: …
<rking> Mon_Ouie: Hrm, it might get a bit gritty to work everything out cleanly, yes, but I'd say just backslash
<rking> Hrm, right right
<rking> Mon_Ouie: Indent level
<Mon_Ouie> Yeah, that works for me
Ethan has joined #ruby
<ThePicard> rking: i'll play with it =D
<Hanmac> smalltalk was good for evolving but i dont see a reason why it sould still be used ... (there are better languages)
<rking> ThePicard: I don't remember the good tutorials. It does help to follow a few so you can figure out which way is up in the UI, but once you start getting it you can just keep exploring.
chimkan has quit [Ping timeout: 250 seconds]
chimkan___ is now known as chimkan
<rking> Hanmac: Are you referring to the system or the actual syntax/grammar?
cirwin has joined #ruby
chimkan has quit [Client Quit]
<Hanmac> both of it ...
CaptainJet has quit [Ping timeout: 250 seconds]
w400z has joined #ruby
CaptainJet has joined #ruby
<rking> Hanmac: The system is definitely something that takes adjusting, but the language itself, I'm not sure what there is to say is "better" now.
hoelzro|away is now known as hoelzro
MornStar| has joined #ruby
<rking> It's so simple. For example the above ifTrue stuff, not even being builtin.
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Bosma has joined #ruby
mockra has quit [Remote host closed the connection]
wvms has quit [Read error: Connection reset by peer]
wvms has joined #ruby
td123 has joined #ruby
ProT-0-TypE has quit [Quit: Leaving]
abdulkarim_ has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
s1n4_ has joined #ruby
lockweel has quit [Remote host closed the connection]
raul782 has joined #ruby
awarner has joined #ruby
s1n4_ has quit [Client Quit]
abdulkarim_ has quit [Quit: Ex-Chat]
s1n4_ has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
davidpk has joined #ruby
s1n4_ has quit [Client Quit]
havenn has joined #ruby
{aaron} has joined #ruby
mockra has joined #ruby
mockra has quit [Remote host closed the connection]
<{aaron}> can anybody explain why i have to do this and whether there is a better way to access the rspec scope? http://pastebin.com/VVG2dce0
<{aaron}> i know let defines a method...but i'm not sure how to access the receiver of that method from within a nested class context
<Mon_Ouie> {aaron}: Because let defines a method in the context and whatever is self in RSpec tests
<Mon_Ouie> So that method isn't accessible anymore when self changes
<Mon_Ouie> (It may use method_missing to implement it, but whatever — still the same principle)
havenn has quit [Ping timeout: 246 seconds]
<{aaron}> is there any less ugly way to refer to the method on the RSpec self other than defining a temp var ?
<{aaron}> i'm looking for a singleton on the RSpec ExampleGroup class but I don't see anything that will get me a handle to it
SCommette has joined #ruby
<{aaron}> i guess it just depends on RSpec implementation not Ruby
<Mon_Ouie> Why not define a method yourself instead of using let?
gentz has quit [Ping timeout: 248 seconds]
gentz has joined #ruby
<{aaron}> same problem actually
<{aaron}> i.e. if i just change it to def rspec_var; "whatever"; end
<Mon_Ouie> Don't define it there
<{aaron}> same scoping issue
<{aaron}> where would i define it?
<{aaron}> you mean in the DSL class?
<Mon_Ouie> Outside of hat block passed to describe
<Mon_Ouie> that*
<{aaron}> ahh, ok lemme see
SCommette has quit [Client Quit]
mikepack has quit [Remote host closed the connection]
<{aaron}> yeah, ok, that works, but it turns out IRL I'm using RSpec 'double' which it can't find then :P
<{aaron}> ok so i understand what is going on, i'll live with the tmp var
<{aaron}> thanks for your help
dankest has joined #ruby
xorgnak_erc has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
<{aaron}> btw my tests do a lot of file IO and they are hella slow...i'm wondering if there is a common idiom for memoizing file data. i was thinking mmap although that doesn't look builtin. maybe just read the whole file into a byte array and treat as IO
<{aaron}> or maybe just keep the same file handle open (tests are read only)
<fowl> HELLA SLOW
<fowl> where you from {aaron} i have a feeling that you are a cool cat
<{aaron}> eh upstate ny
imami|afk is now known as banseljaj
<fowl> bah nvm
<{aaron}> synonymous with cool cat
<ryanf> hmm. you're from upstate ny and you say "hella"?
<{aaron}> lol
burgestrand1 has quit [Ping timeout: 255 seconds]
<abdulkarim> Why isn't the block from #eat being executed here? >> http://seethiscode.appspot.com/29001
<Spooner> abdulkarim : It is being executed.
<cirwin> abdulkarim: you are probably looking for meal.map{}
<Mon_Ouie> It is executed. But that block only returns a string.
<Spooner> You don't have a "puts" in the version in the method.
<Mon_Ouie> I think he's looking for puts actually, seeing the other commented block
<cirwin> meal.each{} returns meal; not the return values
<Mon_Ouie> Or yeah, maybe that, actually
<{aaron}> ruby doesn't print out gross food combinations
<cirwin> he's just missing the salad base
zeen has quit [Ping timeout: 246 seconds]
<abdulkarim> {aaron}: lol
<Spooner> {aaron} : To answer your question, though, you could open the file in before{:all) {} or you could load the file into a StringIO?
<{aaron}> yeah i'll see what i can do. i think the problem is this code just sucks
<Paradox> i saw this gem/service a few days ago
<Paradox> it was something that did image cropping, facial recognition, and more
<Paradox> it might have been hosted
<Paradox> but i dont think it was
<{aaron}> ruby is pegging CPU so it's a cpu not disk bottleneck
xorgnak has quit [Remote host closed the connection]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<Spooner> That wouldn't help, {aaron}
xorgnak has joined #ruby
<i0n> http://pastie.org/private/ezthduam8a3fnhzpw3jca can someone tell me why im getting different results wiht this File.dirname method?
<abdulkarim> cirwin: yeah, meal.map gives expected output
EstanislaoStan has joined #ruby
<Mon_Ouie> I'd argue that RSpec isn't known for being the fastest testing framework ever
tommyvyo has joined #ruby
xorgnak has quit [Remote host closed the connection]
sevvie has joined #ruby
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
<Hanmac> i0n because you do no result in your for loop
<Hanmac> PS: and for-loops are outdated ... use enumerator fuctions for that
d3vic3 has joined #ruby
<Paradox> Mon_Ouie, no, but its not the slowest
<Paradox> that prize goes to the various java tests
<Spooner> i0n : blah.map {|i| File.dirname(i) }
<Hanmac> this works too: blah.map(&File.method(:dirname))
<Spooner> Don't confuse the poor fellow :)
<i0n> <--- mind blown
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
Ethan has quit [Ping timeout: 246 seconds]
n8ji has joined #ruby
<i0n> this is day 4 for me and its been a struggle but somethings are starting to make sense now
xorgnak has joined #ruby
<Mon_Ouie> ThePicard: Did you try that benchmarks, I'm curious about the results? :p
xorgnak has quit [Remote host closed the connection]
<EstanislaoStan> What is going on in this while loop? "while (line = file.gets)" Why are there parentheses and why isn't the = sign a == sign?
<Spooner> Because it is "set line to the result of file.gets and then, if it is not nil, keep doing while"
<Paradox> hmm, ok, a real question now. One of the projects i work on uses foreman, for starting a web server and some workers. We have to reboot the server on config changes, and i was trying to write a guard script, using guard-unicorn. But when i try to run this in foreman, it just ignores any changes
iamjarvo has joined #ruby
<Mon_Ouie> As for the parens, they're not required
<ryanf> yeah, although it is idiomatic to use parens if you are assigning
<ryanf> to make it clear that you didn't intend for it to be ==
shadoi1 has joined #ruby
abdulkarim has quit [Remote host closed the connection]
gmci has quit [Read error: Operation timed out]
<Spooner> EstanislaoStan : Though ideally, it should be file.each_line {|line| }, since then you don't use that horrible set-within-test business.
gmci has joined #ruby
xorgnak has joined #ruby
xorgnak has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
<EstanislaoStan> set-within-test?
<EstanislaoStan> Oh, setting the variable in the while condition?
<Spooner> Yes, sorry, condition is clearer than "test".
Ethan has joined #ruby
strife25 has joined #ruby
Tomasso has joined #ruby
abdulkarim has joined #ruby
<EstanislaoStan> Ok, thanks for the explanation everyone.
xorgnak has joined #ruby
<fowl> ruby <3s you
raul782 has quit [Remote host closed the connection]
gmci has quit [Read error: Operation timed out]
<Mon_Ouie> Unless there's a method that takes a block, I really don't mind assignments within conditionals
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
nedbat has quit [Ping timeout: 250 seconds]
TheShadowFog has quit [Quit: Leaving]
vlad_starkov has joined #ruby
awarner has quit [Remote host closed the connection]
joshman_ has quit [Quit: Computer has gone to sleep.]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
akem has joined #ruby
defendguin has joined #ruby
w400z has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
shadoi1 has quit [Quit: Leaving.]
vlad_starkov has quit [Ping timeout: 272 seconds]
<defendguin> i'm having an issue getting ruby / rvm setup properly on my new ubuntu box
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
<defendguin> shell -${SHELL} <--- is SHELL supposed to be replaced by something in my screenrc file?
<defendguin> https://rvm.io/workflow/screen/ going by directions here
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
Bosma has quit [Ping timeout: 255 seconds]
Bosma has joined #ruby
xorgnak has quit [Remote host closed the connection]
billiamii has quit [Ping timeout: 272 seconds]
xorgnak has joined #ruby
gmci has joined #ruby
Bosma has quit [Client Quit]
Goles has joined #ruby
banseljaj is now known as imami|afk
nilg has joined #ruby
joekarma has joined #ruby
tomb_ has quit [Quit: Computer has gone to sleep.]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
joekarma has left #ruby [#ruby]
tomb_ has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
billiamii has joined #ruby
xorgnak has quit [Remote host closed the connection]
Kabaka has quit [Quit: Rebooting for hardware change]
xorgnak has joined #ruby
zsnon has joined #ruby
xorgnak has quit [Remote host closed the connection]
celestius has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
raul782 has joined #ruby
xorgnak has joined #ruby
havenn has joined #ruby
celestius has quit [Client Quit]
sevvie has quit [Quit: sevvie]
iamjarvo has quit [Quit: Leaving...]
pencilcheck has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
cableray has joined #ruby
havenn has quit [Ping timeout: 246 seconds]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
Kabaka has joined #ruby
Gavilan has left #ruby [#ruby]
vandemar has quit [Ping timeout: 246 seconds]
vandemar has joined #ruby
xorgnak has joined #ruby
shadoi1 has joined #ruby
xorgnak has quit [Read error: Connection reset by peer]
jonathanwallace has quit [Remote host closed the connection]
Z_Mass has joined #ruby
tatsuya has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
xorgnak has joined #ruby
jonathanwallace has quit [Ping timeout: 264 seconds]
k_89 has quit [Quit: Leaving]
chimkan has joined #ruby
adamkittelson has joined #ruby
rippa has quit [Ping timeout: 264 seconds]
strife25 has quit [Quit: Computer has gone to sleep.]
burgestrand has joined #ruby
nedbat has joined #ruby
s0ber has quit [Read error: Connection reset by peer]
i0n has quit [Quit: leaving]
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
xorgnak has quit [Remote host closed the connection]
strife25 has joined #ruby
s0ber has joined #ruby
snearch has quit [Quit: Verlassend]
jeff_sebring has quit [Quit: Leaving]
conor_ireland has joined #ruby
<Paradox> hi
<Paradox> Skuld
raul782 has quit [Remote host closed the connection]
<Paradox> flotwig
tk__ has quit [Quit: ばいばい]
chimkan has quit [Quit: chimkan]
grantbdev has joined #ruby
nikeita has joined #ruby
fantazo has quit [Ping timeout: 244 seconds]
xbob has quit [Quit: This computer has gone to sleep]
senj has joined #ruby
<shevy> defendguin, if all fails, you can always compile ruby from source
vjacob has joined #ruby
shadoi1 has quit [Quit: Leaving.]
apok has joined #ruby
vjacob has left #ruby [#ruby]
robbyoconnor has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
olrrai has joined #ruby
SCommette has joined #ruby
Vert has joined #ruby
akem has quit [Read error: Connection reset by peer]
dankest has quit [Quit: Linkinus - http://linkinus.com]
akem has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
gmci has quit [Ping timeout: 255 seconds]
SCommette has quit [Client Quit]
fantazo has joined #ruby
TheShadowFog has joined #ruby
maxmmurphy has joined #ruby
pencilcheck has quit [Remote host closed the connection]
uris has joined #ruby
gmci has joined #ruby
digitalcakestudi has joined #ruby
fowl has quit [Changing host]
fowl has joined #ruby
<fowl> defendguin: there are 60 people in #rvm maybe they can help
jwmann has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
linoj has joined #ruby
jjbohn has joined #ruby
thone has quit [Read error: Operation timed out]
Bosma has joined #ruby
brianpWins has joined #ruby
<davidokner> Can you have a class variable and an instance variable by the same name and declare an attr_reader( :var) ?
thone has joined #ruby
<fowl> davidokner: attr_reader won't touch the class var
<shevy> davidokner, you must understand what attr_reader is
<shevy> attr_reader :var is 100% the same as you doing this:
Speed has quit [Remote host closed the connection]
<shevy> def var; @var; end
<Mon_Ouie> And what class variables are, because I suspect you don't know that they are shared with subclasses
<davidokner> It creates a method that returns the variable.
<davidokner> I do know that
<Mon_Ouie> the *instance* variable
<shevy> yes but a method for that instance
<shevy> davidokner, to answer your question, you can have both @var and @@var
<Mon_Ouie> And it's also an instance method that gets defined
<shevy> but the @@ really stink
<fowl> dont use class var, use a class instance var
iamjarvo has joined #ruby
ghjk has joined #ruby
<davidokner> shevy, I'm not asking that though.
<Hanmac> me likes class instance variables too :P
<Mon_Ouie> ^ and for those, you can define another reader in the class' singleton class
<fowl> class Foo; class << self; attr_reader :x; end end Foo.x will look for @x on the class Foo (not an instance)
manizzle has joined #ruby
<fowl> not an instance of Foo*
<shevy> it is always positively surprising how much fowl knows :)
<davidokner> I don't think I know about class instance variables.
<Mon_Ouie> They're just normal instance variables, which you set on a class object
<Mon_Ouie> Which is possible simply because classes are objects too in Ruby
<davidokner> What is wrong with class variables though?
<davidokner> Oh, because you don't like that they are inherited?
<Mon_Ouie> The fact they are shared with subclasses
<davidokner> ok
<Hanmac> in 99.9% of the cases you dont want sharing
raul782 has joined #ruby
<davidokner> So if it isn't shared you wouldn't be able to access that class variable from the subclass though
cirwin has quit [Quit: cycl....ling!]
<davidokner> Or would you?
<davidokner> I'm just learning.
<Hanmac> the Subclasses can have its own variables
<davidokner> I'm getting confused. I probably should deal with that when I practice subclasses more.
<davidokner> Right, but I might want the subclass to know how many things there are of the super class in general.
nedbat has quit [Ping timeout: 245 seconds]
<davidokner> I'm practicing by expanding the banking example in the Pick Axe book to do more than the example does.
strife25 has quit [Quit: Computer has gone to sleep.]
<shevy> davidokner you subclass. then you call super() to call the parent method
<davidokner> I'm making it so it will tell you what accounts you transfered from and how much it just transfered. I also want to create an array of bank accounts, so I can then easy traverse it and print out the balances of all the accounts.
<davidokner> Oh
<davidokner> Ok, right
havenn has joined #ruby
fowl has quit [Ping timeout: 246 seconds]
<davidokner> I'm using RubyMonk, The book of Ruby, The Little Book of Ruby, The Pick Axe Book and some tutorial web sites.
<davidokner> I hope between all of that it will fill in any gaps in undestanding.
chson has quit [Remote host closed the connection]
<davidokner> I've noticed that using multiple sources really helps.
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
havenn has quit [Remote host closed the connection]
ukd1 has joined #ruby
Spooner_ has joined #ruby
<shevy> well
<shevy> the only real way to learn ruby is by writing your own code from 0
greasegum has quit [Ping timeout: 244 seconds]
<davidokner> I'm hiding the code and trying to write it from 0.
defendguin has quit [Quit: Leaving.]
Spooner has quit [Ping timeout: 246 seconds]
<shevy> hehe
<davidokner> I'm not ready to write my own programs yet.
<shevy> that's the wrong attitude
<shevy> you are always ready
<shevy> the rest you will learn as you write
<davidokner> Well I could make my own programs, but only with what I have learned so far.
<shevy> there is not really one perfect way to write ruby code
<shevy> in 2 years your style may be different and you will or could use different patterns anyway
<davidokner> And I'm not very far yet, so I can't write very complicated programs.
<shevy> that is good
<shevy> complicated programs are horrible
<shevy> I write only very simple, primitive programs
<i0n> dirlocation = Dir.mkdir("/foo/bar") unless File.directory?("/foo/bar") .. this is not returning the result I would expect in irb?
<davidokner> No, I mean I can't use many different programming concepts yet because I don't know how to use them because I haven't gotten very far in the books.
<shevy> what result do you expect i0n
<i0n> Its returning "No such file or directory" .. I would like it to create the dir.
fowl has joined #ruby
<shevy> ok good
<shevy> then use this instead:
apok has quit [Quit: apok]
<shevy> dirlocation = FileUtils.mkdir_p("/foo/bar") unless File.directory?("/foo/bar")
<shevy> dirlocation # => "/foo/bar"
<shevy> I'd make it so though:
<shevy> _ = '/foo/bar'; dirlocation = FileUtils.mkdir_p(_) unless File.directory? _
<shevy> davidokner, well many concepts are not easy to understand
<shevy> procs and & syntax for instance
Nisstyre has joined #ruby
balki_ has joined #ruby
balki_ has quit [Read error: Connection reset by peer]
<shevy> but you dont have to know everything in order to write useful things, really
<shevy> you'll get better anyway
balki_ has joined #ruby
<davidokner> shevy: Are you suggesting I don't continue with the book, but rather come up with ideas for programs and then try to find the specific answers in the books for problems as I encounter them?
<davidokner> I was going to do a run-through of the books first.
<davidokner> It has been a while since I have programmed too.
<davidokner> I'm definately going to try to write programs to practice.
<davidokner> After I get the ruby langauge I want to learn RoR.
<shevy> davidokner the book is ok
<shevy> but I suggest, write first. then continue reading the book
balki has quit [Ping timeout: 240 seconds]
<davidokner> I'm writing programs as I learn new things in the book.
<davidokner> I'm not just reading straight through.
<i0n> hmm when specifying dirlocation= as a constant (if thats what its called) in a method argument, it chokes on syntax.
<Mon_Ouie> You can't define constants from a method, and if you feel like you need to, then you shouldn't be using a constant in the first place
<Hanmac> you can define constants in a method, but you should not do it
mahmoudimus has joined #ruby
<i0n> def method(foo, bar="isthisaconstant")
<i0n> ?
<Hanmac> thats only arguments, not constants ... ()
virunga has joined #ruby
<i0n> oic thats called a default value
tonni_ has joined #ruby
nilg has quit [Read error: Connection reset by peer]
<Hanmac> in ruby all constants begins (normaly) with a capital letter
shadoi has joined #ruby
jjbohn has quit [Quit: Leaving...]
<i0n> So it is not proper syntax to do something like this for a method argument? def newmethod(foo, bar=Dir.mkdir(...) unless (....))
tonni has quit [Ping timeout: 246 seconds]
<Mon_Ouie> You just need more parens
<Mon_Ouie> (Dir.mkdir(…) unless …)
<Hanmac> mmm when you dont get a syntax error then its proper :P
adamkittelson has quit [Remote host closed the connection]
<Mon_Ouie> Although have complex expressions in a default value argument isn't really recommended
kvirani has quit [Remote host closed the connection]
sailias has joined #ruby
negval has joined #ruby
tommyvyo has joined #ruby
yugui_zzz is now known as yugui
negval has left #ruby [#ruby]
syamajala has joined #ruby
kah_ has joined #ruby
mehlah_ has joined #ruby
beneggett has joined #ruby
mehlah_ has quit [Client Quit]
<nikeita> an instance var can be named like this -> display?
cirwim has joined #ruby
<nikeita> or better with an attr_accessor: display?
<nikeita> or better with an attr_accessor: :display?
zemanel has quit [Quit: Remote hottie closed the connection]
<hoelzro> nikeita: if you *did* do that, I wouldn't make it attr_accessor
<hoelzro> obj.display? = value seems funny to me.
mehlah has quit [Read error: Connection reset by peer]
jumpingcloud has joined #ruby
kpshek has joined #ruby
kpshek has quit [Client Quit]
<shevy> nikeita you make too many :
<nikeita> maybe an attr_reader: :display?
<shevy> pls
<shevy> try to reduce the amount of :
<Hanmac> nikeita: i get: NameError: invalid attribute name `display?'
<nikeita> yes sure.. sorry
<hoelzro> that answers that
<nikeita> maybe an attr_reader :display?
<shevy> you can workaround it
<Mon_Ouie> And both @foo? and foo?= are invalid
<nikeita> now ok...
<shevy> def display?; @display; end
<hoelzro> but you can always do def display? ... end
<Mon_Ouie> attr_reader :display; alias display? display
<shevy> yeah or what Mon_Ouie showed
<Mon_Ouie> Well, not really better
<shevy> hehe
<Mon_Ouie> But I do that with attr_accessor
hemanth_ has joined #ruby
<shevy> would matz consider adding an attr_* that has a "?" at the end of its method name?
<shevy> attr_cool :display
<shevy> would make a display? method
<shevy> hmm attr_query :display
<shevy> attr_extended_reader :display
<shevy> oh
<shevy> attr_reader2 :display
syamajala has quit [Remote host closed the connection]
<shevy> nah, those all suck...
<fowl> whats wrong with attr_reader?
<nikeita> attr_? :display
<jumpingcloud> Hey, Does anyone know how to automate a keyed ssh session with password?
<shevy> fowl it's fine, only when you want to add a ? query method... attr_reader :foo ... some_object.foo?
igotnolegs has joined #ruby
<fowl> and instead of returning @display it should be !!@display
<hoelzro> jumpingcloud: what kind of automation are you trying to do?
<fowl> shevy: i meant `attr_reader?`
<shevy> ah
<shevy> hmm would this be legal syntax?
<jumpingcloud> hoelzro: i just need to login to a system and have that system log into another system and run a few commands.
<Hanmac> the "!" method could be overritten but this may be worst style ever :P
<bperry> jumpingcloud: we do this in metasploit
<jumpingcloud> hoelzro: bothe systems use shared keys with passphrases
<nikeita> i do not understand why attr_reader :display? not work or is a bad practice
<hoelzro> jumpingcloud: prompt for the first key at startup, and use agent forwarding?
<Hanmac> nikeita: the problem is: methods can have ! and ? in there names ... variables not
jwmann has quit [Quit: Leaving.]
hemanth has quit [Ping timeout: 276 seconds]
shadoi has quit [Quit: Leaving.]
<jumpingcloud> hoelzro: I want it to beable to run without any user interraction.
<Hanmac> (and ! and ? are only alowed at the end and only one of them)
<jumpingcloud> bperry: Thanks, I'm checking into this now.
<nikeita> can be aliased like @synthesize in obj-c ?
<bperry> Hanmac: that almost isn't true, they aren't part of the method name, they are modifiers to the behaviour of evaluating the method
jwmann has joined #ruby
<bperry> they tell ruby how to evaluate what is returned
<Mon_Ouie> Obj-C's separation of attribute declaration and @synthesize for the implementation just doesn't make sense in Ruby
<Hanmac> bperry wrong! the "!" in Array#delete! is part of the method name
<Mon_Ouie> It all happens at once
mehlah has joined #ruby
<bperry> it means evalutate inplace
<bperry> evaluate
<bperry> ? mean evaluate as a boolean value
jwmann has quit [Client Quit]
<bperry> not part of the method name because you can run .delete on it's own without !
<Mon_Ouie> bperry: No, it means call #delete!, which happens to be called like that because it is a destructive method
<Hanmac> bperry ifs only an konversion ... its not a RULE
<hoelzro> jumpingcloud: run ssh-add before running ssh, then?
<bperry> ah, I stand corrected
<Mon_Ouie> That you can also call #delete only proves there's a delete method – which is another one
davidokner has quit [Read error: Operation timed out]
<Mon_Ouie> Try it: def foo; puts "foo"; end; def foo!; puts "bar!"; end
senj has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<bperry> I see
<Hanmac> other funny method names are "+@", "-@", "!@" , "~@"
<nikeita> so the proper way is : def display?; @display; end; without attr_accessor
RubyPanther has quit [Quit: self.exit(:stage=>:left)]
<Hanmac> information: 1 + -2 and 1 + - 2 are not the same in ruby
<bperry> you would only be testing the existence of @display then right? not whether the value of @display is true or false
<bperry> I could be wrong
kvirani has joined #ruby
<nikeita> i need to check t/f
<bperry> I could be wrong, but you may need to return @display == true or something
<nikeita> call it @display_flagh
<nikeita> ops
<jumpingcloud> hoelzro: ssh-add is disabled on the first system. Isn't there a way to send keypresses? or a string to stdin
<hoelzro> jumpingcloud: well, you *can* do it with a PTY
<hoelzro> but those are not fun.
<hoelzro> it's funny; someone just asked about this on #lua =)
negval has joined #ruby
negval has quit [Remote host closed the connection]
<jumpingcloud> hoelzro: yeah i was looking into PTY, looks kinda tricky... I cant get my head around it.
tatsuya has joined #ruby
<nikeita> bpeyy, why ? i can't simple return the boolean value?
d3vic3 has quit [Quit: leaving]
<jumpingcloud> hoelzro: ha, yeah it'd be nice to be able to do this.
denis_ has joined #ruby
<hoelzro> jumpingcloud: using ssh-add or password-less keys would be best, I'd say
<jumpingcloud> in ruby,
<hoelzro> there's also probably a libssh binding
<hoelzro> or maybe you could leverage expect/PTYs
<jumpingcloud> i know... ihave it working password-less, but I don't have root to this machine.. it's for work. I'm trying to automate some of my support tasks so i'll have more time to code at work ;)
odigity has quit [Ping timeout: 276 seconds]
<hoelzro> hehe
<hoelzro> so you're automating a root login via SSH?
<jumpingcloud> hoelzro: shhh my boss would freak out.
<jumpingcloud> but yeah totally..
<hoelzro> O_o
<jumpingcloud> it's not that bad
<nikeita> bperry, it work without ==
<bperry> cool :)
<bperry> I wasn't sure how that would behave
kvirani has quit [Remote host closed the connection]
<nikeita> basically it return already T/F
<bperry> what id @display is nil?
<jumpingcloud> hoelzro: it's all internal systems, it'll save me time doing it this way.
<bperry> if*
<jumpingcloud> hoelzro: =) do you not approve?
<hoelzro> well, I don't
<hoelzro> but I'm not you =)
<hoelzro> I think requiring a password for this couldn't hurt
<Hanmac> shevy do you know how to turn ruby commands into VM code points? (i mean that shows that the VM does?)
<Mon_Ouie> bperry: nil is treated like false in conditionals
<jumpingcloud> what if i wanted to cron it tho.
<bperry> yep, I am aware
<bperry> but I wasn't sure is nikeita was
devdazed has joined #ruby
<hoelzro> jumpingcloud: then run the cronjob as root on the designated box
<bperry> it may not be logic he was expecting
heftig has quit [Quit: leaving]
<nikeita> just tested in irb
<Mon_Ouie> Hanmac: puts RubyVM::InstructionSequence.disasm proc { |x| y = x + 2; puts y }
<nikeita> if it is not set (nil) obj.display? return false
banisterfiend` has quit [Read error: Connection reset by peer]
heftig has joined #ruby
notVert has joined #ruby
<Mon_Ouie> If you wanted to change the default, you wouldn't change the reader — you'd change the default value which you set in #initialize
linoj has quit [Quit: linoj]
<jumpingcloud> hoelzro: yeah i get that, So I'll just keep it requiring the pass for now. But it'd be nice to know how to fully automate this.
<Hanmac> Mon_Ouie: you could see the big diff between 1 + -2 and 1 + - 2 ;P
Vert has quit [Ping timeout: 252 seconds]
werdnativ has joined #ruby
cornholioz has quit [Quit: leaving]
whowantstolivefo has quit [Ping timeout: 260 seconds]
<jumpingcloud> hoelzro: im going to explore your suggestion and check libssh, pty and expect. Have you checked out greenletters?
fowl has quit [Changing host]
fowl has joined #ruby
whowantstolivefo has joined #ruby
<hoelzro> I haven't heard of it
<shevy> not really Hanmac ... only example I have are things like:
<shevy> code = RubyVm::InstructionSequence.compile('a = 1; puts 1 + a')
Spooner_ is now known as Spooner
<jumpingcloud> hoelzro: it's promising to be a better solution than expect. And it looks nice but i'm getting errors trying to get it doing what i want.
<Hanmac> shevy RubyVM::InstructionSequence.disasm proc { |x| 1 + -2 }
banisterfiend has joined #ruby
artOfWar has quit [Remote host closed the connection]
<shevy> Hanmac, what is this doing?
<jumpingcloud> hoelzro: it's starting the session just fine but wont touch the file
rmascarenhas has joined #ruby
<jumpingcloud> hoelzro: i should have cleaned that up... before submitting the issue.... =/
<Hanmac> shevy: Mon_Ouie shows me this, it tells you how ruby interpret your code
notVert has quit [Ping timeout: 252 seconds]
<bperry> so if you did this
<bperry> code = RubyVM::InstructionSequence.compile('a = 1; puts 1 + a')
<bperry> how would you run code?
<bperry> just curious
<bperry> I just tried a bit of googling, nothing apparent cam eup
Vert has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<Hanmac> bperry, the code you get has an eval method
chessguy has joined #ruby
<bperry> cool
<bperry> I see that now
<nikeita> puts can be escaped to print colors in termina?
n8ji has quit [Remote host closed the connection]
<Hanmac> bperry but imo the classes in RubyVM namespace are mostly only for debuging
linoj has joined #ruby
<bperry> I am thinking it would be very useful for lazyloading
<bperry> in the metasploit framework, every module gets loaded on startup and it is slow :(
<bperry> we do some ninja trickery to do it all
bullicon has joined #ruby
EstanislaoStan has quit []
<Hanmac> no ... dont do it ... it would not work as you think
justinseiter has joined #ruby
notVert has joined #ruby
<bperry> ah
hoelzro is now known as hoelzro|away
<bperry> I would have just played with it at first
<bperry> I may still play with it just to understand why it wouldn't work as expected
Vert has quit [Ping timeout: 252 seconds]
<heftig> for lazy loading, just delay the "require" or "load" until you actually need it
<heftig> there's also autoload, but that's deprecated and going to be removed
akem has quit [Read error: Connection reset by peer]
<bperry> yeah, we don't actually use it that wasy
<bperry> we read in the files then eval the code because require does fancy stuff that can break
<bperry> it is super hacky
<bperry> way*
bullicon has quit [Client Quit]
<bperry> nobody likes it
akem has joined #ruby
jwmann has joined #ruby
hadees has joined #ruby
<bperry> bbl
beneggett has joined #ruby
davidokner has joined #ruby
tonni_ has quit [Remote host closed the connection]
kvirani has joined #ruby
bradhe has joined #ruby
heftig has quit [Remote host closed the connection]
akem has quit [Read error: Connection reset by peer]
beneggett has quit [Ping timeout: 244 seconds]
olrrai has quit [Quit: Saliendo]
hemanth_ has quit [Read error: Connection reset by peer]
kvirani has quit [Remote host closed the connection]
hemanth_ has joined #ruby
akem has joined #ruby
heftig has joined #ruby
nedbat has joined #ruby
RubyPanther has joined #ruby
kvirani has joined #ruby
virunga has quit [Quit: Sto andando via]
jwmann has quit [Quit: Leaving.]
devdazed has quit [Quit: Computer has gone to sleep.]
beneggett has joined #ruby
bradhe has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
werdnativ has quit [Quit: werdnativ]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
maxmmurphy has joined #ruby
kvirani has quit [Remote host closed the connection]
strife25 has joined #ruby
maxmmurphy has quit [Client Quit]
workmad3 is now known as wm3|zzz
tonni has joined #ruby
akem has quit [Read error: Connection reset by peer]
kirun has quit [Quit: Client exiting]
<chessguy> is there a gem for command-line apps with a repl-like loop?
akem has joined #ruby
duply has quit [Read error: Connection reset by peer]
mahmoudimus has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
jarred has quit [Quit: jarred]
Gavilan has joined #ruby
jarred has joined #ruby
Rezwan has joined #ruby
shadoi1 has joined #ruby
banisterfiend has quit [Remote host closed the connection]
pskosinski has quit [Remote host closed the connection]
Azaria has joined #ruby
adamkittelson has joined #ruby
tonni has quit [Remote host closed the connection]
tonni has joined #ruby
pskosinski has joined #ruby
tonni has quit [Remote host closed the connection]
Ethan has quit [Read error: Connection reset by peer]
Ethan has joined #ruby
shadoi1 has quit [Quit: Leaving.]
bier has quit [Ping timeout: 246 seconds]
mockra has joined #ruby
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ruby
manizzle has quit [Remote host closed the connection]
Azaria has quit [Quit: Linkinus - http://linkinus.com]
raul782 has quit [Remote host closed the connection]
manizzle has joined #ruby
Gurpartap has joined #ruby
akem has quit [Ping timeout: 272 seconds]
Gurpartap is now known as Guest90464
Guest90464 has quit [Changing host]
Guest90464 has joined #ruby
Guest90464 has joined #ruby
raul782 has joined #ruby
nikeita has quit [Quit: sleep]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
akem has joined #ruby
Guest90464 has quit [Client Quit]
paradoja has quit [Ping timeout: 272 seconds]
ph^ has quit [Remote host closed the connection]
Stalkr_ has quit [Quit: Leaving...]
bglusman has joined #ruby
<zsnon> p/quit
<zsnon> fail
zsnon has quit [Quit: leaving]
singh has joined #ruby
singh is now known as Gurpartap
Gurpartap has quit [Changing host]
Gurpartap has joined #ruby
Gurpartap has joined #ruby
bglusman_ has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
Spooner has quit [Ping timeout: 246 seconds]