Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
tshauck joined #ruby
ethndbst joined #ruby
ethndbst joined #ruby
obj_lesson joined #ruby
pabloh joined #ruby
Synthpixel_ joined #ruby
vitoravelino joined #ruby
happynoff joined #ruby
<happynoff> Hi. How would you test a method supposed to call require ?
<happynoff> (Using rspec)
timonv joined #ruby
macmartine joined #ruby
Know1edge1 joined #ruby
milkpost_ joined #ruby
heftig joined #ruby
andyparsons joined #ruby
looopy joined #ruby
Knodi joined #ruby
hadees joined #ruby
GreaseMonkey joined #ruby
<burgestrand> happynoff: test just that
pantsman joined #ruby
pantsman joined #ruby
<happynoff> burgestrand: ok but that's the point :/ I don't know how to test it
<burgestrand> Oh, I see
<happynoff> I tried Kernel.should_receive(:require)
hadees_ joined #ruby
<burgestrand> And the result?
<happynoff> called 0 times
<happynoff> but the script is loaded
<burgestrand> *shrug*
obj_lesson left #ruby
<happynoff> And google is not my friend tonight :(
<burgestrand> How about you require a certain file that declares something, instead?
burgestrand joined #ruby
<happynoff> I tried to think about it
<happynoff> a constant is not an option
<burgestrand> Hm, I ponder, since the method is on Kernel, you might need to mock it out in the object calling require
<happynoff> I thought about a method but it didn't work and I would have to undef the method before each test if it worked
<happynoff> mocking Kernel ?
<happynoff> or just stubbing :require
<burgestrand> No, the object the method is defined on
<happynoff> I just stubbed require on the object and it worked \o/
<happynoff> thank you burgestrand !
Synthpixel joined #ruby
<burgestrand> :)
stephenjudkins joined #ruby
axilla joined #ruby
<happynoff> have a good day/night
minijupe joined #ruby
esparkman joined #ruby
araujo joined #ruby
wyhaines joined #ruby
ognevsky joined #ruby
MekkisFreenode joined #ruby
JumpMast3r joined #ruby
Ankhers joined #ruby
wilmoore joined #ruby
QaDeS_ joined #ruby
colloquialismic joined #ruby
colloquialismic joined #ruby
linoj joined #ruby
apok joined #ruby
s0ber joined #ruby
<marcamilly> aren't .first and .count Ruby methods? even for version 1.8.7?
<marcamilly> i am pulling data from an API, and I stored a collection in a variable
<marcamilly> and when I try variable.first and variable.count
<marcamilly> it keeps giving me nil
<marcamilly> but when I do variable
<marcamilly> it shows me all the items in the collection
<marcamilly> thoughts?
badabim joined #ruby
maletor joined #ruby
<atmosx> marcamilly: it's an array?
<marcamilly> it returns this: => #<OpenStruct total=253,
<marcamilly> ahh, you are right
<marcamilly> so it's not is it
<marcamilly> hrmm, so I should declare the variable an array and then set them in there?
<atmosx> type puts variable.class
<marcamilly> ruby-1.8.7-p302 > q.class
<marcamilly> => OpenStruct
<atmosx> depends the most common mistake is that you create an array of arrays
<marcamilly> that's what i see when I do .class
<atmosx> marcamilly: array.first is available only in ruby19
<marcamilly> ok
<marcamilly> what about array.count
<marcamilly> same?
<atmosx> same
<marcamilly> hrmm
<marcamilly> damnit
<atmosx> what os are you at?
<atmosx> I write code only 1.9 so I was not sure but just checked
<marcamilly> i am on OS X
<atmosx> these methods are not supported
<marcamilly> but the weirdest thing
<atmosx> okay, then install macports, or rvm or brew
<marcamilly> so some of the stuff I am seeing says it supports only 1.8.7
<atmosx> I'm on osx too
<marcamilly> but when I read the source
<marcamilly> of the library
<marcamilly> look there, they even use .first
bpfh joined #ruby
<marcamilly> inside the source, even though they say only 1.8.7 is supported
<atmosx> the native version 1.8.x of macosx does not support these methods
<atmosx> just tested
<marcamilly> but when I query the API and get back the results, I can't iterate through the data using those methods
<atmosx> y don't you just install 1.9?
<atmosx> it's better to use it anyway, it will last more than 1.8.x
<marcamilly> i have it
<marcamilly> lemme test it
<marcamilly> i was trying to get it to work
<marcamilly> with the gem i am using
<marcamilly> sec
<raz> hmm, how do i write a simple parser that substitutes tokens like "$foo" in a string with the corresponding values ('foo') from a hashmap?
<marcamilly> .gsub?
<raz> marcamilly: yea, but what's my pattern to make it generic? (work for any $foo)
estoner joined #ruby
<raz> or rather $foo, $bar .. etc
<marcamilly> hrmm, good question, /\$\w/ ?
<marcamilly> something like that, i am not a regex expert
<marcamilly> but that's just off the dome
<marcamilly> would have to look it up
<raz> ah interesting, gsub can take a function on the right hand side
<atmosx> I'm off to bed
<atmosx> good night all :-)
<marcamilly> hrmm
<marcamilly> atmosx left me :(
<marcamilly> yes, it can take a regex string
<marcamilly> does that make sense, raz?
<marcamilly> the regex that I wrote?
looopy joined #ruby
brownies joined #ruby
michael_mbp joined #ruby
banisterfiend joined #ruby
macmartine joined #ruby
ethndbst joined #ruby
zmoazeni_ joined #ruby
kennethreitz joined #ruby
ziggles joined #ruby
Manhose__ joined #ruby
hadees joined #ruby
mpereira joined #ruby
alanp_ joined #ruby
jinglebe1lz joined #ruby
bwright_ joined #ruby
tdmackey_ joined #ruby
BrokenCo1 joined #ruby
zigidias_ joined #ruby
deadbea7_ joined #ruby
rtyler_ joined #ruby
jhchabra1 joined #ruby
Seventoe1 joined #ruby
udk joined #ruby
gentz_ joined #ruby
eregon_ joined #ruby
Kivi_ joined #ruby
marcin_m_ joined #ruby
_axx_ joined #ruby
davidboy_ joined #ruby
zumbi_ joined #ruby
elektron1ut joined #ruby
zigidias joined #ruby
philips joined #ruby
musee joined #ruby
mcpierce joined #ruby
dagobah joined #ruby
Manhose joined #ruby
<raz> marcamilly: sort of, i'll sketch something up
<raz> thx for the pointer
<marcamilly> k, np
Synthpixel joined #ruby
Manhose_ joined #ruby
Tasser joined #ruby
luckyruby joined #ruby
looopy joined #ruby
mxweas_ joined #ruby
syamajala joined #ruby
CannedCo_ joined #ruby
<rcs> Anyone have a nice way to do something like ary.slice(1,ary.count-1) ? Something like ary[1..] or ary[1..inf] ?
erenrich joined #ruby
Manhose joined #ruby
daed joined #ruby
<flazz> rcs: first, *rest = ary
<flazz> rcs: rest = ary[1,-1]
krz joined #ruby
<heftig> you mean [1..-1]
sythe joined #ruby
sythe joined #ruby
rushed joined #ruby
jwmann joined #ruby
linoj joined #ruby
Mahoek joined #ruby
<rcs> flazz: Yeah.
<rcs> heftig: Yeah.
<rcs> Thanks both of you.
<flazz> heftig: yep
sbanwart joined #ruby
Adept` joined #ruby
mickn joined #ruby
sdwrage joined #ruby
sbanwart_ joined #ruby
poindontcare joined #ruby
jimmy1980 joined #ruby
mickn joined #ruby
Cerales joined #ruby
stephenjudkins joined #ruby
mxweas_ joined #ruby
Araxia_ joined #ruby
sbanwart__ joined #ruby
Sliker joined #ruby
<Cerales> Is it possible to have subclasses modify class constants without it affecting the constants in the superclass?
creativeprodigy joined #ruby
sdwrage joined #ruby
<Cerales> I'm trying to write a superclass that has an array as a constant, then a bunch of subclasses which push additional values to that array, but I only want the subclasses to have those other values. i thought this was pretty trivial subclassing behaviour, but i can't get it to work without all the values being global across the classes
dagnachewa joined #ruby
maletor joined #ruby
mxweas_ joined #ruby
banisterfiend joined #ruby
marknyc joined #ruby
looopy joined #ruby
<bpfh> Cerales, like this http://pastebin.com/iBaXjzhb?
<Cerales> oh! thank you.
Synthead joined #ruby
blaenk joined #ruby
Sliker joined #ruby
Adept` joined #ruby
indstry joined #ruby
nari joined #ruby
marcamilly joined #ruby
macmartine joined #ruby
possibilities joined #ruby
raincole joined #ruby
jay_zawr1tny joined #ruby
Nisstyre joined #ruby
suung__ joined #ruby
kingfishr joined #ruby
indstry joined #ruby
<indstry> NickServ identify apple
<indstry> great
Stuffness joined #ruby
<Stuffness> What's a way to check if a string is one of the names of the subclasses of a certain class
banisterfiend joined #ruby
chessguy joined #ruby
x0F__ joined #ruby
flip_digits joined #ruby
headius joined #ruby
wyhaines joined #ruby
<shevy> Stuffness what
<shevy> if a string is what?
<shevy> can you give an example data
JumpMast3r joined #ruby
rpowell joined #ruby
Seisatsu joined #ruby
p1d_ joined #ruby
<Stuffness> shevy, let's say I get a string from the user, "Wheel". I want to create a new Wheel object, but only if it's defined as a subclass of my Car class. What's the best way to check this
chiznitz_ joined #ruby
<shevy> Stuffness http://pastie.org/2962840
<shevy> turn that into a method ... and ancestors should become dynamic. but that's the general idea, one way that works.
palentine joined #ruby
radic joined #ruby
dagnachewa joined #ruby
ryanf joined #ruby
Seisatsu_ joined #ruby
mikepack joined #ruby
aakashvd joined #ruby
luckyruby joined #ruby
_catch joined #ruby
sdwrage joined #ruby
luckyruby joined #ruby
LittleBill902 joined #ruby
mxweas_ joined #ruby
stephenjudkins joined #ruby
Azure joined #ruby
<Stuffness> shevy, thanks!
colloquialismic joined #ruby
colloquialismic joined #ruby
apok joined #ruby
dhruvasagar joined #ruby
mikeycgto joined #ruby
mikeycgto joined #ruby
ethndbst joined #ruby
ethndbst joined #ruby
randym_ joined #ruby
Seisatsu joined #ruby
mxweas_ joined #ruby
CannedCo_ joined #ruby
katselphrime joined #ruby
ryan0x2 joined #ruby
kenperkins joined #ruby
banisterfiend joined #ruby
chiznitz_ joined #ruby
ethndbst joined #ruby
friskd joined #ruby
amh345 joined #ruby
amh345 left #ruby
ethndbst joined #ruby
wilmoore joined #ruby
brownies joined #ruby
fixl joined #ruby
johntitor joined #ruby
tk_ joined #ruby
excelsio1 joined #ruby
thepix joined #ruby
cooper joined #ruby
mxweas_ joined #ruby
warlock_handler joined #ruby
colloquialismic_ joined #ruby
<warlock_handler> hi.. is there a ruby version of http://misterhouse.sourceforge.net/
<warlock_handler> something like a computer based automation system
samxor joined #ruby
macmartine joined #ruby
luckyruby joined #ruby
colloquialismic joined #ruby
katselphrime joined #ruby
amh345 joined #ruby
pen_isident joined #ruby
nerdy_ joined #ruby
cooper joined #ruby
ognevsky joined #ruby
imf joined #ruby
maletor joined #ruby
Tachyx joined #ruby
colloquialismic joined #ruby
kenperkins joined #ruby
Zimsky joined #ruby
raythecat joined #ruby
JumpMast3r joined #ruby
ethndbst joined #ruby
Cervajz joined #ruby
PhilK joined #ruby
fantazo joined #ruby
<shevy> I swear rewriting code takes way too long
Cervajz joined #ruby
kassien joined #ruby
amh345 left #ruby
jimmy1980 joined #ruby
rippa joined #ruby
yxhuvud joined #ruby
eft left #ruby
eldariof joined #ruby
martisj joined #ruby
thepix joined #ruby
rpowell joined #ruby
h4mz1d joined #ruby
eighty4 joined #ruby
estoner joined #ruby
ryan0x2 joined #ruby
brownies joined #ruby
alienvenom joined #ruby
RLa joined #ruby
apok joined #ruby
Stuffness left #ruby
Seisatsu joined #ruby
ph^ joined #ruby
flippingbits joined #ruby
Kn|t3 joined #ruby
Guest____ joined #ruby
mklappst_ joined #ruby
mindCrime joined #ruby
nachtwandler joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
ramusara joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
fayimora joined #ruby
rpowell joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
xpot joined #ruby
raincole joined #ruby
vmatiyko joined #ruby
raincole joined #ruby
bugz^ joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
apok joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
tatsuya_o joined #ruby
raincole joined #ruby
Vendethiel joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
workmad3 joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
bosphorus joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
bosphorus_ joined #ruby
raincole joined #ruby
raincole joined #ruby
jgrimes joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
raincole joined #ruby
jgrimes joined #ruby
raincole joined #ruby
adambeynon joined #ruby
jimmy1980 joined #ruby
jgrimes joined #ruby
jbpros joined #ruby
ChampS_ joined #ruby
enikar joined #ruby
nyuszika7h joined #ruby
visof joined #ruby
ephemerian joined #ruby
visof joined #ruby
workmad3 joined #ruby
apok_ joined #ruby
RLa joined #ruby
srji joined #ruby
mindCrime joined #ruby
mikeric joined #ruby
elliot98 joined #ruby
elliot98 joined #ruby
Tuxist joined #ruby
CorpusCallosum joined #ruby
apeiros_ joined #ruby
PhilK joined #ruby
willb joined #ruby
Clooth joined #ruby
<banisterfiend> hi
banisterfiend joined #ruby
jimmy1980 joined #ruby
indentman joined #ruby
visof joined #ruby
zastaph joined #ruby
banisterfiend joined #ruby
visof joined #ruby
banisterfiend joined #ruby
smgt joined #ruby
randym joined #ruby
Pip joined #ruby
Pip joined #ruby
Adept` joined #ruby
banister_ joined #ruby
cook1es joined #ruby
<banister_> who can deny the cuteness of a system that allows something like this to be expressed so simply https://gist.github.com/1429902
burgestrand joined #ruby
<banister_> burgestrand: sup burgdiggity
<burgestrand> mornin'!
<burgestrand> Going to play some Skyrim :)
dexcs joined #ruby
<banister_> burgestrand: we have bash-style aliases in 5 lines of code
<banister_> burgestrand: awesome, i bought that too, but only for my ps3 and i find the controls too unwieldy so i dont actually play it :/
<banister_> burgestrand: you have it on pc?
<burgestrand> banister_: heh, got to love ruby
<banister_> burgestrand: https://gist.github.com/1429902
<banister_> forgot to paste it ;)
<burgestrand> naw, ps3 too, got nothing against the controls really, only time when I think it matters is for FPS games :)
<burgestrand> rofl, that’s awesome
<apeiros_> banister_: oh, so you'd disrecommend buying it for xbox too?
<burgestrand> best implementation ever
<banister_> burgestrand: well looking around is kind of hard, mouse look feels a lot more natural i think
<banister_> apeiros_: well this is the first game ive played in about 4 years so maybe im just not used to gaming
<banister_> but i found it hard to control
<burgestrand> banister_: that is true, I’m not too much of a look-arounder
<burgestrand> banister_: did you know SotC got remastered and released to PS3?
<banister_> burgestrand: i bought it ;) haven't played that either...
<burgestrand> hehe
<banister_> i think i'm too ADHD to play games now
<banister_> i should probably give skyrim a proper go though since it looks awesome
<banister_> burgestrand: in skyrim i got stuck at the part where u have to climb stairs and it tells me to jump
<banister_> i couldnt' seem to get to the top of the tower, but i gues si was going the wrong way. Right at the very start after the dragon attacks
<burgestrand> banister_: I vaguely remember it, you’re meant to jump out of the tower towards the burning building
<burgestrand> I think
ikaros joined #ruby
<banister_> oh ok
<burgestrand> get-naked command!
<burgestrand> \o/
<banister_> yeah a guy chained that to one of his pull requests and i didnt see it ;)
<burgestrand> hehe
flippingbits joined #ruby
jimmy1980 joined #ruby
pen joined #ruby
michael_mbp joined #ruby
katselphrime joined #ruby
p1d joined #ruby
atmosx joined #ruby
Mahoek joined #ruby
zul__ joined #ruby
otakutomo joined #ruby
eldariof joined #ruby
Hellojere joined #ruby
pencilcheck joined #ruby
kirun joined #ruby
workmad3 joined #ruby
pen joined #ruby
yann3 joined #ruby
apok joined #ruby
ghosTM55 joined #ruby
altivec_ joined #ruby
trivol joined #ruby
abonec joined #ruby
colloquialismic joined #ruby
<abonec> hello, is there way to open ruby console (like irb) but with executed rb file?
<banister_> abonec: http://pry.github.com
<abonec> i try any arguments of pry but it can execute only string of code via "pry -e 'class My; end'
<banister_> abonec: what do you mean 'with executed rb file' ?
<banister_> abonec: do you want runtime invocatino? then put 'binding.pry' inside the file at the point you want the console
erwinpdev joined #ruby
<erwinpdev> Hi I've got a Ruby question. Let's say you have a sbyte with value of -91 in C#. How would you represent the same in Ruby?
<abonec> banister_, i need a ruby console with context of executed file (like rails console with rails application)
eighty4 joined #ruby
<banister_> abonec: then put 'binding.pry' in the right place in your file?
<banister_> abonec: or maybe you want: pry -r ?
<banister_> abonec: please watch teh railscast here, i think something is confused: https://gist.github.com/850379627c72879f1515
<banister_> abonec: here i mean: http://railscasts.com/episodes/280-pry-with-rails
<rippa> erwinpdev: a = -91 ?
altivec joined #ruby
<erwinpdev> rippa: that's what I tried but I got the feeling something is going wrong. It's a xorkey in this case and I am not getting the results I was expecting.
iocor joined #ruby
<abonec> banister_, hah, pry -r it was i actually try find, but it not work as 'pry -r file.rb', only for 'pry -r ./file.rb', thx
pete__ joined #ruby
<banister_> abonec: yeah taht's a ruby 1.9.2 thing
Telling joined #ruby
pencilcheck joined #ruby
<apeiros_> erwinpdev: maybe show a simple xor example. input and expected output.
pantsman joined #ruby
pantsman joined #ruby
Codif joined #ruby
<erwinpdev> apeiros_: Ok, here is the function and below is some input and expected output: http://www.pastie.org/private/trv9mttm9qxcaowdcyrtw
<erwinpdev> Hmm, I marked it private by mistake, are you able to see it?
<apeiros_> erwinpdev: simplify it down. I'd suggest to make an example based on `bytes[0] ^ xorkey.to_i`
<apeiros_> i.e., what do you expect 'a'.bytes.to_a[0] ^ -91 to be
<erwinpdev> Good question I only got input and output for the whole algorithm and not for this specific step
<apeiros_> erwinpdev: as I understood, you have the same algorithm working correctly in C#?
<erwinpdev> Yes
<erwinpdev> But it's not mine, only trying to implement it in Ruby
Nss joined #ruby
<apeiros_> yes, but you got the C# code, so you could see what individual steps result in…
jensn joined #ruby
Morkel joined #ruby
<apeiros_> one thing that could be a problem is that ruby has no upper limit on integers, so a negative integer in binary in ruby basically has an infinite number of 1's at the beginning
<apeiros_> (if I remember correctly) so when you do >> 4 on a 16bit int in one language, you get at least 4 zeros at the most significant bits. you don't get those in ruby.
aod joined #ruby
<erwinpdev> Ah, ok. Is there any way to get the same behaviour?
<apeiros_> use unsigned arithmetic
<apeiros_> you can & 0xffff the negative number to get its equivalent
<apeiros_> (assuming a limit of 16bit)
MHD0 joined #ruby
<erwinpdev> actually the xorkey is of sbyte type in C#: http://msdn.microsoft.com/en-us/library/d86he86x%28v=vs.71%29.aspx
<erwinpdev> So, shouldn't I do & 0xff in that case?
<apeiros_> also, why do you pack("U*") at the end?
S1kx joined #ruby
<apeiros_> yes
<erwinpdev> To convert the decimal ascii values back to ascii/string
<rippa> U is utf-8
<apeiros_> you want C, not U
<apeiros_> also, are you sure your algorithm is correct otherwise?
<apeiros_> because you access array indices that aren't set…
<apeiros_> (ruby won't complain upon that, it'll return nil, and nil responds to ^ too…)
<erwinpdev> I probably mixed it up the pack bit.
<erwinpdev> The original code reads the password as a byte array in UTF8
<erwinpdev> and outputs the result in ASCII
TMM joined #ruby
<apeiros_> erwinpdev: I'm talking about your first for loop
<apeiros_> line 12
<apeiros_> you access index 1 of the array, but in the case of 'a' as input, you do not have an index 1
<MHD0> man, ruby is great
<apeiros_> your array consists of a single element at index 0…
<erwinpdev> Hmm, yeah you are right. I have to have another look at the original code
<erwinpdev> I see the difference now. I come from a C background myself, so I am used to writing the for loop conditions myself. So basically it should something like for (int i; i < bytes.length; i++)
<apeiros_> for i in 1...bytes.length
<erwinpdev> where int i = 1 btw
<apeiros_> though, for-in loops are actually rarely used in ruby code…
<erwinpdev> Ok, but is it < or <=, because that's an important difference in this case?
<apeiros_> ... means end of the range is excluded
<apeiros_> for i in 1..10 will have start with i = 1 and end with i = 9
<erwinpdev> Ok, so it should read for i in 0...bytes.length in Ruby?
<erwinpdev> Ok, I get it.
<apeiros_> yes, as I pasted :)
<apeiros_> so for a string 'a', the loop won't be executed
<erwinpdev> Sorry, you were just a bit quicker then me ;)
<apeiros_> for 'aa', it'll be executed once, with i = 1
<apeiros_> you probably want the same in the second loop…
<erwinpdev> yes, that's the way it should be. Thanks, I'll change it.
<apeiros_> beware, the conditions is only evaluated once…
<apeiros_> though, since you keep increasing the size of the string, that's probably what you want…
<erwinpdev> What would be the Ruby way to do this, because you said for loops are rarely used?
<shevy> In ruby code you rarely find for loops because other ways are more natural
chessguy joined #ruby
<apeiros_> well, I'd stick with the for-in for now and first fix the algorithm
<erwinpdev> yeah
_debo joined #ruby
<apeiros_> but we use things like 1.upto(bytes.length) do |i| … end
<apeiros_> actually, `1.upto(bytes.length-1) do |i| … end` here
<erwinpdev> What's the backtick for?
<apeiros_> delimiting the code within my irc message
<apeiros_> it's not part of the code.
<erwinpdev> ah, ok ;)
<erwinpdev> Is there a way to make line 3 read the string as UTF8? I played around with the pack option, but only received errors?
<apeiros_> you want unicode codepoints?
<apeiros_> unpack("U*")
<apeiros_> but unicode codepoints are not restricted to 8bits…
<erwinpdev> sorry, working with Ruby 1.8.7 here, so no codepoints
<apeiros_> ruby 1.8 has no issues with that
<apeiros_> 1.8 is just encoding unaware. but it can very well unpack("U*")
<erwinpdev> I thought it didn't support codepoints
<apeiros_> it doesn't understand encodings.
<apeiros_> that is, a string is always just an array of bytes to ruby 1.8.
<apeiros_> but as said, unpack("U*") exists in ruby 1.8.
<erwinpdev> I know
<erwinpdev> I changed it now to bytes = string.bytes.to_a.pack("U*")
<apeiros_> that makes no sense…
<apeiros_> you unpack a string, not an array.
<apeiros_> string.unpack("U*"),
<apeiros_> -,
Manhose joined #ruby
Pip_ joined #ruby
<apeiros_> but again, as I understood, you want to do arithmetics on a per-byte basis, not a per-unicode-codepoint basis.
<apeiros_> the former is guaranteed to be always 1 byte, the latter can go much higher
<erwinpdev> Yes, per-byte as far as I know.
<apeiros_> then you do not want unicode codepoints.
<apeiros_> bytes = string.unpack("C*") (the same as bytes = string.bytes.to_a)
<apeiros_> ruby doesn't care whether your string contains unicode or not.
<erwinpdev> Ok
io_syl joined #ruby
<erwinpdev> So now I need to add & 0xff to the xorkey variable
<kke> corkey
<kke> life goes on
<apeiros_> erwinpdev: http://pastie.org/2964231 is what I tried, but I think the loop is still not quite correct. result is correct for 'a' as input, but longer strings are wrong.
<apeiros_> care to show the original C# code?
workmad3 joined #ruby
mk03 joined #ruby
<erwinpdev> I'll have a look at your code to see where it differs from mine
shevy joined #ruby
vmatiyko left #ruby
king-of-spain joined #ruby
martisj joined #ruby
sj26 joined #ruby
wyhaines joined #ruby
<erwinpdev> I changed the xorkey, but mine and your code show different results
<erwinpdev> while I can't find any real difference in the code.
sbanwart__ joined #ruby
jarin joined #ruby
surfm joined #ruby
Utkarsh joined #ruby
senny joined #ruby
sepp2k joined #ruby
fetimo joined #ruby
altivec joined #ruby
<erwinpdev> Ah, found the difference in the code
argh joined #ruby
<erwinpdev> apeiros: I think it's going wrong in the last loop
sbanwart__ joined #ruby
Elfix joined #ruby
<apeiros_> erwinpdev: you did notice that line 32 is ++index, so index is 2 in the first iteration…
<erwinpdev> No, I did not, argh.
<apeiros_> also, the C# code works with 2 arrays
<apeiros_> input and output
<apeiros_> while you work with (and modify while working with it) a single array
<erwinpdev> yes, I was going to change that. The main reason they probably do that is because the new array is twice the size of the old one
<apeiros_> hm, I'm wrong
<apeiros_> ++index doesn't cause index to be 2 in the first iteration
<apeiros_> at least not in C
<erwinpdev> This is C#
<erwinpdev> I have to check as well
scr1bbles joined #ruby
Hunner joined #ruby
sejo joined #ruby
Dreamer3 joined #ruby
Muz joined #ruby
techieshark joined #ruby
mitchty joined #ruby
bastlfreenode joined #ruby
darkskiez joined #ruby
ReinH joined #ruby
patjoh joined #ruby
D4T-Away joined #ruby
Gruber_ joined #ruby
jmcphers joined #ruby
v0n joined #ruby
davidboy joined #ruby
doomviking joined #ruby
grieve joined #ruby
mattp_ joined #ruby
ada2358 joined #ruby
Mohan joined #ruby
matled joined #ruby
TheNumb joined #ruby
Guest63931 joined #ruby
Norrin joined #ruby
cableray joined #ruby
kingfishr joined #ruby
apeiros_ joined #ruby
katselphrime joined #ruby
p1d joined #ruby
yann3 joined #ruby
erwinpdev joined #ruby
fetimo joined #ruby
joelio joined #ruby
Asher joined #ruby
Spockz joined #ruby
omry joined #ruby
jmeeuwen joined #ruby
er1c_ joined #ruby
nopper` joined #ruby
ByteCrunch joined #ruby
caveat- joined #ruby
Sirecote joined #ruby
nicksmith joined #ruby
flagg0204 joined #ruby
marra joined #ruby
andman joined #ruby
Veejay joined #ruby
tsykoduk joined #ruby
zaarg joined #ruby
botam joined #ruby
rpgsimmaster joined #ruby
_2easy joined #ruby
swi7ch joined #ruby
jsz` joined #ruby
dominikh joined #ruby
JStoker joined #ruby
ozzloy joined #ruby
xsdg joined #ruby
monomyth joined #ruby
aeufemio joined #ruby
__main__ joined #ruby
marcoecc joined #ruby
cesario joined #ruby
john2x joined #ruby
Drakx joined #ruby
speggey joined #ruby
Ok4mi joined #ruby
_lennart joined #ruby
KaZeR_W joined #ruby
Nowaker joined #ruby
gaspar|work joined #ruby
nelsnelson joined #ruby
Paladin joined #ruby
cyri_ joined #ruby
jwmann joined #ruby
creativeprodigy joined #ruby
Guest83872 joined #ruby
willb joined #ruby
Clooth joined #ruby
atmosx joined #ruby
iocor joined #ruby
Nss joined #ruby
S1kx joined #ruby
chessguy joined #ruby
io_syl joined #ruby
altivec joined #ruby
preller_ joined #ruby
crayfishx joined #ruby
wang joined #ruby
ephesius joined #ruby
dohzya joined #ruby
conceal_rs joined #ruby
flazz joined #ruby
andrewblack joined #ruby
mksm joined #ruby
mrmist joined #ruby
xea joined #ruby
sbanwart__ joined #ruby
meder joined #ruby
sixteneighty joined #ruby
mindCrime joined #ruby
ChloeD joined #ruby
snowcrashed joined #ruby
yellow5 joined #ruby
dpritchett joined #ruby
xybre joined #ruby
Boohbah joined #ruby
stepnem joined #ruby
spyvspy joined #ruby
wookiehangover joined #ruby
Shrink joined #ruby
frogstarr78 joined #ruby
kuzushi joined #ruby
sandpy joined #ruby
alek_b joined #ruby
Derander joined #ruby
mrapple joined #ruby
dyer joined #ruby
matti joined #ruby
kke joined #ruby
lkba joined #ruby
vitoravelino joined #ruby
jinglebe1lz joined #ruby
jhchabra1 joined #ruby
Seventoe1 joined #ruby
ryan0x2 joined #ruby
ph^ joined #ruby
jgrimes joined #ruby
elliot98 joined #ruby
Adept` joined #ruby
otakutomo joined #ruby
Pip joined #ruby
workmad3 joined #ruby
mk03 joined #ruby
king-of-spain joined #ruby
senny joined #ruby
aces1up joined #ruby
epitron joined #ruby
nuba joined #ruby
raz joined #ruby
voodoofish joined #ruby
yaotti_aw joined #ruby
nibalizer joined #ruby
Kichael joined #ruby
anonymouse89 joined #ruby
sonkei joined #ruby
theRoUS joined #ruby
tommyblue joined #ruby
vandemar joined #ruby
alindeman joined #ruby
fahadsadah joined #ruby
77CAAAORG joined #ruby
PhilK joined #ruby
joschi joined #ruby
chrisbuchholz joined #ruby
wereHamster joined #ruby
DeeJayTwo joined #ruby
any-key joined #ruby
patronus_ joined #ruby
felipe joined #ruby
andyl joined #ruby
benwoody joined #ruby
mephux joined #ruby
tomaw joined #ruby
gabriel joined #ruby
Guest58253 joined #ruby
literal joined #ruby
KillerFox joined #ruby
flexd joined #ruby
zbrown joined #ruby
sgronblo joined #ruby
brian- joined #ruby
theoros joined #ruby
phrame joined #ruby
sean_m joined #ruby
DoobieBiscuits joined #ruby
yahooooo joined #ruby
pradeepto joined #ruby
lantins joined #ruby
Caius joined #ruby
pseud0cod3r joined #ruby
cynosure joined #ruby
vereteran joined #ruby
dotemacs joined #ruby
patricksroberts joined #ruby
dv_ joined #ruby
nlew joined #ruby
omp joined #ruby
musl joined #ruby
RegEchse joined #ruby
chrxn joined #ruby
jamnew joined #ruby
shikamaru joined #ruby
robbyoconnor joined #ruby
Mon_Ouie joined #ruby
dnyy joined #ruby
Mchl joined #ruby
nimred joined #ruby
peterhil` joined #ruby
Kiall joined #ruby
Targen joined #ruby
fleas joined #ruby
Harzilein joined #ruby
eko joined #ruby
jhunter joined #ruby
elb0w joined #ruby
jds joined #ruby
jrist-afk joined #ruby
spyvrsspy joined #ruby
Frantic joined #ruby
Beoran__ joined #ruby
Evixion joined #ruby
namidark joined #ruby
thone joined #ruby
y_matsu joined #ruby
y3llow joined #ruby
Axsuul joined #ruby
nonotza joined #ruby
riush joined #ruby
incluye joined #ruby
rickmasta joined #ruby
s0ber joined #ruby
zmoazeni_ joined #ruby
zigidias joined #ruby
deadbea7_ joined #ruby
udk joined #ruby
eregon_ joined #ruby
Kivi_ joined #ruby
marcin_m_ joined #ruby
elektronaut joined #ruby
philips joined #ruby
mcpierce joined #ruby
dagobah joined #ruby
Tasser joined #ruby
daed joined #ruby
krz joined #ruby
poindontcare joined #ruby
Araxia joined #ruby
possibilities joined #ruby
Nisstyre joined #ruby
x0F__ joined #ruby
palentine joined #ruby
radic joined #ruby
LittleBill902 joined #ruby
Azure joined #ruby
dhruvasagar joined #ruby
mikeycgto joined #ruby
chiznitz_ joined #ruby
tk_ joined #ruby
cooper joined #ruby
Zimsky joined #ruby
Cervajz joined #ruby
rippa joined #ruby
yxhuvud joined #ruby
Kn|t3 joined #ruby
mklappst_ joined #ruby
nachtwandler joined #ruby
xpot joined #ruby
bugz^ joined #ruby
Vendethiel joined #ruby
ChampS_ joined #ruby
ephemerian joined #ruby
Tuxist joined #ruby
CorpusCallosum joined #ruby
zastaph joined #ruby
randym joined #ruby
banister_ joined #ruby
cook1es joined #ruby
burgestrand joined #ruby
michael_mbp joined #ruby
zul__ joined #ruby
Hellojere joined #ruby
kirun joined #ruby
eighty4 joined #ruby
pencilcheck joined #ruby
pantsman joined #ruby
jensn joined #ruby
martisj joined #ruby
sj26 joined #ruby
jarin joined #ruby
Utkarsh joined #ruby
sepp2k joined #ruby
tommylom1ykins joined #ruby
d-snp joined #ruby
Espen-_- joined #ruby
milkshak1s joined #ruby
c9s_ joined #ruby
loocorez joined #ruby
WutangDr1g0n joined #ruby
madhatter joined #ruby
SegFaultAX joined #ruby
mbreit joined #ruby
Ogion joined #ruby
QKO joined #ruby
ampex joined #ruby
udoprog joined #ruby
StitchedKite joined #ruby
knix joined #ruby
vbernetr joined #ruby
Sargun_Screen joined #ruby
Know1edge joined #ruby
rtl joined #ruby
jshsu joined #ruby
RichGuk joined #ruby
ronniemlr joined #ruby
marienz_ joined #ruby
bier|tp joined #ruby
emmanuelux joined #ruby
misc-- joined #ruby
RubyPanther joined #ruby
uxp joined #ruby
nate_h joined #ruby
araujo joined #ruby
statarb3 joined #ruby
anekos joined #ruby
ping-pong joined #ruby
dkr joined #ruby
gf3 joined #ruby
warebec|1at joined #ruby
bier joined #ruby
jeekl joined #ruby
dfr|work joined #ruby
Gate joined #ruby
epochwolf|vps joined #ruby
benj_ joined #ruby
eeadc joined #ruby
thoolihan joined #ruby
ged joined #ruby
duey joined #ruby
thomasfedb joined #ruby
lupine_85 joined #ruby
Sigma00 joined #ruby
Ilithya joined #ruby
Apocalypse joined #ruby
kmmndr joined #ruby
tobyo joined #ruby
cinch joined #ruby
klaas joined #ruby
drPoggs joined #ruby
thorncp joined #ruby
deavid joined #ruby
jimmy1980 joined #ruby
icambridge joined #ruby
MekkisFreenode joined #ruby
__root__ joined #ruby
Tick-Tock joined #ruby
DarthGandalf joined #ruby
dju joined #ruby
tessi joined #ruby
DaZ joined #ruby
SirFunk joined #ruby
mahlon joined #ruby
ezkl joined #ruby
davidboy joined #ruby
kd0t|away joined #ruby
mitchty joined #ruby
Sliker joined #ruby
elliot98 joined #ruby
jimmy1980 joined #ruby
elliot98 joined #ruby
jinglebellz joined #ruby
DMKE joined #ruby
_nyuszika7h_ joined #ruby
justicefries joined #ruby
G joined #ruby
raz joined #ruby
dju joined #ruby
DarthGandalf joined #ruby
Apocalypse joined #ruby
tessi joined #ruby
mindCrime joined #ruby
prudhvi joined #ruby
sbanwart joined #ruby
xec joined #ruby
jinglebe2lz joined #ruby
jinglebe1lz joined #ruby
hSATAC joined #ruby
elliot98 joined #ruby
elliot98 joined #ruby
lupine_85 joined #ruby
thorncp joined #ruby
Apocalypse joined #ruby
Apocalypse joined #ruby
eeadc joined #ruby
jimmy1980 joined #ruby
drPoggs joined #ruby
jensn joined #ruby
cinch joined #ruby
duey joined #ruby
Sigma00 joined #ruby
SirFunk joined #ruby
MekkisFreenode joined #ruby
SpitfireWP joined #ruby
DDAZZA joined #ruby
thomasfedb joined #ruby
fahadsadah joined #ruby
Guest64586 joined #ruby
flippingbits joined #ruby
MissionCritical joined #ruby
rotor_ joined #ruby
Drakevr joined #ruby
heftig joined #ruby
bosphorus joined #ruby
bpfh joined #ruby
Samoi joined #ruby
nyuszika7h joined #ruby
sbanwart joined #ruby
cdepue joined #ruby
katselphrime joined #ruby
abonec joined #ruby
sbanwart_ joined #ruby
kaneda joined #ruby
fetimo_ joined #ruby
alexhanh_ joined #ruby
<alexhanh_> Who else thinks handling net/http 's exceptions blows? https://gist.github.com/1430335 I mean really?
<apeiros_> alexhanh: you're aware you can put them all on one line?
<apeiros_> rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, …; nil; …
fayimora joined #ruby
<apeiros_> also check for common ancestors and/or included modules.
<alexhanh> apeiros_: yes :) the thing is that it took me a long and painful road to discover all of these various exceptions
Codif joined #ruby
<apeiros_> alternatively: rescue the exceptions that you actually can handle
<apeiros_> what sense is there in rescuing exceptions you can't actually handle?
Pip joined #ruby
ezkl joined #ruby
<Tasser> apeiros_, I once saw 'rescue Exception' a piece of code...
<apeiros_> if you really want to rescue all, even if you don't handle it - rescue the ones you do handle first, then rescue StandardError
<apeiros_> Tasser: I do that too. but then again, I know what I do :-p
Nss_ joined #ruby
<alexhanh> I guess I'd want Net lib to throw exceptions with better names and with unified namespace
<alexhanh> we have libraries such as HttParty, but for some reason they don't address this issue
<alexhanh> maybe I'm thinking fundamentally wrong here
<apeiros_> alexhanh: well, all Errno' errors are thinly wrapped exceptions from the underlying C code
Pip joined #ruby
Pip joined #ruby
jimmy1980 joined #ruby
jetblack joined #ruby
Manhose joined #ruby
fetimo joined #ruby
<Tasser> apeiros_, I'm pretty sure the guy didn't.
<apeiros_> well possible
vmatiyko joined #ruby
<Tasser> apeiros_, and I assume the fact that you're op here and don't have tits should give you enough reputation to be allowed to use 'rescue Exception' ;-)
<alexhanh> I think majority of the time when people fetch something with http, they are mostly interested whether the request was succesful and *maybe* handle different http errors
<apeiros_> I liked the idea of having to declare all exceptions your method could raise (including those raised by methods you use within your method)
<apeiros_> but I think that'd lead to other atrocities…
<alexhanh> but now, it's not possible to do rescue Net/SocketSpecificException => be done with it
<apeiros_> alexhanh: as said, `rescue => e` then
<apeiros_> though, Timeout isn't a StandardError, which is slightly mean
<apeiros_> so `rescue Timeout::Error, StandardError`, should have you covered.
fayimora joined #ruby
bruegel joined #ruby
<apeiros_> hm, seems that has been changed
<apeiros_> finally…
<apeiros_> ruby-1.9.3:359:0>> Timeout::Error.ancestors # => [Timeout::Error, RuntimeError, StandardError, Exception, Object, PP::ObjectMixin, Kernel, BasicObject]
<apeiros_> alexhanh: also be happy you have exceptions.
* apeiros_ fiddles with C, exception handling *sucks*
Araxia_ joined #ruby
Tuxist joined #ruby
mickn joined #ruby
<alexhanh> well, catching StandardError is almost like a 'catch all exceptions'? I mean we want to filter out socket/net/http specific errors and bubble the rest up.
<apeiros_> it's not all, but close to it, yes
Jake232 joined #ruby
<alexhanh> and the thing is, I haven't seen one place that would list all of these various exceptions (Errno, SocketError, EOFError, HttpError, etc.) that the openUri.open actually can throw
<apeiros_> alexhanh: and you solve that by limiting your begin/rescue block to the relevant code
<apeiros_> instead of putting just *all* code in there.
<alexhanh> like how the hell I'm supposed to know all of those?
<apeiros_> s/throw/raise/, throw means something different in ruby.
dv310p3r joined #ruby
<apeiros_> you can't be sure with large blobs of code whether the origin is really net/http anyway
<alexhanh> oh, good point.. hmm, maybe it's not openuri.open that throws all of those
<apeiros_> or how do you know your EOFError is not caused by nokogiri?
ethndbst joined #ruby
<apeiros_> but yes, I'd like ruby to have a proper attribution of something like 'packages', which could be extended to exceptions and warnings.
mikewintermute joined #ruby
<alexhanh> Well, Nokogiri throwing anything except EOFError doesn't make sense.. so we are left with Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::ECONNRESET, SocketError, Timeout::Error and OpenURI::HTTPError
ethndbst joined #ruby
deadlock joined #ruby
Manhose_ joined #ruby
enikar joined #ruby
idoru joined #ruby
timonv joined #ruby
linoj joined #ruby
<alexhanh> rest-client gem seems to patch things up
bier|tp joined #ruby
bier joined #ruby
<alexhanh> For the more common http error situation, they provide more specific exceptions, otherwise they give you RestClient::Exception
Manhose joined #ruby
<alexhanh> that's my point, majority of the time, we are not interested what the cause of failure is if it's not httperror.. we just want to handle that case (and for example, re-queue the http get for later)
pen_ joined #ruby
jimmy1980 joined #ruby
<alexhanh> but still bubble up other, non-http/network/socket specific exceptions
statarb3 joined #ruby
statarb3 joined #ruby
fayimora joined #ruby
<shevy> bubble
<shevy> rescue Bubble
<apeiros_> bubble trouble?
<shevy> trouble in my bubble
<alexhanh> :D
<apeiros_> alias bubble raise
<apeiros_> rescue Foo; bubble; end
iocor joined #ruby
iocor joined #ruby
Squarepy joined #ruby
Squarepy joined #ruby
lupine_85 joined #ruby
<apeiros_> begin doesn't introduce a new lexical scope. you don't have to do io=nil. but yes, better…
<alexhanh> oh, so io will be available outside of rescue block even if it gets introduced inside it for the first time?
<apeiros_> same for data={} btw.
<apeiros_> you reassign it later anyway
<apeiros_> alexhanh: correct
<alexhanh> what's good practise here.. is it a convention to do the kind of "forward declaration" as i did?
<apeiros_> alexhanh: I think a normal method should be short enough that it doesn't need 'declarations'
<shevy> what forward delcar... declaration
thoolihan joined #ruby
<shevy> you mean you set the variables you use to some value
CannedCorn joined #ruby
<shevy> well, it doesn't hurt
<alexhanh> Yeah. Thanks a lot guys!
dexcs joined #ruby
jimmy1980 joined #ruby
Manhose_ joined #ruby
snapcase joined #ruby
<HNDavid> using ruby with cgi, is there any way to get the path that the user requested? e.g. /cgi-bin/foo.rb
petercoulton joined #ruby
<shevy> hmm PATH_INFO or PATH_TRANSLATED ... you can also output the result of __FILE__ perhaps it is specified there
<HNDavid> PHP has a REQUEST_URI variable, but i don't see an equivalent...
<HNDavid> think i tried those, but i will try again
<shevy> I'll try in some minutes, I broke my ruby, need to fix that
vmatiyko left #ruby
excelsio1 joined #ruby
nonotza_ joined #ruby
aeufemio joined #ruby
Knodi joined #ruby
JonnieCache joined #ruby
<HNDavid> shevy: what's the right syntax for getting these? i'm a bit of a newb - http://pastie.org/2964756
<shevy> I think ENV['PATH_INFO'] should work
<HNDavid> nil
<shevy> hmm
<HNDavid> also, the docs say they are 'read-only attributes of the CGI object'
<HNDavid> how do you access an attribute? just like a method, isn't it?
<shevy> should work
avitzurel joined #ruby
<shevy> HNDavid, did you try cgi.query_string
<HNDavid> i can try it, but it's not what i want
<shevy> mhm
<shevy> can you try cgi.path_info too
<HNDavid> that was already in my first paste
<HNDavid> it's nil
<shevy> hmm
Corey joined #ruby
jimmy1980 joined #ruby
Corey joined #ruby
<shevy> and cgi.request_uri ?
<shevy> ENV["REQUEST_URI"] will give you /test.rbx?test=1
<HNDavid> nice, that works
<HNDavid> thanks
<shevy> cool
dagnachewa joined #ruby
Russell^^ joined #ruby
kidoz joined #ruby
kassien joined #ruby
andrewhl joined #ruby
<HNDavid> what i was working on: https://gist.github.com/1430558
burgestrand joined #ruby
banisterfiend joined #ruby
jimmy1980 joined #ruby
Manhose joined #ruby
fermo joined #ruby
iamjarvo joined #ruby
<shevy> and what's it do
<shevy> and will it blend
<HNDavid> gets through boston globe's leaky paywall. i wrote it out of annoyance :)
<shevy> hehe
esparkman joined #ruby
DMKE joined #ruby
Sliker joined #ruby
akem joined #ruby
Manhose_ joined #ruby
robotmay joined #ruby
Morkel joined #ruby
jonegg joined #ruby
Kn|t3 joined #ruby
headius joined #ruby
pantsman joined #ruby
<jonegg> hello, I'm new to the Ruby community and I'm looking for a solid web framework. Not too huge (Rails) and not too small (Sinatra). Fast and clean. Any suggestions?
pantsman joined #ruby
<apeiros_> are you intentionally removing the two best options from the list of available frameworks? :)
<jonegg> that's why I ask
dagnachewa joined #ruby
<yxhuvud> ramaze? padrino?
<jonegg> Rails seems to be dirty and slow
<jonegg> and Sinatra doesn't quite provide all tools I need
<jonegg> but maybe my intention is wrong
<jonegg> I'll take a look at Ramaze and Padrino
<jonegg> something with REST would be beautiful
RomD joined #ruby
<jonegg> or what do good ruby developers use for medium sized projects?
excelsio1 joined #ruby
banisterfiend joined #ruby
Eucharis joined #ruby
Kn|t3 joined #ruby
<jonegg> I come from PHP and I'm used to that the framework includes everything (Validation library, ORM, email-library). Is this even required in Ruby with the Gems? Is it a good idea to use Sinatra and install a couple of gems for the rest?
kaneda joined #ruby
<wookiehangover> jonegg: in that case, its a good idea to look into rails
<wookiehangover> but beware that "learning rails" can be distinct from "learning ruby"
<jonegg> but precisely because Rails includes everything, I perceive it as dirty
<wookiehangover> I'd call it mature
ognevsky joined #ruby
<wookiehangover> it has *just enough*
<jonegg> It doesn't feel natural
<nelsnelson> A dirty old man?
<wookiehangover> eh, any mvc framework regardless of language can "have too much"
<nelsnelson> JBoss has wayyyyyyyy too much. For instance. (Not a mvc fw, admittedly.)
<wookiehangover> just because people have made tooling for common tasks doesnt necessarily mean that its bloated
<nelsnelson> Spring is a better example of a bloated mvc framework.
<wookiehangover> sure
<nelsnelson> Coming from a Java world, rails is pristine.
<wookiehangover> but rails is really great in terms of rapid productivity, finding answers for common problems, etc
<wookiehangover> its still really easy to create a bloated rails app
Codif joined #ruby
<wookiehangover> but that comes down to the person(s) writing the code ;)
<jonegg> so rails isn't as bad as his image?
<wookiehangover> exactly
<HNDavid> what did you use in PHP?
<jonegg> Kohana
<HNDavid> mm, don't know of it
<wookiehangover> but for the same reason that jquery is becoming the lingua franca for interacting with the DOM in javascript, Rails solves a lot of common problems and has a LOT of people actively testing each release in production
<jonegg> or FuelPHP
<jonegg> and Lithium seems also interesting
<wookiehangover> which is an easy point to miss when using stuff that's less widely adopted or "rolling your own"
<wookiehangover> ya I used to do Zend framework stuff in php land
lennyks_ joined #ruby
<jonegg> my intention was that Rails is not really good, but Ruby developers were too lazy to build something better and just use rails
spike2251 joined #ruby
<jonegg> apart from Rails, there aren't many popular Ruby web frameworks
dyer joined #ruby
<wookiehangover> only if you adjust your definition of "popular"
nachtwandler_ joined #ruby
cdepue joined #ruby
katselphrime joined #ruby
<jonegg> Should a ruby framework include everything or nothing and you have to install a bunch of gems?
cook1es joined #ruby
<wookiehangover> IMO there's a fine balance between framework bloat and gem bloat
<Mchl> there's sinatra that is gaining some popularity
<wookiehangover> sinatra has been popular for a while
<wookiehangover> padrino is great, IMO
<Mchl> oh... so it's in fact losing popularity now? ;P
<jonegg> Sinatra looks good, but I'd have to install gems for everything
<Mchl> I'm always a step behind everyone it seems
<jonegg> and because I'm new in Ruby, I don't know the "best practice" gems
<yfeldblum> the last time someone thought "Rails is not really good, let's build something better", they did - and then refactored Rails to be that better thing
<wookiehangover> jonegg: padrino solves a bunch of that
<bpfh> jonegg, what changes do you propose to make rails better?
<wookiehangover> yfeldblum: merb ;)
<wookiehangover> jonegg: but if you're just getting started... learn about sinatra and rack
<yfeldblum> yep, the merb crew were like: "this is how rails should be"; the rails crew were like: "please make rails that thing"; problem solved
<jonegg> bpfh, I guess it looks less dirty and huge if it gets faster and more modular
<wookiehangover> and make sure you have familiarity with the ruby runtime (dependency loading, configuration, classes, modules, etc)
<yfeldblum> obviously, glossing over 99.9% of the history
<wookiehangover> yfeldblum: and yehuda was like "sure"
<wookiehangover> similar story with sprockets / tilt
dotnull joined #ruby
quest88 joined #ruby
linkz0r joined #ruby
<wookiehangover> "rails frontend support is garbage, lets fix that"
<yfeldblum> wookiehangover: what's this sprockets/tilt story now?
<wookiehangover> just an example of a psuedo game-changing external project getting pulled into rails
fetimo_ joined #ruby
<jonegg> I heard that Rails merged with Merb. So Rails 3 is something completely different than Rails 2?
<wookiehangover> and generally making things better
<wookiehangover> jonegg:
<wookiehangover> yes
macmartine joined #ruby
<wookiehangover> and rails 3.1 is much improved from rails 3
<wookiehangover> jonegg: http://railscasts.com/
<wookiehangover> just start watching
<wookiehangover> and watching
<jonegg> ok, I'll take a serious look at Rails, I hope it turns out that it's not as bad and huge as I think
<wookiehangover> its really
<wookiehangover> not
<wookiehangover> but watch a few railscasts to get started
QaDeS joined #ruby
<jonegg> is it easy to replace the ORM used in Rails?
<wookiehangover> jonegg: yes, but activerecord is really nice
<wookiehangover> IMO you'd only need to use something else if you're planning on using mongo or couchdb
<yfeldblum> yes; the rest of rails depends on the ActiveModel public API, not on ActiveRecord; so any ORM/ODM which exports that public API will integrate perfectly with your app
linkz0r left #ruby
Tachyon joined #ruby
<yfeldblum> ActiveRecord implements the ActiveModel public API; so does Mongoid and many other ORM/ODM's
<bpfh> jonegg, can you point us some framework that represents, in your opinion, a faster and and more modular software than rails or you think rails is dirty and huge based on your subjective impressions?
<yfeldblum> and that's all ActionController/ActionView need
thone_ joined #ruby
bruegel joined #ruby
<jonegg> bpfh, it's based on my subjective impression and what I've heard, I have't took a serious look at rails yet, but Kohana or FuelPHP are good frameworks in my opinion which would be even better if everything would be modular. node.js is kind of nice because it includes nothing and the express framework is extremely clean, mostly because it's quite new
<jonegg> I guess Rails just has to improve his image
<jonegg> Can I replace every component in Rails with another Gem?
<Norrin> at the rate cpus get faster, and if rails/ruby can become more multi-threaded, the perceive performance issues should fade into the past
decoy_octopus joined #ruby
<jonegg> Rails feels bloated because it cuts off bad in performance comparison
<decoy_octopus> hello
<jonegg> *does poorly
<wookiehangover> jonegg: performance problems in rails are generally a non issue
linoj joined #ruby
<wookiehangover> i mean, you're gonna be let down if you want to do tons of real time shit
<Norrin> wookiehangover: true that twitter dropped rails for performance issues?
<wookiehangover> eg) live chat
<lennyks_> jonegg, I agree, if you have seen talk by Aaron Patterson, he shows how bloated the middleware stack is in Rails 3, 30% slower performance than Rails 2.3.8
<wookiehangover> Norrin: they didn't drop is per se, they just had to start augmenting it because they had really insane needs
<Norrin> insane eh? like the need to be profitable?
<apeiros_> Norrin: even if they *did* ditch it, people forget that it enabled them to become that big in the first place.
<wookiehangover> 500-1000 of anything PER SECOND qualifies as insane to be
<Norrin> apeiros_: true. it's a good start, even if it has to be ditched alter
<Norrin> later*
<wookiehangover> s/be/me
<wookiehangover> github is still largely rails based
<apeiros_> of course, you can design every little poop-ass website to handle a couple of thousand requests per second, but then you'd probably be obsolete by the time you're done…
<wookiehangover> granted, there are like 30 separate apps in there
<wookiehangover> but twitter is a really special case in terms of performance
<wookiehangover> rails experience very few traffic issues with "normal" amounts of load--meaning what most developers will experience on a given project
<Norrin> its a company based on a web application. if the app is going to be computational, i can't say that's an insane case
<lennyks_> twitter still doesn't scale, 'fail whale' occurs quite often in hight pick times
<Norrin> groupon is a sales company, so twitter's needs are insane to groupon. but they're different type of companies
<Norrin> seems normal for a computational website is what i mean
<shevy> titter
<wookiehangover> ok, gotcha
<wookiehangover> but I'd even say that groupon's needs definitely exceed what's considered normal
<Norrin> seems normal for a company that's actually going to make money
decoy_octopus left #ruby
<wookiehangover> hold on, groupon makes money?
<wookiehangover> ;)
Indian joined #ruby
<wookiehangover> I thought they just bought out entire consulting shops and then had IPOs
<Norrin> i wouldn't lump every individual devs test projects into this pool of what's considered average. those aren't sites/apps that actually earn anything
<wookiehangover> Norrin: that's a bit cynical, but I see your point
<yfeldblum> Norrin: same applies w.r.t. every language/framework
<wookiehangover> i'm just saying that rails is really good for the majority of people's needs
MHD0 joined #ruby
<wookiehangover> and then there's a lot that can be done in terms of optimization, if your traffic warrants it
Beoran_ joined #ruby
<wookiehangover> so IMO it has nothing to do with the ability to make money
Mahoek joined #ruby
JumpMast3r joined #ruby
<shevy> RAILS IS FOR MONEY
<jonegg> is there a ruby framework with a really good architecture? Modular, fast, REST, good OOP (DI etc.)?
<shevy> jonegg they all suck
<shevy> also "fast"
<shevy> this is ruby man!!!
<wookiehangover> shevy's right
<shevy> Modular. Fast. Rest. OOP. Ponies.
<shevy> decide!!!
<wookiehangover> jonegg: and they're all on teh githubz
<shevy> oh
<Norrin> as up and coming sites/companies run into rails performance issues, i think hardware will eleviate those problems in the future. pressure will be applied to rails core-team to improve performance also. so probably a good idea to use rails for what its good at. making ideas into reality quickly
<jonegg> Ruby frameworks don't use good OOP?
<shevy> perhaps github is a good framework
<wookiehangover> so you can read the code and figure out if they meat yr REST, good OOP (DI etc.) needs
<shevy> jonegg I don't know what you mean with "good OOP"
<shevy> is Java good OOP? C++?
<yfeldblum> jonegg: DI is great for Java, but kind of useless for Ruby
<wookiehangover> shevy: objects, lots of them!
<shevy> what is DI?
<shevy> ah
<shevy> Dependency Injection?
<jonegg> I'm still used to the PHP "OOP" and DI isn't bad there, but rarely used
<shevy> I am writing classes in ruby, then translate this into PHP as much as possible :)
<shevy> one day I need to write a code-converter ...
<jonegg> I need to write my own Ruby framework.
<yfeldblum> jonegg: as opposed to writing an app?
<jonegg> This was irony, just to be clear. I expected far faster reactions to this.
excelsior joined #ruby
<apeiros_> we use ruby. we're supposed to be slow.
<jonegg> The thing is it seems I can't befriend me with the existing ruby frameworks, but the language is beatiful
<jonegg> *beautiful, not beatful
ryanf joined #ruby
<bpfh> just out of curiosity, does anyone here make a living programming ruby and not rails?
<Norrin> any language that can perceive what the author's intent is as well as ruby is going to be slower. a framework built on that language is going to be slower. why does it matter?
<Norrin> either you want very readable code, which fewer lines than most, or you want to have to be very specific in your code. have to choose
<Norrin> s/which/with
hadees joined #ruby
<jonegg> I want clean code and no black magic.
<Norrin> try jsp
<Norrin> or .net
<Norrin> magic isn't real however. its just the stuff is predefined in rails. lots of stuff. all documented however - no magic involved
<jonegg> I don't like this link_to_xyz thing
<yfeldblum> bpfh: i use ruby for multiple things: automating infrastructure with chef, various scripts, etc
<Norrin> that's deprecated syntax i think
<yfeldblum> bpfh: and rails
<tommylom1ykins> is there a preferred way of executing shell commands in ruby? is `command` generally acceptable?
<jonegg> I'll learn Ruby and rack from ground up and start experimenting with Rails and Sinatra soon, then I can choose
jbpros joined #ruby
<bpfh> yfeldblum, nice but in this case for me you're still a rails programmer :)
otakutomo joined #ruby
<apeiros_> jonegg: any sufficiently analyzed magic is indistinguishable from science…
sorin joined #ruby
otakutomo joined #ruby
jonegg joined #ruby
<jonegg> nah, IRC-client crashed. Thank you for your help and suggestions.
ozzloy joined #ruby
Tachyon joined #ruby
<yfeldblum> bpfh: or did you mean "does anyone program webapps in ruby with other-than-rails?"
raythecat joined #ruby
DDAZZA joined #ruby
<bpfh> no, I meant someone that codes(in ruby) things unrelated to webapps and makes a living of it
pen joined #ruby
Zal joined #ruby
Zal joined #ruby
Indian joined #ruby
banisterfiend joined #ruby
<Zal> Hello, any particular tutorial/book recommendations for an experienced python programmer to learn ruby?
<Zal> also, which ones should I avoid? ;)
Codif joined #ruby
banisterfiend joined #ruby
<shevy> Zal if the python programmer in question is experienced, that person won't need any books!
<shevy> Zal that python programmer should read through http://pine.fm/LearnToProgram/?Chapter=00 at least once. It won't be any challenge but that python programmer will understand most about ruby afterwards
<Zal> shevy, excellent, thanks.
mikepack joined #ruby
wyhaines joined #ruby
looopy joined #ruby
CannedCorn joined #ruby
<bpfh> Zal, why are you learning ruby?
GoldenPie joined #ruby
<Zal> bpfh, for a job
<Zal> bpfh, probably eventually to use RoR
<Zal> I like coming at frameworks from the language up, rather than learning the language through the framework, generally.
p1d joined #ruby
h4mz1d joined #ruby
<Zal> bpfh, is that what you wanted to know? :-)
<bpfh> yes
<Zal> Any tips are appreciated.
axilla joined #ruby
<apeiros_> Zal: many people new to ruby seem to like the ruby koans
<Zal> apeiros_, cool, thanks, I will check it out.
<apeiros_> haven't done/used them myself, tho
<GoldenPie> I'm (trying to) run a sinatra app on heroku, it uses datamapper and I get a few errors when running rackup locally
<Clooth> HAPPY BIRTHDAY MS|EMILY http://i.imgur.com/cu2wA.png
banisterfiend joined #ruby
esparkman joined #ruby
Codif joined #ruby
statarb3 joined #ruby
gregorz joined #ruby
macabre joined #ruby
fetimo__ joined #ruby
gianlucadv joined #ruby
banisterfiend joined #ruby
fetimo_ joined #ruby
fetimo___ joined #ruby
burgestrand joined #ruby
tshauck joined #ruby
dankest joined #ruby
abonec joined #ruby
Pip_ joined #ruby
bgupta joined #ruby
gf3 joined #ruby
king313 joined #ruby
king313 joined #ruby
dagnachewa joined #ruby
workmad3 joined #ruby
cafesofie joined #ruby
sepp2k joined #ruby
jbw joined #ruby
<Zal> in python, string concatenation works but is frowned upon for all but the simplest joins. Is it more freely used in ruby?
ycy joined #ruby
<ycy> hi
<ycy> when using 'case x', where x is an instance of Integer, is it possible to specify a condition like '<= 10' in the 'when' cause?
Codif joined #ruby
johntitor joined #ruby
<Guest81719> ycy, no, but you can use Ranges
mksm joined #ruby
<ycy> mksm: what if I do not now the inferior range?
p1d joined #ruby
BrianE joined #ruby
Manhose joined #ruby
daed joined #ruby
jonegg joined #ruby
incluye joined #ruby
tomzx joined #ruby
<tommylom1ykins> 'require 'FileUtils'' ==> cannot load such file
Targen joined #ruby
<tommylom1ykins> (1.9.3-p0 via rvm)
<tommylom1ykins> any clues?
<shevy> Zal string concatenation is just sending a message to String objects in ruby. You use it whenever you need it. In the simplest form, in Ruby you use "<<", which means append, more or less. So for instance, x = "foo", and then x << "bar"
MHD0 joined #ruby
ycy left #ruby
Asher joined #ruby
dbgster joined #ruby
Morkel joined #ruby
<Zal> shevy, gotcha, thanks. I just read that strings are mutable in ruby, so that pretty much answers my question too.
james_cotterill joined #ruby
bosphorus joined #ruby
james_co_ joined #ruby
punkrawkR joined #ruby
cook1es joined #ruby
ikaros_ joined #ruby
abstrakt joined #ruby
rumpround joined #ruby
fahadsadah joined #ruby
SaneWarning joined #ruby
Seisatsu joined #ruby
timonv joined #ruby
BrianE joined #ruby
mikewintermute joined #ruby
<yfeldblum> tommylom1ykins: `require "fileutils"` lowercased
chessguy joined #ruby
<tommylom1ykins> oh
Spockz_ joined #ruby
daniel_hinojosa joined #ruby
pen joined #ruby
bafilius joined #ruby
axilla joined #ruby
stacchio52 joined #ruby
<stacchio52> !list
Ch4rAzZz joined #ruby
jay_zawrotny joined #ruby
<stacchio52> !addon
Telling- joined #ruby
stacchio52 left #ruby
Sil4nc4_ joined #ruby
<Sil4nc4_> hi guys, can i overwrite a after "deploy:finalize_update" do ... ?
<Sil4nc4_> capistrano does this, but i want to overwrite it in my config file
<Sil4nc4_> so i do not need to modify the lib itself
trivol joined #ruby
pantsman joined #ruby
pantsman joined #ruby
looopy joined #ruby
mykeus joined #ruby
Hellojer_ joined #ruby
Targen_ joined #ruby
Nss joined #ruby
jbpros joined #ruby
h4mz1d joined #ruby
pangur joined #ruby
mrmist joined #ruby
cdepue joined #ruby
workmad3 joined #ruby
badabim joined #ruby
apeiros_ joined #ruby
headius joined #ruby
cafesofie joined #ruby
jarjar_prime joined #ruby
stephenjudkins joined #ruby
<Norrin> what's the ||= operator do?
_debo joined #ruby
<Norrin> if does not exist, assign?
<apeiros_> Norrin: like all <op>= operators, you can think of `a <op>= b` as `a = a <op> b`
<apeiros_> e.g. a += b --> a = a + b
<apeiros_> (technically, ||= is *slightly* different, but the analogy is close enough)
<apeiros_> and a || b is a if a is anything else than nil or false. if a is nil or false, then the expression evaluates as the value of b.
Pip joined #ruby
Targen joined #ruby
<Norrin> ok, kinda what i said than
<Norrin> well not exactly, but almost
<apeiros_> nil exists ;-)
<Norrin> it doesn't to me lol
<Norrin> but i still have to learn that about ruby
supergiantrobot joined #ruby
<apeiros_> nil is something that represents nothing. but it still is. otherwise you couldn't invoke methods upon it.
<apeiros_> nil.class # => NilClass
<Norrin> "if a is anything else than nil or false." -- usually ends up lumped together with false
<Norrin> and false is returned when things don't exist
<apeiros_> yes, nil and false are the falsy values in ruby
<apeiros_> that's a bad way to think of it IMO
perryh joined #ruby
<apeiros_> false is just one of the two values in binary logic.
igotnolegs joined #ruby
timonv joined #ruby
linoj joined #ruby
Phrogz_ joined #ruby
tatsuya_o joined #ruby
ghanima joined #ruby
moonunitzappa joined #ruby
james_co_ joined #ruby
incluye joined #ruby
tatsuya_o joined #ruby
jefflembeck joined #ruby
BrianE joined #ruby
olito joined #ruby
dr_bob joined #ruby
havenn joined #ruby
<ryanf> actually if you just referred to a var that didn't exist, you'd get a ReferenceError normally
<ryanf> ||= is a special case where it's ok for it not to exist first
<ryanf> (it might actually be a consequence of some weirdness with the parser instead of being strictly speaking a special case, but close enough)
<ryanf> wow, that conversation was a while ago huh
araujo joined #ruby
araujo joined #ruby
maletor joined #ruby
atmosx joined #ruby
bpfh joined #ruby
bosphorus joined #ruby
sythe joined #ruby
S2kx joined #ruby
greenwall joined #ruby
<greenwall> hyyy
zmanfx joined #ruby
dv310p3r joined #ruby
kenperkins joined #ruby
looopy joined #ruby
michael_mbp joined #ruby
lennyks joined #ruby
jimmy1980 joined #ruby
dagnachewa joined #ruby
araujo joined #ruby
fridim_ joined #ruby
bpfh joined #ruby
MHD0 left #ruby
BrianJ joined #ruby
workmad3 joined #ruby
Brozilla joined #ruby
<erwinpdev> apeiros_: Just want to say thanks again for your help, really appreciated. Had to leave earlier today
<apeiros_> erwinpdev: yw
Clooth joined #ruby
<erwinpdev> good night all
TandemAdam joined #ruby
josh_ joined #ruby
bafilius joined #ruby
bonhoffer joined #ruby
<bonhoffer> super runs the rest of an overloaded method, right, is there a way to get the first half of a method, then overwrite the rest?
friskd joined #ruby
<bonhoffer> if a method has steps 1,2,3, overloading that method would do step 0, super, running 0,1,2,3, right?
<shevy> what
rpowell joined #ruby
<shevy> bonhoffer just write example classes and test
<bonhoffer> shevy, to me?
<bonhoffer> shevy, i will do -- but is super the only way to get back to the parent class?
ph^ joined #ruby
<shevy> the parent class? you mean the parent method?
<bonhoffer> yes, parent method
<bonhoffer> and super runs the full parent method from the beginning, right?
<apeiros_> yes
wyhaines joined #ruby
<bonhoffer> and super is the only way to get there?
ziggles joined #ruby
<bonhoffer> what if you want the whole parent method to run, except for the final line?
<bonhoffer> do you have to copy the whole method then?
<apeiros_> you can't do that unless the method is designed to do that
<bonhoffer> got it -- and it would receive a block or something to allow that line to be changed
<apeiros_> you can't do obj.foo:butwithoutline(10) either
conor_ireland joined #ruby
<apeiros_> so why would super be different?
<apeiros_> but you can reach the method on other ways too
<apeiros_> e.g. by SuperClass.instance_method(method_name).bind(self).call
<bonhoffer> got it
<bonhoffer> never used bind
mindCrime joined #ruby
cdepue joined #ruby
kenperkins joined #ruby
RomD joined #ruby
wilmoore joined #ruby
h4mz1d joined #ruby
GK0199 joined #ruby
<GK0199> hi
<GK0199> hi guys
<GK0199> any recommendations on learning PHP?
punkrawkR joined #ruby
<bonhoffer> just start playing around with it
<friskd> How do i instantiate a dynamic class from a string.
<GK0199> any books you guys recommend that teaches PHP?
<friskd> ex: I have 3 classes.. . Agent1 , Agen2, Agent3
<bonhoffer> i got a quick learning book -- but #php would be better able to answer your question
<friskd> I only want to include and instantiate 1 of them.
<friskd> but i don't know until runtime as i extract the # from data i retreive.
<friskd> So Ideally i could do, agent = Agent{#agent_id}.new();
GK0199 left #ruby
mikepack joined #ruby
ndch joined #ruby
Axsuul joined #ruby
araujo joined #ruby
araujo joined #ruby
<apeiros_> friskd: since Agent1 is a constant, you can use const_get
<apeiros_> Object.const_get("Agent#{id}").new
lkba joined #ruby
kennethreitz joined #ruby
stephans joined #ruby
roadze joined #ruby
nari joined #ruby
alindeman joined #ruby
<friskd> apeiros_: very neat. So i could do a require on /agent_1
<friskd> and then do agent = Object.const_get("Agent#{id}").new('local')
<friskd> ?
<friskd> Which would include the correct agent file.
<friskd> And then make agent an instance of Agent1
stephenjudkins joined #ruby
iocor joined #ruby
looopy joined #ruby
headius joined #ruby
Targen joined #ruby
<apeiros_> friskd: sure.
* apeiros_ off
<friskd> apeiros_: thanks!
stephenjudkins joined #ruby
randym joined #ruby
stephenjudkins joined #ruby
Synthpixel joined #ruby
jbpros joined #ruby
otakutomo joined #ruby
mikeric joined #ruby
asQuirreL joined #ruby
brownies joined #ruby
<asQuirreL> hey guys, quick question about hashes in 1.9.2 vs. 1.8.7
<asQuirreL> the code is super long winded, so I won't go in to details
<asQuirreL> but essentially
<asQuirreL> in 1.8.7, somewhere along the way, when the hash got passed around, it just magically turned in to an array of tuples
<asQuirreL> which doesn't happen in 1.9.2
canton7 joined #ruby
<asQuirreL> this would be fine, but this is for a computer algebra system that's going to be running on rails
__class__ joined #ruby
n8ji joined #ruby
<asQuirreL> so I was wondering if there was anything in particular making this happen?
apok joined #ruby
<ryanf> asQuirreL: I think there are some Enumerable methods that, when called on a hash, return a hash on 1.9 and tuples on 1.8
<ryanf> or Hash methods. I guess that would make more sense
<ryanf> I don't remember the specifics though
<asQuirreL> ryanf: thanks man
<asQuirreL> I'm already a week behind on this :P
<asQuirreL> I switched from Haskell to Ruby pretty much at the last minute
<asQuirreL> so that I could save myself some trouble and write the UI in rails.. :P
nerdy_ joined #ruby
Thropp joined #ruby
mdunn joined #ruby
Squarepy joined #ruby
cooper joined #ruby
<banisterfiend> asQuirreL: Hash#select in particular iirc, returns a hash in 1.9 and an array in 1.8
jbhewitt joined #ruby
toddmorrill joined #ruby
<toddmorrill> anyone out there know of any sites impementing fb chat api?
<toddmorrill> i want to see it from an end user experience
<asQuirreL> banisterfiend: ah, perfect, I know exactly where I used that...
<asQuirreL> thanks for all your help
headius joined #ruby
stephenjudkins joined #ruby
<toddmorrill> anyone interested in taking a look at my new side project :)
<toddmorrill> http://plist.tv
roadze joined #ruby
<toddmorrill> Its an open source mtv replacement project
badabim joined #ruby
flip_digits joined #ruby
jbrokc joined #ruby
<jbrokc> is there a way to .map with an index? I don't think .map_with_index |f, i| is right
<banisterfiend> jbrokc: which version of ruby?
<banisterfiend> if you're using 1.8, use: collection.each_with_index.map { |v, i|
<banisterfiend> if you're using 1.9, use: collection.map.with_index { |v, i|
apok_ joined #ruby
<ryanf> the first one still works in 1.9 right?
stephenjudkins joined #ruby
banisterfiend joined #ruby
BrianE joined #ruby