ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
headius has joined #ruby-lang
mihar has quit [Ping timeout: 265 seconds]
mihar has joined #ruby-lang
cantonic has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
cantonic has quit [Client Quit]
krzkrzkrz has joined #ruby-lang
krz has quit [Ping timeout: 240 seconds]
krzkrzkrz is now known as krz
wpaulson has joined #ruby-lang
banisterfiend has joined #ruby-lang
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
krzkrzkrz has joined #ruby-lang
krz has quit [Ping timeout: 252 seconds]
krzkrzkrz is now known as krz
wpaulson has joined #ruby-lang
tenderlo_ has joined #ruby-lang
tenderlove has quit [Ping timeout: 240 seconds]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
tenderlove has joined #ruby-lang
headius has quit [Quit: headius]
tenderlo_ has quit [Ping timeout: 260 seconds]
bluemonk has quit [Ping timeout: 248 seconds]
tenderlove has quit [Ping timeout: 248 seconds]
tenderlove has joined #ruby-lang
seanstickle has quit [Quit: Nihil sub sole novum]
iamjarvo has joined #ruby-lang
gix has quit [Ping timeout: 256 seconds]
bluemonk has joined #ruby-lang
gix has joined #ruby-lang
neoesque has joined #ruby-lang
zilch has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mistym has quit [Remote host closed the connection]
zilch has joined #ruby-lang
zilch has left #ruby-lang [#ruby-lang]
countdigi has quit [Ping timeout: 246 seconds]
countdigi has joined #ruby-lang
wpaulson has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
tenderlove has quit [Ping timeout: 260 seconds]
wpaulson_ has joined #ruby-lang
iamjarvo has quit [Quit: Computer has gone to sleep.]
wpaulson has quit [Ping timeout: 248 seconds]
wpaulson_ is now known as wpaulson
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
postmodern has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
levifig has quit [Read error: Operation timed out]
spectra has quit [Read error: Operation timed out]
levifig has joined #ruby-lang
banisterfiend has joined #ruby-lang
levifig has quit [Quit: Farewell]
levifig has joined #ruby-lang
nertzy has joined #ruby-lang
artOfWar has quit [Remote host closed the connection]
WillMarshall has joined #ruby-lang
mistym has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
cha1tanya has joined #ruby-lang
tenderlove has quit [Ping timeout: 260 seconds]
znowi_ has quit [Ping timeout: 240 seconds]
Hakon has quit [Ping timeout: 248 seconds]
cha1tanya has quit [Quit: आलोच..]
znowi has joined #ruby-lang
WillMarshall has quit [Ping timeout: 255 seconds]
hynkle has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
hynkle has quit [Client Quit]
concernedcitizen has joined #ruby-lang
concernedcitizen has quit [Remote host closed the connection]
concernedcitizen has joined #ruby-lang
concernedcitizen has quit [Changing host]
concernedcitizen has joined #ruby-lang
WillMarshall has joined #ruby-lang
WillMarshall has quit [Client Quit]
futurecode has joined #ruby-lang
gregmoreno has quit [Read error: Connection reset by peer]
gregmoreno has joined #ruby-lang
savage- has quit [Remote host closed the connection]
lsegal has joined #ruby-lang
jxie has quit [Ping timeout: 240 seconds]
jxie has joined #ruby-lang
neocoin has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
futurecode has quit [Ping timeout: 248 seconds]
verbad has quit [Remote host closed the connection]
savage- has joined #ruby-lang
imperator has joined #ruby-lang
cha1tanya has joined #ruby-lang
andrewhl_ has quit [Remote host closed the connection]
banisterfiend has joined #ruby-lang
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
tomb_ has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
ridders24 has joined #ruby-lang
ridders24 has quit [Ping timeout: 255 seconds]
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby-lang
sepp2k has joined #ruby-lang
Axsuul has quit [Read error: Connection reset by peer]
Axsuul has joined #ruby-lang
pemeon has joined #ruby-lang
solars has joined #ruby-lang
diegoviola has quit [Ping timeout: 260 seconds]
DEac-_ has quit [Ping timeout: 248 seconds]
DEac- has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has quit [Changing host]
|Vargas| has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
stardiviner has joined #ruby-lang
eydaimon has joined #ruby-lang
<eydaimon> why do no style guides (except Erlang that I can find) have restrictions on the number of lines that a function is OK to have?
<eydaimon> A function with too many lines is clearly unwieldly and breaks all kinds of rules of being modular
<Mon_Ouie> I am against having a hard limit to the amount of lines in a method — because it ends up encouraging to write stupid code just to fit into that limit
areil has joined #ruby-lang
<eydaimon> Mon_Ouie: there's never a hard limit, not even on the number of characters in a line. That doesn't mean 5,000 lines should be acceptable
spectra has joined #ruby-lang
nertzy has quit [Quit: This computer has gone to sleep]
<eydaimon> There's a soft limit which is flexible based on readability.
<Mon_Ouie> Well, I have seen people seriously suggest 5-line methods at most :p
<Mon_Ouie> But in that case, I don't see what a style guide could say, other than "methods shouldn't be too long, based on common sense"
<eydaimon> well, we're limiting character length to 80 based on a 80x25 terminal. Seems 25 lines is a pretty good guideline for functions
<eydaimon> how often do you write methods which are longer anyway? When I do, I question implementation
<Mon_Ouie> A common case of longer methods is a large when … then … list
certainty has joined #ruby-lang
<eydaimon> you mean a case statement? Even those shouldn't need to be too long ... just put method calls when the conditionals are met
<eydaimon> case value
<eydaimon> when "blah"
<eydaimon> method_here
<eydaimon> end
<eydaimon> i've never had the need to make those excessivly long anyway
banisterfiend has joined #ruby-lang
<Mon_Ouie> I mean when there are more than 25 possible values
<eydaimon> uh huh ...
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<imperator> if i .dup a string, and only modify the .dup, the original string shouldn't be affected in any way, right?
<certainty> trur
<certainty> true, even
<certainty> moin
<banisterfiend> imperator: trur
<imperator> then i'm confused: http://gist.github.com/3162285
<eydaimon> imperator: try simplifying the issue and get rid of some cruft. may help you find the problem
<imperator> is that supposed to be a joke?
<eydaimon> nope. you can get rid of the ffi stuff
<eydaimon> it doesn't need to be there to prove your point
igotnolegs has quit [Quit: Computer has gone to sleep.]
<imperator> eydaimon, i can't duplicate it outside of an ffi example
<imperator> can you?
<eydaimon> I don't know. but doesn't that tell you something?
<certainty> :)
<imperator> jesus, is that your idea of insight? you're pissing me off
<imperator> NO SHIT
<certainty> do have dup'ed strings references to their originals that a foreign function could mess with?
<Mon_Ouie> :string is probably interpreted as const char* — so it may just pass the buffer used by the String object without bothering to copy it
<Mon_Ouie> And since Ruby uses copy on write…
<Mon_Ouie> Use an FFI::MemoryPointer instead, and write the string in it before passing it to your function
savage- has quit [Remote host closed the connection]
<certainty> Mon_Ouie: but the buffer that is passed to the foreign function should be the one that comes from the dup'ed string. Do duped strings share structure?
<Mon_Ouie> certainty: That's what copy-on-write is about
<Mon_Ouie> They share the same buffer until one of them is changed
<imperator> Mon_Ouie, yeah, that worked; thought i tried it before and failed, but i may not have .dup'd the arg before when i tried
<certainty> Mon_Ouie: aha! Thanks for the clarification
<imperator> eydaimon, THAT is my idea of insight
<imperator> ^^^^
<eydaimon> imperator: if you had thought about it more, you could have realized it yourself with my insight
<Mon_Ouie> imperator: Using the MemoryPointer you shouldn't need to dup anything
dc5ala has joined #ruby-lang
<imperator> Mon_Ouie, yes; i don't know what i did wrong before :(
<imperator> thanks
<matled> eydaimon: here is another coding style that limits the number of lines per function: Chapter 6 of http://www.kernel.org/doc/Documentation/CodingStyle
<Mon_Ouie> I've heard it wasn't actually meticulously followed
<imperator> eydaimon, i'll try to maximize my synergies to optimize resource utilization next time
<eydaimon> matled: awesome. that by Linus?
<eydaimon> imperator: great, then you will vibrate better with the compiler
<imperator> tabs are eight characters - haha - FUCK THAT SHIT
workmad3 has joined #ruby-lang
<eydaimon> imperator: hm. that invalidates the rest of the doc, doesn't it ...
<eydaimon> I'm serious btw.
<eydaimon> he does make a good case
Hakon has joined #ruby-lang
<Harzilein> uhm, tw=8 for c is fine
<eydaimon> I've got a junior guy who keep implementing really long functions (500+ lines). I suggested he make them smaller and he made this really long convoluted excuse.
woollyams has quit [Ping timeout: 240 seconds]
Z33K|Lux has quit []
<eydaimon> His code is really hard to follow. very very long lines, many many levels of indentation, the long functions, camelCased code, etc
<imperator> testing usually cures that, not style guides
<eydaimon> he doesn't believe in testing
<eydaimon> that's another hurdle
JohnBat26 has joined #ruby-lang
zmack has joined #ruby-lang
<imperator> doesn't believe in testing? a junior guy?
zmack_ has joined #ruby-lang
<imperator> i haven't seen that attitude except from crusty old programmers from days of yore
<eydaimon> imperator: junior PHP guy .... when I asked him about ruby, he said he doesn't like the ruby community. I forget what other BS he said.
<eydaimon> But that was his excuse for not liking Ruby
<eydaimon> smart guy, but junior
<eydaimon> although my previous comment probably conflicts with the one above
<eydaimon> hm. jQuery is the only coding standard I've seen that says tabs instead of spaces
boardyuk has joined #ruby-lang
workmad3 has quit [Read error: Operation timed out]
zmack has quit [Ping timeout: 264 seconds]
<imperator> doesn't' like the community, oh lord
<imperator> people get hung up on the weirdest stuff sometimes
<eydaimon> no kidding
<imperator> DHH said 'fuck' in a presentation, better switch to PHP
<eydaimon> he worries about THAT, but is completely fine with no testing
JoshWines has quit [Ping timeout: 260 seconds]
<eydaimon> imperator: sorry about earlier. I would have helped more if I knew. I was just hoping to get you thinking about the solution.
<eydaimon> bed now
<manveru> eydaimon: go also uses tabs :)
<imperator> (slightly nsfw)
<imperator> eydaimon, np, good night
symm- has joined #ruby-lang
<imperator> Mon_Ouie, think i was struggling with UTF-16LE before
dhruvasagar has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
fayimora has quit [Quit: Busy…..zzzzz]
dc5ala has quit [Quit: Ex-Chat]
slyphon has quit [Ping timeout: 245 seconds]
mssola has joined #ruby-lang
JoshWines has joined #ruby-lang
sepp2k has quit [Ping timeout: 260 seconds]
sepp2k has joined #ruby-lang
dc5ala has joined #ruby-lang
setmeaway2 has joined #ruby-lang
setmeaway has quit [Read error: Connection reset by peer]
wycats has quit [Excess Flood]
wycats has joined #ruby-lang
Criztian has joined #ruby-lang
tooky has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
srbartlett has quit [Remote host closed the connection]
fgomez has quit [Ping timeout: 264 seconds]
kristofferrr has joined #ruby-lang
pemeon has quit [Ping timeout: 260 seconds]
boardyuk has quit [Ping timeout: 260 seconds]
boardyuk has joined #ruby-lang
krzkrzkrz has joined #ruby-lang
krz has quit [Ping timeout: 260 seconds]
krzkrzkrz is now known as krz
WillMarshall has joined #ruby-lang
pcboy_ has quit [Ping timeout: 245 seconds]
charliesome has joined #ruby-lang
gsav has quit [Ping timeout: 248 seconds]
pcboy_ has joined #ruby-lang
d3vic3 has joined #ruby-lang
gsav has joined #ruby-lang
concernedcitizen has quit [Remote host closed the connection]
perryh is now known as perryh_away
workmad3 has joined #ruby-lang
postmodern has quit [Quit: Leaving]
future_chimp has joined #ruby-lang
jarib has quit [Excess Flood]
sora_h is now known as s0ra_h
jarib has joined #ruby-lang
boardyuk has quit [Read error: Connection reset by peer]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
boardyuk has joined #ruby-lang
boardyuk_ has joined #ruby-lang
boardyuk_ has quit [Read error: Connection reset by peer]
jxie has quit [Quit: leaving]
boardyuk_ has joined #ruby-lang
boardyuk has quit [Ping timeout: 248 seconds]
boardyuk_ has quit [Read error: Connection reset by peer]
perryh_away has quit [Ping timeout: 245 seconds]
boardyuk has joined #ruby-lang
perryh has joined #ruby-lang
gregmoreno has quit [Read error: No route to host]
boardyuk has quit [Read error: Connection reset by peer]
boardyuk has joined #ruby-lang
gregmoreno has joined #ruby-lang
krzkrzkrz has joined #ruby-lang
gsav has quit [Quit: Lost terminal]
gsav has joined #ruby-lang
neocoin has joined #ruby-lang
krz has quit [Ping timeout: 264 seconds]
krzkrzkrz is now known as krz
perryh has quit [Ping timeout: 248 seconds]
mjbamford has joined #ruby-lang
Caius has quit [Read error: Connection reset by peer]
Piglop has joined #ruby-lang
pajama has joined #ruby-lang
krz has quit [Quit: krz]
tonni has joined #ruby-lang
heftig has quit [Read error: Operation timed out]
boardyuk has quit [Read error: Connection reset by peer]
boardyuk has joined #ruby-lang
apeiros_ has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
krz has joined #ruby-lang
face has joined #ruby-lang
chendo_ has joined #ruby-lang
tonni has quit [Ping timeout: 248 seconds]
the-newsman has joined #ruby-lang
neoesque has quit [Quit: Bye!]
tonni has joined #ruby-lang
boardyuk has quit [Quit: boardyuk]
heftig has joined #ruby-lang
cha1tanya has quit [Quit: आलोच..]
kedare has joined #ruby-lang
s0ra_h is now known as sora_h
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
pajama has quit [Remote host closed the connection]
krz has quit [Quit: krz]
pajama has joined #ruby-lang
tonni has quit [Remote host closed the connection]
sora_h is now known as s0ra_h
mjbamford has quit [Quit: Leaving...]
mjbamford has joined #ruby-lang
neocoin has joined #ruby-lang
cha1tanya has joined #ruby-lang
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby-lang
s0ra_h is now known as sora_h
neocoin_ has joined #ruby-lang
neocoin has quit [Ping timeout: 260 seconds]
woollyams has joined #ruby-lang
fromhet has joined #ruby-lang
<fromhet> Hi! I am learning ruby, and am now working with file IO. If I in rib do "File.open('foo','w')", it obviously creates file 'foo' in the . directory. If I on the other hand type File.open('~/Desktop/foo','w') I get "Errno::ENOENT: No such file or directory - ~/Desktop/foo". Why is this? Can't I use ~ in ruby? What can I then use instead?
<fromhet> not 'rib' obviously, 'irb'.
<canton7> File.open(File.join(Dir.home, 'foo'), 'w')
<canton7> not the neatest I'll admit
Criztian has joined #ruby-lang
<henk> ENV["HOME"] might be better?
<burgestrand> You can also do File.expand_path('~/Desktop/foo').
<burgestrand> fromhet: ^
mwjcomputing has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
JohnBat26|2 has joined #ruby-lang
<fromhet> Thanks!
mwjcomputing has left #ruby-lang [#ruby-lang]
WillMarshall has quit [Ping timeout: 255 seconds]
JohnBat26|2 has quit [Ping timeout: 248 seconds]
WillMarshall has joined #ruby-lang
tbuehlmann has joined #ruby-lang
WillMarshall has quit [Ping timeout: 264 seconds]
kristofferrr has quit [Quit: ❤]
jarib has quit [Excess Flood]
Criztian has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
jarib has joined #ruby-lang
WillMarshall has joined #ruby-lang
WillMarshall has quit [Ping timeout: 252 seconds]
WillMarshall has joined #ruby-lang
mssola has quit [*.net *.split]
stardiviner has quit [*.net *.split]
|Vargas| has quit [*.net *.split]
znowi has quit [*.net *.split]
s0ber has quit [*.net *.split]
telemachus has quit [*.net *.split]
mahlon has quit [*.net *.split]
Defusal_ has quit [*.net *.split]
Bwild has quit [*.net *.split]
ReinH has quit [*.net *.split]
alindeman has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
jaimef has quit [*.net *.split]
SubSpawn has quit [*.net *.split]
meise has quit [*.net *.split]
thorncp has quit [*.net *.split]
vbatts has quit [*.net *.split]
anacond109 has quit [*.net *.split]
jaylevitt has joined #ruby-lang
stardiviner has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has quit [Changing host]
|Vargas| has joined #ruby-lang
mssola has joined #ruby-lang
znowi has joined #ruby-lang
mahlon has joined #ruby-lang
Defusal_ has joined #ruby-lang
telemachus has joined #ruby-lang
s0ber has joined #ruby-lang
ReinH has joined #ruby-lang
jaimef has joined #ruby-lang
SubSpawn has joined #ruby-lang
meise has joined #ruby-lang
thorncp has joined #ruby-lang
vbatts has joined #ruby-lang
anacond109 has joined #ruby-lang
alindeman has joined #ruby-lang
alindeman has joined #ruby-lang
Bwild has joined #ruby-lang
WillMarshall has quit [Ping timeout: 255 seconds]
WillMarshall has joined #ruby-lang
Jay_Levitt has quit [Ping timeout: 260 seconds]
jaylevitt has quit [Client Quit]
Jay_Levitt has joined #ruby-lang
mjbamford has quit [Quit: Leaving...]
the-newsman has left #ruby-lang [#ruby-lang]
WillMarshall has quit [Ping timeout: 264 seconds]
Spaceghostc2c has joined #ruby-lang
Spaceghostc2c has quit [Changing host]
Spaceghostc2c has joined #ruby-lang
Spaceghostc2c has quit [Changing host]
Spaceghostc2c has joined #ruby-lang
alindeman has quit [*.net *.split]
mssola has quit [*.net *.split]
znowi has quit [*.net *.split]
s0ber has quit [*.net *.split]
telemachus has quit [*.net *.split]
mahlon has quit [*.net *.split]
Defusal_ has quit [*.net *.split]
ReinH has quit [*.net *.split]
jaimef has quit [*.net *.split]
SubSpawn has quit [*.net *.split]
meise has quit [*.net *.split]
thorncp has quit [*.net *.split]
vbatts has quit [*.net *.split]
anacond109 has quit [*.net *.split]
Jay_Levitt has quit [Ping timeout: 260 seconds]
alindeman has joined #ruby-lang
mssola has joined #ruby-lang
znowi has joined #ruby-lang
s0ber has joined #ruby-lang
telemachus has joined #ruby-lang
mahlon has joined #ruby-lang
Defusal_ has joined #ruby-lang
ReinH has joined #ruby-lang
jaimef has joined #ruby-lang
SubSpawn has joined #ruby-lang
meise has joined #ruby-lang
thorncp has joined #ruby-lang
vbatts has joined #ruby-lang
anacond109 has joined #ruby-lang
alindeman is now known as Guest1223
WillMarshall has joined #ruby-lang
WillMarshall has quit [Ping timeout: 255 seconds]
brunocoelho has joined #ruby-lang
brunocoelho has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
Axsuul has quit [Ping timeout: 248 seconds]
tommyvyo has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
kristofferrr has joined #ruby-lang
Leeky_afk is now known as Leeky
apeiros_ has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
kitallis has joined #ruby-lang
tubbo`remote has joined #ruby-lang
scampbell has joined #ruby-lang
Leeky is now known as Leeky_afk
tubbo`remote has quit [Client Quit]
tubbo has joined #ruby-lang
apeiros_ has joined #ruby-lang
cha1tanya has quit [Quit: आलोच..]
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 260 seconds]
futurecode has joined #ruby-lang
<crankharder> looking for an enumerable that returns the the first truthy result of the block
<crankharder> basically select{}.first, but w/o iterating on every object
<banisterfiend> crankharder: find
<crankharder> find/detect return the yielded object
<banisterfiend> crankharder: (1..20).find { |v| v.even? } #=> 2
<crankharder> looking for the result of the block
Defusal_ has quit [Quit: brb]
<crankharder> right, in that case I'd need true returned
<banisterfiend> crankharder: then use any?
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<crankharder> any returns true/false
<banisterfiend> crankharder: (1..10).any? { |v| v.even? } #=> true
<crankharder> you've misunderstood the question
savage- has joined #ruby-lang
<crankharder> [nil, nil, false, "a", 1].blah{|i| i} => "a"
<apeiros_> .find
<crankharder> now you've confused me... thats not what i want
DEac- has quit [Ping timeout: 248 seconds]
<crankharder> [User, Event, Team, OtherARClass].blah{|k| k.find_by_id(some_id)} => first instance that's found
<crankharder> e.g., i need the result of the block returned
<apeiros_> you want some kind of map_find?
<crankharder> i dont know what map_find is
pajama_ has joined #ruby-lang
pajama has quit [Read error: Connection reset by peer]
<crankharder> it's functionally the same as select(&:stuff).first, but works like detect/find where it stops iterating after it finds a truthy result
verbad has joined #ruby-lang
<banisterfiend> crankharder: it seems a kind of weird thing to want, cos the block you want to use both for its truthiness as well and for its actual object return value
<crankharder> you're weird
<lianj> ^^
sailias has quit [Ping timeout: 260 seconds]
verbad has quit [Remote host closed the connection]
verbad has joined #ruby-lang
<certainty> callcc{ |back| ["y","x","foo"].each{ |elt| ((match = elt.match(/foo/)) && back[match]) } } ... *hack*
<workmad3> crankharder: ary.find {|k| k.find_by_id(some_id)}
mistym has quit [Remote host closed the connection]
<banisterfiend> workmad3: he wants this value: k.find_by_id(some_id)
<DefV> crankharder: what you are describing (select.first) is .find
<banisterfiend> rather than 'k'
<workmad3> oh, bugger yeah
<workmad3> bleh
<workmad3> yeah, that's odd :P
<certainty> :)
<apeiros_> crankharder: you're contradicting your self
<apeiros_> first you describe something that'd be select { … }.first (which find)
<banisterfiend> crankharder: your hack is cool
<banisterfiend> hehe
<apeiros_> then you describe something that'd be map { … }.find
<apeiros_> make up your mind
<crankharder> yea i am, fail :(
<apeiros_> your example is the latter
<apeiros_> module Enumerable; def map_find; return enum_for(__method__) unless block_given?; each { |*a| result = yield(*a); return result if result }; nil; end; end
<banisterfiend> apeiros_: check out this shit: callcc{ |back| ["y","x","foo"].each{ |elt| ((match = elt.match(/foo/)) && back[match]) } }
<apeiros_> [User, Event, Team, OtherARClass].map_find { |k| k.find_by_id(some_id) } # should/would work the way you described it
<apeiros_> banisterfiend: do continuations work in jruby yet?
<apeiros_> but yes, I think earlier enumerators were cc based
<certainty> i labeled it explictely as a hack. Please don't take it too serious
<banisterfiend> apeiros_: not sure
<banisterfiend> certainty: it's cool :)
<banisterfiend> mind bending
Defusal has joined #ruby-lang
Defusal has quit [Changing host]
Defusal has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
DEac- has joined #ruby-lang
melter has quit [Remote host closed the connection]
<certainty> continuations are slow (and at least in older rubies may leak memory), also i believe the will be removed? (in 1.9.3 you can have them if you require 'continuation' though
coryf has joined #ruby-lang
pajama_ has quit [Remote host closed the connection]
coryf has quit [Remote host closed the connection]
iamjarvo has joined #ruby-lang
DEac- has quit [Read error: No route to host]
DEac- has joined #ruby-lang
Defusal has quit [Quit: brb]
Defusal has joined #ruby-lang
<banisterfiend> certainty: do you have a github account?
<certainty> banisterfiend: yeah, but i do not do much there. I'm more a mercurial and thus a bitbucket guy
<banisterfiend> certainty: what's your account name on those sites
<certainty> banisterfiend: certainty
<banisterfiend> thanks
<manveru> certainty: continuations are now implemented in terms of fibers
yugui_zzz is now known as yugui
<certainty> manveru: i see. Thanks for pointing that out
<manveru> there was talk about deprecating them because it's impossible to implement them in some other interpreters, i think
imajes has quit [Excess Flood]
<manveru> probably mostly relating to jruby
<andrewvos> Hmm. I'm writing an app that periodically hits a whole lot of twitter users and stores their tweets in a database. I want to use resque to do this. Can someone suggest how to do this in terms of what tasks I would have?
<banisterfiend> certainty: can u give me the bitbucketlink?
<andrewvos> Do I have a task that spawns multiple tasks per twitter user for example?
imajes has joined #ruby-lang
<andrewvos> Or just one task that does all of it?
<certainty> banisterfiend: sure https://bitbucket.org/certainty. But you won't find much ruby there. It's mostly scheme and a bit of CL
<andrewvos> bitbucket
henrikhodne has joined #ruby-lang
Jake232 has joined #ruby-lang
yugui is now known as yugui_zzz
concernedcitizen has joined #ruby-lang
concernedcitizen has quit [Changing host]
concernedcitizen has joined #ruby-lang
slyphon has joined #ruby-lang
hynkle has joined #ruby-lang
<workmad3> andrewvos: either
<workmad3> andrewvos: there's advantages, pitfalls and reasons for either approach
concernedcitizen has quit [Read error: Connection reset by peer]
suckerpunch has joined #ruby-lang
suckerpunch is now known as Guest40362
concernedcitizen has joined #ruby-lang
concernedcitizen has quit [Changing host]
concernedcitizen has joined #ruby-lang
sailias has joined #ruby-lang
Guest40362 has quit [Client Quit]
iamjarvo has quit [Quit: Computer has gone to sleep.]
apeiros_ has quit [Remote host closed the connection]
<andrewvos> workmad3: Was just discussing this with a colleague. So if you have one task that launches multiple tasks then you have more chances to succeed.
<andrewvos> workmad3: I'm now thinking one task to pull the json from twitter, and another to store in the databse.
cantonic has joined #ruby-lang
yugui_zzz is now known as yugui
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
verbad has quit [Remote host closed the connection]
dv310p3r has joined #ruby-lang
Dreamer3 has quit [Ping timeout: 246 seconds]
lun_ has joined #ruby-lang
concernedcitizen has quit [Remote host closed the connection]
Dreamer3 has joined #ruby-lang
pajama has joined #ruby-lang
savage- has quit [Remote host closed the connection]
fromhet has quit [Quit: fromhet]
yugui is now known as yugui_zzz
bfreeman has quit [Quit: bfreeman]
JustinCampbell has joined #ruby-lang
henrik_hodne has joined #ruby-lang
henrikhodne has quit [Read error: Connection reset by peer]
kitallis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
burgestrand has quit [Quit: Leaving.]
iamjarvo has joined #ruby-lang
|Vargas| has quit [Quit: ...]
henrik_hodne has left #ruby-lang [#ruby-lang]
<workmad3> andrewvos: yes, but it also requires more resources... you mentioned database saving for example, so you'd need several connections, each one only saving a single user, rather than one connection batching a load together
<workmad3> andrewvos: and it'll also depend on whether half of a thing should succeed :)
shevy has quit [Ping timeout: 260 seconds]
<andrewvos> workmad3: haha good point
<workmad3> andrewvos: hence why it's a 'either way can work' question ;)
<andrewvos> So in this case I have to do twitter requests for a number of twitter accounts.
<andrewvos> To get their tweets
<andrewvos> So each request could potentially fail, but the others shoudl still continue on.
pajama has quit [Remote host closed the connection]
<workmad3> andrewvos: and don't forget, retrieval and saving don't have to be synchronised... you could do something like - a set of tasks that are pulling down twitter users, and a periodic task that batch saves a load of retrieved users to the db
rue_XIV has left #ruby-lang [#ruby-lang]
rue has joined #ruby-lang
<rue> Sounds almost like a message queue
jxie has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
andrewhl has joined #ruby-lang
shevy has joined #ruby-lang
<andrewvos> It is
jtoy has joined #ruby-lang
zmack_ has quit [Remote host closed the connection]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
headius has joined #ruby-lang
diegoviola has joined #ruby-lang
areil has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 245 seconds]
DEac- has quit [Ping timeout: 248 seconds]
lun_ has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
yugui_zzz is now known as yugui
stardiviner has quit [Client Quit]
gsav has quit [Quit: leaving]
gsav has joined #ruby-lang
gsav has quit [Client Quit]
wallerdev has joined #ruby-lang
DEac- has joined #ruby-lang
kvirani has joined #ruby-lang
cldwalker has joined #ruby-lang
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
JustinCampbell has quit [Remote host closed the connection]
fgomez has joined #ruby-lang
JustinCampbell has joined #ruby-lang
iamjarvo has quit [Ping timeout: 255 seconds]
apeiros_ has joined #ruby-lang
iamjarvo has joined #ruby-lang
<imajes> hey, anyone know if it's possible (and, how) to have a private accessor in 1.9?
S1kx has quit [Quit: Leaving]
<banisterfiend> imajes: put private b4 it
<imajes> that's sufficient? ok
<banisterfiend> Yeah, but you'll need to put a 'public' after that if u want the remaining methods to be public again
<imajes> i always code private at the end
<imajes> thx
Jake232 has quit [Quit: Computer has gone to sleep.]
symm- has quit [Ping timeout: 252 seconds]
<andrewvos> What's going on here? https://gist.github.com/3164388#comments
savage- has joined #ruby-lang
jtoy has quit [Quit: jtoy]
sora_h is now known as s0ra_h
s0ra_h is now known as sora_h
sora_h is now known as s0ra_h
face has left #ruby-lang [#ruby-lang]
faces has joined #ruby-lang
Criztian has joined #ruby-lang
<andrewvos> oh hell
<andrewvos> never mind
<faces> andrewhl: is it supposed to be stub() or stubs()? I haven't used resque but can't find any stub docs
<andrewvos> faces: I didn't add minitest to my gemfile.
<Muz> Stub usually comes from the minitest stuff.
<Muz> faces: ^
<andrewvos> Though not sure why it ever worked.
<faces> ah
<Muz> IT's not a direct method on the Resque gubbins.
<andrewvos> mocha = stubs
<andrewvos> Muz: Wha?
<Muz> Wait, ignore, thinking of the wrong thing.
DEac- has quit [Ping timeout: 252 seconds]
<andrewvos> Testing resque is starting to seriously piss me off.
<savage-> andrewvos: what about sidekiq?
<andrewvos> savage-: Not tried it.
<savage-> andrewvos: you should. it's easy, same api (mostly) as resque, and does not need to spawn multiple processes.
DEac- has joined #ruby-lang
lsegal has joined #ruby-lang
carloslopes has joined #ruby-lang
dejongge has joined #ruby-lang
Caius has joined #ruby-lang
futurecode has quit [Ping timeout: 240 seconds]
akira989 has joined #ruby-lang
futurecode has joined #ruby-lang
tomb_ has quit [Quit: Computer has gone to sleep.]
yugui is now known as yugui_zzz
kristofferrr has quit [Quit: ❤]
<andrewvos> How can I verify that a method is called on a class in minitest?
<andrewvos> The Resque class obviously.
tenderlove has joined #ruby-lang
melter has joined #ruby-lang
<lianj> "it does not let you set up expectations on existing objects"
<andrewvos> How can I do this without minitest then?
tenderlove has quit [Ping timeout: 240 seconds]
bfreeman has joined #ruby-lang
<lianj> andrewvos: mocha?
<andrewvos> lianj: Don't want to use another gem just for one single test.
tenderlove has joined #ruby-lang
<lianj> overwrite the method?
burgestrand has joined #ruby-lang
<andrewvos> Hmmm
butchanton has joined #ruby-lang
andrewhl has quit [Remote host closed the connection]
derrida has quit [Ping timeout: 246 seconds]
hynkle has quit [Quit: Computer has gone to sleep.]
fromhet has joined #ruby-lang
<andrewvos> One more question: https://gist.github.com/3164575
<andrewvos> Why am I getting undefined method << for NilClass. Is @enqueus referring to a different object in both cases?
gentz has quit [Ping timeout: 246 seconds]
lake_away has quit [Ping timeout: 246 seconds]
gentz has joined #ruby-lang
enroxorz has joined #ruby-lang
enroxorz has joined #ruby-lang
jtoy has joined #ruby-lang
<lianj> andrewvos: http://ideone.com/bgs81
derrida has joined #ruby-lang
futurecode has quit [Ping timeout: 255 seconds]
<andrewvos> lianj: yay!
futurecode has joined #ruby-lang
macmartine has joined #ruby-lang
kvirani has quit [Remote host closed the connection]
Hakon has quit [Quit: Leaving...]
lake_away has joined #ruby-lang
sailias has quit [Ping timeout: 245 seconds]
bfreeman_ has joined #ruby-lang
bfreeman has quit [Read error: Connection reset by peer]
Piglop has quit [Quit: Quitte]
Criztian has quit [Remote host closed the connection]
hynkle has joined #ruby-lang
mrsolo has joined #ruby-lang
JohnBat26|2 has joined #ruby-lang
chimkan_ has joined #ruby-lang
ozzloy_ has left #ruby-lang [#ruby-lang]
brianpWins has quit [Quit: brianpWins]
future_chimp has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 260 seconds]
dhruvasagar has joined #ruby-lang
tommyvyo has quit [Quit: Computer has gone to sleep.]
jborica has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
headius has quit [Ping timeout: 240 seconds]
enroxorz has quit [Ping timeout: 264 seconds]
tommyvyo has joined #ruby-lang
headius has joined #ruby-lang
andrewhl has joined #ruby-lang
futurecode has quit [Read error: Connection reset by peer]
hahuang65 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fayimora has joined #ruby-lang
fayimora has quit [Client Quit]
banisterfiend` has joined #ruby-lang
apeiros_ has joined #ruby-lang
d3vic3 has quit [Quit: leaving]
cantonic has quit [Quit: cantonic]
headius_ has joined #ruby-lang
headius has quit [Ping timeout: 264 seconds]
headius_ is now known as headius
banisterfiend has quit [Ping timeout: 248 seconds]
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
rolfb has joined #ruby-lang
scientes has quit [Ping timeout: 264 seconds]
sailias has joined #ruby-lang
kvirani has joined #ruby-lang
dejongge has quit [Ping timeout: 240 seconds]
deryl has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
scientes has joined #ruby-lang
mjbamford has joined #ruby-lang
mjbamford has quit [Client Quit]
hahuang65 has joined #ruby-lang
mjbamford has joined #ruby-lang
Austin__ has joined #ruby-lang
pemeon has joined #ruby-lang
Hakon has joined #ruby-lang
sepp2k1 has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby-lang
crudson has joined #ruby-lang
kain has quit [Read error: Connection reset by peer]
kain has joined #ruby-lang
iamjarvo has joined #ruby-lang
zmack has joined #ruby-lang
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
hahuang65 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fayimora has joined #ruby-lang
gsav has joined #ruby-lang
pemeon has left #ruby-lang [#ruby-lang]
tommyvyo is now known as vim
vim is now known as Guest83534
Guest83534 is now known as tommyvyo
enroxorz has joined #ruby-lang
enroxorz has joined #ruby-lang
ridders24 has joined #ruby-lang
<ridders24> how do I do a new line in sinatra? http://pastebin.com/iEEMjdv9
<canton7> ridders24, the return value from the block is printed out. in ruby, if there's no explicit return statement, the last statement in the block is returned. here, it's the "G: ..." line. So you'll never get the "C: ... " line
<canton7> as for newlines, I think you need to learn a bit of HTML before writing a website
<lianj> [string_one, string_two].join("\n") # or join("<br />")
Hakon has quit [Quit: Leaving...]
alessio has joined #ruby-lang
rolfb has quit [Quit: Leaving...]
<ridders24> lianj: would that not produce both results on the same line?
<shevy> lianj! my brother!
<burgestrand> ridders24: join("\n") concatenates the lines together with a newline between each one
apeiros_ has quit [Remote host closed the connection]
<burgestrand> ridders24: however, in HTML it does not matter it will be printed on the same line anyway unless you’ve changed the text formatting
apeiros_ has joined #ruby-lang
apeiros_ has quit [Read error: Connection reset by peer]
apeiros has joined #ruby-lang
<ridders24> that makes sence, I just dont understand how to scructure the page with sinatra. Off to google
apeiros has quit [Remote host closed the connection]
<burgestrand> ridders24: sinatra has a good introduction document
<burgestrand> ridders24: http://www.sinatrarb.com/intro
apeiros_ has joined #ruby-lang
<burgestrand> ridders24: you are most likely after views.
<burgestrand> ridders24: http://www.sinatrarb.com/intro#Views%20/%20Templates
<ridders24> cheers
<manveru> that still won't teach you about <br> i fear
<burgestrand> But it’s a good ramp to get started with HTML ;)
Hakon has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
<burgestrand> ridders24: http://www.sinatrarb.com/documentation has some more resources listed that you might be interested in
Hakon has quit [Client Quit]
<ridders24> many thanks guys
zenspider has joined #ruby-lang
Axsuul has joined #ruby-lang
zmack has quit [Remote host closed the connection]
rolfb has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tenderlove has quit [Ping timeout: 240 seconds]
rolfb has quit [Quit: Linkinus - http://linkinus.com]
jborica has left #ruby-lang [#ruby-lang]
ridders24 has quit [Read error: Connection reset by peer]
ridders24 has joined #ruby-lang
tbuehlmann has quit []
ridders24 has quit [Ping timeout: 240 seconds]
tonni has joined #ruby-lang
Axsuul has quit [Read error: Connection reset by peer]
Sambalero has joined #ruby-lang
Axsuul has joined #ruby-lang
jbwiv has joined #ruby-lang
Denommus has joined #ruby-lang
<Denommus> I think I'm exaggerating with metaprogramming
<Denommus> I created a class in execution time only for making "o.text.<method>"
<lianj> well, all freedom to you ;)
<Denommus> the code is horrible, nobody besides me would understand why the hell I done that XD
<mistym> This is the dark side of metaprogramming.
gsav has quit [Ping timeout: 260 seconds]
<lianj> nah, just a chance to refactor
<Denommus> ok, I created a class in interpretation time. Much more readable (and it has much more sense)
<Denommus> seriously, I was creating a class variable (@@text_class) on the "MessageConfig" class so I could have the "Text" class created only once
JohnBat26|2 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<Denommus> I got myself asking "why the hell couldn't I create it normally?"
<apeiros_> Denommus: you are aware that all classes are created at interpretation time?
<shevy> class variables are so annoying, why did matz add them :(
<Denommus> yes, I am. But I can only create a class inside of a method with class_eval
<apeiros_> o0
<apeiros_> your abilities are limited in a strange way…
<Denommus> I don't know why I decided that that class should be inside of a method
mjbamford has quit [Remote host closed the connection]
akira989 has quit [Remote host closed the connection]
<Denommus> apeiros_: I'm oversimplifying, I know. But I created the class on the most ugly way possible
<Denommus> and without a real reason
<Denommus> I needed only one, "static", class. Not a class that must change whenever I run my code
<shevy> simplifying? :)
<Denommus> metaprogramming is awesome, but I don't need it all the time (and yes, all know that technically Ruby uses metaprogramming all the time)
<shevy> I think metaprogramming is hyped too much
fayimora has quit [Ping timeout: 240 seconds]
<Mon_Ouie> Denommus: I think if you showed an actual example we could find a better solution
Denommus has quit [Ping timeout: 240 seconds]
gsav has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
arooni-mobile has joined #ruby-lang
akira989 has joined #ruby-lang
Denommus has joined #ruby-lang
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
<Denommus> did I flood? Sorry
<canton7> ping timeout, apparently
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
crudson has left #ruby-lang [#ruby-lang]
orwi has joined #ruby-lang
workmad3 has joined #ruby-lang
wallerdev has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 264 seconds]
orwi has quit [Client Quit]
agilob has quit [Ping timeout: 252 seconds]
qpingu has joined #ruby-lang
workmad3 has quit [Ping timeout: 252 seconds]
agilob has joined #ruby-lang
hynkle has quit [Quit: Computer has gone to sleep.]
tenderlove has joined #ruby-lang
tenderlo_ has joined #ruby-lang
tenderlo_ is now known as tenderlove_
iamjarvo has joined #ruby-lang
tenderlove has quit [Ping timeout: 240 seconds]
<Denommus> guys
<Denommus> can I still use PGconn.connect in pg gem?
<drbrain> Denommus: what would stop you?
Hakon has joined #ruby-lang
Hakon has quit [Client Quit]
<Denommus> it's a method from postgres gem. I don't know if it still exists. I'll try, anyway
<drbrain> I'd bet it still exists
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<erikh> ri PGconn.connect
<erikh> ... should probably tell you what you need to know before trying it.
neocoin_ has quit [Remote host closed the connection]
neocoin has joined #ruby-lang
workmad3 has joined #ruby-lang
Austin__ has left #ruby-lang [#ruby-lang]
neocoin has quit [Ping timeout: 264 seconds]
Austin__ has joined #ruby-lang
Austin__ has left #ruby-lang [#ruby-lang]
<Denommus> it worked
sailias has quit [Ping timeout: 245 seconds]
kvirani has quit [Remote host closed the connection]
scampbell has quit [Quit: Ex-Chat]
enroxorz has quit [Quit: Leaving]
<Denommus> is there a daemon gem where I could have onstart and onstop events?
Denommus has quit [Read error: Connection reset by peer]
tenderlove_ is now known as tenderlove
<andrewvos> God
bglusman has joined #ruby-lang
zmack has joined #ruby-lang
dv310p3r has quit [Quit: Leaving]
dv310p3r has joined #ruby-lang
agilob has quit [Ping timeout: 252 seconds]
agilob has joined #ruby-lang
VGoff is now known as VGoff_afk
VGoff_afk is now known as VGoff
burgestrand has quit [Quit: Leaving.]
solars has quit [Ping timeout: 248 seconds]
gsav has quit [Ping timeout: 252 seconds]
imajes has quit [Excess Flood]
sandbags has quit [Remote host closed the connection]
imajes has joined #ruby-lang
jd has quit [Ping timeout: 245 seconds]
thone has quit [Read error: Operation timed out]
iamjarvo has quit [Quit: Computer has gone to sleep.]
thone has joined #ruby-lang
zmack has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
lun_ has joined #ruby-lang
yugui_zzz is now known as yugui
s0ra_h is now known as sora_h
Criztian has joined #ruby-lang
justinmcp has joined #ruby-lang
woollyams has quit [Ping timeout: 245 seconds]
mistym has quit [Remote host closed the connection]
diegoviola has quit [Quit: leaving]
alessio has quit [Remote host closed the connection]
dv310p3r has quit [Ping timeout: 260 seconds]
headius has quit [Ping timeout: 248 seconds]
awwaiid_ has quit [Read error: Connection reset by peer]
awwaiid has joined #ruby-lang
mssola has quit [Quit: Konversation terminated!]
sora_h is now known as s0ra_h
bglusman has quit [Remote host closed the connection]
tomb_ has joined #ruby-lang
diegoviola has joined #ruby-lang
heftig has joined #ruby-lang
iamjarvo has joined #ruby-lang
zenspider has quit [Read error: Connection reset by peer]
zenspider has joined #ruby-lang
<Tasser> is there a way to get the last return value of an iteration?
<zenspider> return value? I doubt you mean that
<Tasser> result... whatever, eval result
<heftig> huh?
<zenspider> Tasser: either use the right enumerable method to begin with, or use your own mechanism
yugui is now known as yugui_zzz
<Tasser> zenspider, producing some example...
<zenspider> *blink* a.map {...}.last
<zenspider> chances are by asking the question you're doing the wrong thing to begin with
sailias has joined #ruby-lang
iamjarvo has quit [Quit: Computer has gone to sleep.]
<Tasser> indeed
Sambalero has quit [Remote host closed the connection]
neocoin has joined #ruby-lang
Sambalero has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
sailias has quit [Ping timeout: 260 seconds]
gregmoreno has quit [Ping timeout: 260 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
gregmoreno has joined #ruby-lang
fromhet has quit [Quit: fromhet]
Guest1223 has quit [Quit: /quit]
<andrewvos> Still can't believe this http://www.w3schools.com/html5/av_met_canplaytype.asp
alindeman has joined #ruby-lang
<drbrain> andrewvos: ?
<andrewvos> drbrain: The return values.
<drbrain> ah
<erikh> andrewvos: I made this call for your video, so show me maybe?
carloslopes has quit [Quit: Leaving.]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
akira989 has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 260 seconds]
yugui_zzz is now known as yugui
woollyams has joined #ruby-lang
srbartlett has joined #ruby-lang
nertzy has joined #ruby-lang
Sambalero has quit [Remote host closed the connection]
s0ra_h is now known as sora_h
ilyam has joined #ruby-lang
lun_ has quit [Ping timeout: 248 seconds]
yugui is now known as yugui_zzz
arooni-mobile has joined #ruby-lang
seanstickle has joined #ruby-lang
postmodern has joined #ruby-lang
wpaulson has joined #ruby-lang
<andrewhl> is it possible to use the map shorthand &: to do something like (1..10).map {|n| puts n}? (1..10).map {&:puts} doesn't work, since I guess .puts is not a method belonging to the current object
petercooper has joined #ruby-lang
<andrewhl> i'm fine not using the shorthand for that kind of stuff. Just curious to know if there's some syntax I'm missing
<drbrain> andrewvos: you'd need a wrapper method to swap the receiver and argument of puts
<drbrain> this doesn't work either: Kernel.send :public, :puts; (1..10).map(&:puts)
<andrewhl> hm
towski has joined #ruby-lang
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
deryldoucette has joined #ruby-lang
deryl has quit [Ping timeout: 245 seconds]
deryldoucette is now known as deryl
tomb_ has quit [Quit: Computer has gone to sleep.]
deryl has quit [Quit: deryl]
<whitequark> andrewhl: (1..10).map &method(:puts)
<andrewhl> whitequark: awesome! thanks
<whitequark> & does exactly this: invokes .to_proc on the passed value, extracts the InstructionSequence from the result (i.e. it _must_ be a Proc), and then passes resultant ISeq to the method in the implicit block argument position
JustinCa_ has joined #ruby-lang
butchanton has quit [Quit: Leaving.]
ilyam_ has joined #ruby-lang
outoftime has joined #ruby-lang