apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p362: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
macmartine has joined #ruby
piotr__ has quit [Ping timeout: 246 seconds]
<Xeago> already checked that
d2dchat_ has quit [Remote host closed the connection]
anonymuse has quit [Quit: Leaving.]
beilabs_ has joined #ruby
katherinem13_afk is now known as katherinem13
beilabs_ has quit [Client Quit]
beilabs_ has joined #ruby
headius has quit [Quit: headius]
nari has quit [Ping timeout: 245 seconds]
karasawa has quit [Ping timeout: 264 seconds]
karasawa has joined #ruby
Kingy has joined #ruby
rakuN has joined #ruby
jfl0wers has quit [Ping timeout: 245 seconds]
maletor has joined #ruby
heftig has quit [Quit: leaving]
jonahR has quit [Quit: jonahR]
i_s has quit [Quit: i_s]
Targen has quit [Ping timeout: 245 seconds]
reppard has joined #ruby
b1rkh0ff has quit [Ping timeout: 248 seconds]
ner0x has quit [Quit: Leaving]
aedornv has joined #ruby
robacarp has joined #ruby
heftig has joined #ruby
gyre008 has quit [Remote host closed the connection]
pu22l3r has joined #ruby
i_s has joined #ruby
pkrnj has joined #ruby
mjolk has quit [Quit: This computer has gone to sleep]
miskander has joined #ruby
hadees has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
pu22l3r has quit [Read error: Connection reset by peer]
pu22l3r has joined #ruby
mrsolo has quit [Quit: Leaving]
etcetera has quit []
Nuck has quit [Ping timeout: 248 seconds]
aaronmacy has quit [Quit: Leaving.]
Nuck has joined #ruby
robotmay has quit [Read error: Connection reset by peer]
robotmay has joined #ruby
pu22l3r has quit [Remote host closed the connection]
rpminihan has quit [Ping timeout: 252 seconds]
etcetera has joined #ruby
tomzx has quit [Disconnected by services]
alvaro_o_ has quit [Quit: Ex-Chat]
karupanerura has quit [Excess Flood]
<JMcAfreak> Wow.
<JMcAfreak> I just made several major changes to the code in one of my files because it was returning results that weren't necessarily wrong, but weren't right.
slainer68 has quit [Remote host closed the connection]
<JMcAfreak> And yet every time I would run it, I got the same results.
<JMcAfreak> Until I realized I was executing the wrong file.
<JMcAfreak> Now I get to figure out whether I just broke the file I was working on.
<Xeago> what is mkmf?
karupanerura has joined #ruby
<Xeago> is it makemakefile?
<Xeago> and what should I do if ruby can't find that gem
<Xeago> rubygems doesn't have it?
wargasm1 has joined #ruby
firefux has joined #ruby
<firefux> Can the ensure clause have arguments and be used as a statement modifier?
<heftig> no and no
swingha has joined #ruby
<firefux> heftig: I'm confused by some code in a book, let me paste it
thinkclay has joined #ruby
yacks has joined #ruby
etcetera has quit []
robotmay has quit [Ping timeout: 260 seconds]
wargasm has quit [Ping timeout: 248 seconds]
<JMcAfreak> Xeago: what is the error specifically?
Pip has quit [Quit: Leaving]
timonv_ has quit [Ping timeout: 252 seconds]
<JMcAfreak> (if you answer in the next 10 minutes, I can help
<JMcAfreak> )
jeffreybaird has joined #ruby
<heftig> firefux: yeah, that doesn't work
timonv has joined #ruby
banisterfiend is now known as banister`sleep
tjbiddle_ has joined #ruby
mmmmwww has joined #ruby
<heftig> just do begin; puts(exchange_rates.convert(line)); ensure; rate_mutex.unlock; end
<firefux> heftig: maybe the ensure was supposed to be put in the next line?
<firefux> firefux: or he was missing a ';'
<Mon_Ouie> No, you need a begin … end to use ensure (or to be in a method body)
<JMcAfreak> Xeago: did your problem suddenly go away?
rburton- has joined #ruby
etcetera has joined #ruby
katherinem13 is now known as katherinem13_
lkba has quit [Ping timeout: 240 seconds]
<firefux> heftig: I think you have an extra ; there
<heftig> firefux: no. replace ; with newlines
<firefux> heftig: ah right
swingha has quit [Quit: WeeChat 0.3.9.2]
tjbiddle has quit [Ping timeout: 245 seconds]
tjbiddle_ is now known as tjbiddle
mmmmwww has quit [Client Quit]
hotovson_ has joined #ruby
reppard has quit [Ping timeout: 260 seconds]
bdnelson has joined #ruby
timonv has quit [Ping timeout: 245 seconds]
<JMcAfreak> well, I'm gone
timonv has joined #ruby
truent has quit [Quit: Page closed]
katherinem13 has joined #ruby
miphe has quit [Quit: Leaving]
tjbiddle has quit [Read error: Connection reset by peer]
powerplay has quit [Quit: Leaving.]
bdnelson has quit [Client Quit]
alvaro_o has joined #ruby
<Xeago> JMcAfreak: kinda
<Xeago> I can dump the packets before sshd gets them
stonevil has quit [Read error: Connection reset by peer]
<Xeago> and they are malformed
stonevil has joined #ruby
<Xeago> and thusly get dropped
<Xeago> it doesn't get malformed if I use a port above 1024
freeayu has joined #ruby
<Xeago> (as 1 of the 11th to 18th bit specifically get
<Xeago> malformed)
<shevy> Xeago mkmf is usually provided with default ruby
sjuxax has joined #ruby
<shevy> folks like the ubuntu dev team usually cripples it away
advorak has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
<sjuxax> Hello. I would like to "fork and forget" in Ruby. I am using Process.detach but my parent process still does not return until its child finishes.
ikonia has quit [Read error: Operation timed out]
enebo has quit [Quit: enebo]
tjbiddle has joined #ruby
io_syl has quit [Ping timeout: 255 seconds]
ikonia has joined #ruby
<advorak> sjuxax, oh! I've been playing with Process recently, too ..
samuel02 has quit [Remote host closed the connection]
stopbit has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
<Xeago> shevy: how would I install it now?
<shevy> Xeago the ubuntu folks must have some way to decripple it
<aedornv> Xeago: Did you compile/install Ruby from source?
<shevy> probably via apt-get
baroquebobcat has quit [Ping timeout: 245 seconds]
<shevy> apt-get install ruby1.8-dev
c0rn has quit [Quit: Lates.]
<Xeago> I don't use 1.8 :\
<shevy> probably it is called 1.9 now or something
<shevy> then replace the version name
<shevy> or stop using ubuntu ;)
<aedornv> oh.. didn't see where he said he was using ubuntu
<Xeago> I didn't
<shevy> well it's the whole debian family
katherinem13 has quit [Quit: leaving]
katherinem13_ is now known as katherinem13
io_syl has joined #ruby
<Xeago> well, a long time ago with another issue
<shevy> I dont know any other distribution crippling away mkmf from ruby
goraxe has joined #ruby
katherin1m13 has joined #ruby
io_syl has quit [Remote host closed the connection]
io_syl has joined #ruby
tjbiddle_ has joined #ruby
tjbiddle has quit [Ping timeout: 246 seconds]
tjbiddle_ is now known as tjbiddle
<shevy> hmm does fedora do that? anyone is using ruby on fedora from rpm?
c0rn has joined #ruby
katherinem13 is now known as katherinem13_
<Xeago> how do I list packages installed with apt-get?
katherinem13_ has quit [Quit: katherinem13_]
thinkclay has quit [Quit: Leaving.]
katherin1m13 is now known as katherinem13
reppard has joined #ruby
ben___ has quit [Quit: ben___]
<firefux> I prefer to install ruby from source in my home dir
<shevy> Xeago hmm I think you can do this via dpkg
<shevy> yeah firefux
aaronmacy has joined #ruby
dukedave has quit [Ping timeout: 276 seconds]
<Xeago> how?
<shevy> hmm
<shevy> dpkg --list # I think
<Xeago> I want brew for other stuff than osx
<shevy> yeah, that is my gripe too... brew should work on other OSes too
<shevy> right now it is elitist :(
<Xeago> :3
lkba has joined #ruby
<Xeago> also
<Xeago> ruby1.9.1 or ruby1.9.1full
<shevy> "we use ruby, but only if you are a proper steve jobs nuthugger!"
RagingDave has quit [Quit: Ex-Chat]
yshh has joined #ruby
<shevy> full = complete decrippling, so always go full
<Xeago> damnit
jerius has joined #ruby
<shevy> unless you run a "server OS"
<shevy> then the debian folks will tell you "hey, you are a server, you won't need .h files ever"
* firefux hugs debian
<Xeago> it aint a server stupid kernel readers
<Xeago> I just don't need a gui
<shevy> hehe
<Xeago> and the cputiming with server better suits my runlongjobs but edit at server workflow
dv_ has quit [Ping timeout: 248 seconds]
jrist is now known as jrist-afk
slainer68 has joined #ruby
<Xeago> but damn
<Xeago> 240kb
<Xeago> vs 140MB
sailias has joined #ruby
woolite64 has quit [Quit: Leaving]
dv_ has joined #ruby
dcope has quit [Excess Flood]
<shevy> :P
dcope has joined #ruby
fred909 has quit [Ping timeout: 245 seconds]
<shevy> 140mb the world is coming to an end
<aedornv> shevy: on our corporate network a 140MB download would take until the world's end to download.
icole has quit [Remote host closed the connection]
<Xeago> shevy: only got 800MB
<aedornv> if I had to use that connection I would cry. A river. Literally.
<Xeago> well, now I only have 660
dougireton has quit [Quit: Leaving.]
stonevil has quit [Read error: Connection reset by peer]
stonevil has joined #ruby
<Eiam> shevy: lol os x user = steve jobs nuthugger?
<aedornv> anyway, I thought there was a ruby19-dev package anyway
<Eiam> i just figured it was sane people that hate windows shell/power shell
<shevy> Eiam no, but machomebrew -> written in ruby but only for apple users -> elitist exclusion
<Eiam> shevy: I tried a few weeks ago to drop into 'shell' to get some shit done in windows 7 and i went into some hell hole of trying to install cygwin or powershell or something I dunno wtf was going on but I felt sorry for anyone that had to deal with it! =)
<aedornv> I don't know why I had to use 'anyway' twice there.
<Eiam> shevy: or "constraining your test & support matrix" =)
<shevy> Eiam windows is pretty awful. it is possible to use some kind of bash though, and ruby works on it as well, so it is possible to workaround a few of its quirks
johnmilton has quit [Remote host closed the connection]
<Eiam> or just buy a mac =p
timonv has quit [Ping timeout: 260 seconds]
<Eiam> macbook airs are like $899 with a built in SSD, pretty good deal. thunderbolt too =p
<shevy> power shell also has one good idea going for itself - piping objects
<Eiam> (a 13" mba is my primary dev machine)
miskander has quit [Quit: miskander]
headius has joined #ruby
<shevy> I'd wish we'd have something like piping objects in pure ruby too :(
jblack has joined #ruby
Targen has joined #ruby
<shevy> back when I was on windows, there was one awesome tool... avisynth (+ virtualdub), it was like scripting for video/audio files
katherinem13 has quit [Quit: Lost terminal]
<shevy> now if someone would just connect that into a shell with pipes...
katherinem13 has joined #ruby
<carlzulauf> piping objects? like between two different ruby scripts?
yshh has quit [Remote host closed the connection]
<firefux> Eiam: or just run a VM in windows
<shevy> carlzulauf yeah... but I think more like on the OS level, so that it would be available to every program
dukedave has joined #ruby
<carlzulauf> ah
dougireton has joined #ruby
timonv has joined #ruby
<shevy> the default could be retained in unix pipes "default to text stream data"
yshh has joined #ruby
slainer68 has quit [Ping timeout: 248 seconds]
<carlzulauf> so like if STDIN/STDOUT had complex data type support
<shevy> yeah kinda
<shevy> and combine that with virtual dub... so that the pipe would be like a workstation for every data you could possibly have on your computer, in a general and consistent way
jjbohn has joined #ruby
headius has quit [Ping timeout: 248 seconds]
<carlzulauf> when you put it that way it starts to sound a little like DBus
tjbiddle has quit [Ping timeout: 256 seconds]
<carlzulauf> I love DBus... mostly
ebobby has joined #ruby
<firefux> Eiam: where do you find a mba for $900?
<firefux> 13"
Scriptonaut has quit [Ping timeout: 260 seconds]
rpminihan has joined #ruby
taoru has joined #ruby
<aedornv> I hate DBus...
<carlzulauf> i'd like to see all inter-process/inter-application/inter-server communication standardize on redis... but my dream will probably never come true
Spooner has quit [Quit: Leaving]
<Xeago> firfux the 11" for €783.84 at discounted apple-store
<Xeago> (online)
<carlzulauf> that's a lot more than $900, no?
<Xeago> it is
<Xeago> but apple doesn't usually do conversion rates
<Xeago> macbook for 999
<Xeago> regardless of currency
<Xeago> (usual)
huoxito has joined #ruby
<Xeago> s/l)/lly)
bitcrave has quit [Ping timeout: 245 seconds]
sjuxax has left #ruby [#ruby]
<Xeago> damnit
<Xeago> stupid command-t not working
<Xeago> freakin segv's
mydog2 has joined #ruby
<mydog2> evening
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
jjbohn has quit [Quit: Leaving...]
Mon_Ouie has quit [Ping timeout: 264 seconds]
browndawg has joined #ruby
jeffreybaird has joined #ruby
`brendan has joined #ruby
<ryanf> Xeago: you probably compiled the extension against a different version of ruby from the one vim compiled against
joofsh has quit [Remote host closed the connection]
<Xeago> I only have 1 ruby on my system
_hemanth_ has quit [Read error: Connection reset by peer]
c0rn has quit [Quit: Computer has gone to sleep.]
_hemanth_ has joined #ruby
<havenn> Xeago: What version?
<Xeago> 1.9
<Xeago> and indeed
c0rn has joined #ruby
<Xeago> vim-nox does link against 1.8
<Xeago> stupid apt
io_syl has quit [Remote host closed the connection]
io_syl has joined #ruby
taoru has quit [Remote host closed the connection]
richardjortega has quit [Read error: No route to host]
zeade has quit [Quit: Leaving.]
richardjortega has joined #ruby
hotovson_ has quit [Remote host closed the connection]
dr_neek has joined #ruby
justinleitgeb has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
fred909 has joined #ruby
jjbohn has joined #ruby
tjbiddle has joined #ruby
fyolnish has joined #ruby
<Xeago> gah
artOfWar_ has quit [Remote host closed the connection]
<Xeago> match.c:51:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
stevechiagozie has joined #ruby
PragCypher has quit [Remote host closed the connection]
jeffreybaird has joined #ruby
tjbiddle_ has joined #ruby
<shevy> Xeago the joy of being in a prison - the debian prison, you gotta love your prisons, my dear prisoner ;)
<Xeago> I so love my osx server
<Xeago> just because it is the same as what I use on the go
<Xeago> but headless
<shevy> hehe
tjbiddle has quit [Ping timeout: 276 seconds]
tjbiddle_ is now known as tjbiddle
<shevy> I felt like that with gobolinux... it was the only distribution that, like ruby, I would have considered "elegant and beautiful" (though nixOS also had some great ideas)
ruzu2 is now known as ruzu
ruzu has quit [Changing host]
ruzu has joined #ruby
justinleitgeb has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 255 seconds]
nari has joined #ruby
syamajala has joined #ruby
tvw has quit [Remote host closed the connection]
syamajala has quit [Remote host closed the connection]
syamajala has joined #ruby
fred909 has quit [Ping timeout: 256 seconds]
taoru has joined #ruby
<Xeago> ruby1.9.3 package is available?
syamajala has quit [Client Quit]
<Norrin> what's wrong with rvm?
taoru has quit [Remote host closed the connection]
<swarley> bloated. rbenv
<postmodern> swarley, Norrin, chruby, even smaller than rbenv
<swarley> yes, i use chruby
<postmodern> ok i'll be quiet :)
<swarley> Oh, also I had a small issue
<Xeago> should I use ruby1.9.3 or ruby 1.9.1
connor__ has joined #ruby
<Norrin> .3
<Xeago> and 1.9.1full depends on xterm and x11shizzles?
<swarley> postmodern; I had to modify the chruby function so that it would assign the RUBY env variable correctly
<swarley> as is it was setting it to /opt/rubies/1.9.3
<postmodern> Xeago, probably 1.9.3, although ubuntu names their 1.9.x packages ruby1.9.1
<postmodern> swarley, ah you probably want to upgrade
<swarley> Oh? I'm behind then?
<postmodern> swarley, i had to use RUBY_ROOT instead of RUBY, since Rake uses the RUBY env variable
<swarley> ohh, yeah. I noticed that quite soon
<swarley> I just changed it to use bin/ruby at the end of the path.. But upgrading sounds a lot more stable
<postmodern> speaking of which, need to prepare 0.3.2
<Xeago> oh shit, I killed an apt-get in progress
dmiller1 has joined #ruby
<Eiam> firefux: craigs list? refurb ?
blazes816 has quit [Quit: blazes816]
<Eiam> firefux: you are right, lowest price i see is $911 for 11" macbook air, at macmall. 13" is 1096.
xemu has quit [Quit: Nettalk6 - www.ntalk.de]
Virunga has quit [Remote host closed the connection]
<Eiam> firefux: find someone that works at apple and ask for one of their discounts, that'll put you at the mark.
_hemanth_ has quit [Read error: Connection reset by peer]
dmiller has quit [Ping timeout: 256 seconds]
_hemanth_ has joined #ruby
DatumDrop has quit [Remote host closed the connection]
r3nrut has joined #ruby
DatumDrop has joined #ruby
<r3nrut> evening ladies and gents
DatumDrop has quit [Read error: Connection reset by peer]
taoru has joined #ruby
<dummey> hello theres =D
allure has quit [Ping timeout: 245 seconds]
joeycarmello has quit [Remote host closed the connection]
allure_ has joined #ruby
tjbiddle_ has joined #ruby
pcarrier has quit [Ping timeout: 260 seconds]
jjbohn has quit [Quit: Leaving...]
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
goraxe has quit [Ping timeout: 255 seconds]
tjbiddle has quit [Ping timeout: 245 seconds]
tjbiddle_ is now known as tjbiddle
<ruzu> wtb 15" mb air
pcarrier has joined #ruby
Hanmac1 has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
maletor has quit [Quit: Computer has gone to sleep.]
ttt has joined #ruby
mockra has quit [Remote host closed the connection]
Hanmac has quit [Ping timeout: 260 seconds]
reppard has quit [Ping timeout: 264 seconds]
breakingthings has joined #ruby
pskosinski has joined #ruby
slainer68 has joined #ruby
fred909 has joined #ruby
jaequery has quit [Quit: Computer has gone to sleep.]
stonevil has quit [Quit: stonevil]
jblack has quit [Ping timeout: 276 seconds]
sn0wb1rd has quit [Quit: I will be right back]
g0bl1n has joined #ruby
squidBits has quit [Quit: whoops]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<mydog2> hey guys.. maybe i'll have better luck than the php guys!
dougireton has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 248 seconds]
jonahR has joined #ruby
jds_ has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
<mydog2> trying to find a good/sophisticated ruby landing pad site/app. looking for something that hooks into twitter/youtube/etc... as well as allowing users to login/complete a couple of forms, and read some static content..
karasawa has quit [Ping timeout: 264 seconds]
<mydog2> any open source pointers that you've seen?
karasawa has joined #ruby
ninegrid has joined #ruby
otherj has joined #ruby
twoism_ has quit [Remote host closed the connection]
samphippen has quit [Quit: Computer has gone to sleep.]
djones__ has joined #ruby
tommyvyo has joined #ruby
cobragoa_ has quit [Remote host closed the connection]
<postmodern> swarley, chruby 0.3.2 is out
AlchemyFalcon has joined #ruby
jds_ has quit [Ping timeout: 264 seconds]
joeycarmello has joined #ruby
etcetera has quit []
stevechiagozie has joined #ruby
<AlchemyFalcon> why is a .each block not considered a loop? Is it that they're just two flavors of iterators?
theRoUS has joined #ruby
etcetera has joined #ruby
daniel_- has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
djones__ has quit [Ping timeout: 252 seconds]
AndChat| has joined #ruby
hadees has quit [Quit: hadees]
DatumDrop has joined #ruby
weeb1e has joined #ruby
weeb1e_ has quit [Ping timeout: 272 seconds]
<ryanf> AlchemyFalcon: considered by whom?
<AlchemyFalcon> ryanf: codeacademy.com
jjbohn has joined #ruby
Banistergalaxy has quit [Ping timeout: 264 seconds]
<AlchemyFalcon> loops and blocks are two totally different sections
niklasb has quit [Read error: No route to host]
emocakes has quit [Quit: emocakes]
djones__ has joined #ruby
baphled has quit [Ping timeout: 240 seconds]
otherj has quit [Quit: otherj]
<GeekOnCoffee> so they covered while in one section, and each in the next?
daniel_- has quit [Ping timeout: 276 seconds]
<GeekOnCoffee> I can see why you'd cover them separately, but I wouldn't say .each isn't a loop
<AlchemyFalcon> you know, it was kind of weird- .each was covered in the loops section very briefly, but then covered again in its own section way later after methods
headius has joined #ruby
<stevechiagozie> .each is an iterator, which is a subset of loops
<AlchemyFalcon> stevechiagozie: iterators are a subset of loops, and not the other way around?
<stevechiagozie> you pass .each a block. a block is a larger concept in Ruby
<stevechiagozie> IMO. I would put for…in (which you rarely see) as a loop
<stevechiagozie> while, for..in, etc.
<AlchemyFalcon> so blocks are those things which contain the meat for both methods and loops? is that gist of the concept of blocks?
Kingy has quit [Quit: Leaving]
<stevechiagozie> You can think of a block as being somewhat like the body of an anonymous method.
<stevechiagozie> and just like method a block can take parameters
<aedorn> shevy: have you looked at Bodhi or elive? In terms of "elegant and beautiful" they're pretty neat. Debian based though
<AlchemyFalcon> That makes sense. Are blocks not technically part of regular methods though?
F1skr has quit [Quit: WeeChat 0.3.9.2]
<shevy> aedorn this is like cosmetics on a pig, the innards are debian :(
<shevy> but enlightenment is cool
<aedorn> hmmm what about calculate linux?
willob has joined #ruby
rpminihan has quit [Remote host closed the connection]
CaptainKnots has quit [Quit: bazinga!]
<stevechiagozie> AlchemyFalcon: yes a method is considered a block
<aedorn> CL13 is pretty nice in terms of aesthetics
kil0byte has joined #ruby
<shevy> never heard of that before
<shevy> lemme google
<stevechiagozie> a block is simply a chunk of code enclosed between {} or do/end
kpshek has joined #ruby
<AlchemyFalcon> oh ok. I guess I'm just over thinking it. Thanks.
jonahR has quit [Read error: Connection reset by peer]
<stevechiagozie> AlchemyFalcon: you see the power of blocks as the class progresses (I'm assuming) as you create your own iterators or own methods that accepts blocks
jonahR has joined #ruby
<shevy> AlchemyFalcon every method in ruby can accept a block
<AlchemyFalcon> stevechiagozie: Unfortunately I think that's probably beyond the scope of this class. Codeacademy is really really basic, I just use it to quickly get familiar with a language.
<shevy> you could actually put all logic into a block
butblack has joined #ruby
Axsuul has joined #ruby
<AlchemyFalcon> if you passed a block to a method would the method definition look like this: def method( *stuff ) ...
<shevy> def a; yield if block_given?; end; a { "here we put a natural language\nand another class interpretes this string\n" }
DatumDrop has quit [Ping timeout: 248 seconds]
<shevy> this is a normal argument
<shevy> def foo(*name)
willob has quit [Read error: Connection reset by peer]
<shevy> for a block, you use {}
<shevy> foo('whatever','here','does','not','matter') { 'here is the block!' }
kpshek has quit [Ping timeout: 245 seconds]
reppard has joined #ruby
shorts has joined #ruby
<shevy> yield is the keyword to access the content of the block
<shevy> block_given? is the check to query whether a block was given or not, to a method
dmerrick has quit [Quit: dmerrick]
<shevy> I usually do: "yield if block_given?" inside a method
<AlchemyFalcon> shevy: so the block is actually passed to the function as an argument, and is not just part of the definition?
CaptainKnots has joined #ruby
CaptainKnots has quit [Changing host]
CaptainKnots has joined #ruby
<shevy> it is a special kind of argument
jduan1981 has quit [Ping timeout: 248 seconds]
<shevy> all methods in ruby can always accept a block, without you having to define anything
<shevy> foo()
<shevy> foo() {}
<shevy> you see?
<AlchemyFalcon> interesting
<shevy> it's cool, every method is more flexible whenever you want to
<shevy> you could well use ruby without blocks for yourself
billy_ran_away has quit [Ping timeout: 255 seconds]
<shevy> you can do something like this:
<shevy> cliner {
<shevy> puts 'hello world'
<shevy> }
pac1 has joined #ruby
<shevy> and clinere would be: def cliner; puts '=' * 80; end
rburton- has quit [Quit: Linkinus - http://linkinus.com]
<shevy> oops
<shevy> I forgot the yield
rakl has quit [Quit: sleeping]
<shevy> def cliner; puts '=' * 80; if block_given?; yield; cliner;end; end; cliner { puts 'hello world' }
<shevy> ok try this in irb
<r3nrut> yield in the name of love...
adamjleonard has quit [Quit: Leaving...]
<AlchemyFalcon> k i'll try real quick
<shevy> it will output hello world, within 2x ====
ninegrid has quit [Quit: bbl]
frem has joined #ruby
<AlchemyFalcon> wow that's very interesting
<AlchemyFalcon> so yield pretty much runs the block that was passed to the method?
bigmac has joined #ruby
subbyyy has joined #ruby
jaequery has joined #ruby
timonv_ has joined #ruby
<shevy> AlchemyFalcon yeah
jbw has quit [Ping timeout: 248 seconds]
<shevy> of course your method can have additional arguments
<shevy> the ruby parse will need a () though
<shevy> cliner(:green) { puts 'hello world' }
timonv has quit [Ping timeout: 245 seconds]
<AlchemyFalcon> super interesting… on what sort of problem might you use this?
<shevy> ^^^ then you could have those ==== in green colour (if you use ansicolours, and change the method, of course)
<shevy> AlchemyFalcon dunno, it can always be useful. I use it for pseudo-html generation, a bit similar to the ruby-cgi module
<shevy> h1 { 'hello world' }
<shevy> no wait
<AlchemyFalcon> ohh that's cool
<shevy> that was the wrong example
<shevy> I actually do: h1 'hello world' ... but I use the block for additional behaviour
<shevy> div { h1 'hello world' } <--- ok that is more like it, <h1> will reside in <div>
connor__ has quit [Remote host closed the connection]
<AlchemyFalcon> that makes sense.
<shevy> and the {} is useful because it will also generate the </div>
<shevy> in standard ruby, the {} is used for opening and closing a file
otherj has joined #ruby
<AlchemyFalcon> huh
<shevy> you dont have to do: file.close if you use the {}, because the block will do it for you
<shevy> handle = File.open('test.txt')
PragCypher has joined #ruby
<shevy> handle.puts 'test'
<shevy> handle.close
<shevy> the block form is nicer to read
<shevy> hmm... something like... File.open('test.txt') {|handle| handle.puts 'test' }
crank_ has joined #ruby
<shevy> AlchemyFalcon you simply have additional flexibility with blocks
<shevy> you can also turn them into objects
willob has joined #ruby
g0bl1n has quit [Quit: Ex-Chat]
<AlchemyFalcon> totally. So just out of curiosity, how would you read "File.open('test.txt') {|handle| handle.puts 'test' }" in your head
<shevy> oh, I dont actually do that
<shevy> I wrote a method that just does it for me
<shevy> save_file(data, '/test.txt')
<shevy> I can't remember syntax ;)
jaequery has quit [Quit: Computer has gone to sleep.]
crank_ has quit [Client Quit]
<shevy> the less I have to remember, the better
crank_ has joined #ruby
crank_ has quit [Client Quit]
<shevy> I just want to use ruby as a lego building block
<AlchemyFalcon> but I mean like if I'm reading some code and I want to figure out what it does, I would read a .each { |x| … } as "for each thing x, do …"
timonv_ has quit [Ping timeout: 245 seconds]
bricker`LA has joined #ruby
bricker`LA is now known as bricker
<AlchemyFalcon> i would try to read "File.open('test.txt') {|handle| handle.puts 'test' }" as something like "open file test.txt, then " - I get stuck there because I don't really know _what_ handle is...
<AlchemyFalcon> is handle in that case the file i've opened? similar to just setting handle = File.open(….) like you did earlier?
<shevy> AlchemyFalcon well
<shevy> you must first pay attention the the thing between ||
Michael_ has quit [Remote host closed the connection]
<shevy> *to the
<shevy> let me give you a simpler example
<shevy> you have an array.. array = [1,2,3] ok?
<AlchemyFalcon> so we basically create a variable when we use |thing|
<AlchemyFalcon> ok
<shevy> so via: array.each {|entry| puts entry }, entry would be 1, then 2, then 3
<shevy> ok?
<AlchemyFalcon> yep
<AlchemyFalcon> do we at this point call entry a variable?
<shevy> with the File.open thing, you gave that a name... can be anything... cal it x... it refers and assigns to test.txt, and via the .puts there, you write data to it
dcope has quit [Excess Flood]
<shevy> yeah I think so
dcope has joined #ruby
<shevy> let's call it a block variable, it probably has another name but whatever
djones__ has quit [Quit: djones__]
<AlchemyFalcon> makes sense
<shevy> perhaps it is a local variable, limited to the block scope only
<shevy> but you could find out in irb
<AlchemyFalcon> that would make sense too
<AlchemyFalcon> how do you find that out in irb, .type?
<shevy> a = 'hi'; [1,2,3].each {|a| puts a }; a
<shevy> aha... a is now 3
x82_nicole has joined #ruby
<shevy> at least in ruby 1.8.7
<shevy> a moment AlchemyFalcon, let me test in 1.9.x
<shevy> ok
<shevy> in 1.9.x, a is still 'hi'
<shevy> so I guess in 1.9.x it really is a local block variable
<AlchemyFalcon> hmm super interesting
<shevy> whereas in 1.8.x it would overwrite same named variables outside the block
jbw has joined #ruby
<shevy> AlchemyFalcon yeah... I guess it may be better to use longer named variable names, in your block
alvaro_o has quit [Quit: Ex-Chat]
<shevy> unless you are sure that there can not be any ambiguity
c0rn has quit [Quit: Computer has gone to sleep.]
<shevy> I tend to always use the same names
<shevy> array.each {|line| or {|entry|
<shevy> cant remember which one I usually prefer
rakl has joined #ruby
Hanmac has joined #ruby
<AlchemyFalcon> although in (I think I'm running 1.8.7) if you do (with a undefined) [1,2,3].each {|a| puts a}; a; irb says a is undefined
<shevy> yeah
<shevy> it's a bit limited
<shevy> and not logical, in 1.8.x
snorkdude has joined #ruby
<shevy> because why would the block be able to redefine an existing variable _outside_ the block on the one hand, yet in the other example, a would not exist at all whatsoever
hadees has joined #ruby
<shevy> so I think they 1.9.x behaviour is more logical, and probably leads to less errors too
<AlchemyFalcon> definitely intersting
i_s has quit [Quit: i_s]
iamjarvo has joined #ruby
Hanmac1 has quit [Ping timeout: 256 seconds]
Michael_ has joined #ruby
rmillerx has joined #ruby
DatumDrop has joined #ruby
<AlchemyFalcon> thanks for the help shevy
willob has quit [Quit: Leaving.]
heftig has quit [Ping timeout: 256 seconds]
<shevy> yay! go use ruby :D
MattRb has quit [Quit: This computer has gone to sleep]
<shevy> we have to overthrow perl :P
ben_ has joined #ruby
heftig has joined #ruby
headius has quit [Quit: headius]
pu22l3r has joined #ruby
maletor has joined #ruby
jpfuentes2 has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
sailias has quit [Quit: Leaving.]
dougireton has joined #ruby
dougireton has quit [Client Quit]
jds_ has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
jerius has quit []
friskd_ has joined #ruby
djones__ has joined #ruby
heyitsdave has quit [Ping timeout: 252 seconds]
friskd_ has quit [Client Quit]
topriddy has joined #ruby
greenarrow has quit [Quit: IRC is just multiplayer notepad]
daniel_hinojosa has quit [Ping timeout: 240 seconds]
<aedorn> I've successfully installed a basic Gentoo system using Ruby
<wildcard0> did you have to compile ruby to do that?
<topriddy> hi guys...i'm trying to install pry on my mac...tells me something about not having write permissions. i dont want to use sudo* because this seemed to have messed up my rails installation in the past...any help?
<topriddy> i executed gem install pry
<ryanf> topriddy: if you don't have write permissions to run gem install, you have to use sudo
greenarrow has joined #ruby
<ryanf> just for the install part though, not to actually run pry later or anything
jds_ has quit [Ping timeout: 256 seconds]
rads has quit []
<ryanf> it is probably a better idea to install ruby locally with rvm or rbenv though, and then you won't have to use sudo
friskd has quit [Ping timeout: 248 seconds]
c0rn has joined #ruby
moos3 has quit [Ping timeout: 260 seconds]
djones__ has quit [Client Quit]
<aedorn> wildcard0: sort.. LiveUSB stick with Ruby and subsequent scripts on it that sets up the drive, downloads stage 3, and does the other setup to get it to a bootable state
jaequery has joined #ruby
eka has joined #ruby
arya_ has joined #ruby
<wildcard0> cool
<topriddy> ryanf: i already have ruby installed
DatumDrop has quit [Ping timeout: 255 seconds]
alienven1m has quit [Ping timeout: 255 seconds]
browndawg has quit [Read error: Connection reset by peer]
<topriddy> ryanf: i installed ruby with rvm.
Xeago has quit [Read error: Connection reset by peer]
traph has quit [Quit: Lost terminal]
moos3 has joined #ruby
<topriddy> please what do i do now?
<aedorn> so proof of concept works... guess it's time to make something more practical
Xeago has joined #ruby
graft is now known as Guest42142
Guest75995 is now known as graft
alienvenom has joined #ruby
crackfu has joined #ruby
<bigmac> !qwert!qwert
cha1tanya has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
<ryanf> topriddy: if you type "which ruby", what does it say?
bigmac is now known as i8igmac
<ryanf> if you installed with rvm, you shouldn't have to use sudo
end_guy has quit [Remote host closed the connection]
<ryanf> but if you installed it with sudo (i.e., globally instead of inside your user folder), you might need to add your user to the "rvm" group
<topriddy> ryanf: it points to .../.rv,/rubies/ruuby-1.9.3/...
end_guy has joined #ruby
browndawg has joined #ruby
pac1 has quit [Remote host closed the connection]
<ryanf> is the first ... your home directory?
<topriddy> yes it is
<ryanf> can you gist the output of "gem env"?
jduan1981 has joined #ruby
joshman_ has quit [Quit: Computer has gone to sleep.]
topriddy_ has joined #ruby
snorkdude has left #ruby [#ruby]
<topriddy_> ryanf: here please: https://gist.github.com/4544419
`brendan has quit [Ping timeout: 255 seconds]
hackerdude has quit [Remote host closed the connection]
andrewhl has joined #ruby
jjbohn has quit [Quit: Leaving...]
hackerdude has joined #ruby
<topriddy> ryanf: i gisted it
<topriddy> ??
<ryanf> is it possible that you messed up your permissions before by running something else with sudo?
richardjortega has quit [Quit: richardjortega]
<ryanf> you could try chown -R temitopefaro:staff ~/.rvm
topriddy has left #ruby [#ruby]
<ryanf> I mean sudo chown -R etc
x82_nicole has quit [Quit: Computer has gone to sleep.]
<frem> Question: why is define_method picky about block syntax? https://gist.github.com/4143d84dd70bd8995fbd
fyolnish has quit [Ping timeout: 256 seconds]
browndawg has quit [Quit: Leaving.]
templaedhel has quit [Quit: Leaving...]
jjbohn has joined #ruby
alienvenom has quit [Ping timeout: 272 seconds]
Xeago has quit [Remote host closed the connection]
<topriddy_> ryanf: i did that. now it is installing…can you please explain underlying concepts. what went wrong before?
<frem> Oh, wait. Disregard question, I got it. :)
Michael_ has quit [Remote host closed the connection]
alienvenom has joined #ruby
billy_ran_away has joined #ruby
<topriddy_> ryanf: well thanks again. got it
Zolrath has quit []
fyolnish has joined #ruby
dwu1 has joined #ruby
io_syl has quit [Ping timeout: 255 seconds]
krz has joined #ruby
dwu1 has left #ruby [#ruby]
<ryanf> topriddy_: you probably accidentally did something that made root own files inside your rvm folder
<ryanf> so then you didn't have permission to write to it without sudoing
<ryanf> changing all the ownership back to you fixes that
<topriddy_> oh okay….now i see. i need some motre *nix in my life
moos3 has quit [Quit: Computer has gone to sleep.]
ner0x has joined #ruby
moos3 has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
topriddy_ has quit [Quit: topriddy_]
DatumDrop has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
nathancahill has quit [Quit: nathancahill]
allure_ has quit [Quit: Saindo]
theRoUS has quit [Ping timeout: 276 seconds]
timonv has joined #ruby
Skylab has quit [Quit: Skylab]
forced_request has quit [Remote host closed the connection]
dwu1 has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
tommyvyo has joined #ruby
reppard has quit [Ping timeout: 256 seconds]
jjbohn has quit [Quit: Leaving...]
cha1tanya has quit [Quit: Leaving]
djones__ has joined #ruby
zeade has joined #ruby
jaequery has quit [Quit: Computer has gone to sleep.]
dougireton has joined #ruby
fred909 has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
reset has quit [Quit: Leaving...]
browndawg has joined #ruby
browndawg has left #ruby [#ruby]
jaequery has joined #ruby
jaequery has quit [Client Quit]
hbpoison has quit [Ping timeout: 245 seconds]
DatumDrop has quit [Ping timeout: 252 seconds]
bricker__ has joined #ruby
aapzak has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Ping timeout: 240 seconds]
karasawa has quit [Ping timeout: 260 seconds]
<shevy> long live ruby!
__BigO__ has joined #ruby
<shevy> who is with me
<aedorn> yay.
karasawa has joined #ruby
__BigO__ has quit [Remote host closed the connection]
cobragoa_ has joined #ruby
<shevy> aedorn don't you feel dirty using python, in gentoo, to compile ruby or later addons... :P
n1x has joined #ruby
bricker has quit [Ping timeout: 246 seconds]
__BigO__ has joined #ruby
aapzak has joined #ruby
<aedorn> yes, but I did my first successful Ruby powered Gentoo install just a bit ago
<shevy> hehe
<shevy> there is hope!
breakingthings has quit []
<shevy> more ruby users, more ruby developers, more ruby everywhere
otherj has quit [Quit: otherj]
c0rn has quit [Quit: Computer has gone to sleep.]
LouisGB has joined #ruby
wargasm1 has left #ruby [#ruby]
luckyruby has quit [Remote host closed the connection]
__BigO___ has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
kil0byte has quit [Remote host closed the connection]
jaequery has joined #ruby
__BigO__ has quit [Ping timeout: 260 seconds]
<aedorn> unfortunately I'm also secretly learning felix for no apparent reason
<shevy> felix the cat?
<aedorn> the language: felix-lang.org
ryanf has quit [Quit: leaving]
rmillerx has quit [Read error: Connection reset by peer]
end_guy has quit [Ping timeout: 276 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
mercwithamouth has quit [Ping timeout: 255 seconds]
<shevy> var ch : char = char "H"; // C++ char
<shevy> what a strange syntax
<aedorn> It is a bit strange. I don't know why I'm going into it, but it seemed interesting for tonight.
fred909 has joined #ruby
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
uris has quit [Quit: Leaving]
bricker__ is now known as bricker
arya_ has quit [Ping timeout: 248 seconds]
browndawg has joined #ruby
xpen has joined #ruby
c0rn has joined #ruby
dougireton has quit [Quit: Leaving.]
arya has joined #ruby
hbpoison has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
MattRb has joined #ruby
arya has quit [Ping timeout: 248 seconds]
mercwithamouth has joined #ruby
dasmo has joined #ruby
_hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
daslicious has quit [Ping timeout: 240 seconds]
dasmo is now known as daslicious
DatumDrop has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
arya has joined #ruby
fred909 has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
jjbohn has joined #ruby
krawchyk has quit [Remote host closed the connection]
etcetera has quit []
PragCypher has quit [Quit: Leaving]
huoxito has quit [Quit: Leaving]
aaronmacy has quit [Quit: Leaving.]
banister`sleep has quit [Remote host closed the connection]
a_a_g has joined #ruby
sayan has joined #ruby
Playground is now known as Automorphism
xpen has quit [Read error: Connection timed out]
radic has quit [Disconnected by services]
radic_ has joined #ruby
butblack has quit [Quit: butblack]
xpen has joined #ruby
rakl has quit [Quit: sleeping]
nathancahill has joined #ruby
etcetera has joined #ruby
templaedhel has joined #ruby
pu22l3r_ has joined #ruby
jjbohn has quit [Quit: Leaving...]
fyolnish has quit [Remote host closed the connection]
kil0byte has joined #ruby
d2dchat has joined #ruby
pu22l3r has quit [Ping timeout: 252 seconds]
DatumDrop has quit [Ping timeout: 245 seconds]
jjbohn has joined #ruby
djones__ has quit [Quit: djones__]
fyolnish has joined #ruby
fyolnish has quit [Remote host closed the connection]
etcetera has quit []
jeffreybaird has quit [Quit: jeffreybaird]
cobragoat has joined #ruby
crackfu has quit [Remote host closed the connection]
fyolnish has joined #ruby
crackfu has joined #ruby
cobragoa_ has quit [Ping timeout: 248 seconds]
karasawa has quit [Ping timeout: 264 seconds]
dougireton has joined #ruby
hackerdude has quit [Remote host closed the connection]
moos3 has quit [Quit: Computer has gone to sleep.]
headius has joined #ruby
macmartine has joined #ruby
crackfu has quit [Ping timeout: 276 seconds]
butblack has joined #ruby
generalissimo has joined #ruby
pyro111 has joined #ruby
jjbohn is now known as jjbohn|afk
jjbohn|afk is now known as jjbohn
nathancahill has quit [Read error: Connection reset by peer]
stkowski has quit [Read error: Connection reset by peer]
<aedorn> this data import is taking forever.. might as well walk the data to the center myself.
stkowski has joined #ruby
arya has quit [Ping timeout: 248 seconds]
alta has quit [Quit: ZNC - http://znc.in]
blazes816 has joined #ruby
toekutr has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
dougireton has quit [Ping timeout: 276 seconds]
skaczor has quit [Remote host closed the connection]
rakl has joined #ruby
dougireton has joined #ruby
connor__ has joined #ruby
katherinem13 has quit [Quit: leaving]
katherinem13 has joined #ruby
sayan has quit [Read error: Connection reset by peer]
nathancahill has joined #ruby
arya has joined #ruby
dawkirst_ has joined #ruby
_alejandro has joined #ruby
Goopyo has quit [Ping timeout: 252 seconds]
i8igmac has quit [Ping timeout: 248 seconds]
DatumDrop has joined #ruby
dawkirst_ has quit [Client Quit]
agarie has quit [Remote host closed the connection]
stopbit has quit [Quit: Leaving]
jjbohn has quit [Quit: Leaving...]
katherinem13 has quit [Quit: leaving]
headius has quit [Quit: headius]
katherinem13 has joined #ruby
joeycarmello has quit [Remote host closed the connection]
timonv_ has joined #ruby
swingha has joined #ruby
timonv has quit [Ping timeout: 245 seconds]
dougireton has quit [Quit: Leaving.]
_alejandro has quit [Remote host closed the connection]
kil0byte_ has joined #ruby
_veer has joined #ruby
_veer has quit [Changing host]
_veer has joined #ruby
kil0byt__ has joined #ruby
atno has quit [Remote host closed the connection]
kil0byte has quit [Ping timeout: 255 seconds]
generalissimo has quit [Remote host closed the connection]
ebobby has quit [Ping timeout: 264 seconds]
DatumDrop has quit [Ping timeout: 276 seconds]
kil0byte_ has quit [Ping timeout: 245 seconds]
hbpoison has quit [Ping timeout: 245 seconds]
mercwithamouth has quit [Ping timeout: 260 seconds]
shorts has quit [Remote host closed the connection]
shorts has joined #ruby
n1x has quit [Ping timeout: 245 seconds]
xybre1 has joined #ruby
shorts has quit [Remote host closed the connection]
shorts has joined #ruby
shorts has quit [Remote host closed the connection]
shorts has joined #ruby
ner0x has quit [Quit: Leaving]
tjbiddle has quit [Quit: tjbiddle]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
az7ar has joined #ruby
bluOxigen has joined #ruby
cobragoat has quit [Remote host closed the connection]
xybre1 is now known as xybr_
shorts has quit [Client Quit]
shorts has joined #ruby
ebobby has joined #ruby
templaedhel has quit [Quit: Leaving...]
h4mz1d has joined #ruby
bluOxigen has quit [Ping timeout: 256 seconds]
jduan1981_ has joined #ruby
jduan1981 has quit [Read error: Connection reset by peer]
jduan1981_ is now known as jduan1981
timonv has joined #ruby
dawkirst_ has joined #ruby
templaedhel has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
shorts has quit [Quit: shorts]
shorts has joined #ruby
lolmaus has joined #ruby
timonv_ has joined #ruby
timonv has quit [Read error: Connection reset by peer]
yosafbridge has quit [Ping timeout: 252 seconds]
joeycarmello has joined #ruby
jazzanova has joined #ruby
arya has quit [Ping timeout: 248 seconds]
russfrank has quit [Ping timeout: 276 seconds]
<jazzanova> how can I escape double quotes in a string?
russfrank has joined #ruby
yosafbridge has joined #ruby
sayan has joined #ruby
yacks has quit [Ping timeout: 246 seconds]
advorak has quit [Remote host closed the connection]
hbpoison has joined #ruby
arya has joined #ruby
<aedorn> jazzanova: \"
ben_ has quit [Quit: ben_]
<jazzanova> nevermind, i found it
<jazzanova> .to_csv
Bry8Star has joined #ruby
kiyoura has quit [Quit: Leaving]
DatumDrop has joined #ruby
dukedave has quit [Read error: Connection reset by peer]
pu22l3r_ has quit [Remote host closed the connection]
headius has joined #ruby
opettaja has joined #ruby
headius has quit [Client Quit]
dougireton has joined #ruby
cobragoat has joined #ruby
jazzanova has quit [Quit: Page closed]
__BigO___ has quit [Remote host closed the connection]
arkiver has joined #ruby
crank_ has joined #ruby
rezzack has quit [Quit: Leaving.]
crackfu has joined #ruby
hbpoison has quit [Ping timeout: 264 seconds]
arya has quit [Ping timeout: 248 seconds]
madwilliamflint has quit []
butblack has quit [Read error: Connection reset by peer]
butblack has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
ben_ has joined #ruby
butblack has quit [Client Quit]
Rydefalk has joined #ruby
yacks has joined #ruby
crackfu has quit [Ping timeout: 252 seconds]
dawkirst_ is now known as dawkirst
arya has joined #ruby
drago757 has quit [Quit: drago757]
frem has quit [Ping timeout: 248 seconds]
DatumDrop has quit [Ping timeout: 245 seconds]
hbpoison has joined #ruby
lkba has quit [Ping timeout: 248 seconds]
<dawkirst> Hi, *very* new to Ruby and programming. How can I cache something for a set period of time?
fyolnish has quit [Remote host closed the connection]
lkba has joined #ruby
davidcel- has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
cobragoat has quit [Remote host closed the connection]
erichmenge_ has joined #ruby
timonv has joined #ruby
generalissimo has joined #ruby
shorts has quit [Quit: away]
erichmenge has quit [Quit: Arrivederci!]
erichmenge_ is now known as erichmenge
dougireton has quit [Quit: Leaving.]
tps_ has quit [Quit: tps_]
jcrawford has quit [Excess Flood]
nomenkun has joined #ruby
fyolnish has joined #ruby
jjbohn has joined #ruby
cobragoat has joined #ruby
kil0byte has joined #ruby
generali_ has joined #ruby
generalissimo has quit [Read error: Connection reset by peer]
hackerdude has joined #ruby
dhruvasagar has joined #ruby
jcrawford has joined #ruby
kil0byt__ has quit [Ping timeout: 256 seconds]
karasawa has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
browndawg has quit [Quit: Leaving.]
jjbohn has quit [Ping timeout: 248 seconds]
EPIK has quit [Ping timeout: 260 seconds]
iamjarvo has quit [Quit: Leaving.]
BoomCow has joined #ruby
Fretta has quit [Quit: Fretta]
brandon|work has quit [Ping timeout: 272 seconds]
aaronmacy has joined #ruby
timonv has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
bitZero_1 has quit [Ping timeout: 252 seconds]
davidcelis has quit [Disconnected by services]
davidcel- is now known as davidcelis
davidcelis has quit [Changing host]
davidcelis has joined #ruby
a_a_g1 has joined #ruby
bitZero__ has joined #ruby
davidcel- has joined #ruby
MattRb has quit [Quit: This computer has gone to sleep]
DatumDrop has joined #ruby
<havenn> dawkirst: What do you mean by cache? A variable?
io_syl has joined #ruby
io_syl has quit [Client Quit]
alup has quit [Ping timeout: 248 seconds]
davidcel- has quit [Client Quit]
kenneth has joined #ruby
tagrudev has joined #ruby
Liothen has joined #ruby
<havenn> dawkirst: I'm not sure I understand your question, but if you mean temporarily assign an instance variable to something arbitrary, could do something like: @cache = 'temp'; Thread.new { sleep 30; @cache = nil }
io_syl has joined #ruby
a_a_g has quit [Ping timeout: 252 seconds]
MattRb has joined #ruby
bitZero__ has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 276 seconds]
emmanuelux has quit [Remote host closed the connection]
bitZero__ has joined #ruby
subbyyy has quit [Ping timeout: 260 seconds]
crank_ has quit [Quit: crank_]
tonini has joined #ruby
hackerdude has quit [Remote host closed the connection]
jaequery has quit [Quit: Computer has gone to sleep.]
arya has quit [Ping timeout: 248 seconds]
DatumDrop has quit [Ping timeout: 276 seconds]
jjbohn has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
BoomCow has quit [Quit: This computer has gone to sleep]
nwertman has quit [Read error: Connection reset by peer]
karasawa has quit [Ping timeout: 276 seconds]
arya has joined #ruby
DrShoggoth has quit [Quit: Leaving]
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
xybre has quit [Quit: leaving]
LouisGB has quit [Ping timeout: 246 seconds]
apeiros has quit [Ping timeout: 245 seconds]
xybr_ is now known as xybre
nwertman has joined #ruby
xybre has quit [Changing host]
xybre has joined #ruby
timonv_ has quit [Ping timeout: 246 seconds]
timonv has joined #ruby
alanjc has quit [Quit: ThrashIRC v2.8 sic populo comunicated]
rippa has joined #ruby
nomenkun has quit [Remote host closed the connection]
jjbohn has quit [Ping timeout: 264 seconds]
SiliconDon has joined #ruby
MattRb has quit [Quit: This computer has gone to sleep]
slainer68 has joined #ruby
hbpoison has joined #ruby
charliesome has joined #ruby
rippa has quit [Ping timeout: 252 seconds]
diegoviola has quit [Quit: WeeChat 0.3.9.2]
slainer68 has quit [Read error: Operation timed out]
browndawg has joined #ruby
blazes816 has quit [Quit: blazes816]
pyx has joined #ruby
clocKwize has joined #ruby
robustus has quit [Ping timeout: 255 seconds]
robustus has joined #ruby
Chryson has quit [Quit: Leaving]
SiliconDon has quit [Ping timeout: 246 seconds]
dmiller1 has quit [Ping timeout: 246 seconds]
DatumDrop has joined #ruby
arya has quit [Ping timeout: 248 seconds]
adeponte has joined #ruby
piotr_ has joined #ruby
Fretta has joined #ruby
Valkyrie^ is now known as Azure
ChampS666 has joined #ruby
arya has joined #ruby
aganov has joined #ruby
ChampS_ has joined #ruby
MattRb has joined #ruby
stkowski has quit [Quit: stkowski]
francisfish has quit [Remote host closed the connection]
francisfish has joined #ruby
ChampS666 has quit [Ping timeout: 252 seconds]
tatsuya_o has quit [Remote host closed the connection]
jjbohn has joined #ruby
mafolz has joined #ruby
zommi has joined #ruby
h4mz1d has quit [Ping timeout: 252 seconds]
DatumDrop has quit [Ping timeout: 264 seconds]
noyb has joined #ruby
francisfish has quit [Ping timeout: 248 seconds]
soulcake has quit [Ping timeout: 252 seconds]
Fretta has quit [Ping timeout: 260 seconds]
rakl has quit [Quit: sleeping]
tps_ has joined #ruby
Morkel has joined #ruby
hbpoison has quit [Ping timeout: 252 seconds]
tps_ has quit [Client Quit]
rezzack has joined #ruby
ChampS_ has quit [Ping timeout: 255 seconds]
<pyro111> mini syntactic sugar that looks like this: [1,2,3].all? &x{ is_a? Integer } # => true
jjbohn has quit [Ping timeout: 255 seconds]
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
andrewhl has quit [Remote host closed the connection]
connor__ has quit [Remote host closed the connection]
razibog has joined #ruby
noxoc has joined #ruby
topriddy_ has joined #ruby
topriddy_ has quit [Read error: Connection reset by peer]
topriddy_ has joined #ruby
topriddy_ has quit [Read error: Connection reset by peer]
cgcardona has joined #ruby
aaronmacy has quit [Quit: Leaving.]
topriddy_ has joined #ruby
topriddy_ has quit [Read error: Connection reset by peer]
b1rkh0ff has joined #ruby
timonv has quit [Ping timeout: 260 seconds]
topriddy_ has joined #ruby
topriddy_ has quit [Read error: Connection reset by peer]
ben_ has quit [Quit: ben_]
MattRb has quit [Quit: This computer has gone to sleep]
arya has quit [Ping timeout: 248 seconds]
TomyLobo has joined #ruby
LouisGB has joined #ruby
aaronmacy has joined #ruby
opettaja has quit [Remote host closed the connection]
arya has joined #ruby
filipe has joined #ruby
adeponte has quit [Remote host closed the connection]
DatumDrop has joined #ruby
generali_ has quit [Remote host closed the connection]
mkillebrew has quit [Ping timeout: 264 seconds]
jds_ has joined #ruby
mkillebrew has joined #ruby
apeiros has joined #ruby
jprovazn has joined #ruby
hbpoison has joined #ruby
jduan1981 has quit [Quit: jduan1981]
zigomir has joined #ruby
arturaz has joined #ruby
eldariof-office has joined #ruby
chussenot has joined #ruby
templaedhel has quit [Quit: Leaving...]
toekutr has joined #ruby
zmo_ has joined #ruby
connor__ has joined #ruby
jwang has joined #ruby
hbpoison has quit [Ping timeout: 240 seconds]
DatumDrop has quit [Ping timeout: 240 seconds]
cb0ss has quit [Read error: Connection reset by peer]
cb0ss has joined #ruby
Goopyo has joined #ruby
nomenkun has joined #ruby
ryanf has joined #ruby
arturaz has quit [Remote host closed the connection]
razibog1 has joined #ruby
Axsuul has quit [Ping timeout: 252 seconds]
havenn has quit [Remote host closed the connection]
robert__ has joined #ruby
robert__ has quit [Changing host]
robert__ has joined #ruby
razibog has quit [Ping timeout: 260 seconds]
hbpoison has joined #ruby
pyx has quit [Quit: WeeChat 0.3.9.2]
buibex has joined #ruby
buibex has quit [Client Quit]
robert_ has quit [Ping timeout: 276 seconds]
ryanf has quit [Quit: broken pipes |||]
banister`sleep has joined #ruby
hotovson_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
jds_ has quit [Remote host closed the connection]
zeade has quit [Quit: Leaving.]
iaj has quit [Ping timeout: 248 seconds]
TheFuzzball has joined #ruby
kn330 has joined #ruby
ryanf has joined #ruby
iaj has joined #ruby
sayan has quit [Read error: Connection reset by peer]
arya has joined #ruby
blaxter has joined #ruby
w400z has joined #ruby
robert___ has joined #ruby
cobragoat has quit [Remote host closed the connection]
cobragoat has joined #ruby
kil0byte_ has joined #ruby
w400z has quit [Client Quit]
RagingDave has joined #ruby
robert__ has quit [Ping timeout: 245 seconds]
hbpoison has quit [Ping timeout: 276 seconds]
blaxter has quit [Ping timeout: 246 seconds]
hoelzro|away is now known as hoelzro
[Neurotic] has quit [Remote host closed the connection]
aaronmacy has quit [Quit: Leaving.]
kil0byte has quit [Ping timeout: 248 seconds]
razibog has joined #ruby
cobragoat has quit [Ping timeout: 240 seconds]
gyre008 has joined #ruby
aaronmacy has joined #ruby
DatumDrop has joined #ruby
jonahR has quit [Quit: jonahR]
razibog1 has quit [Ping timeout: 276 seconds]
marr has joined #ruby
Elhu has joined #ruby
jonahR has joined #ruby
x82_nicole has joined #ruby
jjbohn has joined #ruby
jimeh has joined #ruby
atno has joined #ruby
blaxter has joined #ruby
francisfish has joined #ruby
sn0wb1rd has joined #ruby
billy_ran_away has quit [Read error: Operation timed out]
elico has joined #ruby
sayan has joined #ruby
ebobby has quit [Quit: Lost terminal]
DatumDrop has quit [Ping timeout: 260 seconds]
billy_ran_away has joined #ruby
jjbohn has quit [Ping timeout: 252 seconds]
emocakes has joined #ruby
elico has quit [Client Quit]
zeade has joined #ruby
cjk101010_ is now known as cjk101010
TheFuzzball has quit [Quit: Computer has gone to sleep.]
luckyruby has joined #ruby
clocKwize has quit [Quit: clocKwize]
zeade has quit [Read error: Operation timed out]
Goopyo has quit [Quit: Goopyo]
Spooner has joined #ruby
main has joined #ruby
hbpoison has joined #ruby
beilabs_ is now known as beilabs
horofox has joined #ruby
Morkel has quit [Quit: Morkel]
blacktulip has joined #ruby
nwertman has quit [Read error: Operation timed out]
jds_ has joined #ruby
luckyruby has quit [Remote host closed the connection]
Morkel has joined #ruby
clocKwize has joined #ruby
hbpoison has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
segv- has joined #ruby
Morkel has quit [Client Quit]
Kuifje has joined #ruby
Morkel has joined #ruby
robotmay has joined #ruby
karasawa has joined #ruby
jds_ has quit [Ping timeout: 260 seconds]
rdark has joined #ruby
kn330 has quit [Read error: Connection reset by peer]
sn0wb1rd has quit [Read error: Connection reset by peer]
sn0wb1rd has joined #ruby
noxoc has quit [Quit: noxoc]
cdt has joined #ruby
ephemerian has joined #ruby
dwu1 has quit [Quit: Leaving.]
slainer68 has joined #ruby
taoru has quit [Remote host closed the connection]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
adambeynon has joined #ruby
pavilionXP has quit [Quit: Forget progress by proxy. Land on your own moon.]
osaut has joined #ruby
taoru has joined #ruby
elaptics`away is now known as elaptics
nkr has joined #ruby
DatumDrop has joined #ruby
Goopyo has joined #ruby
stonevil has joined #ruby
zz_chrismcg is now known as chrismcg
horofox has quit [Quit: horofox]
chussenot has quit [Quit: chussenot]
nari has quit [Ping timeout: 245 seconds]
timonv has joined #ruby
berserkr has joined #ruby
taoru has quit [Remote host closed the connection]
hbpoison has joined #ruby
RagingDave has quit [Quit: Ex-Chat]
arya has quit [Ping timeout: 248 seconds]
tatsuya_o has joined #ruby
arietis has joined #ruby
mahmoudimus has joined #ruby
noyb has quit [Ping timeout: 256 seconds]
noxoc has joined #ruby
diegoviola has joined #ruby
jgrevich has quit [Remote host closed the connection]
noyb has joined #ruby
hemanth_ has quit [Read error: Connection reset by peer]
timmow has joined #ruby
hemanth_ has joined #ruby
hemanth_ has quit [Read error: Connection reset by peer]
x82_nicole has quit [Quit: Computer has gone to sleep.]
hemanth_ has joined #ruby
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
ryanf has quit [Quit: leaving]
DatumDrop has quit [Read error: Operation timed out]
toekutr has quit [Read error: Connection reset by peer]
stonevil has quit [Quit: stonevil]
Nisstyre has quit [Ping timeout: 248 seconds]
kn330 has joined #ruby
zigomir has quit [Quit: zigomir]
bluOxigen has joined #ruby
noyb has quit [Ping timeout: 248 seconds]
Zolrath has joined #ruby
Goopyo has quit [Quit: Goopyo]
mahmoudi_ has joined #ruby
reuven has quit [Remote host closed the connection]
reuven has joined #ruby
arturaz has joined #ruby
Elhu has quit [Ping timeout: 245 seconds]
yacks has quit [Ping timeout: 276 seconds]
freeayu has quit [Ping timeout: 245 seconds]
Elhu has joined #ruby
reuven has quit [Remote host closed the connection]
pavilionXP has joined #ruby
mahmoud__ has joined #ruby
mahmoudimus has quit [Ping timeout: 276 seconds]
fyolnish has quit [Ping timeout: 245 seconds]
mahmoudi_ has quit [Ping timeout: 245 seconds]
freeayu has joined #ruby
malte_ has quit [Quit: malte_]
lkba has quit [Quit: Bye]
Xeago has joined #ruby
matthias_ has joined #ruby
matthias_ has quit [Client Quit]
hamed_r has joined #ruby
binaryplease has joined #ruby
jblack has joined #ruby
Nisstyre has joined #ruby
vlad_starkov has joined #ruby
jblack has quit [Client Quit]
Automorphism has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
sayan has quit [Read error: Connection reset by peer]
Playground has joined #ruby
Morkel has quit [Quit: Morkel]
moshee has quit [Ping timeout: 246 seconds]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
arietis has quit [Quit: Computer has gone to sleep.]
rezzack has quit [Quit: Leaving.]
<shevy> pyro111 hmmmmmmm
<shevy> this looks so strange
vlad_starkov has quit [Ping timeout: 246 seconds]
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
hemanth_ has quit [Read error: Connection reset by peer]
<shevy> I dont get how it works
yacks has joined #ruby
<shevy> this part: def x &block; proc { |obj| obj.instance_eval &block }
hemanth_ has joined #ruby
<shevy> def x(&block)
<shevy> so it accepts a block... which it instance_eval()s
hemanth_ has quit [Read error: Connection reset by peer]
zigomir has joined #ruby
<shevy> oh
hemanth_ has joined #ruby
<shevy> &x is a method
xpen has quit [Ping timeout: 240 seconds]
<shevy> ruby can be strange
kuzushi has quit [Read error: Operation timed out]
<emocakes> try php
<tobiasvl> shevy: blocks are just methods, basically
<tobiasvl> lambdas
<shevy> emocakes lol
<shevy> I am trying to extend pyro111's code... with method_missing
<pyro111> i think that & is keyword, so it takes block and feed it to instance_eval
companion has quit [Ping timeout: 260 seconds]
yacks has quit [Quit: Leaving]
<pyro111> shevy: good idea so you can get rid of &
<shevy> oh
DatumDrop has joined #ruby
companion has joined #ruby
<pyro111> something like map_ { ... }
<tobiasvl> & is an operator
atno is now known as afarazit
<pyro111> hm..
gyre007 has joined #ruby
matthias_ has joined #ruby
kuzushi has joined #ruby
arietis has joined #ruby
<pyro111> >> [1,2,3].each &-> {|x| puts x}
<eval-in> Pyro111: Output: "/tmp/execpad-3fd55b95d227/source-3fd55b95d227:1: syntax error, unexpected '|'\n[1,2,3].each &-> {|x| puts x}\n ^\n/tmp/execpad-3fd55b95d227/source-3fd55b95d227:1: syntax error, unexpecte ..." (http://eval.in/6834)
<pyro111> >> [1,2,3].each &->(x){ puts x}
<eval-in> Pyro111: Output: "1\n2\n3\n" (http://eval.in/6835)
<pyro111> i think its keyword in this case
yacks has joined #ruby
Vert has joined #ruby
<pyro111> anyway am bad with terminology
razibog has quit [Quit: Leaving.]
razibog1 has joined #ruby
mengu has joined #ruby
<shevy> whoa
alup has joined #ruby
<shevy> [1,2,3].each &->(x){ puts x}
<shevy> crazy
<shevy> can I chain multiple ->()->()->() ?
<heftig> [1,2,3].each &proc{ |x| puts x}
<heftig> lame
<shevy> &->()&->()&->()
samuel02 has joined #ruby
<shevy> ack
<heftig> shevy: no. it's just the usual & syntax
psino has quit [Excess Flood]
binaryplease has quit [Quit: WeeChat 0.3.9.2]
evanx_ has joined #ruby
<shevy> hmm. why do people use foo.call(5) rather than foo[5] ? at least it seems most prefer .call even though it is longer
<shevy> for proc objects
<shevy> ok heftig
evanx has quit [Ping timeout: 245 seconds]
evanx_ is now known as evanx
<heftig> because operator overloading is ugly
psino has joined #ruby
<shevy> hehe
sayan has joined #ruby
cdt has quit [Quit: Ex-Chat]
<pyro111> there is people who use foo.call 5 because there is no parens
<shevy> ok
<shevy> but foo.call 5 is still longer than foo[5]
<hoelzro> foo[5] (for Procs) is just gross.
cdt has joined #ruby
razibog1 has quit [Read error: Connection reset by peer]
razibog has joined #ruby
mahmoud__ has quit [Quit: Computer has gone to sleep.]
<dawkirst> havenn, thanks, that'll probably do the trick.
tonini has quit [Remote host closed the connection]
daniel_- has joined #ruby
<pyro111> >> p 2; BEGIN{ p 1 }
<eval-in> Pyro111: Output: "1\n2\n" (http://eval.in/6836)
cha1tanya has quit [Read error: Connection reset by peer]
cha1tanya has joined #ruby
<pyro111> >> Point.new(1,2) ; p Point[1,2] ; BEGIN{ class Point < Struct.new :x, :y }
<eval-in> Pyro111: Output: "/tmp/execpad-4b505a361e6c/source-4b505a361e6c:1: syntax error, unexpected '}', expecting ';' or '\\n'\n...ass Point < Struct.new :x, :y }\n... ^\n" (http://eval.in/6837)
DatumDrop has quit [Ping timeout: 252 seconds]
razibog has quit [Client Quit]
<pyro111> anyway in this case i prefer .new then .[]
razibog1 has joined #ruby
<pyro111> but [] lokks natural aswell
<JonnieCache> is there a neater way of doing `[1,2,3].push(*[4,5,6])`
<JonnieCache> the first array must be mutated not replaced
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
horofox has joined #ruby
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
yshh has quit [Remote host closed the connection]
<pyro111> >> [1,2,3].tap{|x|x.replace(x+[4,5,6])}
<eval-in> Pyro111: Output: "" (http://eval.in/6838)
<pyro111> >> p [1,2,3].tap{|x|x.replace(x+[4,5,6])}
<eval-in> Pyro111: Output: "[1, 2, 3, 4, 5, 6]\n" (http://eval.in/6839)
ottbot has joined #ruby
<JonnieCache> i wouldnt call that neater
<JonnieCache> but i appreciate the effort
osaut has quit [Quit: osaut]
wallerdev has quit [Quit: wallerdev]
sayan has quit [Read error: Connection reset by peer]
hotovson_ has quit [Remote host closed the connection]
<pyro111> ok the neater way is to remove parens: [1,2,3].push *[4,5,6]
<blaxter> >> a = [1,2,3]; original_id = a.object_id; b=[4,5,6]; a |= b; print original_id == a.object_id
<eval-in> blaxter: Output: "false" (http://eval.in/6840)
<blaxter> fail
cha1tanya has quit [Read error: Connection reset by peer]
eldariof-office has quit [Ping timeout: 248 seconds]
eldariof has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Read error: Connection reset by peer]
reinaldob has joined #ruby
<blaxter> >> a = [1,2,3]; original_id = a.object_id; b=[4,5,6]; a.push *b; print original_id == a.object_id
<eval-in> blaxter: Output: "true" (http://eval.in/6841)
<apeiros> blaxter: a.concat b is more efficient than a.push *b
<JonnieCache> apeiros: does concat mutate though
<apeiros> JonnieCache: as opposed to push? :)
<JonnieCache> no i want it to mutate
<apeiros> yes, concat mutates
<apeiros> as does push
<apeiros> + does not mutate
<apeiros> and: irb!
<JonnieCache> (its a fancy object not a real array so i cant replace it)
<JonnieCache> and i already found out my method in pry using object ids and stuff i just wanted to golf it
karasawa has quit [Read error: Connection reset by peer]
connor__ has quit [Remote host closed the connection]
djones_ has joined #ruby
kil0byte_ has quit [Ping timeout: 246 seconds]
rakuN has quit [Quit: Saliendo]
karasawa has joined #ruby
a_a_g has joined #ruby
kil0byte has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
tvw has joined #ruby
a_a_g1 has quit [Ping timeout: 276 seconds]
chussenot has joined #ruby
<shevy> teenage ninja mutant turtles
<shevy> they can push, they can concat, man they rule
matthias_ has quit [Remote host closed the connection]
raulp has quit [Ping timeout: 260 seconds]
raulp has joined #ruby
DatumDrop has joined #ruby
FlyingFoXy has quit [Ping timeout: 252 seconds]
hemanth_ has quit [Read error: Connection reset by peer]
kil0byte_ has joined #ruby
clocKwize has quit [Read error: Connection reset by peer]
stonevil has joined #ruby
hemanth_ has joined #ruby
pskosinski has joined #ruby
buibex has joined #ruby
<DefV> :ç
rippa has joined #ruby
clocKwize has joined #ruby
voxal has joined #ruby
buibex has quit [Remote host closed the connection]
<voxal> gwaan
kil0byte has quit [Ping timeout: 248 seconds]
buibex has joined #ruby
* Xeago yawns.. Why did I have to get funky configuring a server till 5am
<voxal> Is there a clean way of causing Ruby to raise a particular exception when upon out-of-bounds Array index access?
<voxal> Default behaviour is of course to create nil elements until that point
io_syl has quit [Quit: Computer has gone to sleep.]
banister`sleep has quit [Ping timeout: 260 seconds]
<tobiasvl> clean way = monkey patching? :)
hotovson_ has joined #ruby
<shevy> hmm voxal if you use array[number] you only get nil
<shevy> perhaps via .fetch
<voxal> shevy: by access actually, I meant writing rather than reading
<shevy> #<IndexError: index 555 out of array>
<shevy> perhaps you can rescue that and then use your own error object
<voxal> Hmm that could work, thanks :)
<shevy> my brain is still on pyro111's code
segv- has quit [Quit: segv-]
<xybre> voxal: subclass Array
<JonnieCache> Xeago: how funky did you get
hemanth_ is now known as whoami
<voxal> Oh actually it wouldn't work due to me needing to write rather than read
<JonnieCache> did you decide to build gentoo or something
<voxal> xybre: thanks, gonna give that a go right now
whoami has quit [Quit: Leaving]
banister`sleep has joined #ruby
DatumDrop has quit [Ping timeout: 255 seconds]
Michael_ has joined #ruby
joshman_ has joined #ruby
workmad3 has joined #ruby
arya has joined #ruby
sayan has joined #ruby
hamed_r has quit [Remote host closed the connection]
FlyingFoX has joined #ruby
<JonnieCache> damn, you know sequel is a good ORM, it has 0 issues and 0 pull requests
<JonnieCache> such a good project
mjolk has joined #ruby
connor__ has joined #ruby
hbpoison has joined #ruby
arya has quit [Ping timeout: 248 seconds]
carloslopes has joined #ruby
samphippen has joined #ruby
sayan has quit [Quit: Leaving]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
arya has joined #ruby
kil0byte has joined #ruby
aaronmacy has quit [Quit: Leaving.]
postmodern has quit [Quit: Leaving]
kn330 has quit [Ping timeout: 256 seconds]
arya has quit [Ping timeout: 248 seconds]
kil0byte_ has quit [Ping timeout: 240 seconds]
arya has joined #ruby
nwertman has joined #ruby
<shevy> long live gentoo
<shevy> we just have to replace emerge with remerge
connor__ has quit [Ping timeout: 260 seconds]
<voxal> I have one method throwing an exception (IndexError); the callee does: begin; the_method(); rescue IndexError; throw InputError; end;
<voxal> It says IndexError is uncaught, is this not sufficient?
<voxal> The intention of the code is to ultimately buble up the exception chain an exception of appropriate abstraction level
<shevy> why do you use throw
<shevy> should it not be raise instead?
az7ar has quit [Quit: Leaving]
<shevy> hey JonnieCache
<voxal> .....yes. Thank you!
daniel_- has quit [Ping timeout: 260 seconds]
<shevy> welcome voxal
<shevy> JonnieCache, when you see this:
<shevy> def initialize(label, &action)
<shevy> wouldn't people assume that &action is the second argument?
<JonnieCache> it is
<shevy> hmmmmmm
<JonnieCache> its the block which is the second argument
<JonnieCache> unless im very confused
<shevy> the block, but the block happens later or? for example:
<shevy> def foo(a, &b)
beliveyourdream has joined #ruby
<shevy> some_object.foo('hi') { :bla }
<shevy> or?
<shevy> well bad example
<shevy> some_object.foo('hi', &bla)
<shevy> ^^^ would not work, right?
<shevy> alright... I need beer...
<JonnieCache> maybe not
aaronmacy has joined #ruby
<JonnieCache> but some_object.send(:foo, "hi", Proc.new {:bla}) works
<JonnieCache> iirc
vibez has joined #ruby
vibez has left #ruby [#ruby]
jprovazn has quit [Quit: Leaving]
Michael_ has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
karasawa has quit [Ping timeout: 264 seconds]
freeayu has quit [Ping timeout: 264 seconds]
timonv has joined #ruby
beiter has joined #ruby
timonv has quit [Read error: Connection reset by peer]
freeayu has joined #ruby
nkts has joined #ruby
DatumDrop has joined #ruby
arya_ has joined #ruby
eka has joined #ruby
reppard has joined #ruby
arya has quit [Ping timeout: 248 seconds]
timonv has joined #ruby
zeade has joined #ruby
krz has quit [Quit: krz]
melisaa has joined #ruby
osaut has joined #ruby
baphled has joined #ruby
sayan has joined #ruby
karasawa has joined #ruby
<shevy> hmm
<shevy> it's strange
<shevy> my brain would have expected that "def foo(a, b)" always come inside the () parens, when calling it
<shevy> or rather, "def foo(a, &b)"
vlad_starkov has joined #ruby
<shevy> I feel matz principle's of least surprise is violated!
<JonnieCache> ruby doesnt follow the principle of leats surprise
aaronmacy has quit [Quit: Leaving.]
<JonnieCache> it follows the principle of least surprise for matz
zeade has quit [Ping timeout: 260 seconds]
<JonnieCache> tbh i dont know why anyone would ever associate POLS with ruby
ABK has joined #ruby
lkba has joined #ruby
jonahR has quit [Quit: jonahR]
DatumDrop has quit [Ping timeout: 260 seconds]
melisaa has quit [Ping timeout: 255 seconds]
<tobiasvl> haha no
<shevy> yeah that's why I wrote "shevy> I feel matz principle's of least surprise is violated!"
<shevy> see the name matz in there!!!
<tobiasvl> how can you know if he was surprised by that? :)
<shevy> because it is like C++!
<shevy> you use special syntax for something completely different
<shevy> I think the only way this is like so is because of the way how the parser works
<JonnieCache> its kind of acceptable because its an absolute core language feature though
<JonnieCache> so if youre surprised by it you cant have been using ruby long so you would expect to be surprised
<shevy> you could say the same about C++ :D
<JonnieCache> well there is a lot of that c++ bullshit in ruby really
<JonnieCache> the special operator method thingies
<JonnieCache> []= and so on
arya_ has quit [Ping timeout: 252 seconds]
baphled has quit [Ping timeout: 260 seconds]
arya has joined #ruby
melisaa has joined #ruby
melisaa has left #ruby [#ruby]
Shrink has quit [Ping timeout: 276 seconds]
arya_ has joined #ruby
stonevil has quit [Quit: stonevil]
TheFuzzball has joined #ruby
djones_ has quit [Quit: djones_]
melisaa has joined #ruby
arya has quit [Ping timeout: 252 seconds]
viario has joined #ruby
mmitchell has joined #ruby
Ca11yWally has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 248 seconds]
carloslopes has quit [Remote host closed the connection]
slainer68 has quit [Remote host closed the connection]
Criztian has joined #ruby
swingha has quit [Quit: WeeChat 0.3.9.2]
ExxKA has joined #ruby
mikecmpbll has joined #ruby
melisaa has quit [K-Lined]
mjolk has quit [Quit: Leaving]
mjolk has joined #ruby
blueOxigen has joined #ruby
reppard has quit [Ping timeout: 245 seconds]
bluOxigen has quit [Ping timeout: 255 seconds]
<shevy> hey guys... question. I am writing a small class that will use ffmpeg to cut audio files
<shevy> input like "33-561" would cut from 33 seconds to 561 seconds. so far so good
<shevy> but I also want to have separate input for start-position, and end-position. like "33", and "561" in this case
<shevy> so now I am thinking of allowing special characters... but what should I use for start and end?
<shevy> in regex, start and end would be ^ and $, so I was thinking of using that
<shevy> "^33", "$561" ... hmm but it's kinda ugly
nari has joined #ruby
mmitchell has quit [Remote host closed the connection]
zeade has joined #ruby
Shrink has joined #ruby
lateau has quit [Ping timeout: 252 seconds]
DatumDrop has joined #ruby
d2dchat has quit [Remote host closed the connection]
chiel has quit [Ping timeout: 255 seconds]
timonv has quit [Remote host closed the connection]
yacks has quit [Read error: Operation timed out]
jds_ has joined #ruby
gyre007 has quit [Remote host closed the connection]
connor__ has joined #ruby
osaut has quit [Quit: osaut]
__BigO__ has joined #ruby
jds_ has quit [Ping timeout: 276 seconds]
connor__ has quit [Ping timeout: 276 seconds]
baphled has joined #ruby
ABK has quit [Ping timeout: 260 seconds]
DatumDrop has quit [Ping timeout: 260 seconds]
lateau has joined #ruby
BizarreCake has joined #ruby
timonv has joined #ruby
zeade has quit [Ping timeout: 272 seconds]
baphled has quit [Ping timeout: 248 seconds]
tommyvyo has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
jlebrech has joined #ruby
Spami has joined #ruby
<jlebrech> how do I force install a yanked gem?
<apeiros> uhm, a yanked gem is no longer there. you can't install something that doesn't exist…
<apeiros> if you have a local copy of it, you can install it via `gem install PATH`
gyre007 has joined #ruby
browndawg has quit [Quit: Leaving.]
slainer68 has joined #ruby
tvw has quit [Ping timeout: 245 seconds]
sepp2k has joined #ruby
Mon_Ouie has joined #ruby
Morkel has joined #ruby
banister`sleep has quit [Ping timeout: 240 seconds]
kil0byte_ has joined #ruby
banister`sleep has joined #ruby
stevechiagozie has joined #ruby
baphled has joined #ruby
yacks has joined #ruby
sheerun has quit [Quit: ZNC - http://znc.in]
kil0byte has quit [Ping timeout: 264 seconds]
sheerun has joined #ruby
`brendan has joined #ruby
poseid has joined #ruby
<JonnieCache> you can still get yanked gems from the rubygems.org web interface
<JonnieCache> but you shouldnt really. they got yanked for a reason
Vert has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
karasawa has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
shorts has joined #ruby
enroxorz-work has joined #ruby
dustint has joined #ruby
stevechiagozie has quit [Read error: Connection reset by peer]
jlebrech has quit [Ping timeout: 245 seconds]
iamjarvo has joined #ruby
baphled has quit [Ping timeout: 264 seconds]
Nisstyre has quit [Ping timeout: 252 seconds]
DatumDrop has joined #ruby
<shevy> yank me good please
<JonnieCache> :(
afarazit is now known as afarazit|atno
zeade has joined #ruby
hotovson_ has quit [Remote host closed the connection]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
zeade has quit [Ping timeout: 248 seconds]
nwertman has quit [Read error: Connection reset by peer]
nwertman has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
<shevy> but with a smile! :)
arya has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
DatumDrop has quit [Ping timeout: 245 seconds]
Nisstyre has joined #ruby
araujo has quit [Read error: Connection reset by peer]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
BizarreCake has quit [Ping timeout: 252 seconds]
karasawa has joined #ruby
carloslopes has joined #ruby
stonevil has joined #ruby
cha1tanya has joined #ruby
cha1tanya has joined #ruby
mark_locklear has joined #ruby
lateau has quit [Remote host closed the connection]
lateau has joined #ruby
baphled has joined #ruby
chiel has joined #ruby
yacks has quit [Ping timeout: 255 seconds]
jds_ has joined #ruby
<shevy> $$ = new_masgn(p, $1, list1($3));
<shevy> ewwww... .y files
Shrink has quit [Ping timeout: 252 seconds]
<matti> ?
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
connor__ has joined #ruby
x0F_ is now known as x0F
sailias has joined #ruby
EPIK has joined #ruby
mgrayson has joined #ruby
mikecmpbll has quit [Quit: Computer has gone to sleep.]
Neomex has joined #ruby
willob has joined #ruby
<shevy> matti matz has to write .y files
<matti> Well.
mmitchell has joined #ruby
<shevy> when I create a programming language, I'd rather not want to write .y files
Neomex has quit [Client Quit]
jds_ has quit [Ping timeout: 260 seconds]
<shevy> hmmm
<shevy> this is C actually
baphled has quit [Ping timeout: 260 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<shevy> almost
<shevy> %token
<shevy> keyword__ENCODING__
<shevy> %token <id> tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR tLABEL
BizarreCake has joined #ruby
<shevy> hey apeiros does halsbe also have .y files like this? listing the keywords and such
<apeiros> shevy: I'm not using bison, so no, no .y files
connor__ has quit [Ping timeout: 260 seconds]
kil0byte has joined #ruby
voxal has quit [Quit: Page closed]
<apeiros> for developing I use a ruby based parser.
karasawa has quit [Ping timeout: 264 seconds]
karasawa has joined #ruby
kil0byt__ has joined #ruby
moos3 has joined #ruby
yacks has joined #ruby
zeade has joined #ruby
mmitchell has quit [Ping timeout: 260 seconds]
dross has quit [Read error: Operation timed out]
a_a_g has quit [Quit: Leaving.]
companion has quit [Ping timeout: 255 seconds]
kil0byte_ has quit [Ping timeout: 276 seconds]
dross has joined #ruby
djones_ has joined #ruby
stonevil has quit [Quit: stonevil]
kil0byte has quit [Ping timeout: 252 seconds]
companion has joined #ruby
DatumDrop has joined #ruby
__BigO__ has quit [Remote host closed the connection]
zeade has quit [Ping timeout: 255 seconds]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
wubie has joined #ruby
iIlL10Oo has joined #ruby
<iIlL10Oo> how to draw a line or a dot on the linux screen ?
<iIlL10Oo> with out gems
<hoelzro> iIlL10Oo: you mean in the terminal? or in X?
<Xeago> line as a character-wide line, or a pixel?
<wubie> If I subclass Array and override insert with: def insert(index, object); end;
<wubie> Shouldn't that stop things being insertible in the array? (Via insert at least)
<iIlL10Oo> Xeago: a pixel or pixel line , or wider is ok
<iIlL10Oo> hoelzro: on X
<hoelzro> iIlL10Oo: you'll need to use a binding to Xlib or xcb
<hoelzro> that or implement the X wire protocol in Ruby.
<hoelzro> I recommend the former twol
<hoelzro> *two
<Xeago> why not print ascii escape codes to terminal?
tvw has joined #ruby
<wubie> Though the other (but related issue), is I'm trying this: def insert(index, object); raise Error if not self[index].nil?; self[index] = object; end; -- it raises Error every time, why?!
solidoodlesuppor has joined #ruby
solidoodlesuppor has quit [Client Quit]
<iIlL10Oo> hoelzro: must install gems ?
<hoelzro> iIlL10Oo: for xlib and xcb, probably
<hoelzro> that or write a binding in C
<hoelzro> iIlL10Oo: maybe you should describe why you're trying to draw a line on the screen?
<workmad3> wubie: first, please consider not subclassing Array... it tends to not work correctly
Shrink has joined #ruby
<iIlL10Oo> hoelzro: I want draw a snow screen, like on windows
browndawg has joined #ruby
<workmad3> wubie: wrapping an array in a proxy, a delegator or a decorator tends to allow things to work more consistently
<iIlL10Oo> hoelzro: on windows, there is SetPixel API
<wubie> workmad3: that actually sounds like a nicer solution
solidoodlesuppor has joined #ruby
<workmad3> wubie: it also lets you expose the interface you want, rather than having to deal with the entirety of the Array interface
solidoodlesuppor has quit [Client Quit]
tommyvyo has joined #ruby
baphled has joined #ruby
<wubie> workmad3: truesay. thank you
<iIlL10Oo> hoelzro: this url is C\C++ ,thank you
rondale__ has joined #ruby
sailias has quit [Quit: Leaving.]
<hoelzro> iIlL10Oo: I think it's just C
<hoelzro> either way, it should give you an idea of how to accomplish what you want
<hoelzro> that, or do what you need already
Goles has joined #ruby
DatumDrop has quit [Ping timeout: 240 seconds]
ffranz has joined #ruby
mpfundstein has joined #ruby
jtharris has joined #ruby
geekbri has joined #ruby
<iIlL10Oo> hoelzro: yes , snow on linux is more difficult then windows
solidoodlesuppor has joined #ruby
jeffreybaird has joined #ruby
karasawa has quit [Ping timeout: 240 seconds]
pcarrier has quit [Ping timeout: 276 seconds]
<apeiros> trollol?
reinaldob has quit [Remote host closed the connection]
jimeh has quit [Quit: Bye.]
alup has quit [Ping timeout: 240 seconds]
nfk has joined #ruby
dmiller has joined #ruby
<iIlL10Oo> hoelzro: this is code for win32 http://paste.org/60230
baphled has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
Vainoharhainen has joined #ruby
jeffreybaird has quit [Read error: Connection reset by peer]
jeffreybaird has joined #ruby
<Xeago> is this english correct?
<Xeago> The authors opinion can be found in his
joofsh has joined #ruby
<dawkirst> What is the simplest way to download a file with Ruby?
haxrbyte has joined #ruby
stonevil has joined #ruby
Spami has quit [Ping timeout: 276 seconds]
<lupine> data = `wget url -O-`
<JonnieCache> eww no dont do that
<lupine> (note that simplest isn't always best)
<dawkirst> ok
<shevy> aha
<matti> dawkirst: I am hereby bitch-slapping you for being lazy ;p
<dawkirst> matti, just found that one too, thanks
<shevy> in the good old days people wrote a solution
rondale__ has quit [Ping timeout: 252 seconds]
<matti> dawkirst: There you go ;p
<shevy> nowadays people just link in stackoverflow answers
<dawkirst> matti, accepted :)
<matti> :)
<dawkirst> haha
invisime has joined #ruby
arya has quit [Ping timeout: 248 seconds]
<shevy> every new year the world is becoming lazier
<matti> shevy: Its the smart way. Why re-invent the wheel?
<lupine> mm, it's not hard to do with Net::HTTP
<shevy> because the wheel is not round!!!
<lupine> mine is simpler though :)
<shevy> but you cheated lupine
<shevy> you advocated a non-ruby solution :(
jimeh has joined #ruby
<lupine> no, I stayed within the confines of the problem specification
<matti> Precisely.
<matti> Bitch slap him.
<matti> ;]
<lupine> so where's my cheque? :p
<shevy> let me read up on the problem specification
<matti> ;p
<shevy> "<dawkirst> What is the simplest way to download a file with Ruby?" <-- !!!!!!
razibog has joined #ruby
pcarrier has joined #ruby
emka has joined #ruby
<shevy> mattb, I hereby designate you as the official channer slapper
<shevy> go slap em good
<shevy> oops
<shevy> wrong matt... I meant matti
<lupine> most of these solutions seem to end up putting the file contents into ruby objects, which is a shame
<dawkirst> Ok I'm leaving
mgrayson has quit [Quit: mgrayson]
razibog1 has quit [Ping timeout: 248 seconds]
<dawkirst> jk
<shevy> well that's what a ruby object is
<shevy> a happy container
<shevy> and [] is the perfect method to access that container, it looks like a bottle or a box if you look at it the right way
theRoUS has joined #ruby
<emka> can I get an object var when I have the name of the field as a variable? Something like this… http://pastie.org/5696416
zeade has joined #ruby
<shevy> emka do you want to invoke this method name
<emka> yes
<emka> from the var
<emka> variable
breakingthings has joined #ruby
<shevy> you could use .send for this
pothibo has joined #ruby
otherj has joined #ruby
<shevy> class Foo; def name; puts 'I am name()'; end; end; foo = Foo.new; foo.send :name # I am name()
lateau has quit [Remote host closed the connection]
<emka> works thanks shevy!
<workmad3> emka: if that happens to be a rails model, you can also do user[var]
<dawkirst> thanks for the help lupine, matti, shevy
<workmad3> emka: or user.read_attribute(var)
<workmad3> emka: ignore if that's not an activerecord model though :)
<shevy> dawkirst only a solved ruby problem is a good problem
<emka> ok…it's rails. What's the most effcient?
<emka> it's AC
<emka> AR
<emka> i mean
<workmad3> emka: I'd personally avoid send in favour of []
<emka> ok
<emka> cool
Targen has quit [Ping timeout: 264 seconds]
Spami has joined #ruby
zeade has quit [Ping timeout: 255 seconds]
ExxKA has quit [Quit: This computer has gone to sleep]
iIlL10Oo has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 245 seconds]
<Xeago> All proposed designs have undergone significant testing by the author, results are written down in the test-results
<Xeago> where test-results is a hyperlink
<Xeago> the second part has an awful lot of redundancy in it
<Xeago> how can I reword this to read more fluent?
blaxter has quit [Quit: foo]
r3nrut__ has joined #ruby
djones_ has quit [Quit: djones_]
djones_ has joined #ruby
carloslopes has quit [Remote host closed the connection]
dukedave has joined #ruby
DatumDrop has joined #ruby
cha1tanya has quit [Quit: Leaving]
asteve has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
v0n has joined #ruby
aquaranto has joined #ruby
cgcardona has quit [Quit: zzzzz]
segv- has joined #ruby
jerius has joined #ruby
pcarrier has quit [Ping timeout: 252 seconds]
ttt has quit [Remote host closed the connection]
jfl0wers has joined #ruby
pcarrier has joined #ruby
Bidness has joined #ruby
zph has joined #ruby
drago757 has joined #ruby
DatumDrop has quit [Ping timeout: 252 seconds]
arkiver has quit [Ping timeout: 245 seconds]
AlchemyFalcon has quit [Quit: AlchemyFalcon]
Vainoharhainen has quit [Remote host closed the connection]
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
sailias has joined #ruby
Vainoharhainen has joined #ruby
r3nrut__ has quit [Ping timeout: 260 seconds]
mikeycgto has quit [Client Quit]
ner0x has joined #ruby
xemu has joined #ruby
anonymuse has joined #ruby
jonahR has joined #ruby
pcarrier has quit [Ping timeout: 248 seconds]
Bidness has quit [Remote host closed the connection]
xAndy is now known as xandy
otherj has quit [Quit: otherj]
hbpoison has quit [Ping timeout: 256 seconds]
xandy is now known as xAndy
zeade has joined #ruby
billy_ran_away has quit [Ping timeout: 276 seconds]
hadees has quit [Ping timeout: 260 seconds]
pcarrier has joined #ruby
skaczor has joined #ruby
zeade has quit [Ping timeout: 260 seconds]
invisime has left #ruby [#ruby]
jerius has quit []
d2dchat has joined #ruby
jerius has joined #ruby
dustint has quit [Ping timeout: 245 seconds]
wubie has quit [Quit: Page closed]
buibex has quit [Remote host closed the connection]
chichou has joined #ruby
chichou has quit [Remote host closed the connection]
mmitchell has joined #ruby
jcrawford has quit [Excess Flood]
jcrawford has joined #ruby
buibex has joined #ruby
mmitchell has quit [Remote host closed the connection]
kil0byte has joined #ruby
volk_ has joined #ruby
mmitchell has joined #ruby
emka has quit [Quit: emka]
ezkl has joined #ruby
cr3 has joined #ruby
kil0byt__ has quit [Ping timeout: 256 seconds]
spinagon has joined #ruby
rippa has quit [Ping timeout: 252 seconds]
DatumDrop has joined #ruby
jjbohn has joined #ruby
dustint has joined #ruby
stonevil has quit [Quit: stonevil]
volk_ has quit [Quit: volk_]
clocKwize has quit [Quit: clocKwize]
<whowantstolivefo> i download rubykoans and i want to know how it works ? i should do something from bash ? or anything else ?
<ezkl> whowantstolivefo: http://rubykoans.com/
Jackneill has joined #ruby
Jackneill has quit [Changing host]
Jackneill has joined #ruby
<ezkl> whowantstolivefo: oops - http://rubykoans.com/#the_path
drago757 has quit [Quit: drago757]
jrist-afk is now known as jrist
zeade has joined #ruby
Fretta has joined #ruby
DatumDrop has quit [Ping timeout: 260 seconds]
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
jpfuentes2 has joined #ruby
<whowantstolivefo> ezkl: i downloaded files.. i open via eclipse ide... in bash i must run ` ruby rubyfile.rb ' only this ?
BizarreCake has quit [Ping timeout: 248 seconds]
interactionjaxsn has joined #ruby
<ezkl> whowantstolivefo: change into the rubykoans directory and run `ruby path_to_enlightenment.rb`
<whowantstolivefo> my app directory in aslan@ubuntu:~/Downloads/aslan/koans$
<whowantstolivefo> ezkl: i am at right path , yes ?
<JonnieCache> great username
soc42 has joined #ruby
<ezkl> whowantstolivefo: If that is where you downloaded them, then yes
boonedocks has joined #ruby
jgarvey has joined #ruby
<whowantstolivefo> https://gist.github.com/4547753 here whats output... what i do is true ?
reinaldob has joined #ruby
zeade has quit [Ping timeout: 260 seconds]
r3nrut has quit [Ping timeout: 276 seconds]
filipe has quit [Quit: Leaving]
<whowantstolivefo> ezkl: ? i didnt figure out what i will do with this files.. i am newbie.. i finished reading guides in rubyonrails.page i am learnin slowly slowly
philcrissman has joined #ruby
volk_ has joined #ruby
<ezkl> whowantstolivefo: That looks like the output of a koan to me.
kil0byte has quit [Remote host closed the connection]
<ezkl> They message about `/home/aslan/Downloads/aslan/koans/about_asserts.rb:10` means you'll want to open that file with an editor and look at line #10
<ezkl> You'll want to modify that line, save the file, and re-run the koans
dustint_ has joined #ruby
d2dchat has quit [Ping timeout: 252 seconds]
Fretta has quit [Remote host closed the connection]
dustint_ has quit [Client Quit]
<whowantstolivefo> oo okay ezkl let me do it thank you
<ezkl> whowantstolivefo: You're welcome. Have fun!
dustint has quit [Quit: Leaving]
dustint has joined #ruby
dbrgn has quit [Quit: leaving]
joofsh has quit [Remote host closed the connection]
jcrawford has quit [Excess Flood]
frogstarr78 has joined #ruby
osaut has joined #ruby
jcrawford has joined #ruby
etank has quit [Quit: WeeChat 0.3.9.2]
x82_nicole has joined #ruby
tps_ has joined #ruby
__BigO__ has joined #ruby
blaxter has joined #ruby
nari has quit [Ping timeout: 252 seconds]
obryan has joined #ruby
BizarreCake has joined #ruby
hbpoison has joined #ruby
joofsh has joined #ruby
emka has joined #ruby
boonedocks has left #ruby [#ruby]
mmitchell has quit [Remote host closed the connection]
jds_ has joined #ruby
boonedocks has joined #ruby
mmitchell has joined #ruby
RagingDave has joined #ruby
withnale has joined #ruby
dmiller has quit [Read error: Connection reset by peer]
connor_ has joined #ruby
nomenkun has quit [Remote host closed the connection]
theRoUS has joined #ruby
failshell has joined #ruby
nomenkun has joined #ruby
etank has joined #ruby
sc077 has quit [Remote host closed the connection]
jds_ has quit [Ping timeout: 256 seconds]
mafolz has quit [Quit: mafolz]
soc42 has quit [Remote host closed the connection]
stopbit has joined #ruby
ffranz has quit [Remote host closed the connection]
zommi has quit [Quit: Leaving.]
connor_ has quit [Ping timeout: 248 seconds]
d2dchat has joined #ruby
beliveyourdream has quit [Read error: Connection reset by peer]
DatumDrop has joined #ruby
adamjleonard has joined #ruby
pu22l3r has joined #ruby
ffranz has joined #ruby
v0n has quit [Quit: WeeChat 0.3.9.2]
hbpoison has quit [Read error: Connection reset by peer]
d2dchat has quit [Remote host closed the connection]
hbpoison has joined #ruby
pu22l3r has quit [Read error: Connection reset by peer]
ffranz has quit [Client Quit]
zeade has joined #ruby
v0n has joined #ruby
tagrudev has quit [Remote host closed the connection]
bean__ has joined #ruby
r3nrut has joined #ruby
crank1 has quit [Quit: Leaving.]
Raboo_ has quit [Ping timeout: 240 seconds]
carloslopes has joined #ruby
crank_ has joined #ruby
crank_ has quit [Client Quit]
crank_ has joined #ruby
olrrai has joined #ruby
Raboo has joined #ruby
AlchemyFalcon has joined #ruby
crank_ has left #ruby [#ruby]
crank_ has joined #ruby
zeade has quit [Ping timeout: 260 seconds]
hotovson_ has joined #ruby
maxmanders has joined #ruby
olrrai has quit [Client Quit]
xsarin has joined #ruby
hackerdude has joined #ruby
DatumDrop has quit [Ping timeout: 276 seconds]
daniel_- has joined #ruby
cba has joined #ruby
generalissimo has joined #ruby
w400z has joined #ruby
alta has joined #ruby
Liothen has quit [Remote host closed the connection]
karasawa has joined #ruby
tatsuya__ has joined #ruby
hackerdude has quit [Remote host closed the connection]
kpshek has joined #ruby
tatsuya_o has quit [Ping timeout: 252 seconds]
akemrir has joined #ruby
a_a_g has joined #ruby
boonedocks has left #ruby [#ruby]
alex__c2022 has joined #ruby
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
reuven has joined #ruby
raulp has quit [Changing host]
raulp has joined #ruby
hackerdude has joined #ruby
ffranz has joined #ruby
boonedocks has joined #ruby
fyolnish has joined #ruby
fjfish has joined #ruby
speakingcode has joined #ruby
ckrailo has joined #ruby
fyolnish has quit [Read error: Connection reset by peer]
fjfish has quit [Read error: Connection reset by peer]
fjfish has joined #ruby
wf2f has quit []
volk__ has joined #ruby
SCommette has joined #ruby
francisfish has quit [Ping timeout: 276 seconds]
zarubin has quit [Ping timeout: 264 seconds]
speakingcode has quit [Client Quit]
volk_ has quit [Ping timeout: 272 seconds]
volk__ is now known as volk_
zarubin has joined #ruby
baphled has joined #ruby
Goopyo has joined #ruby
DatumDrop has joined #ruby
etcetera has joined #ruby
zarubin has quit [Ping timeout: 276 seconds]
zarubin has joined #ruby
joofsh has quit [Remote host closed the connection]
kinginky has joined #ruby
tatsuya__ has quit [Ping timeout: 248 seconds]
emka has quit [Quit: emka]
tatsuya_o has joined #ruby
karasawa has quit [Ping timeout: 276 seconds]
opettaja has joined #ruby
slainer68 has quit [Remote host closed the connection]
danneu has joined #ruby
karasawa has joined #ruby
lateau has joined #ruby
slainer68 has joined #ruby
Umren has joined #ruby
jgrevich has joined #ruby
main has quit [Ping timeout: 255 seconds]
DatumDrop has quit [Ping timeout: 264 seconds]
PragCypher has joined #ruby
gyre007 has quit [Ping timeout: 256 seconds]
shorts has quit [Quit: shorts]
joeycarmello has quit [Read error: Connection reset by peer]
arturaz has quit [Ping timeout: 245 seconds]
gyre007 has joined #ruby
joeycarmello has joined #ruby
_bart has joined #ruby
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
gyre007_ has joined #ruby
binaryplease has joined #ruby
binaryplease has quit [Client Quit]
buibex has quit [Ping timeout: 276 seconds]
walbert has left #ruby [#ruby]
opettaja has quit [Remote host closed the connection]
io_syl has joined #ruby
aganov has quit [Remote host closed the connection]
joeycarmello has quit [Ping timeout: 260 seconds]
dormiens has joined #ruby
mkillebrew2 has joined #ruby
dormiens is now known as alanjc
gyre007 has quit [Ping timeout: 272 seconds]
connor_ has joined #ruby
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
poseid has quit [Quit: Page closed]
baroquebobcat has joined #ruby
<invariant> How can I update to the latest version of a package in a short amount of time without having to reinstall it completely?
samphippen has joined #ruby
dougireton has joined #ruby
<invariant> Just asking whether a new version is available should take in the order of 100ms or so.
<GeekOnCoffee> invariant: what exactly are you trying to do?
fourq is now known as CodeBaker
<invariant> GeekOnCoffee, I want to keep a set of ruby gems up to date.
CodeBaker is now known as fourq
akemrir has quit [Quit: WeeChat 0.3.9.2]
<invariant> GeekOnCoffee, I already have something that "works", but the bottle neck is not having an operation which says 'yes' or 'no'
<invariant> GeekOnCoffee, (as in: there is a newer version available than the one you have installed)
gyre007 has joined #ruby
joofsh has joined #ruby
connor_ has quit [Ping timeout: 272 seconds]
jrist is now known as jrist-demo
<GeekOnCoffee> you could query for the most recent version and compare
eldariof has quit [Read error: Operation timed out]
<invariant> GeekOnCoffee, great.
Nisstyre-laptop has joined #ruby
<invariant> GeekOnCoffee, I suppose the only thing more efficient would be a feed :)
<invariant> GeekOnCoffee, is there also something like that?
daniel_- has quit [Ping timeout: 272 seconds]
<GeekOnCoffee> not that I know of… typically people want to test gem updates, so they aren't looking to do this sort of thing
wallerdev has joined #ruby
<GeekOnCoffee> invariant: are you looking for http://www.sourceninja.com/ ?
<GeekOnCoffee> :P
gyre007_ has quit [Ping timeout: 272 seconds]
<invariant> "Patch in days, not weeks." -> I'd prefer minutes.
andrewhl has joined #ruby
<breakingthings> brb SourceSamurai with tagline "Patch in minutes, not days"
maletor has joined #ruby
mongag has joined #ruby
aeontech has joined #ruby
maxmanders has joined #ruby
<mongag> How to get a day of the week as number ? 1 - Monday 7 Sunday ?
zarubin has quit [Ping timeout: 248 seconds]
Thesolonius has joined #ruby
zarubin has joined #ruby
<breakingthings> mongag: Date#wday
nateberkopec has joined #ruby
<mongag> thx
tvw has quit [Remote host closed the connection]
tvw has joined #ruby
ben______ has joined #ruby
volk_ has quit [Remote host closed the connection]
volk_ has joined #ruby
vonsar has joined #ruby
mercwithamouth has joined #ruby
AlchemyFalcon has quit [Quit: AlchemyFalcon]
jaequery has joined #ruby
philips_ has quit [Excess Flood]
jaequery has quit [Max SendQ exceeded]
hoelzro is now known as hoelzro|away
mongag has quit [Quit: BitchX: good to the last drop!]
az7ar has joined #ruby
jaequery has joined #ruby
baphled has quit [Ping timeout: 255 seconds]
woolite64 has joined #ruby
DatumDrop has joined #ruby
blazes816 has joined #ruby
<az7ar> can anyone please suggest how I can learn about Monads in ruby ? your bookmarked article perhaps
<ericwood> is there such a thing?
<shevy> az7ar ruby is monad free. we put them into an object, then sent it into a black hole. since that day, happiness exists
maxmanders has quit [Quit: Textual IRC Client: www.textualapp.com]
<shevy> az7ar he is using lambda. that has nothing to do with monads
<az7ar> ok
<ericwood> iirc the computer science-y term would be "closures"
<shevy> whoa... this is an awful blog
<shevy> someidentity.pass do |value_a| f( value_a ) end.pass |value_b|
<shevy> "Its wings have sprouted! It takes to the air! It is a monad!"
<shevy> hehe :D
<shevy> "Now that Identity is a really, truly monad, let?s grant it one last thing before it flutters away."
<shevy> you know what
<shevy> I think a monad is what you get after a LSD trip
<az7ar> Its a very old post, I could not figure out any use cases
<shevy> hehehe
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
<shevy> typical monad
invariant has quit [Quit: ZNC - http://znc.in]
advorak has joined #ruby
jtharris has quit [Ping timeout: 255 seconds]
philips_ has joined #ruby
malte_ has joined #ruby
jonathanwallace has quit [Ping timeout: 260 seconds]
generalissimo has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
razibog has quit [Ping timeout: 260 seconds]
alanjc has quit [Ping timeout: 240 seconds]
jaequery has quit [Quit: Textual IRC Client: www.textualapp.com]
samphippen has quit [Quit: Computer has gone to sleep.]
jaequery has joined #ruby
alanjc has joined #ruby
Morkel has quit [Quit: Morkel]
_sillymarkets has joined #ruby
yacks has quit [Ping timeout: 260 seconds]
evanx has quit [Quit: evanx]
mockra has joined #ruby
etcetera has quit []
jjbohn is now known as jjbohn|afk
enroxorz-work has quit [Read error: Connection reset by peer]
swex_ has joined #ruby
swex has quit [Ping timeout: 252 seconds]
wallerdev has quit [Quit: wallerdev]
chrisramon has joined #ruby
djones_ has quit [Remote host closed the connection]
joeycarmello has joined #ruby
djones_ has joined #ruby
templaedhel has joined #ruby
apeiros has quit [Remote host closed the connection]
raulp has left #ruby [#ruby]
beiter has quit [Quit: beiter]
chrisramon has left #ruby [#ruby]
jjbohn|afk is now known as jjbohn
macmartine has joined #ruby
frem has joined #ruby
timonv has quit [Remote host closed the connection]
enroxorz-work has joined #ruby
fermion has joined #ruby
generalissimo has joined #ruby
_bart has quit [Ping timeout: 240 seconds]
skcin7 has joined #ruby
wallerdev has joined #ruby
hbpoison has quit [Ping timeout: 248 seconds]
alvaro_o has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
benlieb has joined #ruby
jonathanwallace has joined #ruby
vonsar has quit [Quit: This computer has gone to sleep]
samphippen has joined #ruby
etcetera has joined #ruby
daniel_- has joined #ruby
etcetera has quit [Client Quit]
wargasm has joined #ruby
dawkirst_ has joined #ruby
Monie has joined #ruby
zeade has joined #ruby
<dawkirst_> hi, why is 'open("foo.jpeg", "wb") do |file|' working but 'open("foo.jpg", "wb") do |file|' is not?
nomenkun has quit [Remote host closed the connection]
<workmad3> dawkirst_: because foo.jpeg exists, and foo.jpg doesn't maybe?
<Hanmac> dawkirst_ they should both work ... show us a pastie of your entire code
jph_ has left #ruby [#ruby]
<dawkirst_> workmad3, nope
<dawkirst_> Hanmac, ok
<Mon_Ouie> workmad3: Notice he's opening the file for *writing*, not reading ;)
Vert has joined #ruby
<workmad3> Mon_Ouie: oh yeah... d'oh
Goles has quit [Ping timeout: 252 seconds]
* workmad3 fails @ reading
connor_ has joined #ruby
yacks has joined #ruby
mk03 has joined #ruby
kinginky has quit [Remote host closed the connection]
<Hanmac> workmad3 i think he uses other functions that uses file.path for some kind of convert magic, and maybe the other function is too dump to understand .jpg too :D
<dawkirst_> Hanmac, not sure about the other funcitons
benlieb has quit [Quit: benlieb]
noxoc has quit [Quit: noxoc]
<dawkirst_> Hanmac, so with .jpg the file is opened, and written to, but it is garbled. With .jpeg it is not.
<Mon_Ouie> And when you say it doesn't work, what do you mean?
connor_ has quit [Ping timeout: 256 seconds]
<Hanmac> dawkirst_ what happend if you do 'File.open("foo.jpg", "wb") do |file|' ?
templaedhel has quit [Quit: Leaving...]
bitcrave has joined #ruby
<dawkirst_> Mon_Ouie, it's garbled -- but here's something interesting, when I copy the file it's fine (it's not garbled). So it appears as if some function is using it.
hbpoison has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
templaedhel has joined #ruby
<dawkirst_> Oof, am I making any sense?
Goles has joined #ruby
nga4 has joined #ruby
Kakera has joined #ruby
<Kakera> how do you pass a class method as a block?
Goles has quit [Remote host closed the connection]
<Kakera> ['a','b'].map String.new
<Kakera> this doesn't work because it actually invokes the new method
jonathanwallace has quit [Ping timeout: 246 seconds]
<Mon_Ouie> The block syntax is some_method { |arguments| … }
<Hanmac> Kakera: ['a','b'].map &String.method(:new)
<dawkirst_> Hanmac, when I do foo.jpg it's fine. So it's just with 'Bird.jpg'. Weird.
<JonnieCache> fuck i was trying to remember that one
<Kakera> Hanmac, thanks
<JonnieCache> Kakera: you shouldnt really need to do that though...
<Mon_Ouie> If you want to copy strings, or objects in general, there's Object#dup
<Kakera> I was just wondering
a_a_g has joined #ruby
<carlzulauf> Kakera: ['a','b'].map(&:dup) does pretty much the same thing
<JonnieCache> yeah fair enough its a good thing to wonder
BeLucid has quit [Read error: Connection reset by peer]
<Hanmac> kakera i use it for Dir["*"].map(&File.method(:size)).inject(0,:+)
bricker__ has joined #ruby
<JonnieCache> now thats what i call ruby
BoomCow has joined #ruby
timmow has quit [Ping timeout: 252 seconds]
<JonnieCache> thats the rubyest line of code ever
ephemerian has quit [Quit: Leaving.]
adeponte has joined #ruby
artOfWar has joined #ruby
<JonnieCache> you can even do just Dir["*"].map(&File.method(:size)).inject(:+) cant you?
arietis has joined #ruby
<JonnieCache> in 1.9
<Kakera> so let's say I want a hash with the default value being a new object of a class
apeiros has joined #ruby
<Kakera> should I just do Hash.new { MyClass.new } ?
pyreal has joined #ruby
<JonnieCache> yeah but it will be the same new instance every time
<Mon_Ouie> Hash.new { |h, k| h[k] = MyClass.new }
<Mon_Ouie> JonnieCache: It won't
tatsuya__ has joined #ruby
<Hanmac> JonnieCache: [].inject(:+) #=> nil [].inject(0,:+) #=> 0
<JonnieCache> ah right
<JonnieCache> Mon_Ouie: i thought when you made a hash with a default value it got reused
bricker has quit [Ping timeout: 240 seconds]
<Kakera> it would if I just wrote Hash.new MyClass.new
<Mon_Ouie> Sure, but he's creating a hash with a default proc, not a default value
iamjarvo has quit [Quit: Leaving.]
grzywacz has quit [Ping timeout: 248 seconds]
<JonnieCache> yeah im with you
BeLucid has joined #ruby
<Hanmac> kakera: information about default proc and default value: hashs with default proc are not Marshalable anymore ... if it does affect you
<Kakera> I don't know what that means so probably not
friendmaster has joined #ruby
tatsuya_o has quit [Ping timeout: 272 seconds]
daniel_-_ has joined #ruby
ffranz has quit [Quit: Leaving]
<Hanmac> kakera with marshal you could serialize stuff ... (maybe for writing them in binary files like game saves)
daniel_-_ has quit [Client Quit]
templaedhel has quit [Quit: Leaving...]
zigomir has quit [Quit: zigomir]
ffranz has joined #ruby
boonedocks has quit [Quit: boonedocks]
robotmay has quit [Remote host closed the connection]
aeontech has quit [Quit: aeontech]
daniel_-_ has joined #ruby
bricker__ is now known as bricker
BoomCow has left #ruby ["Leaving"]
cdt has quit [Read error: Operation timed out]
w400z has quit []
daniel_- has quit [Ping timeout: 252 seconds]
dougireton has quit [Quit: Leaving.]
_bart has joined #ruby
pyro111 has quit [Quit: Leaving]
vonsar has joined #ruby
stkowski has joined #ruby
s1n4 has joined #ruby
dmiller1 has joined #ruby
fjfish has quit [Remote host closed the connection]
rakl has joined #ruby
jblack_ has joined #ruby
hbpoison has quit [Ping timeout: 246 seconds]
mahmoudimus has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
crank_ has quit [Ping timeout: 272 seconds]
bean__ has quit [Quit: Computer has gone to sleep.]
crank_ has joined #ruby
haxrbyte has quit [Ping timeout: 255 seconds]
daniel_-_ is now known as daniel_-
bean__ has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
s1n4 has quit [Quit: leaving]
Glacer232 has joined #ruby
dougireton has joined #ruby
arturaz has joined #ruby
cobragoat has joined #ruby
etcetera has joined #ruby
lusory has quit [Ping timeout: 276 seconds]
_bart has quit [Ping timeout: 260 seconds]
sn0wb1rd has quit [Quit: sn0wb1rd]
jlast_ has quit [Ping timeout: 260 seconds]
frogstarr78 has quit [Ping timeout: 252 seconds]
jtharris has joined #ruby
h4mz1d has joined #ruby
Criztian has quit [Remote host closed the connection]
evanx has joined #ruby
frogstarr78 has joined #ruby
haxrbyte has joined #ruby
<gyre007> guys I'm trying to run sinatra app...using runit service for thin but I'm getting the following error: chpst: fatal: unable to run: bundle: file does not exist
<gyre007> strange thing is that the bundle DOES exist and if I change into that directory and execute the same command it works just fine...
dougireton has quit [Remote host closed the connection]
<workmad3> gyre007: check the PATH that the runit service is attempting to use
<gyre007> this is my run script https://gist.github.com/4549237
slainer68 has quit [Remote host closed the connection]
<gyre007> very simple...
<gyre007> mm
dougireton has joined #ruby
a_a_g has quit [Quit: Leaving.]
<Kakera> this is really basic, but how do you set an object's property inside the constructor
<banister`sleep> Kakera: @property = blah
mongag has joined #ruby
<Kakera> then what's 'self'
<davidcelis> the instance
breakingthings has quit []
<Hanmac> Kakera: you need "self.property = blah " when you want to call the setter function
<Kakera> what's the difference between self.p and @p
<davidcelis> if you were to do `self.property = blah`, it would expect the `property=` method to be defined
<davidcelis> Kakera: `self.p` is a method, which probably returns @p
chrismcg is now known as zz_chrismcg
<davidcelis> Kakera: google for attr_reader, attr_writer, and attr_accessor
Markvilla has joined #ruby
icole has joined #ruby
JohnBat26 has joined #ruby
<davidcelis> read about those and you'll understand
marxarelli has joined #ruby
templaedhel has joined #ruby
templaedhel has quit [Remote host closed the connection]
sjuxax has joined #ruby
<cschneid> does anybody have rb-fsevent working on osx 10.8? Its breaking my use of guard, and when used directly from irb, it's not seeing changes. Any suggestions?
<Kakera> how do you access an object's member
<davidcelis> member?
<Mon_Ouie> member? You mean instance variable?
<Kakera> from outside the class
<Kakera> yes
<davidcelis> again, do some research on attribute accessors
<Mon_Ouie> Define an accessor for it, e.g. using attr_accessor
<Kakera> you can't do it without accessors?
havenn has joined #ruby
kenneth has quit [Quit: kenneth]
<davidcelis> you can use instance_variable_get
<Mon_Ouie> You can, but that's not what you should do in a normal situation
<davidcelis> but just define accessors
<Kakera> okay
<Kakera> I'll just use a hash instead
<sjuxax> Hello. Suppose I want to execute a chunk of code until a certain variable is reached. I understand some of Ruby's structures may support this but I'd like more information on their exact mechanism of action. Do they return back to the loop after each line of code to re-evaluate the condition? I need to make some code run only for x seconds, and abort if that time is exceeded. I know how to do this basically, but is there a way to do it well over a chunk of
<davidcelis> ...
<davidcelis> wtf
noxoc has joined #ruby
<Kakera> since it will only store two arrays
noxoc has quit [Client Quit]
NemesisD has joined #ruby
<davidcelis> sjuxax: the condition is checked each time the loop is run, not each time a line is evaluated
timonv has joined #ruby
<davidcelis> or, rather, each time the block passed to the loop is run
<havenn> sjuxax: Wrote a #keep_doing_for method last night, curious what the optimal way to do this is: https://gist.github.com/4545241
Elhu has quit [Quit: Computer has gone to sleep.]
<NemesisD> is there a library or common pattern in ruby for a work queue that has an end? Queue seems like it doesn't fit well for a finite amount of work
<davidcelis> NemesisD: why not?
w400z has joined #ruby
<sjuxax> davidcelis: Right, that's what I thought. Is there a reasonable way to interrupt code more frequently?
S1kx has quit [Quit: Leaving]
eldariof has joined #ruby
<NemesisD> davidcelis: because you need a separate threadsafe mechanism for flagging that there will be no more work put into the queue
<davidcelis> sjuxax: do you really need to? how long does one iteration of your block take to run?
Nisstyre-laptop has quit [Ping timeout: 252 seconds]
<cschneid> sjuxax: there's a Timeout library built in I believe. Check it out. http://www.ruby-doc.org/stdlib-1.9.3/libdoc/timeout/rdoc/Timeout.html#method-c-timeout
<davidcelis> sjuxax: you can dedicate one line of the block to breaking if the time limit has been exceeded
<NemesisD> davidcelis: you also need to make sure your queue pops are nonblocking in that case and the mechanism that Queue has for tha
<NemesisD> t is pretty silly, catching ThreadError
timonv has quit [Remote host closed the connection]
<davidcelis> lol
<NemesisD> if your consumers outpace your producer, a queue will be empty but not necessarily done
<havenn> cschneid: I get told Timeout.timeout is an anti-pattern. (Prolly because it relys on exceptions for flow control?)
<davidcelis> if threading is an issue for you, you could check out the sidekiq queueing library; though that uses redis as a backend, so if you don't want to add another service, im not sure
DrShoggoth has joined #ruby
<cschneid> presumably it's an exceptional case that you can't reach the outside world or whatever you're doing. Anyway, meh. Keeping messes localized is not terrible, don't use exceptions for massive flow control, but at some point, timeout will use system level signal ugliness to work
<cschneid> and that's just how it needs to be in order to work. I can't think of another way to interrupt a line of ruby code
<NemesisD> davidcelis: oh i already use resque in my app, but i'm looking for a cheap, in-process way to do 2 things at once: pull lots of data from the web into a queue-like data structure and then work that queue off, all within a job
<havenn> cschneid: Good point.
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<workmad3> NemesisD: well, a queue implies that you're working it in order
<workmad3> NemesisD: so why not just push on a work item for 'end of queue'?
jduan1981 has joined #ruby
<NemesisD> workmad3: order isn't important, you're right, but i don't follow your meaning
<workmad3> NemesisD: well, you're pushing items onto a queue, and they'll be pulled off the front of the queue while you add to the back, right?
dr_neek has quit [Quit: dr_neek]
<workmad3> NemesisD: it isn't like an item is going to be removed from the middle or the end
<NemesisD> if producer is in a thread pushing work, consumers are taking work out of the queue (for lack of a better term), producer needs a way to signal that it is done, so workers must empty out the queue and go away
Xeago has quit [Remote host closed the connection]
<workmad3> NemesisD: so when your producer has pushed all the work onto the queue, it simply adds on a final item of 'FinishNow' and goes away
shevy2 has joined #ruby
rdark has quit [Quit: leaving]
Spooner has quit [Remote host closed the connection]
<NemesisD> workmad3: that would work ok with 1 worker, but not with multiple worker threads
karasawa has quit [Ping timeout: 252 seconds]
<sjuxax> thanks guys, cschneid especially. Timeout is a great help and is already working. :) Thanks.
dr_neek has joined #ruby
<NemesisD> i was just curious if there's a library out there for this, i can't be the only person to have ahd this problem, searching isn't coming up with much
<cschneid> sjuxax: there are fancier versions of that with retry and similar
samphippen has quit [Quit: Computer has gone to sleep.]
MattRb has joined #ruby
<NemesisD> if i have a common problem and i can't find a published solution in ruby, i wonder if my approach is wrong
karasawa has joined #ruby
advorak has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
dr_neek has quit [Client Quit]
shevy has quit [Ping timeout: 246 seconds]
Virunga has joined #ruby
nkts has quit [Ping timeout: 245 seconds]
aeontech has joined #ruby
Cicloid has joined #ruby
<NemesisD> anyone have any experience with peach? (parallel each)
elaptics is now known as elaptics`away
Markvilla has quit [Quit: Computer has gone to sleep.]
sn0wb1rd has joined #ruby
IrishGringo has joined #ruby
osaut_ has joined #ruby
_br_ has quit [Excess Flood]
aeontech has quit [Client Quit]
Nisstyre-laptop has joined #ruby
<NemesisD> it iterates over an enumerable and spawns a thread per item to execute the block. i am curious if the block is IO bound if it would see a speedup in MRI
a_a_g has joined #ruby
aeontech has joined #ruby
bricker is now known as bricker`la
workmad3 has quit [Ping timeout: 264 seconds]
bricker`la is now known as bricker`LA
osaut has quit [Ping timeout: 256 seconds]
osaut_ is now known as osaut
_br_ has joined #ruby
iamjarvo has joined #ruby
jds_ has joined #ruby
mrsolo has joined #ruby
_br_ has quit [Excess Flood]
n1x has joined #ruby
brianpWins has joined #ruby
connor_ has joined #ruby
<arturaz> NemesisD, it would
_br_ has joined #ruby
chussenot has quit [Ping timeout: 245 seconds]
b1rkh0ff has quit [Ping timeout: 255 seconds]
jds_ has quit [Ping timeout: 276 seconds]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
francisfish has joined #ruby
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
connor_ has quit [Ping timeout: 248 seconds]
osaut has quit [Quit: osaut]
geekbri has quit [Remote host closed the connection]
dmerrick has joined #ruby
benlieb has joined #ruby
volk_ has quit [Quit: volk_]
lusory has joined #ruby
dougireton has quit [Quit: Leaving.]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 245 seconds]
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
h4mz1d has quit [Ping timeout: 256 seconds]
Michael_ has joined #ruby
dougireton has joined #ruby
boonedocks has joined #ruby
tvw has quit [Remote host closed the connection]
JMcAfreak has quit [Remote host closed the connection]
Criztian has joined #ruby
Playground has quit [Ping timeout: 260 seconds]
viario has quit [Remote host closed the connection]
kenneth has joined #ruby
osaut has joined #ruby
yacks has quit [Remote host closed the connection]
inokenty has joined #ruby
grzywacz has joined #ruby
hbpoison has joined #ruby
Glacer232 has quit [Quit: Textual IRC Client: www.textualapp.com]
b1rkh0ff has joined #ruby
Kingy has joined #ruby
melisaa has joined #ruby
jekotia has joined #ruby
pu22l3r has joined #ruby
mengu has quit [Quit: Konversation terminated!]
vlad_starkov has joined #ruby
Mchl has joined #ruby
icole has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
io_syl has joined #ruby
Eiam has quit [Ping timeout: 255 seconds]
Spami has quit [Quit: This computer has gone to sleep]
pu22l3r has quit [Ping timeout: 244 seconds]
c0rn has joined #ruby
canton7 has quit [Ping timeout: 252 seconds]
joofsh has quit [Remote host closed the connection]
chrisramon has joined #ruby
canton7 has joined #ruby
c0rn has quit [Client Quit]
luckyruby has joined #ruby
jaequery has quit [Ping timeout: 272 seconds]
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
dr_neek has joined #ruby
jonathanwallace has joined #ruby
dougireton has quit [Quit: Leaving.]
ryannielson has joined #ruby
samphippen has joined #ruby
melisaa has quit [Remote host closed the connection]
bricker_ is now known as bricker\
bricker\ is now known as bricker
arkiver has joined #ruby
chrisramon has left #ruby [#ruby]
jrist-demo is now known as jrist-afk
buibex has joined #ruby
dougireton has joined #ruby
djones_ has quit [Ping timeout: 272 seconds]
Criztian_ has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
jaequery has joined #ruby
Kingy has quit [Quit: Leaving]
<evanx> I'm trying to use in_groups_of(7) but is only outputting the first column, can I share the code?
pu22l3r has joined #ruby
developingchris has joined #ruby
<canton7> evanx, sure, use a pastebin
developingchris has left #ruby [#ruby]
Eiam has joined #ruby
Eiam has quit [Changing host]
Eiam has joined #ruby
nomenkun has joined #ruby
joofsh has joined #ruby
dr_neek has quit [Client Quit]
mossplix has joined #ruby
dawkirst_ has quit [Ping timeout: 252 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jonathanwallace has quit [Ping timeout: 252 seconds]
browndawg has quit [Quit: Leaving.]
cpruitt has joined #ruby
<canton7> in general, never use for loops
<canton7> they have weird scoping, and there's really no need for them
<canton7> use #each instead
<canton7> well, in this case, #in_groups_of is expecting a block anyway
<canton7> so <% @doctor.schedules.in_groups_of(7) do |schedule| %>
jaequery has quit [Ping timeout: 252 seconds]
karasawa has quit [Ping timeout: 272 seconds]
volk_ has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
breakingthings has joined #ruby
a_a_g has quit [Quit: Leaving.]
jaequery has joined #ruby
<evanx> canton7: I did the refactor still same results,
osaut has quit [Quit: osaut]
<canton7> what are those results?
<canton7> also, line 3, <% should be <%= ?
<evanx> is outputting only the first 20 values and they are 140
arkiver has quit [Ping timeout: 252 seconds]
daniel_- has quit [Ping timeout: 252 seconds]
nathancahill has quit [Quit: nathancahill]
<evanx> the line 3 is <% is ok.
<canton7> you're aware that 'schedule' is an array?
<canton7> (I'm afraid I don't know rails at all, so I can't tell what the form helpers are doing)
reinaldob has quit [Remote host closed the connection]
pkrnj has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<canton7> each 'schedule' is an array of 7 elements. so your outermost block will be called 20 times, each time with an array of 7 values
swingha has joined #ruby
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<canton7> anyway, afk, back in a bit
kpshek has quit []
codeFiend has joined #ruby
<evanx> afk?
jonathanwallace has joined #ruby
<waxjar> away from keyboard
<evanx> thank you.
zastern has joined #ruby
<evanx> is ok the form_helper is generating a field.
verto|off has quit [Ping timeout: 276 seconds]
<canton7> (well, mostly afk). eyah, but I don't know whether fields_for is expecting an array as its 2nd arg, for instance)
whowantstolivef1 has joined #ruby
_bart has joined #ruby
aeontech has quit [Ping timeout: 276 seconds]
codeFiend is now known as aeontech
_bart has left #ruby [#ruby]
Nisstyre-laptop has quit [Quit: Leaving]
tommyvyo has joined #ruby
jlast has joined #ruby
rvmeier has joined #ruby
<evanx> ok.
kpshek has joined #ruby
c0rn has joined #ruby
icole has joined #ruby
ingvarha has left #ruby [#ruby]
MattRb has quit [Quit: This computer has gone to sleep]
alvaro_o_ has joined #ruby
nathancahill has joined #ruby
melisaa has joined #ruby
benlieb has quit [Quit: benlieb]
sayan has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
mahmoudimus has joined #ruby
twoism has joined #ruby
alvaro_o has quit [Ping timeout: 240 seconds]
Markvilla has joined #ruby
BizarreCake has quit [Quit: Leaving]
andrewhl has quit [Remote host closed the connection]
arkiver has joined #ruby
dougireton has quit [Quit: Leaving.]
verto has joined #ruby
<Dwarf> Good evening
verto is now known as Guest19481
MattRb has joined #ruby
<Dwarf> I am trying to fetch a random row from a database using SQLite3
<Dwarf> So far no luck, I get the following error: `initialize': no such function: RAND (SQLite3::SQLException)
Criztian_ has quit [Remote host closed the connection]
<Dwarf> That's the code
<Dwarf> Any idea what I'm doing wrong?
francisfish has quit [Remote host closed the connection]
tatsuya__ has quit [Remote host closed the connection]
benlieb has joined #ruby
ChampS666 has joined #ruby
<r3nrut> try execute instead of prepare
osaut has joined #ruby
bjeanes- has quit [Ping timeout: 248 seconds]
bjeanes has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
g0bl1n has quit [Ping timeout: 276 seconds]
Goopyo has quit [Quit: Goopyo]
<Dwarf> Could you clarify?
francisfish has joined #ruby
jds_ has joined #ruby
<Dwarf> I get "no such function: RAND"
haxrbyte has joined #ruby
<Dwarf> Yet I'm pretty sure RAND() is a function
boonedocks has quit [Quit: boonedocks]
karasawa has joined #ruby
connor_ has joined #ruby
rdark has joined #ruby
willob1 has joined #ruby
guestt has joined #ruby
willob1 has quit [Max SendQ exceeded]
francisfish has quit [Remote host closed the connection]
guestt has left #ruby [#ruby]
willob has quit [Read error: Connection reset by peer]
<canton7> Dwarf, it's RANDOM in sqlite
<Dwarf> Oh
dougireton has joined #ruby
willob has joined #ruby
<Dwarf> Well that explains a lot hehe
willob has quit [Max SendQ exceeded]
jds_ has quit [Ping timeout: 255 seconds]
io_syl has quit [Quit: Textual IRC Client: www.textualapp.com]
io_syl has joined #ruby
* Hanmac guess that nothing explains sqlite :P
willob has joined #ruby
djones_ has joined #ruby
willob has quit [Max SendQ exceeded]
Playground has joined #ruby
chrisja has joined #ruby
Joel_____ has joined #ruby
chrisja has quit [Client Quit]
Joel is now known as Guest63297
connor_ has quit [Ping timeout: 252 seconds]
djones__ has joined #ruby
willob has joined #ruby
willob has quit [Max SendQ exceeded]
djones__ has quit [Remote host closed the connection]
djones__ has joined #ruby
Guest63297 has quit [Ping timeout: 245 seconds]
dougireton has quit [Client Quit]
willob has joined #ruby
willob has quit [Max SendQ exceeded]
AlchemyFalcon has joined #ruby
djones_ has quit [Ping timeout: 252 seconds]
iamjarvo has quit [Quit: Leaving.]
dougireton has joined #ruby
karasawa has quit [Ping timeout: 244 seconds]
danneu has quit [Quit: WeeChat 0.3.8]
mark_locklear has quit [Remote host closed the connection]
dougireton has quit [Client Quit]
JumpMast3r has joined #ruby
sayan has joined #ruby
clocKwize has joined #ruby
kyle__ has left #ruby [#ruby]
rvmeier has quit [Quit: Leaving]
<lectrick> I love you all. Because we all think this language is beautiful, and because I would have a hard time explaining why to someone on the street. And for that I am grateful.
* apeiros thinks it's easy to explain
<apeiros> "it feels good, it allows me to do more, using less of my time"
Xeago has joined #ruby
<apeiros> even understandable by non-programmers :)
dougireton has joined #ruby
<RubyPanther> Because Ruby cares about the programmer, not the CPU.
greasegum has joined #ruby
greasegum has quit [Read error: Connection reset by peer]
dougireton has quit [Client Quit]
sayan has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
piotr__ has joined #ruby
snearch has joined #ruby
dougireton has joined #ruby
<Kakera> is there a shorter way to write Hash.new { |hash, key| hash[key] = Hash.new } ?
piotr_ has quit [Ping timeout: 245 seconds]
Playground is now known as lolcathost
whowantstolivef1 has quit [Ping timeout: 248 seconds]
Vainoharhainen has joined #ruby
jibi has joined #ruby
jibi has quit [Client Quit]
arkiver has quit [Ping timeout: 246 seconds]
clocKwize has quit [Quit: clocKwize]
etcetera has quit []
kirun has joined #ruby
<banister`sleep> apeiros: it rocks out my D.
benlieb has quit [Quit: benlieb]
jblack_ has quit [Ping timeout: 252 seconds]
Vainoharhainen has quit [Client Quit]
clocKwize has joined #ruby
malte_ has quit [Quit: malte_]
ryannielson has quit [Read error: No route to host]
Dann1 has joined #ruby
benlieb has joined #ruby
etcetera has joined #ruby
JMcAfreak has joined #ruby
etcetera has quit [Client Quit]
kil0byte has joined #ruby
grzywacz has quit [Ping timeout: 248 seconds]
dmiller1 has quit [Ping timeout: 276 seconds]
_sillymarkets has quit [Ping timeout: 245 seconds]
<Mon_Ouie> Hash.new{|h,k|h[k]={}}
<Mon_Ouie> (In practice, I wouldn't actually drop the spaces)
bdry has joined #ruby
MattRb has quit [Quit: This computer has gone to sleep]
<banister`sleep> Mon_Ouie: if i give u a torrent to dl c&c3, will u get it and play me multiplayer?
<bdry> Wagwaan
<heftig> I like Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }
<bdry> When bounds testing something, is it worth having separate tests for both boundaries, or worth putting them in one?
ikolito has joined #ruby
<bdry> It seems at-the-time better to test both assertions in one; but better long-term to have them separated, and long-term matters more with testing... what do you think?
AlchemyFalcon has quit [Quit: AlchemyFalcon]
<frem> banister`sleep: ಠ_ಠ
<banister`sleep> frem: did you see the gist i postd for you the other day?
<banister`sleep> frem: you seemed to have disappeared
blaxter has quit [Quit: foo]
<frem> banister`sleep: I don't think I did. Internet connection was a bit flaky.
<banister`sleep> frem: https://gist.github.com/4513230
MattRb has joined #ruby
danneu has joined #ruby
Goopyo has joined #ruby
<frem> banister`sleep: I figured out how it was working, eventually. Way down towards the end of the file it was extending activerecord with all it's methods.
<banister`sleep> frem: oh ok, well i think that gist met your original specs, but tbh i wasn't 100% sure what you were asking me :)
<frem> banister`sleep: thanks! :)
<banister`sleep> np
Diger_s has left #ruby [#ruby]
blaxter has joined #ruby
<heftig> http://research.swtch.com/randhash very interesting
<heftig> too bad i'd break existing ruby behavior
<heftig> it'd
vonsar has quit [Quit: This computer has gone to sleep]
albakry has joined #ruby
w400z has quit []
<frem> Ruby 1.9 already broke hash behavior
<shevy2> hmm I have two arrays
enebo has joined #ruby
<shevy2> array1 = [11,22,33]; array2 = [66,77,88] ... is there a simple way to merge both into a new array new_array = [ [11,66], [22,77], [33,88] ] ?
<heftig> zip
<aedornv> shevy2: array1.zip(array2)
<shevy2> cool
<shevy2> thanks you two
<aedornv> Is there a reason (besides readability) to use 'lambda' over -> ? I keep thinking there was some reason I chose not to but I can't remember now...
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
skcin7 has quit [Ping timeout: 252 seconds]
tethra has joined #ruby
<banister`sleep> aedornv: they couldn't figure out how to do default parameters with the old lambda syntax, so they invented -> which culd do defaults
<banister`sleep> aedornv: but they subsequently figured out how to do it with lambda
speakingcode has joined #ruby
ephemerian has joined #ruby
<speakingcode> i have two classes in same file. class A and class B, separate from each other. why can't i create an object of class B inside of class A?
<banister`sleep> speakingcode: you need to show your code befoer we can make senes of that statement
spinagon has quit [Ping timeout: 252 seconds]
<speakingcode> class A .... end class B... end
<aedornv> So ... there's no reason now to use one over the other? Glorious
<speakingcode> inside of class A: myobject = B.new
<banister`sleep> speakingcode: where are you doing it inside class A ?
<speakingcode> error: uninitialized constant A::B (NameError)
<banister`sleep> speakingcode: show where you are doing that inside class A
<banister`sleep> just in the body? or inside a method?
slainer68 has quit [Remote host closed the connection]
hadees has joined #ruby
tar_ has joined #ruby
<speakingcode> in the body of the class
<banister`sleep> speakingcode: why would u want to do that in the body of a class? that's pretty unusual
malte_ has joined #ruby
<banister`sleep> speakingcode: anyway, you can't reference a class before it's defined
<banister`sleep> in executable code
etcetera has joined #ruby
<speakingcode> banister`sleep: because i want the object ot be a member variable of the class
<swarley> ./template/id.h.tmpl:#define RUBY_TOKEN(t) RUBY_TOKEN_##t
<swarley> That macro, cost me a fair amount of grief
<Hanmac> speakingcode: let "class A file" require "class B file"
<swarley> I had to clone into the repo and grep to find it. And it seems almost pointless
<speakingcode> they're in the same file
<havenn> speakingcode: You want B to be a namespace under A?
<banister`sleep> speakingcode: you mean a class instance variable?
<lectrick> Kakera: Mon_Ouie: Note that that technique will only work down to 2 levels of hash. After that it will still be nil. If you want something that works down to infinite levels, you will have to get cleverer...er
<havenn> speakingcode: Gist the code?
<speakingcode> .... it's very basic. two classes
<speakingcode> i want an object of one, in the other
<lectrick> also heftig
<banister`sleep> speakingcode: are you sure you want a class instance variable? how new are you to ruby?
<Mon_Ouie> lectrick: I know. Like heftig's example.
workmad3 has joined #ruby
<banister`sleep> there's chance you're doing something weird, i.e wrong
<speakingcode> yes
<lectrick> Mon_Ouie: Oh, just read that. Yeah, heftig's is the way to go
<speakingcode> i'm sure i want an instance variable.
<Hanmac> speakingcode: class A; class B; end: end or just make two files
<speakingcode> an object of class B will be a member of an object of class A
<banister`sleep> speakingcode: i said *class* instance variable, as opposed to a variable that belongs to an instance
Criztian has joined #ruby
<banister`sleep> speakingcode: well then u're doing it wrong
<banister`sleep> speakingcode: you want to do it in intialize()
bdry has quit [Ping timeout: 245 seconds]
<havenn> speakingcode: class A; def call; B.new; end; end; class B; end; A.new.call #=> #<B:0x107b597f0>
kenneth has quit [Ping timeout: 248 seconds]
<banister`sleep> class A; end; class B; def initialize(); @a = A.new; end; end
<banister`sleep> that will work
<speakingcode> so instance variables have to be defined inside of initialize?
<banister`sleep> speakingcode: yes
<banister`sleep> speakingcode: or inside a method
<speakingcode> well that's just poor design
<banister`sleep> speakingcode: if you just define it in the class body it will belong to the *class* itself
<banister`sleep> speakingcode: no it's not, it's just a different model, it's actually pretty cool once you take the time to grok it
<speakingcode> why wouldn't you be allowed to define an instance variable in the body of a class, which corresponds to the scope of that variable?
<banister`sleep> speakingcode: because inside the class body the 'self' is the class itself
<havenn> speakingcode: It is lovely design!
<banister`sleep> speakingcode: so variables defined there belong to the class, and methods that are executed there are executed on the class
ryannielson has joined #ruby
bean__ has quit [Quit: Computer has gone to sleep.]
<banister`sleep> speakingcode: it all derives from teh fact a class body is executable code
reset has joined #ruby
<speakingcode> whether it belongs to the class or an instance, i should still be able to instantiate an object, no?
<banister`sleep> speakingcode: this fact is used to very cool effect with ruby metaprogramming techinques, cf attr_accessor which is a class method that builds instance methods
<Hanmac> speakingcode nope it cant because the class didnt exist
<banister`sleep> speakingcode: no, because the class body is executed as it is seen -- if you haven't defined a class that is referenced in that body, then you'll get an error
weldyss2 has joined #ruby
<speakingcode> ah, i see
Proshot has quit [Quit: Leaving]
<speakingcode> so at what point is a class's body executed?
<banister`sleep> when it's defined
<banister`sleep> try this: class A; puts "defining the A class!"; end
<speakingcode> hmm
Michael_ has quit [Remote host closed the connection]
<havenn> speakingcode: The class returns a value even when defined: class A; 'pudding!' end #=> "pudding!"
<speakingcode> so as soon as the classes source is read, it is executed?
jrist-afk is now known as jrist
<Hanmac> now you get it
<speakingcode> so if i include a class from another file, is that class's body executed as soon as the interpreter reads the include line?
Nisstyre-laptop has joined #ruby
uris has joined #ruby
<Hanmac> yep
<banister`sleep> speakingcode: no, and you're confusing 'include' with 'require'
<banister`sleep> speakingcode: it's executed as soon as teh file containing that class is require'd
<speakingcode> i'm using the word include generally, not syntactically
<banister`sleep> well that's just confusing :)
karasawa has joined #ruby
<speakingcode> tbh i didn;t know there was a diff but i'll go read on that
<banister`sleep> speakingcode: yeah, read about ruby's object model too
<banister`sleep> it's actually pretty elegant
<yfeldblum> ... for a scripting language
horofox has quit [Quit: horofox]
<banister`sleep> yfeldblum: it's more elegant than the object models in many non-scripting languages, like java/C++ for example :)
<speakingcode> interesting model. i see the purpose of it but i don't know that i like it. much different than java, where you have explicit static members (class members) and object members, and static members are lazy-initialized at the first point the class is referenced in run time
iamjarvo has joined #ruby
<banister`sleep> speakingcode: yeah so 'static members' are kind of special-cased in java/C++, whereas in ruby they're just natural result of the object model, just methods defined on the metaclass of a class
Jackneill has quit [Remote host closed the connection]
<speakingcode> while i see some value in being able to execute code as soon as the class is read by the interpreter, i see that pening the door for horrible practices also
<banister`sleep> speakingcode: and you can go as far as you want, defined class methods on the metaclass, by defining methods on the metaclass's metaclass
<speakingcode> opening*
iamjarvo has quit [Client Quit]
aaronmacy has joined #ruby
willob has joined #ruby
iamjarvo has joined #ruby
robert__ has joined #ruby
Hanmac has quit [Read error: Connection reset by peer]
willob has quit [Max SendQ exceeded]
<banister`sleep> speakingcode: well, if we couldn't do that, things like attr_accessor wouldn't work, nor a lot of the rails-sy metaprogramming methods you see in class definitions
Nisstyre-laptop has quit [Quit: Leaving]
emmanuelux has joined #ruby
weldyss2 has quit [Remote host closed the connection]
<speakingcode> like oh here let me put some gets and puts and what not here in the body of my class and then the next time someone requires my class all this funky unexpected stuff happens... granted that's a big DOH to overlook but you get my point
karasawa has quit [Ping timeout: 264 seconds]
Proshot has joined #ruby
willob has joined #ruby
<banister`sleep> speakingcode: not really
samphippen has joined #ruby
<banister`sleep> all that stuff will happen only the first time the class is require'd (subsequent requires are just ignored), and it's supposedly there for a reason
berserkr has quit [Quit: Leaving.]
horofox has joined #ruby
timonv has joined #ruby
Goopyo has quit [Read error: Connection reset by peer]
willob has quit [Read error: Connection reset by peer]
<speakingcode> right but i'm just saying it's theoretically possible (for a poor programmer) to put code to execute in a class body that really shouldn't be
Goopyo has joined #ruby
samphippen has quit [Client Quit]
<banister`sleep> speakingcode: of course, anyone can write broken code.
robert___ has quit [Ping timeout: 245 seconds]
<speakingcode> not even broken, just mischevious
<banister`sleep> i dont see what oyu're saying is anything different to someone just defining a stupid/bad method
<banister`sleep> which can happen in any language
willob has joined #ruby
jaybee_ has joined #ruby
<speakingcode> true, but. meh. it's just room for "magic" and i don't like magic
<banister`sleep> executable class bodies aren't really magic
<banister`sleep> bbl
workmad3 has quit [Ping timeout: 255 seconds]
<yfeldblum> speakingcode, then you might want to find another field ...
<speakingcode> yfeldblum: this one has been serving me well for 13 years
<yfeldblum> speakingcode, code is magic to the uninitiated, obvious to the initiated
beiter has joined #ruby
d2dchat has joined #ruby
JohnBat26 has quit [Ping timeout: 252 seconds]
<speakingcode> right but my point is code executing as soon as a class definition is LOADED creates room for not-obvious side-effects. it's just true, rather or not it is common or sensible
headius has joined #ruby
<yfeldblum> speakingcode, there are many styles: c and c++ have a screwed up style, java and c# have a two-phase whole-program compilation style, and ruby and python have a line-by-line execution style
<yfeldblum> speakingcode, it's just one more way to write code that is, in many cases, simple to use
<yfeldblum> speakingcode, in ruby, classes and class bodies are *not* syntax; they are normal code just like any other
<jaybee_> Hi all, I'm trying to convery a ruby prog into something else (please don't shoot me, my boss told me to). I'm not familiar with ruby. What does the following statement do: counters = "<%= @counters %>" - I understand that it assigns something to the variable counters; I understand (from the rest of the code) that it is something other than the string literal "<%= @counters %>", does it have to do with the variable COUNTERS (previously mentioned in this c
<speakingcode> well i'm not saying it isn't useful, all i'm saying is it does create a space for surprises
<yfeldblum> speakingcode, instead of `class MyFunClass < BaseClass ... end`, you can just do `MyFunClass = Class.new(BaseClass) do ... end`
<jaybee_> I tried googling, but I have no idea what to google.
<yfeldblum> speakingcode, it's not a surprise, except to someone who comes from a very different style
<speakingcode> no
<speakingcode> i'm not saying the convention is a surpise
<speakingcode> i'm saying the convention creates room for surpises
<speakingcode> for instance
<speakingcode> class SomeLib .... puts "heyh this is my lib test est" .... end
<speakingcode> two weeks later require 'SomeLib' => "hey this is my lib test test" "why the hell is that printing out??
pothibo has quit [Quit: pothibo]
<yfeldblum> speakingcode, why would that be any more of a surprise than if you just had `puts "hey this is my lib test" ... class SomeLib .. end` ?
<Criztian> jaybee_ what you pasted must be inside a view. "counters =" should be plain text while <%= @counters %> means to paste the content of the variable counters
<speakingcode> that's just a contrieved example. i'm simply saying the ability for code to execute simply by loading a class CAN lead to surprises
<speakingcode> becuase it occurs the moment you require the class without calling anything to execute on it
hoelzro|away is now known as hoelzro
malte_ has quit [Quit: malte_]
d2dchat has quit [Remote host closed the connection]
<yxhuvud> speakingcode: it can lead to surprises, but it can also lead to sweet chunky bacon
<Gate> speakingcode: requiring a ruby file executes it, period. You could put a puts above the class and it would execute on require.
<yfeldblum> speakingcode, my example is the same as yours, with the same observable effects, except that in mine the silly code was outside the class definition ... why is there a difference in surprise?
<Gate> It also opens the possability of mokeypatching classes, one of ruby's most powerful AND most dangerous features.
<Criztian> jaybee_ asking you to convert a rails app to something else is harder than asking you to make it all over
aaronmacy has quit [Quit: Leaving.]
<speakingcode> yfeldblum: inside the class body or in the file, outside of a class definition, each can lead to surprises
Targen has joined #ruby
<speakingcode> in fact that was something i had to resolve in a python project just last week that a fairly new programmer was working on
havenn has quit [Remote host closed the connection]
joshman_ has quit [Quit: Computer has gone to sleep.]
<kapowaz> people who know rake-pipeline. Why might rakep successfully run but not generate any CSS? (it is successfully generating JS) How can I debug this? Are there logs somewhere?
<yfeldblum> speakingcode, they're the same exact surprise though ... and so this has got nothing to do with executable class bodies, really, but it's got to do with ruby and python executing each line of your program as it sees each line
mantovan1 has joined #ruby
<mantovan1> morning
mantovan1 is now known as mantovani
<speakingcode> he was putting code to instantiate and call mehtods on in the same file he defined the class, and then when including it in another file he was getting strange effects he couldn't figure out
havenn has joined #ruby
<jaybee_> Thanks, Criztian. As far as I can tell, the program is a stand-alone script, meant to be run from commandline. The script is only 105 lines, including 70 lines of data.
slainer68 has joined #ruby
<jaybee_> I got the script from http://wklej.org/hash/c5cc11c331/
<yxhuvud> jaybe: from the look of it you are generating a config file or something like that, using the template language ERB.
<yfeldblum> speakingcode, sounds like a case of "dunno how python works"
<speakingcode> yfeldblum: yes
malte_ has joined #ruby
<yfeldblum> speakingcode, but it really is just the standard way scripting languages work
<speakingcode> but, shrug. i don't wanna og in circles here
<speakingcode> yeah, hmm
<yfeldblum> speakingcode, if i'm new to circular saws, i'll probably end up needing a bandaid too
syamajala has joined #ruby
<yxhuvud> jaybe: uh. never mind. that's just weird
blaxter has quit [Quit: foo]
skcin7 has joined #ruby
blueOxigen has quit [Ping timeout: 248 seconds]
danneu has quit [Quit: WeeChat 0.3.8]
<jaybee_> I know roughly what the output is supposed to be.
<speakingcode> yeah yeah
jfl0wers has quit [Quit: jfl0wers]
daniel_- has quit [Ping timeout: 256 seconds]
djones__ has quit [Ping timeout: 276 seconds]
<speakingcode> anyway, thanks for the insight, fixed my issue
mercwithamouth has quit [Ping timeout: 248 seconds]
havenn has quit [Ping timeout: 276 seconds]
<yxhuvud> jaybee: is it running by itself? Because it looks as if what is happening is that a ruby script is generated. that is, that script is just a template generatnig whatever should be run in the end
grzywacz has joined #ruby
connor_ has joined #ruby
vonsar has joined #ruby
Thesolonius has quit [Quit: Thesolonius]
nathancahill has quit [Quit: nathancahill]
syamajal1 has joined #ruby
BadLarry has quit [Ping timeout: 255 seconds]
jtharris has quit [Ping timeout: 248 seconds]
syamajala has quit [Remote host closed the connection]
toekutr has joined #ruby
syamajal1 has quit [Client Quit]
syamajala has joined #ruby
<kapowaz> somebody here must use rake-pipeline?
timonv has quit [Remote host closed the connection]
<kapowaz> somebody. out of all the people in here.
BadLarry has joined #ruby
daniel_- has joined #ruby
<speakingcode> ugh now i have another issue. :-) empty_items = items.select do |item| item['found'].count == 0 end =>count: wrong number of arguments
timonv has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
<apeiros> speakingcode: figure out what class item['found'] is, get the docs of that class and look up the count method.
alex__c2022_ has joined #ruby
<speakingcode> items is an array of hashes. so item should refer to a hash. the 'found' field of that hash is an array. why should count on an array need arguments?
<apeiros> speakingcode: docs.
<apeiros> srsly.
<apeiros> somebody spend a lot of time writing them.
<speakingcode> count -> int. returns number of items in enum. IF an argument is given, counts the number of items in enum, for which equals to item"
d2dchat has joined #ruby
<yfeldblum> speakingcode, in any event, there's also Array#empty?
<apeiros> maybe you want to go back to step 1 now - make sure you know what class `item['found']` has
omani has joined #ruby
<yfeldblum> items.select{|item| item["found"].empty?}
<omani> I need ruby-debug. it says: install it with gem install ruby-debug
d2dchat has quit [Remote host closed the connection]
<omani> but if I do, it still says that
<omani> do I have to update something?
<speakingcode> item['found'] is an array of ints, thus my confusion
alex__c2022 has quit [Ping timeout: 248 seconds]
alex__c2022_ is now known as alex__c2022
<apeiros> speakingcode: obviously it's not
<speakingcode> and the docs say right here, that an argument is optional
xnm has quit [Ping timeout: 245 seconds]
timonv has quit [Ping timeout: 260 seconds]
timonv_ has joined #ruby
<speakingcode> puts item['found'] => [312,319,379,384] heh
<apeiros> yeah, no. not reliable.
<apeiros> just because something's to_s looks like array's to_s doesn't make it an array.
<apeiros> also, did you test all item['found']'s?
billy_ran_away has joined #ruby
<speakingcode> well considering i'm defining it as one, and it prints out as one, heh
<apeiros> additionally: it might even be mentioned in the exception
dmiller1 has joined #ruby
<apeiros> (standard arg error exception doesn't mention it, though)
Asym has joined #ruby
<kapowaz> ok, screw it. fixed.
Hanmac1 has joined #ruby
<apeiros> speakingcode: look, there's 3 explanations for what you see: a) you don't have an array, b) you or something you use overrode Array#count, c) you're using a version of ruby where count required an argument (don't know whether that even exists)
gnarmis has joined #ruby
<Asym> if i have class Base and classes Derived1, Derived2, Derived3 that all derive from Base, is it possible to have an class variable inside Base that has refs to all the classes that derive from it? i'd like to hook a class method on Base that gets invoked whenever a derived class gets defined
<apeiros> asym: class Base; def self.inherited(descendant) …
AsgardBSD has joined #ruby
<Asym> apeiros: thanky
<Kakera> is there a function to output several variables separated with spaces?
<Kakera> like Python's print or JavaScripts console.log
timonv_ has quit [Ping timeout: 252 seconds]
dmiller1 has quit [Ping timeout: 246 seconds]
bricker`LA has quit [Ping timeout: 252 seconds]
<gnarmis> Kakera: something different from ruby's #print?
<omani> could someone help me please?
<omani> why does gem install "gem" not work
<Kakera> gnarmis, yes, ruby's print doesn't add spaces
dr_neek has joined #ruby
<Kakera> I guess I'll just have to insert them manually
<omani> I mean it works. but I can't start rails -e production -u with option "-u"
rakl has quit [Quit: sleeping]
linguini has joined #ruby
bricker`LA has joined #ruby
<omani> it always says: install ruby-debug with "gem install ruby-debug"
schwap has quit [Quit: Lost terminal]
reinaldob has joined #ruby
<Hanmac1> apeiros: i played with inherited ... its cool but it cant forbit the creation of the class right?
<Kakera> I don't really need tabs, just spaces
jtharris has joined #ruby
Norrin has left #ruby [#ruby]
mikepack has joined #ruby
<linguini> After upgrading my gems yesterday, I started to get this [BUG]: http://dpaste.org/GJHaf/
<gnarmis> Kakera: ['a','b'].join ' '
<apeiros> Hanmac1: no, it can't. it's invoked after the class has been subclassed
<apeiros> Hanmac1: well, you could remove the constant…
<omani> ok now it works.
Hanmac1 is now known as Hanmac
dougireton has quit [Quit: Leaving.]
<gnarmis> Kakera: as long as you have them in some kind of data structure, you could join em up with spaces
<Kakera> yeah just thought about it
<Hanmac> hm i am looking for a way to forbit it, :/
<linguini> (pthread_cond_wait: Invalid argument (EINVAL) in ruby 1.9.3p362)
<apeiros> puts a,b,c # will print each on a new line
<apeiros> p a,b,c # same, but using a.inspect instead of a.to_s
<apeiros> for debugging, you'll usually want p, not puts or print
aaronmacy has joined #ruby
kpshek has quit []
<gnarmis> plus so much better to just `p` for lazy me
<swarley> ugh
<swarley> I don't want to pay to read the Ruby ISO standard
<swarley> Anyone have a copy they want to give me?..
kpshek has joined #ruby
malte_ has quit [Quit: malte_]
ryannielson has quit [Quit: ryannielson]
<swarley> I tried reading parser.y but that's just a huge clusterfuck
BinaryMaster has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
<linguini> Should I report the above on http://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport ?
hotovson_ has quit [Remote host closed the connection]
<swarley> linguini; can you recreate it?
kenneth has joined #ruby
robotmay has joined #ruby
<linguini> swarley: Not reliably, but it seems to happen intermittently on my production server.
chrisramon has joined #ruby
<Kakera> can you return from inside a condition inside a function?
<Kakera> I get 'unexpected return'
<linguini> swarley: I installed ruby1.9 using macports; perhaps it built ruby badly (wrong pthread??)?
<Kakera> wait nvm
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
joshman_ has joined #ruby
MattRb has quit [Quit: This computer has gone to sleep]
zph has quit [Quit: Computer has gone to sleep.]
<swarley> Hm, it's difficult to say
<Hanmac> be happy that mac allows you to build your own software
bean_ has joined #ruby
<aedornv> mmm only $285.00 for the ISO spec. Never did check the price until now
icole has quit [Remote host closed the connection]
<swarley> Yeah... That's a little more than I'm willing to pay to develop an application that won't turn a profit
robert___ has joined #ruby
robert___ has joined #ruby
robert___ has quit [Changing host]
icole has joined #ruby
robert___ is now known as robert_
hotovson has joined #ruby
icole has quit [Remote host closed the connection]
icole has joined #ruby
<linguini> Looks similar to http://www.ruby-forum.com/topic/4404543
malte_ has joined #ruby
robert__ has quit [Ping timeout: 245 seconds]
malte_ has quit [Client Quit]
benlieb has quit [Quit: benlieb]
<aedornv> That's a lot of hoops to jump through to get a site license for distribution between a group for an ISO spec, too.
hotovson has quit [Ping timeout: 248 seconds]
<ericwood> why can't I do (5..0).to_a ???
<ericwood> >> p (5..0).to_a
<eval-in> ericwood: Output: "[]\n" (http://eval.in/6872)
<ericwood> :(
<ericwood> >> p (0..5).to_a.reverse
<eval-in> ericwood: Output: "[5, 4, 3, 2, 1, 0]\n" (http://eval.in/6873)
nomenkun has quit [Remote host closed the connection]
<aedornv> 5.downto(0)
<ericwood> gracias
<ericwood> I still think it's silly that range won't do that for me, though :(
<Hanmac> its bacause Range only reacts on a #succ method ...
forcefsck has joined #ruby
<ericwood> awww
mongag has quit [Quit: This computer has gone to sleep]
asteve has quit [Quit: Computer has gone to sleep.]
phantasm66 has quit [Quit: *poof*]
sailias has quit [Quit: Leaving.]
elico has joined #ruby
arturaz has quit [Remote host closed the connection]
<swarley> >> p [*0..5]
<eval-in> swarley: Output: "[0, 1, 2, 3, 4, 5]\n" (http://eval.in/6875)
karasawa has joined #ruby
<swarley> >> range = 0..5; p [*a]
<eval-in> swarley: Output: "/tmp/execpad-b20068f70c45/source-b20068f70c45:1:in `<main>': undefined local variable or method `a' for main:Object (NameError)\n" (http://eval.in/6876)
<swarley> >> range = 0..5; p [*range]
<eval-in> swarley: Output: "[0, 1, 2, 3, 4, 5]\n" (http://eval.in/6877)
<swarley> whoops. Lol
Michael_ has joined #ruby
dougireton has joined #ruby
ChampS666 has quit [Ping timeout: 252 seconds]
osaut has quit [Quit: osaut]
ChampS666 has joined #ruby
<swarley> Also, does anyone have a good definition of what the characters allowable in a ruby identifier are? I know you can use [A-Za-z0-9_] but I know unicode is also up for grabs as well
eldariof has quit []
<swarley> So does it just check to make sure that it's not something else?
<tethra> quick question: does anyone know of a gem that will parse an email body? specifically I'm looking for it to deal with attachments, google has thrown up some seemingly ancient and not-in-development things (tmail, mail)
rezzack has joined #ruby
<yfeldblum> swarley, all characters using metaprogramming and #send; the characters in \w if you're talking about parseable ruby
adambeynon has joined #ruby
melisaa has quit [Quit: © Www.Kelebek.Org Mutlaka Download Edin! Kelebek Final irc.kelebek.org ßy wToprak ®]
malte_ has joined #ruby
zigidias has joined #ruby
<swarley> I mean a variable identifier
AlchemyFalcon has joined #ruby
<jaybee_> yxhuvud: sorry, I was AFK. Yes, that's the conclusion I came to as well. I think I have everything I need.
<swarley> because I can do
<jaybee_> Thanks everyone!
chrisramon has quit [Quit: chrisramon]
karasawa has quit [Ping timeout: 264 seconds]
* jaybee_ will pay it forward in #python
<Hanmac> swarley:
<Hanmac> >> öäü = "it works!";p öäü
<eval-in> Hanmac: Output: "/tmp/execpad-39a1a2eaf873/source-39a1a2eaf873:1: invalid multibyte char (US-ASCII)\n" (http://eval.in/6878)
<swarley> >> σ = "sigma"; puts "I just used a unicode #{σ} as a variable identifier!"
<eval-in> swarley: Output: "/tmp/execpad-c2039f4d70c4/source-c2039f4d70c4:1: invalid multibyte char (US-ASCII)\n" (http://eval.in/6879)
chrisramon has joined #ruby
nga4 has quit []
<swarley> ...
<swarley> >> puts RUBY_VERSION
<eval-in> swarley: Output: "1.9.3\n" (http://eval.in/6881)
niklasb has joined #ruby
<swarley> ah
nga4 has joined #ruby
<Hanmac> swarley: it works on my IRB because its enable utf8
<swarley> >> puts __ENCODING__
<eval-in> swarley: Output: "US-ASCII\n" (http://eval.in/6882)
<swarley> yeah
<swarley> But anyway
<swarley> I remember reading the draft a while back
<swarley> But now I don't have access to it
clocKwize has quit [Quit: clocKwize]
<swarley> So I'm not sure what a valid identifier is
horofox has quit [Read error: Connection reset by peer]
jaybee_ has quit [Quit: jaybee_]
horofox has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
malte_ has quit [Client Quit]
dougireton has quit [Remote host closed the connection]
ionte has quit [Read error: Connection reset by peer]
chrisramon has quit [Client Quit]
graft has quit [Ping timeout: 240 seconds]
mikepack has quit [Remote host closed the connection]
ionte has joined #ruby
asteve has joined #ruby
v0n has joined #ruby
Dreamer3 has quit [Ping timeout: 252 seconds]
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
mikepack has joined #ruby
mmitchel_ has joined #ruby
kpshek has quit []
workmad3 has joined #ruby
Dreamer3 has joined #ruby
robotmay has quit [Read error: No route to host]
robotmay_ has joined #ruby
benlieb has joined #ruby
friendmaster has quit [Ping timeout: 248 seconds]
mmitchell has quit [Ping timeout: 264 seconds]
MattRb has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
robert__ has joined #ruby
tatsuya_o has joined #ruby
Hanmac has quit [Quit: Leaving.]
tar_ has quit [Quit: tar_]
hoelzro is now known as hoelzro|away
workmad3 has quit [Ping timeout: 246 seconds]
<Dann1> array = ["item", "item", "item"]
malte_ has joined #ruby
<swarley> k?
<Dann1> I'm trying to append '+' to the start of each item
<Dann1> how do?
Michael_ has quit [Remote host closed the connection]
<swarley> array.map {|x| x.concat '+' }
robert_ has quit [Ping timeout: 245 seconds]
omani has left #ruby [#ruby]
samphippen has joined #ruby
<swarley> >> array = ["item"] * 3; array.map {|x| x.concat '+' }
<eval-in> swarley: Output: "" (http://eval.in/6884)
<swarley> >> array = ["item"] * 3; array.map {|x| x.concat '+' }; p array
<eval-in> swarley: Output: "[\"item+++\", \"item+++\", \"item+++\"]\n" (http://eval.in/6885)
<swarley> o-o
dmiller1 has joined #ruby
<apeiros> Dann1: "append" and "to the start" is somewhat contradictory :-p
<apeiros> prepend is the word you were probably looking for ;-)
pu22l3r has quit [Remote host closed the connection]
<swarley> oh. well that's interesting
<apeiros> yeah, isn't it? :D
sailias has joined #ruby
<apeiros> I'd use String#[]=
carloslopes has quit [Remote host closed the connection]
<swarley> >> array = ["item"] * 3; p array.collect(&:__id__)
<eval-in> swarley: Output: "[82897230, 82897230, 82897230]\n" (http://eval.in/6886)
<apeiros> also, if you mutate the strings, don't use map
<apeiros> you're just confusing people about the intent
<swarley> That's what I find interesting
RagingDave has quit [Quit: Ex-Chat]
<apeiros> >> ary = Array.new(3) { 'item' }; ary.each do |str| str[0,0] = '+' end; p ary
<eval-in> apeiros: Output: "[\"+item\", \"+item\", \"+item\"]\n" (http://eval.in/6887)
<apeiros> who's the owner of eval-in?
<swarley> No idea
Michael_ has joined #ruby
Spami has joined #ruby
benlieb has quit [Quit: benlieb]
mikeg has joined #ruby
Rym has quit [Quit: Rym]
<swarley> I'm aiming for the least efficient here
havenn has joined #ruby
diegoviola has quit [Ping timeout: 246 seconds]
<swarley> >> array = ["item","item","item"]; p (["+"]*3).zip(array[0..-1]).map!(&:join)
<eval-in> swarley: Output: "[\"+item\", \"+item\", \"+item\"]\n" (http://eval.in/6888)
<apeiros> if you want to use map, don't modify the strings:
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<swarley> shhhh
<swarley> I used map!
<apeiros> >> ary = Array.new(3) { 'item' }; p ary.map do |str| '+'+str }; p ary
<eval-in> apeiros: Output: "/tmp/execpad-29322785df9a/source-29322785df9a:1: syntax error, unexpected '}', expecting keyword_end\nary = Array.new(3) { 'item' }; p ary.map do |str| '+'+str }; p ary\n ^\n" (http://eval.in/6889)
<apeiros> >> ary = Array.new(3) { 'item' }; p ary.map { |str| '+'+str }; p ary
<eval-in> apeiros: Output: "[\"+item\", \"+item\", \"+item\"]\n[\"item\", \"item\", \"item\"]\n" (http://eval.in/6890)
<apeiros> gah
jblack has joined #ruby
<apeiros> >> ary = Array.new(3) { 'item' }; p ary.map { |str| '+'+str }
<eval-in> apeiros: Output: "[\"+item\", \"+item\", \"+item\"]\n" (http://eval.in/6891)
<apeiros> 3 tries… that's too much :D
<swarley> I don't see the reason they can't be modified if I use map! ;p
Hanmac has joined #ruby
thone has quit [Read error: Connection reset by peer]
thone has joined #ruby
kirun has quit [Ping timeout: 276 seconds]
havenn has quit [Read error: No route to host]
havenn has joined #ruby
kil0byte has quit [Remote host closed the connection]
mmitchel_ has quit [Remote host closed the connection]
Chryson has joined #ruby
horofox has quit [Quit: horofox]
mmitchell has joined #ruby
nkr has quit [Quit: Linkinus - http://linkinus.com]
benlieb has joined #ruby
kirotan has quit [Ping timeout: 256 seconds]
lolcathost is now known as Automorphism
vlad_starkov has quit [Remote host closed the connection]
end_guy has joined #ruby
albakry has quit [Quit: Leaving]
vlad_starkov has joined #ruby
dougireton has joined #ruby
willob1 has joined #ruby
willob1 has quit [Max SendQ exceeded]
willob has quit [Ping timeout: 248 seconds]
Mon_Ouie has quit [Ping timeout: 248 seconds]
willob has joined #ruby
hibariya_ has quit [Quit: No Ping reply in 180 seconds.]
willob has quit [Max SendQ exceeded]
hibariya has joined #ruby
buibex has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
willob has joined #ruby
benlieb has quit [Quit: benlieb]
willob has quit [Max SendQ exceeded]
kirotan has joined #ruby
willob has joined #ruby
enroxorz-work has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
beiter has quit [Quit: beiter]
Morkel has joined #ruby
bricker`1A has joined #ruby
diegoviola has joined #ruby
rdark has quit [Quit: leaving]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
bricker`LA has quit [Ping timeout: 240 seconds]
IrishGringo has quit [Remote host closed the connection]
nwertman has quit [Read error: Connection reset by peer]
nwertman_ has joined #ruby
az7ar has quit [Ping timeout: 252 seconds]
Kuifje has quit [Ping timeout: 276 seconds]
blacktulip has quit [Remote host closed the connection]
Dann1 has quit [Quit: Dann1]
jonahR has quit [Quit: jonahR]
aeontech has quit [Read error: Connection reset by peer]
joeycarmello has quit [Read error: Connection reset by peer]
Eiam has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
sailias has quit [Quit: Leaving.]
[Neurotic] has joined #ruby
RagingDave has joined #ruby
Spami has quit [Quit: Leaving]
joeycarmello has joined #ruby
dougireton has quit [Quit: Leaving.]
doktrin has joined #ruby
jds_ has joined #ruby
ukd1 has joined #ruby
francisfish has joined #ruby
Spooner has joined #ruby
aeontech has joined #ruby
reinaldob has quit [Remote host closed the connection]
obryan has quit [Remote host closed the connection]
banister`sleep has quit [Remote host closed the connection]
Rym has joined #ruby
dougireton has joined #ruby
DrCode has quit [Ping timeout: 276 seconds]
syamajala has quit [Quit: leaving]
alanjc has quit [Ping timeout: 264 seconds]
Virunga has quit [Remote host closed the connection]
chussenot has joined #ruby
mikepack has quit [Remote host closed the connection]
iamjarvo1 has joined #ruby
entrenador has joined #ruby
connor_ has quit [Remote host closed the connection]
entrenador has quit [Client Quit]
mikepack has joined #ruby
connor_ has joined #ruby
az7ar has joined #ruby
Kingy has joined #ruby
entrenador has joined #ruby
DrCode has joined #ruby
failshell has quit [Remote host closed the connection]
entrenador has quit [Remote host closed the connection]
joofsh has quit [Remote host closed the connection]
sjuxax has left #ruby [#ruby]
entrenador has joined #ruby
iamjarvo has quit [Ping timeout: 260 seconds]
AsgardBSD has quit [Remote host closed the connection]
IrishGringo has joined #ruby
jblack has quit [Ping timeout: 246 seconds]
karasawa has joined #ruby
nathancahill has joined #ruby
dougireton has quit [Quit: Leaving.]
nathancahill has quit [Client Quit]
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
AlchemyFalcon has quit [Quit: AlchemyFalcon]
connor_ has quit [Ping timeout: 256 seconds]
theRoUS has quit [Ping timeout: 276 seconds]
dougireton has joined #ruby
Mchl has joined #ruby
tps_ has quit [Quit: tps_]
rakl has joined #ruby
karasawa has quit [Ping timeout: 252 seconds]
jonahR has joined #ruby
jonathanwallace has quit [Ping timeout: 260 seconds]
fourq has quit [Ping timeout: 240 seconds]
jerius has quit []
vlad_starkov has joined #ruby
Chryson has quit [Ping timeout: 244 seconds]
soulcake has joined #ruby
inokenty has quit [Quit: Leaving.]
kenneth has quit [Ping timeout: 255 seconds]
BinaryMaster has quit [Quit: Leaving]
etcetera has quit []
Axsuul has joined #ruby
Michael_ has quit [Remote host closed the connection]
MattRb has quit [Quit: This computer has gone to sleep]
mossplix has quit [Ping timeout: 272 seconds]
tjbiddle has joined #ruby
zastern has quit [Remote host closed the connection]
miskander has joined #ruby
mmitchell has quit [Ping timeout: 248 seconds]
pavilionXP has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Ping timeout: 248 seconds]
Michael_ has joined #ruby
etcetera has joined #ruby
nfk has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
Veejay has left #ruby ["WeeChat 0.3.0"]
entrenador has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
francisfish has quit [Remote host closed the connection]
ffranz has quit [Quit: Leaving]
Morkel has quit [Quit: Morkel]
hackerdude has quit [Remote host closed the connection]
hackerdude has joined #ruby
benlieb has joined #ruby
nfk has joined #ruby
postmodern has joined #ruby
jonathanwallace has joined #ruby
withnale has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
Cicloid has quit [Ping timeout: 252 seconds]
sailias has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
codezombie has joined #ruby
kold_ has joined #ruby
banisterfiend has joined #ruby
benlieb has quit [Client Quit]
greenarrow has quit [Quit: IRC is just multiplayer notepad]
jblack has joined #ruby
<codezombie> whoops
<codezombie> wrong channel
breakingthings has quit []
daniel_- has quit [Quit: WeeChat 0.3.9.2]
<codezombie> sorry about that.
Kakera has quit [Ping timeout: 276 seconds]
Cicloid has joined #ruby
alanp_ has joined #ruby
alanp has quit [Disconnected by services]
alanp_ is now known as alanp
AlchemyFalcon has joined #ruby
xsarin has quit [Ping timeout: 246 seconds]
Virunga has joined #ruby
willob has quit [Quit: Leaving.]
bean_ has quit [Quit: Computer has gone to sleep.]
nari has joined #ruby
apeiros has quit [Remote host closed the connection]
reppard has joined #ruby
vonsar has quit [Quit: This computer has gone to sleep]
Raboo_ has joined #ruby
jblack has quit [Ping timeout: 244 seconds]
<aedornv> Is there a better way of doing eval("\"\\nsome other stuff\"") to get that inspect styled string into a usable Ruby string again?
Raboo has quit [Ping timeout: 252 seconds]
ChampS666 has quit [Ping timeout: 276 seconds]
joofsh has joined #ruby
jjbohn has quit [Quit: Leaving...]
Eiam has joined #ruby
Markvilla has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
zarubin has quit [Remote host closed the connection]
kold_ has quit [Remote host closed the connection]
wargasm has quit [Ping timeout: 276 seconds]
zarubin has joined #ruby
otters has quit [Ping timeout: 252 seconds]
Umren has quit [Read error: Connection reset by peer]
ilyam has joined #ruby
graft is now known as Guest94656
Guest42142 is now known as graft
rmelissari has joined #ruby
<graft> aedornv: can you clarify what you're asking a bit?
snearch has quit [Quit: Verlassend]
DuoSRX has joined #ruby
jtharris has quit [Quit: WeeChat 0.3.9.2]
philcrissman has quit [Remote host closed the connection]
zarubin has quit [Ping timeout: 276 seconds]
<RubyPanther> aedornv: you're supposed to avoid needing to do that, you should already have it before you inspect it
miskander has quit [Quit: miskander]
connor_ has joined #ruby
zarubin has joined #ruby
<aedornv> I have a long string that gets tossed into another medium, for sake of simplicity let's say it's just a file, with using inspect. So File.write("somefile", "some very long string\n".inspect). When I read it back in, it's still in that "inspected" format .. but I need the original format. Using eval works, but it's cumbersome
sailias has quit [Quit: Leaving.]
<heftig> aedornv: don't use inspect
forcefsck has quit [Quit: Ex-Chat]
<RubyPanther> aedornv: if you need a non-basic type, use an object server (you can implement one over TCP using drb in just a few lines of code) and if it is just basic types, use a database.
enebo has quit [Quit: enebo]
mercwithamouth has joined #ruby
forced_request has joined #ruby
dr_neek has quit [Quit: dr_neek]
miskander has joined #ruby
<RubyPanther> I'm sure dozens of other ways can also be listed. Anything except eval :P
<aedornv> Well, really what's going on is we're sending this log data from a process to a separate server.. when it gets transferred it's already in the format on the other end. That process saves it, and we later read it back on yet another separate process in a different location
joofsh has quit [Remote host closed the connection]
dougireton has quit [Quit: Leaving.]
<RubyPanther> right. And that is the "wrong way."
miskander has quit [Client Quit]
gnarmis has quit [Remote host closed the connection]
<RubyPanther> inspect is for humans, not for computers
gnarmis has joined #ruby
DatumDrop has quit [Remote host closed the connection]
szarubin has joined #ruby
zarubin has quit [Ping timeout: 276 seconds]
<RubyPanther> You should describe your data using some sort of data description format.
mk03 has quit [Remote host closed the connection]
ebobby has joined #ruby
Criztian has quit [Ping timeout: 256 seconds]
Michael_ has quit [Remote host closed the connection]
cr3 has quit [Quit: leaving]
dougireton has joined #ruby
chussenot has quit [Read error: Connection reset by peer]
__BigO__ has quit [Remote host closed the connection]
anonymuse has quit [Quit: Leaving.]
chussenot has joined #ruby
<aedornv> Like XML? ;)
<RubyPanther> sure, it parses easy enough
workmad3 has joined #ruby
<RubyPanther> I would choose some sort of database 100 times and XML 0 times, myself.
<aedornv> It's already in XML ... but the great firewall of China won't let it through without the character escaped.. and thus is the problem
AlchemyFalcon has quit [Quit: AlchemyFalcon]
mjolk has quit [Quit: This computer has gone to sleep]
karasawa has joined #ruby
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
grzywacz has quit [Quit: :wq]
<aedornv> Unfortunately, I think the end answer is going to be Shanghai is out of luck ...
<RubyPanther> aedornv: can't you just unescape the character with .gsub! instead?
Xeago has quit [Remote host closed the connection]
jrajav has joined #ruby
kenneth has joined #ruby
aaronmacy has quit [Quit: Leaving.]
karasawa has quit [Ping timeout: 264 seconds]
segv- has quit [Quit: segv-]
generalissimo has quit [Remote host closed the connection]
<aedornv> RubyPanther: Well, yeah.. we ended up with a rather long set of gsub lines that nobody wanted to look after if any changes were made
jeffreybaird has quit [Quit: jeffreybaird]
segv- has joined #ruby
segv- has quit [Client Quit]
jjang has joined #ruby
solidoodlesuppor has quit [Remote host closed the connection]
<aedornv> Hmmm ... maybe if we just drop XML and just bzip2 the log specifically instead
<RubyPanther> aedornv: I would stuff the regexes into a database
dougireton has quit [Quit: Leaving.]
chussenot has quit [Quit: chussenot]
<RubyPanther> just treat it like a regular translation
havenn has quit [Remote host closed the connection]
szarubin has quit []
asteve has quit [Quit: Computer has gone to sleep.]
elico has quit [Quit: elico]
havenn has joined #ruby
zarubin has joined #ruby
horofox has joined #ruby
headius has quit [Quit: headius]
dougireton has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
jimeh has joined #ruby
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
AlchemyFalcon has joined #ruby
LouisGB has quit [Ping timeout: 255 seconds]
SCommette has quit [Quit: SCommette]
SCommette has joined #ruby
havenn has quit [Ping timeout: 276 seconds]
ukd1 has quit [Quit: leaving]
SCommette has quit [Client Quit]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jimeh has quit [Ping timeout: 248 seconds]
iamjarvo1 has quit [Quit: Leaving.]
malte_ has quit [Quit: malte_]
pencilcheck has joined #ruby
jimeh has joined #ruby
r3nrut_ has joined #ruby
r3nrut has quit [Read error: Connection reset by peer]
chaosis has joined #ruby
otters has joined #ruby
art_man1 has quit [Quit: art_man1]
r3nrut_ has quit [Read error: Connection reset by peer]
zph has joined #ruby
r3nrut has joined #ruby
syamajala has joined #ruby
aaronmacy has joined #ruby
xemu2 has joined #ruby
skaczor has quit [Remote host closed the connection]
xemu has quit [Ping timeout: 248 seconds]
AlchemyFalcon has quit [Remote host closed the connection]
gyre007 has quit [Remote host closed the connection]
jimeh has quit [Ping timeout: 255 seconds]
skcin7 has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby
jfl0wers has joined #ruby
froy has quit [Quit: kablam!]
r3nrut has quit [Ping timeout: 252 seconds]
luckyruby has quit [Remote host closed the connection]
zeade has quit [Quit: Leaving.]
doktrin has quit [Ping timeout: 256 seconds]
stopbit has quit [Quit: Leaving]
MattRb has joined #ruby
xsarin has joined #ruby
pcarrier has quit []
PragCypher has quit [Quit: Leaving]
banisterfiend has quit [Read error: Connection reset by peer]
jfl0wers has quit [Quit: jfl0wers]
<Eiam> is "confident ruby" generally viewed as a good book by the community?
banisterfiend has joined #ruby