fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
kaen has joined #ruby
<burgestrand> cpruitt: this includes stating the encoding of your files if you use anything other than 7-bit ASCII, which is a good practice as the default is different depending on the system environment.
kaen has quit [Read error: Connection reset by peer]
kylemcgill has joined #ruby
<burgestrand> cpruitt: your error stems from ruby thinking your file is in one encoding (your system’s default, most likely) but you’ve written code using ♯, which is not valid in that encoding, and ruby complains loudly.
cantonic has quit [Quit: cantonic]
liluo has quit [Read error: Connection reset by peer]
<cpruitt> OK, that makes sense. I'm still a little unsure of how to proceed. Lets say I have one file with that class defined (accidentals.rb). I use the magic encoding comment to "switch" to UTF-8 (may be mixing terms). If I have another file that is NOT UTF-8 that uses the Accidental class, will that work or does (like I'm thinking) everything using it also have to declare UTF-8?
jeff_sebring has joined #ruby
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
<cpruitt> Ugh… I'm about to just use "#" and "b" instead of the real symbols. lol
emmanuelux has joined #ruby
xorgnak has quit [Remote host closed the connection]
<burgestrand> cpruitt: unless otherwise stated, *every* file required by ruby is in the default encoding. So, say you write this ♯ in every file in your gem, you must also write the "# encoding: utf-8" in every file.
liluo has joined #ruby
<burgestrand> cpruitt: afaik there is no way to change the global default encoding of ruby source files.
btanaka has quit [Remote host closed the connection]
ckrailo has quit [Quit: Computer has gone to sleep.]
<burgestrand> cpruitt: i.e. writing "# encoding: your_encoding" in every file of your gem is recommended :)
<cpruitt> burgestrand: I think I'm tracking with you. If I do that a consuming script (say a rails app for example) will also need to do that or no? That's the part that's throwing me for a loop.
<burgestrand> cpruitt: you won’t, unless the consuming script itself contains UTF-8 characters as well that need their encoding defined. You can use a gem with all files having "# encoding: ISO-8859-1" in it, even if the consuming script is in UTF-8. It’s just that strings coming from the gem with "ISO-8859-1" in it will have their encoding in ISO-8859-1 (latin-1, western style encoding).
iamjarvo has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
xorgnak has joined #ruby
xorgnak has quit [Read error: Connection reset by peer]
kirun has quit [Quit: Client exiting]
kevinbond has joined #ruby
<cpruitt> OK I think I get it. The "# encoding: your_encoding" is telling the ruby interpreter how to handle and parse out the strings in **that file** but once it's in memory it's just a collection of bytes with a note on what encoding to use. Would that be an accurate (albeit maybe poor) way of understanding it?
mengu has quit [Read error: Connection reset by peer]
xaq has quit [Remote host closed the connection]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
xorgnak has joined #ruby
mrdodo has joined #ruby
<burgestrand> cpruitt: yup, that’s pretty much it.
<burgestrand> cpruitt: strings in ruby = collection of bytes, and an encoding.
apok has quit [Remote host closed the connection]
<cpruitt> burgestrand: OK that clicked. Thanks for the help.
reuf has quit [Quit: Leaving]
<cpruitt> burgestrand: would have spent half the night on that one. :-)
apok has joined #ruby
xorgnak has quit [Remote host closed the connection]
headius has quit [Quit: headius]
TechCel has joined #ruby
Freijo is now known as Fraeon
thomas is now known as Thomas
k_89 has quit [Ping timeout: 252 seconds]
zemanel has quit [Quit: Remote hottie closed the connection]
bradhe_ has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 252 seconds]
Progster has quit [Ping timeout: 260 seconds]
<burgestrand> cpruitt: :)
igotnolegs has quit [Quit: Computer has gone to sleep.]
hunglin1 has quit [Quit: Leaving.]
<burgestrand> cpruitt: as a further note, String#force_encoding just swaps the internal encoding flag, does nothing to the bytes representing the string.
yakko_ has joined #ruby
mikeric has joined #ruby
davidcelis has quit [Quit: K-Lined.]
lorandi has joined #ruby
yakko has quit [Ping timeout: 246 seconds]
Simon3 has joined #ruby
mwilson_ has quit [Excess Flood]
Chryson has joined #ruby
mwilson_ has joined #ruby
revans has joined #ruby
Simon5 has joined #ruby
oscardelben has joined #ruby
yakko_ is now known as yakko
c0rn_ has quit [Quit: Computer has gone to sleep.]
Simon3 has quit [Read error: Connection reset by peer]
zodiak has quit [Remote host closed the connection]
celestius has quit [Remote host closed the connection]
sailias has joined #ruby
Rezwan has joined #ruby
billiamii has joined #ruby
hunglin has joined #ruby
adeponte has quit [Remote host closed the connection]
Berglund has quit [Quit: Computer died.]
adeponte has joined #ruby
andrewhl has quit [Remote host closed the connection]
k_89 has joined #ruby
Simon3 has joined #ruby
adamkittelson has quit [Remote host closed the connection]
<Petit_Dejeuner_> Can I not inject a range? '[1..10].inject{|sum, num| sum + num}'
cwang has quit [Remote host closed the connection]
adamkittelson has joined #ruby
shadoi has quit [Quit: Leaving.]
jerm1080 has quit [Quit: Leaving]
Petit_Dejeuner_ is now known as Petit_Dejeuner
<rking> Petit_Dejeuner_: That's actually a range wrapped in an Array
htroyack has quit []
yakko has quit [Remote host closed the connection]
<rking> Petit_Dejeuner: Use ()s insteadda []s.
<Petit_Dejeuner> rking, oh, thanks
<rking> Then all your =[s will turn to =)s
adeponte has quit [Ping timeout: 244 seconds]
wvms has joined #ruby
CannedCo_ has quit [Quit: Computer has gone to sleep.]
Simon5 has quit [Ping timeout: 250 seconds]
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<Petit_Dejeuner> This makes a lot more sense. I'm still thinking in python.
nari has joined #ruby
adamkittelson has quit [Ping timeout: 276 seconds]
wilmoore has quit [Remote host closed the connection]
LoneElf has quit [Quit: Computer has gone to sleep.]
hsbt has quit [Ping timeout: 240 seconds]
c0rn_ has joined #ruby
jrajav has joined #ruby
davidokner has joined #ruby
igotnolegs has joined #ruby
liluo has quit [Remote host closed the connection]
Draco_ has quit [Read error: Connection reset by peer]
Draco_ has joined #ruby
jrajav has quit [Client Quit]
Simon5 has joined #ruby
j| has joined #ruby
Simon3 has quit [Ping timeout: 252 seconds]
julio__ has quit [Ping timeout: 264 seconds]
Rezwan has quit [Read error: Connection reset by peer]
Rezwan has joined #ruby
Simon5 has quit [Ping timeout: 244 seconds]
Spooner has quit [Ping timeout: 264 seconds]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
bradhe has joined #ruby
Simon3 has joined #ruby
sgronblo1 has quit [Ping timeout: 252 seconds]
luckman212 has quit [Remote host closed the connection]
mrsolo has quit [Quit: Leaving]
zeromodu_ has quit [Remote host closed the connection]
sebicas has joined #ruby
sendoushi has joined #ruby
julio has joined #ruby
hsbt has joined #ruby
sailias has quit [Ping timeout: 246 seconds]
c0rn_ has quit [Quit: Computer has gone to sleep.]
liluo has joined #ruby
liluo has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
liluo has joined #ruby
hubub has quit [Read error: No route to host]
mikeric has quit [Read error: Connection reset by peer]
mikeric has joined #ruby
ttilley_off is now known as ttilley
uris has joined #ruby
LiquidInsect has quit [Read error: Operation timed out]
michael2572 has joined #ruby
mfridh has quit [Ping timeout: 255 seconds]
mikepack has quit [Remote host closed the connection]
nilg has quit [Remote host closed the connection]
mxweas has joined #ruby
iamlacroix has joined #ruby
sailias has joined #ruby
Simon3 has quit [Quit: Leaving.]
khakimov has joined #ruby
Draco_ has quit [Remote host closed the connection]
sendoushi has quit [Remote host closed the connection]
blazes816 has quit [Quit: Leaving]
yakko has joined #ruby
adeponte has joined #ruby
jarred has quit [Quit: jarred]
Draco_ has joined #ruby
LiquidInsect has joined #ruby
vertroa has joined #ruby
iamlacroix has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
revans has quit [Quit: Linkinus - http://linkinus.com]
adamkittelson has joined #ruby
EstanislaoStan has joined #ruby
seanstickle has joined #ruby
k_89 has quit [Ping timeout: 252 seconds]
<EstanislaoStan> I'm confused as to why I'm getting the "undefined method '[]' for nil:NilClass" error here. Can I not pass hashes into a module? http://pastie.org/4327476
Hanmac1 has joined #ruby
jrajav has joined #ruby
Hanmac has quit [Ping timeout: 248 seconds]
<seanstickle> EstanislaoStan: please show all your code -- how you are calling the method, etc
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
sebicas has quit [Read error: Connection reset by peer]
sebicas_ has joined #ruby
justsee is now known as justsee|away
c0rn_ has joined #ruby
justsee|away is now known as justsee
mikeric has quit [Read error: Connection reset by peer]
nopolitica has quit [Quit: Leaving.]
savage- has quit [Remote host closed the connection]
mxweas has quit [Quit: Computer has gone to sleep.]
kah_ has joined #ruby
iamjarvo has quit [Ping timeout: 244 seconds]
<EstanislaoStan> Uh, does this help? true_name = TrueNameModule.generate_true_name(thing_name, @dungeon_things)
apok_ has joined #ruby
adeponte has quit [Remote host closed the connection]
akem has quit [Ping timeout: 244 seconds]
<seanstickle> EstanislaoStan: line 2 in http://pastie.org/4327476 isn't doing what you think it's doing
voodoofish430 has quit [Quit: Leaving.]
<seanstickle> EstanislaoStan: it's not setting some sort of global variable that can be used inside the method
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
mikeric has joined #ruby
<seanstickle> Wait hold on
iamjarvo has joined #ruby
<seanstickle> What line is the "undefined method" happening on?
TechCel has quit [Ping timeout: 240 seconds]
kevinbond has quit [Quit: kevinbond]
jrbing has quit [Ping timeout: 265 seconds]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
apok has quit [Ping timeout: 276 seconds]
apok_ has quit [Ping timeout: 276 seconds]
c0rn_ has joined #ruby
c0rn_ has quit [Client Quit]
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<EstanislaoStan> Sorry. My bad for not checking this earlier. It works if I just run this code. But in my larger program it's not. So I've got to figure out whats going on in there.
TorpedoSkyline has joined #ruby
<EstanislaoStan> http://pastie.org/4327476
<arietis> is it possible to make server using standard ruby library?
Progster has joined #ruby
<Petit_Dejeuner> I would imagine you could, with sockets and threading.
alexim has quit [Quit: sleep]
sevvie has joined #ruby
gmci has joined #ruby
ringotwo has quit [Remote host closed the connection]
Axsuul has quit [Ping timeout: 252 seconds]
akem has quit [Read error: Operation timed out]
Axsuul has joined #ruby
<EstanislaoStan> I'm having a problem finding the mistake in my code because I can't tell where the method call is happening from. The wrong object is supplied to my method and it spits out an error when it runs with it. Is there a way I can find where this method call is happening?
mxweas has joined #ruby
nadirvardar has quit [Quit: Computer has gone to sleep.]
ZachBeta has quit [Quit: Computer has gone to sleep.]
<iamjarvo> anyone have an example on building a simple tree like structure with ruby
Berglund has joined #ruby
<jrajav> Providing Google services 24/7
<iamjarvo> jrajav thanks
Banistergalaxy has joined #ruby
paradoja has quit [Remote host closed the connection]
jrbing has joined #ruby
ZachBeta has joined #ruby
yekta has joined #ruby
akem has joined #ruby
noyb has joined #ruby
iamjarvo has quit [Ping timeout: 244 seconds]
yakko_ has joined #ruby
xorgnak has joined #ruby
iamjarvo has joined #ruby
yakko has quit [Ping timeout: 246 seconds]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
cirwim has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
iamjarvo has quit [Ping timeout: 255 seconds]
shadoi has joined #ruby
brjannc has quit [Ping timeout: 252 seconds]
Araxia has quit [Quit: Araxia]
abra has quit [Quit: Leaving]
EstanislaoStan has quit []
iamjarvo has joined #ruby
sdwrage has joined #ruby
akem has quit [Ping timeout: 246 seconds]
brjannc has joined #ruby
Berglund has quit [Quit: Computer died.]
verbad has joined #ruby
sh1ps has joined #ruby
sh1ps has quit [Client Quit]
davidcelis has joined #ruby
dhruvasagar has joined #ruby
S1kx has quit [Read error: Connection reset by peer]
awarner has joined #ruby
S1kx has joined #ruby
S1kx has joined #ruby
rockets has joined #ruby
decbike has joined #ruby
bgupta has joined #ruby
sdwrage has quit [Quit: geekli.st/programmer]
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
michael2572 has quit [Quit: This computer has gone to sleep]
weasels has quit [Quit: WeeChat 0.3.8]
otters has joined #ruby
kevinbond has joined #ruby
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
michael2572 has joined #ruby
michael2572 has quit [Client Quit]
sdwrage has joined #ruby
TorpedoSkyline has joined #ruby
vertroa has quit [Read error: Connection reset by peer]
vertroa has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
xaq has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
decbike has quit [Remote host closed the connection]
radic has quit [Ping timeout: 240 seconds]
sebicas_ has left #ruby [#ruby]
jeff_sebring has quit [Quit: Leaving]
benjammin891 has joined #ruby
sebicas has joined #ruby
benjammin891 has quit [Quit: Leaving]
awarner has quit [Remote host closed the connection]
mikeric has quit [Quit: mikeric]
seanstickle has quit [Quit: Nihil sub sole novum]
mxweas has quit [Quit: Computer has gone to sleep.]
UNIXgod has joined #ruby
nadirvardar has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
QaDeS has joined #ruby
sailias has quit [Ping timeout: 246 seconds]
cakehero has joined #ruby
radic has joined #ruby
mxweas has joined #ruby
rockets has quit [Remote host closed the connection]
<icy`> hm, i'm blanking out... what's the reverse of File.readlines ? (writing an array back into file) File.write is not producing what i expected
<icy`> nvm
<icy`> found a way with File.open(...) {|f| f.puts array}
cakehero has quit [Client Quit]
stefano has joined #ruby
stefano has left #ruby [#ruby]
stefano has joined #ruby
stefano is now known as Guest46949
<Guest46949> anyone use right_aws gem?
Guest46949 is now known as stefano_
noganex has quit [Ping timeout: 248 seconds]
noganex has joined #ruby
fbernier has joined #ruby
ryanf has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
S1kx has quit [Read error: Connection reset by peer]
S1kx has joined #ruby
monkegjinni has quit [Remote host closed the connection]
mnemo_ has joined #ruby
mnemo_ has quit [Client Quit]
lorandi has quit [Quit: Leaving]
CannedCorn has joined #ruby
td123 has joined #ruby
beakerman has quit [Remote host closed the connection]
hydrozen has joined #ruby
chimkan has joined #ruby
auvi has joined #ruby
sdwrage has quit [Ping timeout: 246 seconds]
Vert has quit [Ping timeout: 252 seconds]
williamcotton_ has joined #ruby
auvi has quit []
emmanuelux has quit [Quit: emmanuelux]
zemanel has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
noganex has quit [Ping timeout: 252 seconds]
ViciousPlant has joined #ruby
lldong has joined #ruby
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
noganex has joined #ruby
cakehero has joined #ruby
kah_ has quit [Quit: Leaving]
dhruvasagar has joined #ruby
xaq has quit [Remote host closed the connection]
xaq has joined #ruby
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
FriarTech has joined #ruby
mxweas has quit [Ping timeout: 252 seconds]
mxweas has joined #ruby
apok has joined #ruby
noyb has quit [Quit: Leaving.]
tommyvyo has joined #ruby
itnomad has quit [Quit: Leaving]
dhodgkin has joined #ruby
xaq has quit [Ping timeout: 246 seconds]
xaq has joined #ruby
noyb has joined #ruby
eywu has quit [Quit: Leaving.]
akem has joined #ruby
Draco_ has quit [Remote host closed the connection]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
Progster has quit [Ping timeout: 246 seconds]
Guest_ has joined #ruby
fbernier has quit [Ping timeout: 244 seconds]
Banistergalaxy has quit [Ping timeout: 276 seconds]
mockra has joined #ruby
Guest_ has left #ruby [#ruby]
dhodgkin has quit [Quit: WeeChat 0.3.5]
jtallant has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
dhodgkin has joined #ruby
verbad has quit [Quit: verbad]
sebicas has quit [Quit: sebicas]
matadon has joined #ruby
savage- has joined #ruby
xaq has quit [Remote host closed the connection]
Rezwan has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
lldong has quit [Remote host closed the connection]
lldong has joined #ruby
ananthakumaran has joined #ruby
mpereira has quit [Ping timeout: 248 seconds]
k_89 has joined #ruby
lldong_ has joined #ruby
ged has joined #ruby
lldong_ has quit [Remote host closed the connection]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
fabioboris has joined #ruby
verbad has joined #ruby
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
yakko_ is now known as yakko
decbike has joined #ruby
Draco_ has joined #ruby
fabioboris has left #ruby [#ruby]
robbyoconnor has joined #ruby
Progster has joined #ruby
mpereira has joined #ruby
iamjarvo has joined #ruby
matadon has quit [Quit: Leaving.]
robbyoconnor has quit [Remote host closed the connection]
wpaulson has joined #ruby
robbyoconnor has joined #ruby
xorgnak has quit [Remote host closed the connection]
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
Progster has quit [Ping timeout: 252 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
jarred has joined #ruby
apok has quit [Ping timeout: 246 seconds]
decbike has quit [Remote host closed the connection]
michael2572 has joined #ruby
yakko has quit [Remote host closed the connection]
mrdodo has quit [Remote host closed the connection]
xorgnak has joined #ruby
mikepack has joined #ruby
chimkan has quit [Quit: chimkan]
areil has joined #ruby
verbad has quit []
xorgnak has quit [Remote host closed the connection]
verbad has joined #ruby
williamcotton_ has quit [Quit: williamcotton_]
xorgnak has joined #ruby
Araxia has joined #ruby
verto|off is now known as verto
xorgnak has quit [Remote host closed the connection]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
jarred has quit [Quit: jarred]
xorgnak has joined #ruby
chimkan_ has joined #ruby
apok has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
andrewjf has joined #ruby
shaman42_ has quit [Ping timeout: 265 seconds]
andrewjf has quit [Client Quit]
lxsameer has joined #ruby
lxsameer has quit [Max SendQ exceeded]
andrewjf has joined #ruby
lxsameer has joined #ruby
davidokner has quit [Quit: leaving]
cloud|office has joined #ruby
mrFrog has joined #ruby
lxsameer has quit [Max SendQ exceeded]
jtallant has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
mikepack has quit [Remote host closed the connection]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
nw has quit [Ping timeout: 252 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
jesly__ has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
CannedCorn has quit [Quit: Computer has gone to sleep.]
hemanth has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
yoklov has quit [Quit: computer sleeping]
lxsameer has quit [Quit: Leaving]
lxsameer has joined #ruby
yoklov has joined #ruby
kevinbond has quit [Quit: kevinbond]
<iamjarvo> bnagy how goes it
jarred has joined #ruby
dg73 has joined #ruby
mrFrog has left #ruby [#ruby]
nilg has joined #ruby
wilmoore has joined #ruby
kevinbond has joined #ruby
hadees has joined #ruby
Aaton is now known as Aaton_off
azm has quit [Ping timeout: 250 seconds]
kylemcgill has quit [Remote host closed the connection]
dg73 has quit [Quit: Leaving]
eywu has joined #ruby
hadees has quit [Remote host closed the connection]
daniel_hinojosa has joined #ruby
bigkm has quit [Ping timeout: 240 seconds]
bigkm has joined #ruby
Bosma has quit [Ping timeout: 248 seconds]
eywu has quit [Quit: Leaving.]
eywu has joined #ruby
wilmoore has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 246 seconds]
<hemanth> class String
<hemanth> alias :each_line :each
<hemanth> end
<hemanth> how bad? ruby1.9.x
ViciousPlant has quit [Ping timeout: 245 seconds]
nw has joined #ruby
<Spaceghostc2c> hemanth: What?
dg73 has joined #ruby
yoklov has quit [Quit: bye!]
michael2572 has quit [Ping timeout: 252 seconds]
dg73 has quit [Client Quit]
dg73 has joined #ruby
dg73 has quit [Remote host closed the connection]
<hemanth> Spaceghostc2c, I have some code where .each is applied on String, now with ruby1.9 there is no String#each. so was looking for a work around
<Petit_Dejeuner> hemanth, do you want each word or each char?
stat1x has quit [Read error: Connection reset by peer]
<Petit_Dejeuner> each line?
stat1x has joined #ruby
nw has quit [Client Quit]
hydrozen has quit [Quit: Computer has gone to sleep.]
nw has joined #ruby
<hemanth> Petit_Dejeuner, each_line
khakimov has quit [Quit: Computer has gone to sleep.]
<bnagy> now I'm hungry
<hemanth> if !obj.kind_of?(Array)
<hemanth>
<hemanth> obj = ["#{obj}"]
<hemanth> end
<hemanth>
<hemanth> is what i'm doing as of now
<Petit_Dejeuner> hemanth, myString.split(?\n).each
<hemanth> sorry, for the ugly paste
dg73 has joined #ruby
banisterfiend has joined #ruby
shaman42 has joined #ruby
<hemanth> Petit_Dejeuner, ya, that is right, but I want more generic solution, my code base is huge can't change each occurrence
<hemanth> bnagy, hungry for?
<bnagy> breakfast
<Petit_Dejeuner> You'r eupdating 1.8 to 1.9?
<bnagy> hemanth: just fix the code
<hemanth> Petit_Dejeuner, yes and as well it must work well on both versions
<hemanth> bnagy, :|
dg73 has quit [Remote host closed the connection]
<Petit_Dejeuner> hemanth, String.each = def each() this.split(?\n).each end
<bnagy> can't be _that_ bad, search and replace etc
<bnagy> they took each off String because it's stupid
<Petit_Dejeuner> it might be
<bnagy> so perpetuating that stupidity is only going to make it worse in the long run
<Petit_Dejeuner> You sound like you're a Python 3 proponent.
jesly__ has quit [Ping timeout: 255 seconds]
<hemanth> Petit_Dejeuner, doing so, will not effect 1.8's each method?
<bnagy> I have no idea about python analogies
cirwim has quit [Quit: Leaving.]
tonini has joined #ruby
j| has quit [Quit: (-.-) zzZZzZ]
<bnagy> hemanth: plus, while you're fixing it, you'll no doubt be forced to refactor and DRY some stuff up
tiripamwe has quit [Ping timeout: 255 seconds]
<Petit_Dejeuner> String.each = def each() this.split(?\n).each end unless String.has_value? each
<bnagy> cause if it's that much work then it was written wrong :)
<Petit_Dejeuner> hemanth
Morkel has joined #ruby
<bnagy> but fwiw your original idea of using alias is the right hack
artOfWar has joined #ruby
kevinbond has quit [Quit: kevinbond]
artOfWar_ has joined #ruby
mrdodo has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
<hemanth> Petit_Dejeuner, nice
<hemanth> bnagy, :)
<bnagy> huh? it's not nice, it's gibberish
<bnagy> String.has_value? each is just never going to work
ryanf has quit [Ping timeout: 250 seconds]
<Petit_Dejeuner> bnagy, watch what you say about my code bub, I'm a master of gorilla warfare
<Petit_Dejeuner> bnagy, fine, :each
<hemanth> bnagy, why? you suggest to do selective aliasing ?
banisterfiend has quit [Ping timeout: 246 seconds]
<bnagy> it's not selective, it's just one alias
<hemanth> alias :each_line :each
<hemanth> ?
<bnagy> yeah
Banistergalaxy has joined #ruby
<bnagy> Petit_Dejeuner: String doesn't even respond to has_value? and btw respond_to? is probably the method you wanted
<hemanth> but in 1.8 each_line is not there
sevvie has quit [Ping timeout: 245 seconds]
artOfWar has quit [Ping timeout: 244 seconds]
<bnagy> well in 1.9 you're not going to call each
<bnagy> wait.. there's no each_line in 1.8?
<hemanth> in my case i have to :\
<hemanth> that's why all this headache
<Petit_Dejeuner> bnagy, you're correct, I'm new to this, but my way CAN work.
<bnagy> this is why people shouldn't support that crap anymore
Hien has quit [Quit: leaving]
<bnagy> Petit_Dejeuner: your approach might work if you fixed all the syntax errors, used the correct methods and then tested it
<Petit_Dejeuner> Yeah, it works if it works.
<hemanth> now I'm in /usr/lib/ruby/1.8 where do i find string.rb?
<bnagy> dunno, use find
<hemanth> i'm lazy
<hemanth> :D
<bnagy> find /usr/lib/ruby/ -name string.rb
sevvie has joined #ruby
<bnagy> yeah, that's the lazy way
<hemanth> locate string.rb
<hemanth> lazier way ;) ?
<bnagy> no locate is os specific
mockra has quit [Remote host closed the connection]
<hemanth> mine is a lazy os
<hemanth> chuck that, will work on the fix now
<bnagy> hemanth: hm, 1.8 does have each_line, unless the online docs are lying
<hemanth> bnagy, my bad :\ Array#each_line is not there, indeed not needed also, does not sound meaningful
<Petit_Dejeuner> hemanth, okay, this works, http://pastie.org/private/6a1mgmdnrrpyeanhpvcaq
<Petit_Dejeuner> happy bnagy?
<hemanth> bnagy, so the only fix is having an alias
nazty has quit [Ping timeout: 248 seconds]
<bnagy> hemanth: well I still advocate just moving all your each to each_line
mockra has joined #ruby
lldong_ has joined #ruby
<bnagy> how about just overloading each and having it print caller[1] ?
<bnagy> then you can get a list of places that need fixing
<hemanth> bnagy, then i need to check for string everywhere
andrewhl has joined #ruby
<bnagy> Petit_Dejeuner: much better. BUT :)
bier has quit [Ping timeout: 248 seconds]
<bnagy> use unless not if !, don't use empty parens
<hemanth> but what's wrong with alias :each_line :each ?
lldong has quit [Ping timeout: 255 seconds]
lldong_ is now known as lldong
<bnagy> should work afaict, but it's wrong
<Petit_Dejeuner> bnagy, ah, is unless the standard?
<bnagy> it's a maintenance headache
dross has joined #ruby
<bnagy> Petit_Dejeuner: it's easier to read
<Petit_Dejeuner> fair enough, It feels weird declaring functions without parens, i'll do it, but it's just alien
whowantstolivefo has joined #ruby
<bnagy> yeah, 'modern' ruby doesn't even use parens for methods with params, def compress str; ...
tiripamwe has joined #ruby
sepp2k has joined #ruby
rails has quit [Changing host]
rails has joined #ruby
<Petit_Dejeuner> Ruby has a few edge cases where parens would be prefferable to have.
<Petit_Dejeuner> Better safe than sorry.
brianpWins has joined #ruby
<bnagy> well 'accepted' style is to use them when a) you have to and b) when it would be _really_ confusing not to
<hemanth> btw why was each removed?
<bnagy> but method defs on their own line aren't all that confusing
<bnagy> hemanth: because it's stupid
<hemanth> :{
<bnagy> like string.each {|each_what???|
<Petit_Dejeuner> hemanth, M$ paid off Matz to run the language into the ground and kill _why
<Petit_Dejeuner> hence no each method
<hemanth> :D
<hemanth> bnagy, hmm
<hemanth> `split': wrong argument type Fixnum (expected Regexp) (TypeError)
<hemanth> had to be self.split().each {|line| yield line}
Eldariof-ru has joined #ruby
<bnagy> don't use parens
ackz has quit [Quit: Leaving...]
<bnagy> str.split.each
vectorshelve has joined #ruby
<bnagy> oic... yeah ? changed in 1.8 / 1.9 as well
<Petit_Dejeuner> "don't user parens" Toto, I don't think we're in the 'land of lisp' anymore.
<bnagy> it used to return ordinals
dg73 has joined #ruby
hunglin has quit [Quit: Leaving.]
<bnagy> split("\n") would work too
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
iamjarvo has joined #ruby
<hemanth> hmm, anyway this is worth blogging
<Spaceghostc2c> On that, using a #respond_to? is akin to #try, which is ucky.
<Spaceghostc2c> not ducky.
<hemanth> ducktypying ftw?
<Spaceghostc2c> Petit_Dejeuner: They're useless. Why not use semicolons on every expression ending too? I only use parens when they're required and the code looks so much nicer.
<bnagy> hemanth: why doesn't the simple alias work?
<hemanth> bnagy, because, 1.9 has no each method
<Spaceghostc2c> Unlike in javascript, where they actually mean something to have the parens.
julio has quit [Read error: Connection reset by peer]
<bnagy> hemanth: that's what the alias should create
<Spaceghostc2c> hemanth: Why not just switch to using the each_line and be 1.9 compatible without keeping aliases around?
<Petit_Dejeuner> Spaceghostc2c, It feels weird to talk about Ruby code as yucky
<bnagy> Spaceghostc2c: yeah I tried convincing him already :/
<Spaceghostc2c> Petit_Dejeuner: It's easy. Ucky ruby code is written by people who mistake ruby for a language it isn't.
<hemanth> bnagy, ha, it must be alias :each :each_line
<Spaceghostc2c> hemanth: Good luck.
Hanmac1 is now known as Hanmac
<bnagy> hemanth: oic, yeah I assumed you had them the right way round, arguments to alias always confuse me
<Petit_Dejeuner> Spaceghostc2c, I though ruby existed to serve the programmer
<Spaceghostc2c> Petit_Dejeuner: Ruby exists for adult programmers, not immature ones.
<bnagy> it's like ln -s - no matter how many times I have used it over the years I still get it wrong every time
<hemanth> bnagy, for me to
mockra has quit [Remote host closed the connection]
<Petit_Dejeuner> Spaceghostc2c, ouch
<hemanth> Spaceghostc2c, thanks :)
<Spaceghostc2c> :D
sevvie has quit [Quit: sevvie]
<Spaceghostc2c> hemanth: No worries, friend. Happy hacking.
Chryson has quit [Quit: Leaving]
<hemanth> :)
<hemanth> ln -fs bnagy
<dg73> yeah never know whether it's source or target first when ln -s ing
<Petit_Dejeuner> I still don't quite understand what's wrong with respond_to?.
<Spaceghostc2c> It's source then dest
<hemanth> Petit_Dejeuner, nothing is wrong, it's not needed
<dg73> man page is always handy :)
<Spaceghostc2c> Petit_Dejeuner: It's asking objects if they have methods, which isn't very ducky at all.
<hemanth> s comes after d in the k.b
<hemanth> s,d :)
<Petit_Dejeuner> What's 'ducky'?
<Spaceghostc2c> Petit_Dejeuner: Duck typing.
<dg73> as my old pappie once said: 'fools remember, smart people write things down' :-D long live man pages
davidpk has joined #ruby
<bnagy> Spaceghostc2c: eh? respond_to? is the essence of duck_typing
<bnagy> but we're not talking about duck typing at all when we're defining methods in a specific class
<bnagy> I don't know why my fingers put that underscore in there
<bnagy> but mainly that approach is wrong because it's functionally equivalent to the simple alias
<Petit_Dejeuner> 'alias > respond_to?' because alias is quicker?
sevvie has joined #ruby
<bnagy> it is simple and easy to read
<hemanth> Spaceghostc2c, nice link
<Spaceghostc2c> I don't like it. It's weird and funny in a bad way. A definite code smell.
julio has joined #ruby
<hemanth> If it walks like a duck, If it quacks like a duck, it must be a duck
<bnagy> hemanth: srsly though, just fix it
<bnagy> people reading that code now are going to see each and wonder wtf is going on
<SirFunk> anyone know a good way to read/write yaml that has a more sane format than SYCK's that does junk like saving propertes as :symbols ?
<hemanth> bnagy, :{
<Petit_Dejeuner> hemanth, what exactly are you tring to make work on both versions anyway?
rippa has joined #ruby
dg73 has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<bnagy> hemanth: how are you using that construct so much anyway? Normally you'd use each_line directly on an IO
<Spaceghostc2c> bnagy: You're right. I'd say it's closer to just being ucky in general.
<hemanth> Petit_Dejeuner, there is some $hit code that has use .each assuming it will always get an array, but it does get Strings at times...so need to fix them
<hemanth> bnagy, ^
<Petit_Dejeuner> <-- confused
<bnagy> ok well fix that code
<bnagy> easy, no need to muck about in String
Xethron has left #ruby [#ruby]
<Petit_Dejeuner> Ah, but mucking about in String sound so much more enjoyable than editing and refactoring a bunch of code.
<bnagy> aliasing to create each so that type confused crap continues to work is... horrible
nadirvardar has quit [Quit: Computer has gone to sleep.]
<hemanth> :D
AlbireoX is now known as AlbireoX`Away
<Petit_Dejeuner> I wish I could do this kind of thing in Python. I could pretend Python3 is Python2.7 for years.
<Petit_Dejeuner> <-- Mediocre Programmer
<bnagy> I don't know python, but I was under the impression that Python 3 is used basically by guido and nobody else
<Petit_Dejeuner> That assumption is more or less correct.
<bnagy> GUYS! GUYS! C'MON... GUUUUYS! IT'S COOLER NOW!
<Petit_Dejeuner> I think Google might use some Python 3, what with Guido working there an all.
<Petit_Dejeuner> The only guy I know who works at Google uses 2.7 though.
<hemanth> Petit_Dejeuner, did you know, python3.1 came way before python 2.7 ;) ?
<Petit_Dejeuner> No, I did not.
nadirvardar has joined #ruby
banisterfiend has joined #ruby
<Spaceghostc2c> A later release of python 2 after python 3 came out?
Petit_Dejeuner has left #ruby ["Leaving"]
daniel_hinojosa has quit [Ping timeout: 276 seconds]
<hemanth> Spaceghostc2c, yup
julio has quit [Ping timeout: 250 seconds]
fantazo has quit [Remote host closed the connection]
<banisterfiend> hemanth: hello.
<hemanth> banisterfiend, hey! I had confused bnagy as you :D
banisterfiend has quit [Read error: Connection reset by peer]
eywu has quit [Quit: Leaving.]
ananthakumaran has quit [Quit: Leaving.]
tagrudev has joined #ruby
Xethron has joined #ruby
<bnagy> rvm is like cancer
banisterfiend has joined #ruby
<bnagy> you can cut it out, but it keeps coming back :<
oscardelben has quit [Quit: oscardelben]
<Xethron> Good morning everyone :D
<Spaceghostc2c> bnagy: Good stuff in that regard.
Banistergalaxy has quit [Ping timeout: 250 seconds]
djdb has joined #ruby
nadirvardar has quit [Quit: Computer has gone to sleep.]
cpruitt has quit [Read error: Connection reset by peer]
cpruitt has joined #ruby
<banisterfiend> bnagy: hey naggy
michaelmartinez has joined #ruby
AlbireoX`Away is now known as AlbireoX
AlbireoX is now known as AlbireoX`Away
<bnagy> morning banisterfiend
<bnagy> ok afternoon
<banisterfiend> bnagy: evening here
<banisterfiend> bnagy: hey benjamin
<bnagy> 1815 isn't evening yet
<banisterfiend> bnagy: areyou still in singapore?
<bnagy> no, chiangmai
maletor has joined #ruby
uris has quit [Quit: leaving]
<bnagy> in thai, the day is divided into 6 hour sections, so 1 tum would be 1 in the evening, which is 7pm
<bnagy> therefore evening officially starts at 7, qed
sevvie has quit [Quit: sevvie]
Eldariof-ru has quit []
mrdodo has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
banisterfiend has joined #ruby
nooodl has joined #ruby
jumpingcloud has joined #ruby
vectorshelve has quit [Quit: Page closed]
<jumpingcloud> hey
chimkan_ has quit [Quit: chimkan_]
Dreamer3 has quit [Quit: Leaving...]
Aaton_off is now known as Aaton
adamkittelson has quit [Remote host closed the connection]
ceej has joined #ruby
<ceej> hey, is there a reason ruby would think this is true? "2010-12-10 13:45:55 UTC >= 2011-02-09 12:03:22 UTC and 2010-12-10 13:45:55 UTC <= 2011-02-17 11:28:03 UTC"
<ceej> the dates are ruby date objects
Aaton is now known as Aaton_off
<banisterfiend> i can tell by your eyes that u've probably being crying for-ever
<ceej> me?
verbad has quit []
<ceej> lol… anyone? would love to go to bed before 2 am :)
<bnagy> maybe if you made your question less passive agressive and vague
iamjarvo has quit [Quit: Computer has gone to sleep.]
<ceej> maybe I shouldn't have started listing to "A Soundtrack for Coding: the 2am session by Joanna Butler'
<jumpingcloud> hey im trying to send a string to stdin. but im having problems.
<bnagy> jumpingcloud: silly rabbit, stdin is for input
goraxe has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
<ceej> bnagy what is vague? "2010-12-10 13:45:55 UTC >= 2011-02-09 12:03:22 UTC and 2010-12-10 13:45:55 UTC <= 2011-02-17 11:28:03 UTC" is coming back as true (the dates are http://www.ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/DateTime.html) I just printed what the if statement is as a string so you could see
a_a_g has joined #ruby
<bnagy> ceej: well it works correctly for me
<jumpingcloud> bnagy: but i want to send a password to ssh how would i work that one out?
<ceej> 2010-12-10 13:45:55 UTC is not greater or equal to 2011-02-09 12:03:22 UTC so it should be false....
<bnagy> so either your objects aren't what you think they are, or you're misrepresenting your code
goraxe has joined #ruby
<ceej> I'm not….
<ceej> one se
<ceej> c
<bnagy> and by passive aggressive I mean yes, clearly 2010 is not greater or equal to 2011
<bnagy> so you're implying that ruby just handles dates completely wrong, which is not the case
<bnagy> so yeah, try gist / pastie some actual code :)
Guest4802 has joined #ruby
<jumpingcloud> bnagy: so i'm looking to send to stdout?
<bnagy> jumpingcloud: try using popen3 in block form
<ceej> it's from an active record query so file.dtcreated, start_date and end_date are all Date objects
<bnagy> Date or DateTime?
Jay_Levitt has quit [Quit: Leaving...]
<bnagy> basically I would inspect those 3 dates
<bnagy> and use && not and, but that shouldn't make any difference in this case, it's just good practice
<bnagy> ok shopping time
maesbn has joined #ruby
michaelmartinez has left #ruby [#ruby]
<ceej> is there a way to inspect I did .kind_of?(Date) but it was false
<ceej> same with DateTime
<Spaceghostc2c> Uh.
<ceej> ah .class
<ceej> they are ActiveSupport::TimeWithZone
<ceej> :/
<ceej> but according to all the form posts you should be able to do exactly what I'm doing
<ceej> forum*
darren_ has quit [Remote host closed the connection]
<ceej> strange :/
<apeiros_> ceej: can you change this:
<apeiros_> ap "#{file.dtcreated} >= #{start_date} and #{file.dtcreated} <= #{end_date}"
<apeiros_> to:
<apeiros_> ap "#{file.dtcreated} >= #{start_date} && #{file.dtcreated} <= #{end_date} \#=> #{file.dtcreated >= start_date} && #{file.dtcreated <= end_date}"
<apeiros_> so we see what part of the expression is true
CaptainJet has quit []
<ceej> sure one sec
<apeiros_> also: p [file.dtcreated.class, start_date.class, end_date.class]
<apeiros_> (or ap)
<ceej> "2010-12-10 13:45:55 -0600 >= 2011-02-09 12:03:22 -0600 && 2010-12-10 13:45:55 -0600 <= 2011-02-17 11:28:03 -0600 #=> false && true"
billiamii has quit [Read error: Connection reset by peer]
<apeiros_> btw., file.dtcreated.between?(start_date, end_date) can be used too
ananthakumaran has joined #ruby
<ceej> ah didn't know about that… ty :)
<apeiros_> ok, I'd say those results are correct, no? 2010 is not >= 2011, and 2010 is <= 2011
<apeiros_> so the problem is not with <= and >=
<ceej> correct but false && true is == true because it's returning a result...
tatsuya_o has joined #ruby
<apeiros_> certainly false && true is not == true
_bart has quit [Quit: _bart]
<ceej> right...
<apeiros_> I'd replace `and` with `&&` in `file.dtcreated >= start_date and file.dtcreated <= end_date`
sgronblom has joined #ruby
<ceej> I replaced it with file.dtcreated.between? start_date, end_date same result
<apeiros_> brb
<ceej> k
foolovely has quit [Quit: Leaving]
wallerdev has quit [Quit: wallerdev]
nari has quit [Ping timeout: 248 seconds]
jimeh has joined #ruby
td123 has quit [Ping timeout: 244 seconds]
tatsuya_o has quit [Remote host closed the connection]
krz has quit [Quit: krz]
akem has quit [Ping timeout: 246 seconds]
workmad3 has joined #ruby
spinagon has joined #ruby
<ceej> so I was checking if the length of matches was > than 1… and it was passing. the reason is it creates and empty record inside [[0] []]…. any reason why that code would do that?
dhruvasagar has joined #ruby
mockra has joined #ruby
<ceej> was >= *
zodiac1111 has joined #ruby
andrewjf has quit [Quit: Lost terminal]
<ceej> I guess it's something to do with using << as += works how I expect
franckverrot has quit [Quit: Connection closed for inactivity]
rippa has quit [Ping timeout: 244 seconds]
und3f has joined #ruby
<ceej> would be interested to know why that is
mathie has joined #ruby
codezombie has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
EricKamsky_ has joined #ruby
EricKamsky has quit [Read error: Connection reset by peer]
kjellski has joined #ruby
mxweas has quit [Quit: Leaving...]
Hien has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
chichou has joined #ruby
ryanf has quit [Quit: leaving]
workmad3 has quit [Ping timeout: 244 seconds]
jarred has quit [Quit: jarred]
tatsuya_o has joined #ruby
ph^ has joined #ruby
aganov has joined #ruby
bnagy has quit [Remote host closed the connection]
hoelzro|away is now known as hoelzro
<hoelzro> ceej: << appends to the current object; += creates a new object and assigns it, iirc
rvmeier has quit [Quit: Saliendo]
<ceej> so << would add an empty object but += would because if it's empty it won't create anything?
<ceej> did you see the context? https://gist.github.com/0e2d0b05b095a24911e5
Criztian has joined #ruby
jgrevich has quit [Quit: jgrevich]
savage- has quit [Remote host closed the connection]
Rochefort has joined #ruby
TPFC-SYSTEM has joined #ruby
NimeshNeema has quit [Quit: Connection closed for inactivity]
jeff_sebring has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
aces1up has joined #ruby
dangerousdave has joined #ruby
me has joined #ruby
me is now known as Guest52301
Thomas is now known as thomas
tatsuya_o has joined #ruby
piotr_ has joined #ruby
<Hanmac> ceej wrong, your code will add an empty array
andrewhl has quit [Remote host closed the connection]
jumpingcloud has quit [Ping timeout: 252 seconds]
apok has quit [Quit: apok]
cloud|office has quit [Ping timeout: 255 seconds]
thecreators has joined #ruby
jumpingcloud has joined #ruby
ph^ has quit [Remote host closed the connection]
cezar has joined #ruby
cezar has quit [Client Quit]
yxhuvud has joined #ruby
nyuszika7h has quit [Read error: Connection reset by peer]
Eldariof-ru has joined #ruby
tiripamwe has quit [Ping timeout: 255 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
<apeiros_> ceej: Array#<< and += don't do the same thing
<apeiros_> ceej: compare: a = [1,2,3]; a << [4,5]; a # => [1,2,3,[4,5]]
tatsuya_o has quit [Remote host closed the connection]
pdelgallego has joined #ruby
<apeiros_> vs. a += [4,5]; a # => [1,2,3,4,5]
jprovazn_away is now known as jprovazn
<apeiros_> also with a << b --> x = a.object_id; a << b; x == a.object_id # => true -- the object is mutated in-place
<apeiros_> with a += b --> x = a.object_id; a += b; x == a.object_id # => false -- a *new* object is created and assigned to a
<apeiros_> it's crucial to understand those things
dangerousdave has quit [Quit: Leaving...]
Liothen has quit [Remote host closed the connection]
akem has quit [Ping timeout: 244 seconds]
<Hanmac> ceej you may look for array.push
Bofu2U has quit [Read error: Connection reset by peer]
ceej has quit [Quit: Leaving.]
Bofu2U has joined #ruby
jesly__ has joined #ruby
imami|afk is now known as banseljaj
banisterfiend` has joined #ruby
cloud|office has joined #ruby
shiki has joined #ruby
justsee is now known as justsee|away
<apeiros_> Hanmac: push and << are (mostly) the same
banisterfiend has quit [Ping timeout: 246 seconds]
elhu has joined #ruby
<apeiros_> the only difference is that push accepts multiple arguments
<apeiros_> += is closer to Array#concat than to push
lldong has quit [Remote host closed the connection]
lldong has joined #ruby
baphled has joined #ruby
Hien has quit [Quit: Lost terminal]
cantonic has joined #ruby
BiHi has joined #ruby
<Hanmac> apeiros_ array.push(*otherarray.select {}) try this with <<
beha has joined #ruby
lldong_ has joined #ruby
Hien has joined #ruby
sendoushi has joined #ruby
tiripamwe has joined #ruby
timonv has joined #ruby
<apeiros_> Hanmac: as said, that's the only difference
cantonic has quit [Client Quit]
<apeiros_> Hanmac: `09:50 apeiros_: the only difference is that push accepts multiple arguments `
<apeiros_> Hanmac: also, instead of array.push(*args) you should use array.concat(args)
justsee|away is now known as justsee
tvw has joined #ruby
lldong has quit [Ping timeout: 276 seconds]
lldong_ is now known as lldong
pdelgallego has quit [Read error: Connection reset by peer]
_bart has joined #ruby
tvw has quit [Remote host closed the connection]
akem has joined #ruby
lldong has quit [Remote host closed the connection]
lldong has joined #ruby
affix has quit [Ping timeout: 260 seconds]
akem has quit [Max SendQ exceeded]
elhu has quit [Ping timeout: 252 seconds]
sendoushi has quit [Remote host closed the connection]
elhu has joined #ruby
akem has joined #ruby
Markvilla has joined #ruby
khakimov has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
fivetwentysix has joined #ruby
pdelgallego has joined #ruby
lldong_ has joined #ruby
lldong has quit [Ping timeout: 246 seconds]
lldong_ is now known as lldong
cpruitt_ has joined #ruby
etehtsea has joined #ruby
niklasb has joined #ruby
cpruitt has quit [Ping timeout: 250 seconds]
cpruitt_ is now known as cpruitt
Draco___ has joined #ruby
Draco_ has quit [Ping timeout: 246 seconds]
<_bart> by doing a queue in a resque job before a Raise DontPerform, the job will be added to the back of the queue right?
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
cantonic has joined #ruby
chriskk has quit [Quit: chriskk]
cantonic has quit [Remote host closed the connection]
cantonic has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
dhruvasagar has joined #ruby
Speed has joined #ruby
D4T has joined #ruby
Hien has quit [Quit: Lost terminal]
Hien has joined #ruby
fabrice31 has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby
bigkm has quit [Ping timeout: 244 seconds]
Speed has quit [Ping timeout: 252 seconds]
JohnBat26 has joined #ruby
akem has quit [Read error: Connection reset by peer]
bigkm has joined #ruby
akem has joined #ruby
cloud|office has quit [Read error: Connection reset by peer]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
werdnativ has quit [Quit: werdnativ]
<shevy> if I have a file called "foo.rb", and this file has no module namespacing. Is it possible to load that code into a module, and have it reside in that?
workmad3 has joined #ruby
manizzle has quit [Read error: No route to host]
tonini has quit [Remote host closed the connection]
headius has joined #ruby
headius has quit [Client Quit]
<yxhuvud> shevy: yes, you can always load the text and eval it wherever you want.
<shevy> :(
<apeiros_> shevy: MyModule.module_eval(File.read('foo.rb'))
<apeiros_> require/load are just fancy evals anyway, so no need to be afraid of eval
<shevy> hmm interesting
<banisterfiend`> shevy: hey shevy
<shevy> banisterfiend` hi
<banisterfiend`> apeiros_: also good to do: "foo.rb", 1
<banisterfiend`> IMO
tatsuya_o has joined #ruby
<banisterfiend`> so that source_locaiton works
khakimov has quit [Quit: Computer has gone to sleep.]
mengu has joined #ruby
bullicon has joined #ruby
nilg has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
JohnBat26 has joined #ruby
Draco___ has quit [Remote host closed the connection]
akem has quit [Ping timeout: 250 seconds]
mathie has quit [Quit: Bye!]
lkba has quit [Quit: Bye]
mahmoudimus has quit [Client Quit]
akem has joined #ruby
<apeiros_> banisterfiend`: yeah, sure. though the 1 is afaik default
<banisterfiend`> apeiros_: ah ok
sendoushi has joined #ruby
JustinCampbell has quit [Read error: Connection reset by peer]
jesly__ has quit [Ping timeout: 246 seconds]
JustinCampbell has joined #ruby
justsee is now known as justsee|away
lobak has quit [Quit: No Ping reply in 180 seconds.]
heftig has joined #ruby
lobak has joined #ruby
<apeiros_> would be nice if the eval's would accept an IO too and would just read out the name from the IO object (if applicable)
berserkr has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
<Hanmac> and it would be nice if Binding.eval accept and block too
<DefV> 16
sendoushi has quit [Remote host closed the connection]
<apeiros_> Hanmac: +1
<apeiros_> the evals in ruby are messy
akem has quit [Read error: Connection reset by peer]
<Mon_Ouie> That wouldn't work for all local variables though
<apeiros_> I want my universal_eval. banisterfiend`, why don't you write it? :(
akem has joined #ruby
<banisterfiend`> apeiros_: i tried to write it once but i realized it needed to be a patch rather than an extensino
<apeiros_> universal_eval code, constants: Object, locals: binding, ivars: obj, cvars: klass
<banisterfiend`> Mon_Ouie: hey monny :)
<Mon_Ouie> 'alut
<apeiros_> banisterfiend`: aw :(
<banisterfiend`> apeiros_: yeah, i was working on exactly taht :P
jumpingcloud has quit [Read error: Operation timed out]
vectorshelve has joined #ruby
ghaydarov has joined #ruby
<vectorshelve> can anyone tell me the design pattern used in this small ruby application ? https://github.com/fj/thoughtworks-sales-tax
<banisterfiend`> vectorshelve: dont cross-post, piggy
<vectorshelve> banisterfiend`: it's not cross post as long as it's the same technology room and u wanna have a larger reach
Simon2 has joined #ruby
<banisterfiend`> vectorshelve: you posted the same Q on #ruby and #ruby-lang :) if u do it i'll have u arrested
<banisterfiend`> do it again*
vectorshelve was kicked from #ruby by apeiros_ [told you so many times…]
ph^ has joined #ruby
<shevy> hi vectorshelve welcome back
<apeiros_> of course it's cross-posting… d'uh
vectorshelve has joined #ruby
<ghaydarov> vectorshelve: I dont know the pattern but this was helpful thanks for the link
<vectorshelve> ghaydarov: np
akem has quit [Read error: Connection reset by peer]
Simon2 has quit [Read error: Connection reset by peer]
akem has joined #ruby
Simon2 has joined #ruby
ramblex has joined #ruby
ph^ has quit [Remote host closed the connection]
nyuszika7h has joined #ruby
niklasb has quit [Quit: WeeChat 0.3.8]
jumpingcloud has joined #ruby
arturaz has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby
Vert has joined #ruby
jesly__ has joined #ruby
niklasb has joined #ruby
bier has joined #ruby
flype has joined #ruby
<_bart> What's the difference between the #ruby and #ruby-lang channel?
pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
<hemanth> _bart, -lang?
jesly__ has quit [Ping timeout: 246 seconds]
<_bart> haha I mean, why are there two ruby channels
<_bart> it makes no sense
_pdelgallego has joined #ruby
<hemanth> http://h3manth.com/content/stringeach-missing-ruby19 vectorshelve checkit out
pdelgallego has quit [Read error: Connection reset by peer]
_pdelgallego_ has joined #ruby
_pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
<vectorshelve> hemanth: make that a commit to ruby
pdelgallego has quit [Read error: Connection reset by peer]
<banisterfiend`> hemanth: as zenspider says, that blog post is about 4 years late :P and we've all already figured it out ourselves already :)
pdelgallego has joined #ruby
<hemanth> banisterfiend`, heh heh :)
<_bart> released a new resque gem/plugin! https://github.com/bartolsthoorn/resque-workers-lock
<hemanth> vectorshelve, ^^
<banisterfiend`> hemanth: basically, people have have to maintain 1.8 compatibility have already figured it out, and people who dont, dont care ;)
jjang has quit [Remote host closed the connection]
Spooner has joined #ruby
<banisterfiend`> who have to*
jjang has joined #ruby
ph^ has joined #ruby
<hemanth> banisterfiend`, very true, was on 1.8 till now...
<vectorshelve> hemanth: who did the project u involved in it ?
nu7hatch has left #ruby [#ruby]
<vectorshelve> hemanth: sorry that wasnt for you :)
<hemanth> banisterfiend`, there is nothing wrong in being tardy, it's all about learning :D
DarthGandalf has quit [Ping timeout: 260 seconds]
_pdelgallego_ has quit [Ping timeout: 246 seconds]
<vectorshelve> hemanth: ??
<hemanth> ??
dangerousdave has joined #ruby
sterNiX has quit [Excess Flood]
und3f has quit [Quit: Leaving.]
<vectorshelve> hemanth: no new gems ? :)
<hemanth> vectorshelve, busy with work, will have do port some C this time :)
<vectorshelve> hemanth: that will be great... Long Live C :)
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
<hemanth> ☕ please
<vectorshelve> hemanth: candle ? :)
<hemanth> vectorshelve, lol coffee
ghaydarov has quit [Read error: Connection reset by peer]
ghaydarov has joined #ruby
<vectorshelve> hemanth: lol.. it looks like a candle.. my eyes could hardly decode it...
<vectorshelve> hemanth: thanks by the way... cheers
vlad_starkov has quit [Remote host closed the connection]
<hemanth> banisterfiend`, for the quilt of being very late, i need to blog about something latest...suggestions ;)?
<vectorshelve> hemanth: big data, jelly bean, windows 8 :)
<banisterfiend`> hemanth: https://github.com/kyrylo/pry-theme
<hemanth> M$ $ucks
akem has quit [Ping timeout: 252 seconds]
tvw has joined #ruby
<hemanth> banisterfiend`, so you are suggesting to blog about that? BTW my current console theme is solarized :)
mfridh has joined #ruby
TheTFEF has quit [Read error: Connection reset by peer]
<hemanth> banisterfiend`, what to blog about that?
<banisterfiend`> hemanth: that it's awesome :)
banseljaj is now known as imami|afk
<banisterfiend`> it's pretty cool :)
TheTFEF has joined #ruby
<hemanth> https://github.com/kyrylo/pry-theme itself has sufficient data in it; what shall i blog :\
<forestbird> is it somehow possible to define arrays using a range? so instead of: a = [], b = [] etc. something like a...z *magic* []
<shevy> forestbird you can convert a range to an array
ramblex has quit [Ping timeout: 250 seconds]
<banisterfiend`> forestbird: Array('a'..'z')
vlad_starkov has joined #ruby
<banisterfiend`> forestbird: or: ('a'..'z').to_a
<shevy> array = (1..20).to_a # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
<shevy> forestbird funny that your question almost included the answer to your question ;)
<forestbird> no, i didn't mean it like hat...
<Tasser> forestbird, [*'a'..'z'] ?
habib has joined #ruby
nyuszika7h has quit [Ping timeout: 246 seconds]
<Tasser> forestbird, as in variable names? you're doing something wrong
<Tasser> forestbird, use a hash
<forestbird> yeah as names... it's just curosity :)
Morkel has quit [Quit: Morkel]
<habib> Hi everyone. why after "sudo gem install gosu" ruby says tuex.rb:1:in `require': no such file to load -- gosu (LoadError)????
<Tasser> forestbird, it's a bad pattern. if you want a programatically available namespace, use a hash
<banisterfiend`> habib: require 'rubygems' first
<habib> banisterfiend`, thnx i'll try
strnx has joined #ruby
<forestbird> Tasser: sure, it's bad, but i'd like to know if it's possible, nothing more :)
<banisterfiend`> forestbird: still dont quite know what u're trying to do
<habib> banisterfiend`, thnx it worked!))))))
justinmcp has joined #ruby
<Tasser> forestbird, probably with eval
danielpunt has joined #ruby
<forestbird> Tasser: ok, so probably i'll just leave it :)
<Tasser> banisterfiend`, he wants to define local variables programatically
Rochefort has quit [Remote host closed the connection]
<banisterfiend`> Tasser: i thoguht it had something to do with a rang
mathie has joined #ruby
<banisterfiend`> nm
<banisterfiend`> i get it
<Mon_Ouie> It's not actually possible anyway — you'd need to be using eval to access them for both reading and writing
nyuszika7h has joined #ruby
ZachBeta has joined #ruby
<forestbird> allright, thanks for thinking about it :)
<habib> is there a way to show code to u?
<habib> i need to show code to ask about it
<Muz> gist.github.com, pastie.com
<Tasser> habib, pastebin?
<banisterfiend`> habib: gist
<Muz> www.pastie.org even, sorry.
<habib> thnx
liluo has quit [Remote host closed the connection]
<Tasser> banisterfiend`, I happen to dislike gist, since it requires to to put some PW into an env variable...
Simon2 has quit [Read error: Operation timed out]
<banisterfiend`> Tasser: pry's jist doesnt require that anymore
Simon2 has joined #ruby
<Tasser> banisterfiend`, huh? how do you do the auth?
[Neurotic] has quit [Quit: Leaving]
<habib> thnx!!!
<banisterfiend`> Tasser: it uses some oauth system
<Mon_Ouie> Btw, the install-command in Pry doesn't seem to install gems in the right place
<banisterfiend`> Mon_Ouie: works 4 me, what happens when u try it
<Mon_Ouie> I mean, it doesn't use the --user-install flag that I set in my gemrc
<habib> why it says "unknown method" for require_relative???
<banisterfiend`> Mon_Ouie: oh ok, we just use the rubygems api, i guess we should respect .gemrc
<Mon_Ouie> habib: You're using Ruby 1.8
<habib> yeah
<habib> 1.8.7
<banisterfiend`> Mon_Ouie: can u file an issue about that
<habib> is it wrong version for this?
fermion has joined #ruby
x0F has quit [Disconnected by services]
<Tasser> banisterfiend`, ah right, but their official gist doesn't use it? O.o
x0F_ has joined #ruby
x0F_ is now known as x0F
<banisterfiend`> Tasser: their official gist is unmaintained and broken
<banisterfiend`> Tasser: use 'jist' instead
chussenot has joined #ruby
<habib> Mon_Ouie, doesn't 1.8.7 support require_relative?
<Hanmac> no
<habib> and 1.9.3
<habib> ?
<Tasser> banisterfiend`, thanks
<Hanmac> require_relative only exist in 1.9.+
<habib> oh
<habib> thn
<habib> thnx!
<Spooner> There is a gem for it though, habib (in 1.8.7)
robozahn has joined #ruby
<banisterfiend`> Tasser: np tell your frens
<habib> Spooner, which one?
greyEAX has joined #ruby
<Spooner> require 'require_relative' :)
chussenot_ has joined #ruby
vlad_starkov has quit [Ping timeout: 252 seconds]
<Spooner> Well, gem install require_relative first, obviously.
vlad_starkov has joined #ruby
<habib> )))) thnx. but now i'm ununstalling 1.8.7
<Spooner> Well done :)
<habib> i'll install 193
<banisterfiend`> habib: r u in windows?
cloud|office has joined #ruby
ph^ has quit [Remote host closed the connection]
Foxandxss has joined #ruby
Progster has joined #ruby
Bofu has joined #ruby
ramblex has joined #ruby
tiripamwe has quit [Ping timeout: 244 seconds]
Bofu2U has quit [Ping timeout: 244 seconds]
<kjellski> When I use CGI.excape("Küche"), this is printed as K%C3%BCche, but when I use this to be joined with '+' in an url, why is it converted to K\\xC3\\xBCche ???
<kjellski> the % is encoded another time?
DarthGandalf has joined #ruby
shiki has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 244 seconds]
<heftig> kjellski: i can't reproduce that
<kjellski> heftig: sorry… I just saw it was encoded by csv in the first place… do you know an encoding option for the csv gem?
<heftig> no
nu7hatch has joined #ruby
g0rd0n has joined #ruby
nmarques has joined #ruby
<nmarques> anyone can help me with a small issue building ruby
berserkr has quit [Quit: Leaving.]
pskosinski has joined #ruby
<Tasser> is there a way for Array#- without the set part?
<Tasser> aka I'd like it not to uniq, rather remove one from the left side per item on the right one
federic has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
venkatk_ has joined #ruby
<Spooner> tasser: I think => a.delete_if {|e| b.delete e }
nmarques has left #ruby ["Leaving"]
<Spooner> a = [1, 1, 2, 3]; b = [1, 2]; a.delete_if {|e| b.delete e } #=> [1, 3]
<Tasser> Spooner, http://sprunge.us/IQXP
Axsuul has quit [Ping timeout: 255 seconds]
<Spooner> You need delete_if! if you want to modify-in-place
<Tasser> stupid me ^^
<workmad3> Tasser: or a.delete_at(a.index(item))
<Spooner> And you want to copy b really, now I think about it, if you don't want that messed up.
<Tasser> Spooner, ehm, delete_if deletes in-place already
<Spooner> OH right, sorry.
<workmad3> Tasser: so items_to_delete.each {|i| ary.delete_at(ary.index(i))}
<Spooner> Ah yeah, better.
justsee|away is now known as justsee
dhruvasagar has quit [Ping timeout: 246 seconds]
<Tasser> workmad3, from the numbers, it works as expected
<workmad3> Tasser: you need to handle the case of the item you want to delete not existing though
<workmad3> Tasser: because index returns nil at that point, and delete_at(nil) throws a conversion error
<apeiros_> lut = Hash.new(0); items_to_delete.each do |e| lut[e] += 1 end; (ary.length-1).downto(0) do |i| if lut[i] > 0; lut[i] -= 1; ary.delete_at(i); end end
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<Tasser> workmad3, won't happen
<workmad3> Tasser: cool, always good when you don't need to handle that :)
<apeiros_> O(n) instead of O(n*m). don't know whether it's worth it.
<Tasser> workmad3, I'd add a rescue nil and a compact :-)
<Tasser> it's a small scripty after all
<Tasser> apeiros_, I'll run it on the server if it's too slow for my machine
<workmad3> apeiros_: :)
<workmad3> apeiros_: wait... I'm not sure that works
Rochefort has joined #ruby
<apeiros_> workmad3: it's probabilistic. whether it works is determined at the time of observation…
<Tasser> apeiros_, huh?
<workmad3> apeiros_: heh
<apeiros_> what's your doubt?
<workmad3> apeiros_: items_to_delete doesn't contain the indices of the items you want to delete
monkegjinni has joined #ruby
<workmad3> apeiros_: but that's what you're then using them as in the second loop
<apeiros_> workmad3: I don't use it that way
<Tasser> workmad3, the items itself are the indices, it's a hash
<apeiros_> workmad3: na, items_to_delete is the array with the items to delete. ary is the array from which to delete.
<workmad3> apeiros_: yes, I kunderstand that
<apeiros_> I iterate over ary in reverse order
<apeiros_> and delete at the current index if the item is to be deleted
<workmad3> d'oh, yeah, sorry
<Tasser> apeiros_, why the reverse order?
<apeiros_> because deletion changes index
<workmad3> apeiros_: actually, no, I am right
<apeiros_> but that means items are deleted from the right side :(
<workmad3> apeiros_: lut[i] looks up in the hash using the index, not the item
<apeiros_> workmad3: ah, lut[i] is wrong, yes
<workmad3> apeiros_: you need to do a reversed each_with_index
<apeiros_> lut = Hash.new(0); items_to_delete.each do |e| lut[e] += 1 end; (ary.length-1).downto(0) do |i| e=ary.at(i); if lut[e] > 0; lut[e] -= 1; ary.delete_at(i); end end
<workmad3> apeiros_: :)
<apeiros_> now if you want to delete from the left, you'll have to change the algorithm :-/
elhu has quit [Ping timeout: 276 seconds]
<workmad3> apeiros_: wondering... why ary.at(i) instead of just ary[i]? :)
sgronblom has quit [Ping timeout: 246 seconds]
<workmad3> but yeah, O(n+m) (so O(N) ) instead of O(n*m) :)
elhu has joined #ruby
<workmad3> but more memory used and not as easy to follow...
mohits has quit [Quit: Leaving]
Simon2 has quit [Ping timeout: 246 seconds]
<apeiros_> https://gist.github.com/3175552 - excuse the tabs, my sublime isn't yet completely set up
<apeiros_> this one deletes from the left side
<apeiros_> workmad3: ary.at(i) is *slightly* faster. it doesn't have to check the argument count & type
Simon2 has joined #ruby
<workmad3> apeiros_: hmm, interesting
sixteneighty has joined #ruby
<Mon_Ouie> That's why I like Smalltalk-like method names better: instead of writing code to parse your arguments, different methods will be called
<workmad3> apeiros_: again though... not sure your monkey-patchs work quite right... remove only gives you back an array of items you want to be removed, and remove! will change your array to be the items you wanted to remove...
<apeiros_> Mon_Ouie: is that the part which objC copied?
<Mon_Ouie> Yeah
<apeiros_> workmad3: gah
ZachBeta has quit [Quit: Computer has gone to sleep.]
<workmad3> apeiros_: there aren't ! versions of delete btw... they always modify in place :)
<apeiros_> of course, with this changed one, the << must be in the else
<apeiros_> workmad3: Array#- isn't in-place
<Mon_Ouie> Unless you mean, explicitly specifying the class of every argument like Cocoa does (like componentsSeperatedByString: instead of split:)
<workmad3> apeiros_: ah, good point... and yeah, that works now :)
danielpunt has quit [Remote host closed the connection]
<apeiros_> and now with spaces instead of tabs, too
arietis has joined #ruby
<workmad3> Mon_Ouie: I have to admit, I do miss polymorphic method calls from C++ and java at times
fivetwentysix has quit [Quit: fivetwentysix]
<apeiros_> Mon_Ouie: I've mixed feelings about that
<apeiros_> somehow I like the idea
<apeiros_> somehow I'm not sure. I'd probably have to use a language which does that for a while to meaningfully judge it
sgronblom has joined #ruby
dhruvasagar has joined #ruby
vectorshelve has quit [Quit: Page closed]
kevinbond has joined #ruby
Criztian has quit []
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
blacktulip has quit [Ping timeout: 252 seconds]
jjang has quit [Remote host closed the connection]
k_89 has quit [Ping timeout: 255 seconds]
a_a_g has quit [Quit: Leaving.]
monkegjinni has quit [Remote host closed the connection]
kevinbond has quit [Quit: kevinbond]
bullicon has quit [Quit: Computer has gone to sleep.]
seitensei has joined #ruby
jeff_sebring has quit [Quit: Leaving]
fbernier has joined #ruby
jesly__ has joined #ruby
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
monkegjinni has joined #ruby
Speed has quit [Remote host closed the connection]
k_89 has joined #ruby
kvirani has joined #ruby
<_bart> Will the Redis database empty itself after reboot?
awarner has joined #ruby
gryllida is now known as gry
Simon3 has joined #ruby
awarner has quit [Remote host closed the connection]
<Tasser> _bart, does this look like a redis channel?
<banisterfiend`> Tasser: hey
Simon2 has quit [Ping timeout: 255 seconds]
stefano_ has left #ruby [#ruby]
<Tasser> banisterfiend`, got some bullshit for me? need to add some more text to this paper here
<banisterfiend`> Tasser: what's the topic
davidpk has joined #ruby
baphled has quit [Ping timeout: 246 seconds]
baphled has joined #ruby
<Tasser> banisterfiend`, bacon
<Tasser> ehh, natural language processing
<banisterfiend`> Tasser: there's videos on that topic on coursera
<banisterfiend`> probably all u need
<kjellski> what is the best way in ruby to log onto a website and authenticate with username and password in order to then process pages with nokogiri that need the authentication?
<Tasser> banisterfiend`, this is pretty specific
yekta has quit [Quit: yekta]
<Tasser> kjellski, mechanize
<Tasser> kjellski, if it's too much work, curb
<kjellski> Tasser: I'll just look them up, thanks a lot for the hint
mathie has quit [Quit: Sleeping...]
indian has joined #ruby
indian has quit [Changing host]
indian has joined #ruby
<Tasser> kjellski, err, mechanize is more for consecutive, curb for single requests
<kjellski> Tasser: I see it right now… =) thanks
<banisterfiend`> indian: hey, ltns
pskosinski has quit [Ping timeout: 244 seconds]
<indian> hey banisterfiend`
<indian> still watching those Indian clips on youtube
<banisterfiend`> indian: i turned into one, now i'm an indian clip on youtube watching myself typing stuff on irc to u
<indian> lol
dhruvasagar has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby
Progster has joined #ruby
baphled has quit [Ping timeout: 255 seconds]
uris has joined #ruby
<shevy> lol
nyuszika7h has joined #ruby
<shevy> banister is bored a lot these days
ZachBeta has joined #ruby
mathie has joined #ruby
Markvilla has quit [Quit: Markvilla]
strife25 has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<habib> hey. i'm trying to install ruby from source?
<Tasser> habib, why would you?
<habib> i've downloaded a source of ruby and don't know how to install it
cloud|office has quit [Read error: Connection reset by peer]
<habib> why wouldn't i?))))
BiHi has joined #ruby
<workmad3> habib: rvm or ruby-build are your friends
<habib> workmad3, thnx i'll try)
erichmenge has joined #ruby
<kalleth> \o~
<kalleth> workmad3: rbenv?
uris has quit [Read error: Connection reset by peer]
uris has joined #ruby
<shevy> anyone adding a lot of comments to his ruby code?
<shevy> habib, what is the name of the thing you downloaded
<shevy> "bla-something" <-- what is that name
Simon3 has quit [Ping timeout: 246 seconds]
iamjarvo has joined #ruby
<workmad3> kalleth: rbenv doesn't build ruby
<habib> shevy, ruby-1.9.3-p194
<habib> tar.gz
<apeiros_> shevy: on serious projects I think I have about half as much comments as code
tommyvyo has joined #ruby
pskosinski has joined #ruby
<shevy> habib ok "tar zxvf ruby*tar.gz", then "cd ruby*", then try "./configure --prefix=/usr" or use another prefix if you want to
<shevy> apeiros_, whoa, that's a lot
NimeshNeema has joined #ruby
<JonnieCache> thats into the territory of writing the documentation in the source though, so its kinda different
<kalleth> workmad3: oh, right
<shevy> well I find myself write more and more comments, but in a strange way
<shevy> def foo
<shevy> cleanup # Must do cleanup here, else the successive methods would fail
<shevy> feed_the_cat
<shevy> end
<workmad3> shevy: that's not strange... comments should give why you're doing something IMO
<workmad3> shevy: I'll add comments like that when I can't make it clear in plain code why I'm doing something :)
fbernier has quit [Ping timeout: 246 seconds]
stoffus has joined #ruby
piotr__ has joined #ruby
<JonnieCache> anyone who is a fan of JS Bach and also synthesizers, check this out: https://soundcloud.com/stretta/as-clean-as-fire-1
<JonnieCache> amazing stuff
piotr_ has quit [Ping timeout: 246 seconds]
niklasb has quit [Quit: WeeChat 0.3.8]
<kjellski> Tasser: Thanks for mentioning mechanize, I've been able to login to the page. Is it possible to then just use the same agent to directly visit another page under the same domain, and if so how? Am I missing a visit method or something?
<Tasser> j
<kjellski> Tasser: is j the method?
<Tasser> kjellski, ehh
blacktulip has joined #ruby
<kjellski> Tasser: that was a vim command right? ^^
<Tasser> kjellski, the enter isn't
niklasb has joined #ruby
<kjellski> Tasser: ;)
ZachBeta has quit [Quit: Computer has gone to sleep.]
strnx has quit [Excess Flood]
<habib> shevy, what is zxvf?
strnx has joined #ruby
<shevy> habib options given to the program "tar"
<canton7> flags to tar. z = archive is compressed with gzip. x = extract. v = verbose. f = the next argument is the archive to extract
<habib> shevy, lol ok)))
<habib> shevy, when "./configure" do i need sudo?
<Tasser> habib, you shouldn't
<habib> ok thnx
<habib> ok i did it
<habib> now i'm trying ruby-v
<shevy> habib sudo is only needed during "make install"
<habib> and it says no such file or directory
<shevy> but I pasted a longer "./configure" line ;)
<shevy> yes
<shevy> after "configure" comes "make" then "make install"
<habib> canton7, thnx
<shevy> but ensure that configure gave you no error
bullicon has joined #ruby
<habib> how to ensure it?
<habib> read terminal out?
<shevy> well, if there would be an error
<shevy> yeah
JustinCampbell has quit [Remote host closed the connection]
<shevy> if there would be an error, it would tell you on the terminal
<shevy> if not, then usually there is no error. 95% chance for that then :P
<shevy> then do "make"
JustinCampbell has joined #ruby
<habib> it's ok. no errors
<shevy> this will give you the ruby binary in the current directory (or in bin/ subdirectory there)
<habib> how to make
<shevy> ok do make now
<shevy> "make"
Morkel has joined #ruby
<habib> making
<habib> it's compiling files
<shevy> good
<habib> ыешдд сщьзшдштп)
<habib> still compiling)
arkiver has joined #ruby
theRoUS has quit [Ping timeout: 252 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<habib> failed to configure dl/win32
beakerman has joined #ruby
<habib> there are few things it failed to configure and it says it won't be installed
pskosinski has quit [Remote host closed the connection]
justinmcp has quit [Remote host closed the connection]
<shevy> habib dl/win32 is only needed on windows
<shevy> habib, if the error means that it interrupt, copy paste this to pastie.org
bigkm has quit [Quit: Computer has gone to sleep.]
<shevy> you may need yaml for psych.rb
<shevy> otherwise it gives you this annoying warning about libyaml not found
bigkm has joined #ruby
pskosinski has joined #ruby
cakehero has joined #ruby
fantazo has joined #ruby
<banisterfiend`> habib: what language were u speaking here: ыешдд сщьзшдштп
<Muz> That looks like an attempt to write English with a Russian keymap.
<banisterfiend`> Muz: you're russian?
<Muz> No.
tommyvyo has joined #ruby
Poapfel has quit [Ping timeout: 245 seconds]
<shevy> I could not even read those characters
<shevy> habib sounds arabic :)
<Muz> They're all cyrillic.
Jay_Levitt has joined #ruby
<Muz> "Yesdd cshbzsdstp"
<Muz> I think. Been a while since I last tried learning the cyrillic alphabet for transliteration purposes.
<shevy> Muz Muz Muuuuuuuuuuuuuz!
<Muz> Hm?
sailias has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
<shevy> just having fun :)
nwest has joined #ruby
lldong has quit [Remote host closed the connection]
lldong has joined #ruby
<habib> it was russian)
Guest4802 is now known as Jackneill
Jackneill has quit [Changing host]
Jackneill has joined #ruby
<habib> so. it's made
<Muz> Useless trivia: Russian's often type smileys without "eyes" because a colon is a pain in the arse to produce from a russian keymap.
<habib> what then
<Muz> Argh, superfluous apostrophe.
Petit_Dejeuner has joined #ruby
<habib> when we type english we use the same keymap like u do
<habib> so no sense
<Muz> Cultural, and habitual hangover.
<habib> just used to type smiles that way cos more emotional mustbe
<shevy> habib well. you could do "make install"
<habib> ok
<shevy> that will install or rather copy the files to the --prefix option you gave
<shevy> or "sudo make install2
<shevy> or "sudo make install"
<shevy> damn keyboard fail today
<shevy> or, you could run it directly in the directory
<habib> result is "make: *** [do-install-all] error 1"
<shevy> like via ./bin/irb or bin/irb
<habib> ruby - v => no such file etc
<shevy> I dont see the error there
<shevy> no
<shevy> it is
<habib> ruby -v
<shevy> ruby -v
<habib> yeah
<shevy> and it works only if ruby is in your $PATH
<shevy> try: bin/ruby -v
<habib> same
fbernier has joined #ruby
cousine has joined #ruby
<habib> shevy, bts where to look for it
<Petit_Dejeuner> weird, does irb work?
jrajav has joined #ruby
<habib> btw
<shevy> habib did "make" finish without errors?
<habib> yeah it did
<habib> and make install did with error 1
<shevy> can you use pastie.org, 10 lines from the error "make install"
<habib> Petit_Dejeuner, and no irb
<habib> yeah
<shevy> if "make" finished, then you must have ruby and irb in bin/ habib
MikeWorth has joined #ruby
<banisterfiend`> habib: In English layout in order to type a ";" you press "Shift+;". In Russian layout you press "Shift+6". You can often see Russians typing like this: "haha, funny joke)))))", where ")))))" part means retarded smilies.
<Petit_Dejeuner> like '!111!!!11'?
<banisterfiend`> *to type a ":"
julio has joined #ruby
<MikeWorth> I'm trying to use readline to read to the first instance of either a space or a newline; it doesn't appear to support regexp, is there a way to do this?
<habib> yeah but here i'm typing in english not russian
bluOxigen has quit [Read error: Connection reset by peer]
<shevy> the error says "Permission denied"
bluOxigen has joined #ruby
<hoelzro> MikeWorth: could you just put the terminal in raw mode, and read a key at a time?
<habib> so i need to do this with sudo?
<shevy> your current user profile has not enough permission to do this action habib
<JonnieCache> make install usually needs sudo
<shevy> habib, that would be one way. or become superuser and go wild :D
yekta has joined #ruby
<habib> now that's worked with sudo
<MikeWorth> hoelzro: I'm reading tcp data from rsyslog using the relp protocol; I can't dictate what will be sent, only how I read it
<JonnieCache> either that or rerun ./configure with a --prefix that you can write to
<shevy> and "ruby -v" works now?
<Petit_Dejeuner> mikalv, is there a ruby version of getchar()?
<habib> thnx for all))))))
<habib> yeah ruby -v worked
<shevy> he did those ) smileys
<shevy> :P
<habib> haha
yekta has quit [Client Quit]
linoj has joined #ruby
<shevy> well, good!
<shevy> you could even install into your $HOME dir, then you would not need to use sudo
<habib> yeah i did. when we type ":)" it means a smile and when "))))))))" it means happiness gladness and so on)))
<hoelzro> MikeWorth: so you're not reading from a terminal, but from a socket?
<MikeWorth> hoelzro: yes, the class is TCPSocket
xorgnak has quit [Remote host closed the connection]
<hoelzro> MikeWorth: can't you read a character at a time from it?
k_89 has quit [Ping timeout: 250 seconds]
<MikeWorth> hoelzro: so manually read characters one at a time and assemble the string manually?
<Petit_Dejeuner> Sounds ineffecient, maybe keep a list of characters?
<Petit_Dejeuner> Wait, I'm thinking in Java
<Petit_Dejeuner> ignore me
<Petit_Dejeuner> Strings are mutable so it wouldn't matter, right?
<JonnieCache> yep
<hoelzro> MikeWorth: yeah
Markvilla has joined #ruby
mdickens has joined #ruby
<MikeWorth> hmm, ok then. Thanks for your help
sepp2k has quit [Ping timeout: 246 seconds]
sailias has quit [Quit: Leaving.]
MikeWorth has left #ruby ["Leaving"]
devdazed has quit [Quit: Bye]
Gavilan has left #ruby [#ruby]
mvangala has joined #ruby
und3f has joined #ruby
lorandi has joined #ruby
verbad has joined #ruby
noyb has quit [Quit: Leaving.]
hoelzro is now known as hoelzro|away
mvangala_ has quit [Read error: Connection reset by peer]
jgarvey has joined #ruby
prateekp has joined #ruby
<prateekp> i have got html content of wikipedia page ... and also the ruby command that generated that content ... now if i embed this ruby code in an html file will that prints out the whole html code
flype has joined #ruby
Berglund has joined #ruby
qko_ has joined #ruby
<banisterfiend`> prateekp: wtf is up with yoru nickname
<prateekp> why ?
<prateekp> what ?
<banisterfiend`> "prateekp" one of the weirdest sounding words i've read in a while
Berglund has quit [Client Quit]
<Petit_Dejeuner> Says someone named banisterfiend
<JonnieCache> looks like a transliterated name
<JonnieCache> indian?
flype has quit [Client Quit]
flype has joined #ruby
sspiff has quit [Read error: Connection reset by peer]
<prateekp> yes indian
<prateekp> i have got html content of wikipedia page ... and also the ruby command that generated that content ... now if i embed this ruby code in an html file will that prints out the whole html code
sspiff has joined #ruby
jhunter has quit [Ping timeout: 264 seconds]
blast_hardcheese has quit [Ping timeout: 264 seconds]
xorspark has quit [Ping timeout: 264 seconds]
jhunter has joined #ruby
qko has quit [Ping timeout: 264 seconds]
xorspark has joined #ruby
kpshek has joined #ruby
dv310p3r has joined #ruby
<prateekp> i have got html content of wikipedia page ... and also the ruby command that generated that content ... now if i embed this ruby code in an html file will that prints out the whole html code
<prateekp> what is html_safe
<JonnieCache> thats rails' xss protection
federic has quit [Remote host closed the connection]
sepp2k has joined #ruby
deryl has joined #ruby
<kalleth> prateekp: <%= raw my_variable_containing_html_code %> will use the raw html
leoncamel has joined #ruby
<kalleth> if you don't want it turning < into &lt; etc
<kalleth> :)
<kalleth> wait
<kalleth> i see no mention of rails
* kalleth goes back to sleep
daniel_hinojosa has joined #ruby
jrist-afk is now known as jrist
deryl has quit [Read error: Connection reset by peer]
fermion has quit [Quit: P]
manolo has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
deryl has joined #ruby
blast_hardcheese has joined #ruby
stoffus has quit []
chussenot_ has quit [Quit: chussenot_]
hoelzro|away is now known as hoelzro
kvirani has quit [Remote host closed the connection]
chussenot_ has joined #ruby
bbttxu has joined #ruby
ryannielson has joined #ruby
nateberkopec has joined #ruby
krusty_ar has joined #ruby
linoj_ has joined #ruby
kiela has joined #ruby
axl_ has joined #ruby
milestone has joined #ruby
<milestone> hi is module Streamline included in rails now, or is that a framework on top of rails? I have googled, but only found references to streamlinedframework.org, but that is no longer maintained ...
davidpk has joined #ruby
linoj has quit [Ping timeout: 246 seconds]
linoj_ is now known as linoj
arturaz has quit [Ping timeout: 246 seconds]
uris has quit [Quit: rails]
krusty_ar has quit [Read error: Operation timed out]
krusty_ar has joined #ruby
mrFrog has joined #ruby
reuf has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
mucker has joined #ruby
fermion has joined #ruby
samuel02 has joined #ruby
justsee is now known as justsee|away
<Tasser> milestone, #rubyonrails
reuf has quit [Client Quit]
samuel02 has quit [Remote host closed the connection]
JustinCampbell has quit [Remote host closed the connection]
JustinCampbell has joined #ruby
lldong_ has joined #ruby
mrFrog has left #ruby [#ruby]
minijupe has joined #ruby
canton7 has quit [Remote host closed the connection]
mneorr has joined #ruby
joshman_ has joined #ruby
lldong has quit [Ping timeout: 246 seconds]
lldong_ is now known as lldong
bowlowni has joined #ruby
<milestone> Tasser: thx
andrewhl has joined #ruby
lldong has left #ruby [#ruby]
pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
leoncamel has quit [Ping timeout: 246 seconds]
lolmaus has quit []
und3f has quit [Quit: Leaving.]
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Rochefort has quit [Read error: Connection reset by peer]
Rochefort has joined #ruby
<Tasser> is there something nice to convert an array of hashes to a hash of arrays?
habib has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<apeiros_> o0
cakehero has joined #ruby
<apeiros_> map!
xaq has joined #ruby
beha has quit [Ping timeout: 252 seconds]
jumpingcloud has quit [Ping timeout: 252 seconds]
<Tasser> huh?
dhruvasagar has quit [Ping timeout: 244 seconds]
<hoelzro> you could probably do it using inject
sailias has joined #ruby
linoj has quit [Quit: linoj]
<nooodl> Tasser: an example?
<nooodl> like, what would [{a: 1}, {b: 2}] convert to?
awarner has joined #ruby
linoj has joined #ruby
chussenot_ has quit [Remote host closed the connection]
ackz has joined #ruby
chussenot_ has joined #ruby
EstanislaoStan has joined #ruby
<heftig> [{a:3,b:4},{a:1,b:3,c:5}].flat_map(&:to_a).each_with_object({}) { |(k,v),h| h[k] ||= []; h[k] << v }
gianlucadv has quit [Quit: ZNC - http://znc.sourceforge.net]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<Tasser> heftig, kind of, yep
<EstanislaoStan> Is it possible to access the instance variables of the object my object is nested in?
stopbit has joined #ruby
<hoelzro> EstanislaoStan: what do you mean by nested?
<hoelzro> like your object is of an inner class, or your object is contained in an instance variable of another object?
kiela has quit [Quit: leaving]
<nooodl> i assume it's the latter, and i don't think that's possible
<_bart> I noticed when I use \w+ in regexp to select words it's not allowing '-' , how do I allow it to use -?
<EstanislaoStan> I think it's of an inner class. As in, that class does not inherit from the other class, it's defined inside of the other class.
<_bart> [a-z\-]+?
tk__ has joined #ruby
<hoelzro> I don't think inner classes have any priviledges in Ruby
<nooodl> [a-zA-Z0-9_\-]+
gianlucadv has joined #ruby
<nooodl> or (\w|-)+ possibly
<Tasser> if anyone needs some iterator/enum training, I've got a nice problem over here... :-)
uris has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
Tomasso has joined #ruby
<hoelzro> Tasser: here's my solution: https://gist.github.com/3176381
* hoelzro is starting out with Ruby still
<_bart> nooodl: ah that (\w|-)+ is beautiful, thanks
mockra has joined #ruby
<Tasser> hoelzro, has_key? can be solved with the default_proc (either assign or at Hash.new)
mathie has quit [Quit: Sleeping...]
hunglin has joined #ruby
kvirani has joined #ruby
mathie has joined #ruby
<hoelzro> ah, thanks for that tip!
cousine has quit [Remote host closed the connection]
lolsuper_ has joined #ruby
lolsuper_ has quit [Changing host]
lolsuper_ has joined #ruby
<nooodl> thinking up a method name was much tougher than writing the method to be honest
Jackneill has quit [Quit: Jackneill]
julio has quit [Ping timeout: 276 seconds]
Progster has quit [Ping timeout: 272 seconds]
<JonnieCache> there are only two hard problems in computer science: cache invalidation, and naming things
<JonnieCache> all other hard problems can be reduced to instances of those two
mockra has quit [Remote host closed the connection]
prateekp has quit [Ping timeout: 245 seconds]
swills has joined #ruby
<burgestrand> JonnieCache: there are two hard problems in computer science: cache invalidation, naming things and off-by-one errors.
<nooodl> i'm googling "cache invalidation" but all i'm finding is that quote. huh
<JonnieCache> really?
<JonnieCache> cache invalidation is deciding when to throw something out of cache
<JonnieCache> and its hard
<JonnieCache> or rather, deciding what to throw out at any given time
swills has left #ruby [#ruby]
jprovazn has quit [Remote host closed the connection]
vipulnsward has joined #ruby
jjbohn has joined #ruby
devdazed has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
jprovazn has joined #ruby
verto is now known as verto|off
axl_ has joined #ruby
billiam has joined #ruby
blazes816 has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
the_jeebster has joined #ruby
lkba has joined #ruby
tagrudev has quit [Quit: Me = Awesome]
aganov has quit [Remote host closed the connection]
bier has quit [Ping timeout: 276 seconds]
strife25 has quit [Quit: Computer has gone to sleep.]
oscardelben has joined #ruby
duder has joined #ruby
duder has quit [Client Quit]
r00t_l00p has joined #ruby
vipulnsward has quit [Quit: Leaving]
<r00t_l00p> I come from a Java background, and i have been learning Ruby for a month or so, but i need some help when it comes to the OO structure of Ruby, like with classes and instance variables and such. Does anybody know where I could find the answers for my various questions?
<tommylommykins> Here might be good
<burgestrand> r00t_l00p: google, here, and possibly a few of the popular ruby books.
<burgestrand> It’s kind of dependent on what kind of questions you have.
<tommylommykins> or amybe the ruby-talk mailing-list/forum if not :)
<r00t_l00p> Alright, so my main question is how do i get instance variables like i have in java?
<burgestrand> r00t_l00p: you don’t, this is ruby.
<r00t_l00p> i dont? O_o
<burgestrand> You don’t! \o/
<burgestrand> r00t_l00p: well, could you elaborate?
<burgestrand> r00t_l00p: look upon us as if we don’t know what java is (even though most of us do, some of us very well).
* tommylommykins doesn't \0/
obryan has joined #ruby
<r00t_l00p> well, i mean i can make an object in java where i can access certain things about it, like its name (String), or other things like that
jbw has quit [Ping timeout: 264 seconds]
<burgestrand> r00t_l00p: where does it get it’s name from?
TPFC-SYSTEM has left #ruby [#ruby]
<r00t_l00p> I can just say stuff like "public static String name();", and then set the name later
<burgestrand> r00t_l00p: http://codepad.org/sB6VZg9M
<burgestrand> r00t_l00p: that pastie is the basics of how you add properties to objects in ruby
PaciFisT has joined #ruby
<tommylommykins> mm, the page I linked shows the common shortcut way of doing it
br4ndon has joined #ruby
<r00t_l00p> burgestrand: thanks!!!! that should help a lot :)
<burgestrand> different to many other languages, you don’t define them before you create the object, and as such you cannot set their values before you create the object either
<burgestrand> r00t_l00p: ^
i0n has joined #ruby
<burgestrand> because, before the object exists, it has no instance variables either
bier has joined #ruby
<r00t_l00p> ohhhhh, that makes sense, i never thought of that before...
jesly__ has quit [Ping timeout: 246 seconds]
<burgestrand> r00t_l00p: also, ruby does not have static functions like you’re used to in Java, but we have something that is very similar and for most purposes the same thing
<burgestrand> r00t_l00p: http://codepad.org/BN9g412l
<r00t_l00p> I just used statics because they worked, btw im a freshman in highschool, and i dont know a ton about java
<burgestrand> r00t_l00p: :)
williamcotton_ has joined #ruby
BiHi has quit [Ping timeout: 252 seconds]
<burgestrand> r00t_l00p: the statics in java are special because you don’t need to create a new object to access them, you can just call them
<burgestrand> r00t_l00p: my last pastie is something similar, you don’t need to create a thingy with Thingy.new, you can just… Thingy.hello!
geekbri has joined #ruby
<Tasser> burgestrand, I assume you kind of misunderstood the use of static functions... :-P
blazes816 has quit [Read error: Connection reset by peer]
<r00t_l00p> that makes sense now :) i just used them because if i dont, i get an error because main() is always static
<burgestrand> Tasser: I don’t bother too much with details and 100% correctness with newcomers, too many details cloud the point I’m trying to get across :)
<burgestrand> Tasser: if I were to start speaking of class instances, and that all methods are instance methods, his mind would explode
<r00t_l00p> Wait, what is the "!' used for? i see it a lot when i type whatever.methods
<Tasser> burgestrand, OO vs. functional
pdelgallego has quit [Read error: No route to host]
mikepack has joined #ruby
<hoelzro> r00t_l00p: ! usually indicates a method that is "unsafe"
<burgestrand> r00t_l00p: in ruby, you can use "!" as part of a name for a method
<hoelzro> what "unsafe" means is kind of vague, though
<burgestrand> r00t_l00p: you can also use "?", say door.open?
<Tasser> r00t_l00p, depends on the context. in ruby, it's "dangerous method" (there are some dangerous methods that aren't marked, like delete*) - dangerous as in they change the object
BiHi has joined #ruby
<r00t_l00p> hoelzro: its the kidna thing that i would need to throw an exception for in java, right?
<Tasser> r00t_l00p, in activerecord, it's "throw me an error if things go wrong"
<Tasser> r00t_l00p, nope
<hoelzro> r00t_l00p: not exactly
<r00t_l00p> but the basic idea?
cousine has joined #ruby
<hoelzro> well, a typical is add/add!
<Tasser> r00t_l00p, "use with caution"
<tommylommykins> but just to be clear in foo.method!, the ! is actually part of the method name
pdelgallego has joined #ruby
<tommylommykins> it's not an operator or anything like that
<hoelzro> add might add an object to the receiver, and return the result
<Hanmac> dangerous are only marked with "!" when there is an un-dangerous method too
<hoelzro> add! might add the object to receiver, mutating it
<r00t_l00p> BIG WORDS!!!! O.o haha
iamjarvo has joined #ruby
<r00t_l00p> confusing me a tad, but i can sift through it :)
<burgestrand> r00t_l00p: usually it’s a good practice to not use "!" if you do not have a method with the same name without "!"
<burgestrand> (like usual, usually means usually, not always)
<burgestrand> :p
<r00t_l00p> burgestrand: so just dont use it unless i know that i need to use it?
<burgestrand> r00t_l00p: yeah, pretty much, most often you don’t need ! :)
jamiejackson has joined #ruby
strife25 has joined #ruby
<r00t_l00p> burgestrand: alrighty, gotcha there
indian has quit [Ping timeout: 276 seconds]
<r00t_l00p> in your pasties, you made classes, and is that the same kinda structure i should use with making classes of my own?
<burgestrand> r00t_l00p: here’s an example using ?: http://codepad.org/8LAZi8p0
rachet has quit [Remote host closed the connection]
linoj_ has joined #ruby
shevy has quit [Ping timeout: 248 seconds]
rachet has joined #ruby
<burgestrand> r00t_l00p: yes it’s a good idea, but if you are a beginner it can be tough to understand why at first
<burgestrand> it will become clear as you learn more, especially when your programs grow from one-file scripts to multiple files
linoj has quit [Read error: Operation timed out]
linoj_ is now known as linoj
<r00t_l00p> burgestrand: ill send u a link to the biggest one ive made...
digitalcakestudi has joined #ruby
jbw has joined #ruby
zoidfarb has joined #ruby
<burgestrand> the reason is one of structure, similar reason to why we try to come up with good names for things
pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
bluOxigen has quit [Ping timeout: 255 seconds]
bluOxigen has joined #ruby
<Tasser> if you use one-char variable names in a job, it a) secures your job for a long, long time or b) you get fired at the next QA meeting
<r00t_l00p> and use correct formatting, so that it doesnt get confusing
cousine has quit [Remote host closed the connection]
ghaydarov has quit [Quit: Leaving...]
flip_digits has joined #ruby
<burgestrand> yes :)
br4ndon has quit [Ping timeout: 244 seconds]
CannedCorn has joined #ruby
<r00t_l00p> Tasser: all of my friends use one letter var names, and their formatting is HORRIBLE
<burgestrand> hehe, like Tasser mentions you know you’ve done a good job when nobody needs you
<r00t_l00p> burgestrand: http://codepad.org/j6xizdm1
krusty_ar has quit [Ping timeout: 244 seconds]
<Tasser> burgestrand, or rather people can't read your code
<r00t_l00p> thats the most noteworthy thing ive made
<burgestrand> that’s when you know you’ve done a bad job :p
<Tasser> r00t_l00p, lawl. anyway, ruby prefers camel_case
<Tasser> ehh snake_case
<burgestrand> r00t_l00p: yeah, you don’t really need a class for that, so don’t worry about that particular point
Guest52301 has quit [Quit: Page closed]
PaciFisT has left #ruby [#ruby]
<burgestrand> even in larger applications, not everything needs to be in a class
krusty_ar has joined #ruby
EricKamsky has joined #ruby
<Tasser> r00t_l00p, need some faster fibonacci? http://www.haskell.org/haskellwiki/The_Fibonacci_sequence
<r00t_l00p> burgestrand: okay, so classes arent crucial to the program running
<burgestrand> r00t_l00p: not at all
<r00t_l00p> burgestrand: gotcha
<r00t_l00p> Tasser
JustinCa_ has joined #ruby
<burgestrand> r00t_l00p: when using java, your program starts in the public static main() function, in ruby it starts when you run your script
<r00t_l00p> crap, nvm
erichmenge has quit [Quit: Linkinus - http://linkinus.com]
zodiac1111 has quit [Ping timeout: 252 seconds]
JustinCampbell has quit [Read error: Connection reset by peer]
EricKamsky_ has quit [Ping timeout: 250 seconds]
<burgestrand> r00t_l00p: so in your pastie, like you noticed, it starts right away, from the top and goes to the bottom :)
<r00t_l00p> okay gotcha
<r00t_l00p> haha, true
<burgestrand> also, let fibs = 0 : 1 : zipWith (+) fibs (tail fibs) is beautiful.
<burgestrand> It sums up most things I like about Haskell.
timonv has quit [Remote host closed the connection]
<r00t_l00p> Tasser: i got to 25,000 within 20ish minute on my crappy ppc mac laptop
<burgestrand> And I don’t mean numbers. :)
axl__ has joined #ruby
JustinCampbell has joined #ruby
EstanislaoStan has quit []
<r00t_l00p> what would you guys say is a worthwile math kinda Ruby project like the Fib sequence?
<r00t_l00p> Because I need something to do :)
<the_jeebster> calculating the meaning of life
<r00t_l00p> the_jeebster: puts '42'
<burgestrand> r00t_l00p: given an array of numbers, calculate it’s sum
<r00t_l00p> haha
<r00t_l00p> burgestrand: alright, ill see how quickly i can do that :)
shevy has joined #ruby
<burgestrand> r00t_l00p: http://codepad.org/y4IEtqGJ :)
mucker has quit [Read error: Operation timed out]
chussenot_ has quit [Quit: chussenot_]
JustinCa_ has quit [Ping timeout: 246 seconds]
axl_ has quit [Ping timeout: 276 seconds]
axl__ is now known as axl_
davidpk has quit [Quit: Computer has gone to sleep.]
<JonnieCache> r00t_l00p: http://koans.heroku.com/
<r00t_l00p> burgestrand: without looking at yours: http://codepad.org/nEFgLi5S
davidcelis has quit [Quit: K-Lined.]
areil has quit [Remote host closed the connection]
<burgestrand> r00t_l00p: I just did you a template, not the solution :)
<r00t_l00p> burgestrand: ohh, i just wrote my own :)
* tommylommykins chuckles
<burgestrand> r00t_l00p: the Koans is good if you just want something to try ruby with
<JonnieCache> array.inject(:+)
<i0n> anyone here came from perl? is there anything like $_ in ruby?
<burgestrand> personally I find them a bit confusing
<burgestrand> i0n: what is $_?
crankycoder has joined #ruby
verbad has quit []
<tommylommykins> it's mnost likely the same in ruby?
<tommylommykins> I thought most of the dollar-variables are copied directly from perl
<burgestrand> Yeah, they’re perlisms
<r00t_l00p> the Koans is like RubyMonk
<hoelzro> i0n: I don't behave $_ is there
<hoelzro> $_ is the "default variable" in Perl
<i0n> yea
tk__ has quit [Quit: ばいばい]
<i0n> okay so I have a method that finds a bunch of files and puts them into an array.. I need another method that zips up each file in this array. how would you call each file into the zipup method?
<burgestrand> i0n: files.each { |file| zipup(file) }
<hoelzro> i0n: use each?
<r00t_l00p> burgestrand: http://codepad.org/vUCKrazU
andrewhl has quit [Remote host closed the connection]
<burgestrand> r00t_l00p: hehe :)
<r00t_l00p> :)
<burgestrand> r00t_l00p: now try using Array#each or Array#reduce
jbohn has joined #ruby
<burgestrand> r00t_l00p: it’d be the more idiomatic approach, i.e. what most rubyists would try with
br4ndon has joined #ruby
<r00t_l00p> burgestrand: thats a trip to the api docs..
<burgestrand> r00t_l00p: oh, by Array#each I mean using the "each" instance method of array
<burgestrand> r00t_l00p: indeed :)
<tommylommykins> mmm, as a related sidenote, you don't often need to access elements of an array by their index
Emmanuel_Chanel has quit [Quit: Leaving]
ckrailo has joined #ruby
<fowl> ruby is good for its numerous metalprogramming abilities. ruby has the power of telekinesis which it uses to move objects. ruby has the power of super strength which is used for moving boulders. ruby can fly faster than the speed of light and have mastery over time and space
strnx has quit [Excess Flood]
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
<burgestrand> r00t_l00p: avoid the example of Array#reduce (actually Enumerable#reduce), it contains the solution :p
<r00t_l00p> burgestrand: gotcha
baphled has joined #ruby
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
QaDeS has quit [Quit: Ex-Chat]
Progster has joined #ruby
lolsuper_ has quit [Ping timeout: 276 seconds]
josefig has joined #ruby
beneggett has joined #ruby
jjbohn has quit [Ping timeout: 252 seconds]
billybobjoe299 has joined #ruby
oooPaul has joined #ruby
mengu has quit [Ping timeout: 246 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
arkiver has quit [Ping timeout: 246 seconds]
<i0n> zipup(compressme) Zip::ZipFile.open('compressme.zip')
iamsuger2 has joined #ruby
<i0n> is that how to append zip to the filename?
<burgestrand> i0n: no
<burgestrand> i0n: either use string interpolation, or append ".zip" to the string
<i0n> so "compress" + ".zip" ?
<burgestrand> i0n: "#{compressme}.zip", or compressme + ".zip"
a_a_g has joined #ruby
<i0n> ah i see
<i0n> thanks
<burgestrand> i0n: because compress me is a variable, it needs to be evaluated
<r00t_l00p> burgestrand: so far i have "array.each {|x| sum = sum + x}", but i get a NoMethodError when i try it in irb...?
<r00t_l00p> do i have to use sum.add?
<burgestrand> r00t_l00p: could you show the full error?
ceej has joined #ruby
<tommylommykins> r00t_l00p: Is the variable array defined?
mengu has joined #ruby
_justin has joined #ruby
bequick has joined #ruby
<billybobjoe299> r00t_l00p: you could use array.reduce(&:+) if all you want to do is add the elements
<burgestrand> billybobjoe299: he’s doing it as an exercise
<r00t_l00p> NoMethodError: undefined method `+' for nil:NilClass
<billybobjoe299> ok
<r00t_l00p> from (irb):2
<billybobjoe299> sorry
<r00t_l00p> from (irb):2:in `each'
<r00t_l00p> from (irb):2
Eldariof-ru has quit [Ping timeout: 244 seconds]
<burgestrand> r00t_l00p: use pastie.org or similar to post multiple lines :)
<r00t_l00p> oops, forgot :)
<burgestrand> r00t_l00p: but it’s because sum is undefined, for the very first number, when you do sum = sum + 1, what is sum in "sum + 1"?
<r00t_l00p> oh yeah!!!!! (slaps himself upside the head)
<tommylommykins> mm, although stuff doesn't have to be declared in ruby, you still have to define them
<billybobjoe299> r00t_l00p: you haven't used sum yet; try sum=0 first
<r00t_l00p> yep, gotcha
<tommylommykins> so at some point, there still have has to be sum = 0123 first
beakerma_ has joined #ruby
<r00t_l00p> yes, i got it now, i am just not %100 percent mentally awake yet :)
a_a_g has quit [Client Quit]
<shevy> hehe
<r00t_l00p> life of a teenager XD
<r00t_l00p> burgestrand: http://codepad.org/4CT83PeE
<burgestrand> r00t_l00p: \o/
<burgestrand> r00t_l00p: now try using Array#inject (comes from Enumerable#inject if you search for docs)
<r00t_l00p> burgestrand: :)
<burgestrand> :p
wvms has quit [Quit: wvms]
beakerman has quit [Ping timeout: 246 seconds]
<r00t_l00p> burgestrand: alright, ill look it up
maesbn has quit [Remote host closed the connection]
<burgestrand> when you think of it, there’s many different ruby things in such a simple exercise as this, kind of interesting
iamsuger2 has quit [Quit: Linkinus - http://linkinus.com]
mathie has quit [Quit: Sleeping...]
williamcotton_ has quit [Quit: williamcotton_]
<JonnieCache> well summing an array is a classic FP operation
timonv has joined #ruby
mneorr has quit [Quit: Leaving.]
mathie has joined #ruby
<burgestrand> true, but doing it in ruby subjects you to blocks, and their scope as opposed to just iteration and lists
<burgestrand> And, well, blocks are kind of important!
<JonnieCache> indeed
lolsuper_ has joined #ruby
pdelgallego has quit [Quit: pdelgallego]
mneorr has joined #ruby
oscardelben has quit [Quit: oscardelben]
arkiver has joined #ruby
<r00t_l00p> burgestrand: http://codepad.org/7KvHahDH hmmmmmmm, it looks like it forgot the last number
johnlcox has joined #ruby
<r00t_l00p> burgestrand: and i did not copy and paste from the api docs :)
tewecske has joined #ruby
_justin has quit [Ping timeout: 244 seconds]
pdelgallego has joined #ruby
pdelgallego has quit [Client Quit]
<burgestrand> r00t_l00p: inject is a bit special, but you could ask yourself why you have two three mentions of sum
<burgestrand> hehe, two three :)
sebastorama has joined #ruby
<burgestrand> r00t_l00p: mainly thinking about line #2, versus { |sum, x| … }
TorpedoSkyline has joined #ruby
<banisterfiend`> burgestrand: burg, do u like the stabby lambda
<r00t_l00p> burgestrand: haha, but im guessing that the reason that it didnt add the last number is because of the difference in the curly brackets, right?
<r00t_l00p> not the inject method itself
<r00t_l00p> nvm, that made no sense
<r00t_l00p> :P
<burgestrand> r00t_l00p: yeah, it’s a difference in how inject behaves in the first iteration :)
<burgestrand> r00t_l00p: and local vs. block variables
<shevy> cool... first time I managed to compile gtk3 from source myself
<burgestrand> r00t_l00p: { |sum, x| … } both sum and x here are block variables, they are alive only for the duration of the block
<r00t_l00p> burgestrand: do block variables have any java cousins?
<burgestrand> r00t_l00p: however, in line #2 you also define a local variable, sum = 0
<burgestrand> banisterfiend`: I don’t find many uses for it D:
Morkel has quit [Quit: Morkel]
<burgestrand> banisterfiend`: been thinking of using it when placing lambdas in hashes
<burgestrand> but no, haven’t felt a need for it yet
<r00t_l00p> burgestrand: so if i get rid of the sum = 0, will it work?
<banisterfiend`> burgestrand: ah ok
blazes816 has joined #ruby
ackz has quit [Read error: Connection reset by peer]
jeremy_ has joined #ruby
strnx has joined #ruby
<burgestrand> r00t_l00p: you afraid to try? ;)
jeremy_ is now known as Guest30221
beneggett has quit [Ping timeout: 244 seconds]
<r00t_l00p> burgestrand: haha, already did, but it doesnt because there is no variable "sum" after the block, so there is nothing to return at the end of the method
<r00t_l00p> right?
tvw has quit [Remote host closed the connection]
<burgestrand> r00t_l00p: maybe! but… what does Enumerable#inject return?
<r00t_l00p> burgestrand: lemme check...
<billybobjoe299> r00t_l00p: try something like sum=array.inject{|s,x| s+x}
julio has joined #ruby
verto|off is now known as verto
<r00t_l00p> Enumerable#inject returns an object... so wouldnt "sum" become an object if i used what billybobjoe299 said?
cakehero has quit [Quit: Computer has gone to sleep.]
maletor has joined #ruby
beneggett has joined #ruby
<banisterfiend`> burgestrand: here's my only use of it so far https://gist.github.com/fd345efdabcb63255014
<banisterfiend`> burgestrand: bsically i wanted 2 blocks :P
<burgestrand> r00t_l00p: last sentence of second paragraph of the method documentation states what it *really* returns
<burgestrand> banisterfiend`: yeah, I’ve been thinking of using it for passing two blocks
jprovazn has quit [Ping timeout: 276 seconds]
bglusman has joined #ruby
<r00t_l00p> burgestrand: i cant quite wrap my head around what it is trying to say....
<burgestrand> r00t_l00p: the deal with inject is that it walks a list, and gives you two variables: an accumulated value, and the current item in the list
indian has joined #ruby
<burgestrand> r00t_l00p: whatever you return from the block during the iteration becomes the accumulated value for the next iteration
bluenemo has joined #ruby
<burgestrand> r00t_l00p: in your case, sum = sum + 1, is the last expression of the block, and in ruby the return value of a block (or a method) is the result of the last expression, i.e. the sum up until this point in the iteration
billybobjoe299 has left #ruby [#ruby]
brianpWins has quit [Quit: brianpWins]
<burgestrand> r00t_l00p: this means that the sum is the accumulated value for the next iteration, i.e. the sum in { |sum, x| … }
<burgestrand> r00t_l00p: the return value of Enumerable#inject is the accumulated value of the last iteration
<r00t_l00p> burgestrand: so if i just get rid of the return statement, it will work, since i dont explicitly have to declare what i am returning (like i have to do in java)
<r00t_l00p> right?
<burgestrand> r00t_l00p: right!
Spooner has quit [Ping timeout: 276 seconds]
<r00t_l00p> burgestrand: alright, lets give it a shot :)
<burgestrand> r00t_l00p: essentially, it becomes this: array.inject { |sum, number| sum + number }
sailias has quit [Quit: Leaving.]
sendoushi has joined #ruby
andrewhl has joined #ruby
<burgestrand> r00t_l00p: it might help if you do this on paper, and write out the value of each variable at every iteration
<r00t_l00p> burgestrand: http://codepad.org/kdD57J1N
<burgestrand> r00t_l00p: if you do that, I suggest you do it with a small list so you don’t get writing cramps :P
<burgestrand> r00t_l00p: :)
mengu has quit [Quit: Konversation terminated!]
<r00t_l00p> burgestrand: no, i get what its doing, the second variable is basically like a temporary variable, and it changes every iteration
t0mmyvyo has joined #ruby
* burgestrand nods
cakehero has joined #ruby
<r00t_l00p> burgestrand: so its kinda like the RAM in a computer, correct?
<burgestrand> r00t_l00p: *blinks*
ananthakumaran has joined #ruby
<burgestrand> r00t_l00p: hm?
<blazes816> it's IN ram?
devdazed has quit [Quit: Computer has gone to sleep.]
<JonnieCache> he just means its volatile i think
benson has joined #ruby
<r00t_l00p> not really, im just referencing its function as a temporary space for things to be stored
<r00t_l00p> it makes sense in my head...
JohnBat26 has quit [Read error: Operation timed out]
<blazes816> yeah, well in that sense variables are RAM. they point to places in memory and act as labels for them
devdazed has joined #ruby
MasterIdler has quit [Quit: MasterIdler]
<r00t_l00p> ugh, it was an analogy
jbohn has quit [Ping timeout: 255 seconds]
cantbecool has joined #ruby
chussenot_ has joined #ruby
r00t_l00p has left #ruby [#ruby]
baroquebobcat has joined #ruby
devdazed has quit [Client Quit]
jprovazn has joined #ruby
Guest11054 has quit [Quit: Linkinus - http://linkinus.com]
cantbecool has quit [Client Quit]
bullicon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
artOfWar_ has quit [Ping timeout: 255 seconds]
g0rd0n has quit [Ping timeout: 244 seconds]
devdazed has joined #ruby
jamiejackson has quit [Quit: Page closed]
jjbohn has joined #ruby
Rochefort has quit [Remote host closed the connection]
arkiver has quit [Ping timeout: 276 seconds]
mneorr has quit [Quit: Leaving.]
k_89 has joined #ruby
rushed has joined #ruby
wallerdev has joined #ruby
bwwrd has joined #ruby
timonv has quit [Remote host closed the connection]
daniel_hinojosa has quit [Quit: Leaving.]
oooPaul has quit [Quit: Ciao for now!]
hoelzro is now known as hoelzro|away
chussenot__ has joined #ruby
davidcelis has joined #ruby
chussenot__ has quit [Client Quit]
Beoran_ has quit [Ping timeout: 264 seconds]
tatsuya_o has quit [Remote host closed the connection]
brianpWins has joined #ruby
Draco_ has joined #ruby
savage- has joined #ruby
mk03 has joined #ruby
chussenot_ has quit [Ping timeout: 276 seconds]
mk03 has quit [Remote host closed the connection]
mk03 has joined #ruby
robozahn has quit [Ping timeout: 265 seconds]
mneorr has joined #ruby
erichmenge has joined #ruby
bullicon has joined #ruby
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Spooner has joined #ruby
Ionic` has joined #ruby
Emmanuel_Chanel has joined #ruby
jbohn has joined #ruby
MasterIdler_ has joined #ruby
Solnse has joined #ruby
chussenot has quit [Ping timeout: 276 seconds]
<Ionic`> http://pastie.org/private/7zza3ulilkolrknxzdeq < what am I doing wrong?
indian has quit [Read error: Operation timed out]
wilmoore has joined #ruby
akem has joined #ruby
<gogiel> Ionic`: why + ?
<gogiel> use ,
<gogiel> + doesn't make any sense
<blazes816> I think he's trying to concat the strings
<Ionic`> yeah
<blazes816> try moving the + to the end of the 3rd line
<Ionic`> and I want to split the string on multiple lines to keep it readable
<blazes816> instead of beginning of 4th
<Ionic`> argh... ok
<Ionic`> that works
<Ionic`> thanks
<Ionic`> though I thought ruby was whitespace-ignorant
<blazes816> np. I'd prefer the other way too, but it is what it is
<Ionic`> for the most part that is
jjbohn has quit [Ping timeout: 255 seconds]
<blazes816> i'm not sure exactly how it works
<blazes816> in large part it is
<gogiel> Ionic`: it is with some exceptions. this is one of them
<blazes816> but it has to decide statement termination somehow
<Hanmac> Ionic` "abc" "def" "ghi"
<Ionic`> yeah
<Ionic`> Hanmac: only works on the same line
<shevy> Ionic` ruby is semi whitespace-ignorant. there is even one warning that says "mismatching indent". just a warning though, no error
<shevy> then it also matters between things like "-foo" vs "- foo"
jgrevich has joined #ruby
<Ionic`> yeah
timonv has joined #ruby
<shevy> the parser tries to be clever in a reliable way. sometimes that means it is silly
beneggett has quit [Ping timeout: 276 seconds]
<shevy> :-)
<blazes816> Ionic`: you can add a "\" to the end of the line to tell it you're continuing on the next, but that's ugly
apeiros_ has joined #ruby
<Hanmac> ionic` you could use Here-doc
<Ionic`> hmm that wouldn't look good
<shevy> or %w( foo barbaz )
Beoran_ has joined #ruby
venkatk_ has quit [Quit: This computer has gone to sleep]
devdazed has quit [Quit: Computer has gone to sleep.]
SQLStud has joined #ruby
_bart has quit [Ping timeout: 246 seconds]
artOfWar has joined #ruby
jesly__ has joined #ruby
sendoushi has quit [Read error: Connection reset by peer]
CaptainJet has joined #ruby
sendoushi has joined #ruby
prtksxna has joined #ruby
beneggett has joined #ruby
linoj has quit [Remote host closed the connection]
linoj has joined #ruby
devdazed has joined #ruby
hynkle has joined #ruby
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
tvw has joined #ruby
bradhe has quit [Remote host closed the connection]
nadirvardar has joined #ruby
superjoe has quit [Read error: Operation timed out]
apok has joined #ruby
khakimov has joined #ruby
RomainT has joined #ruby
<RomainT> Hi
<shevy> hi RomainT - new to ruby?
<RomainT> Nop
yankhates has left #ruby [#ruby]
<RomainT> I have issue installing rmagick on OS X Mountain Lion. The gem install rmagick returns https://gist.github.com/10c35a9aa0812ce3e8d6
chichou has quit [Remote host closed the connection]
<RomainT> I have the command line tool for 10.8
chichou has joined #ruby
<Mon_Ouie> It is right that /usr/bin/gcc-4.2 doesn't exist though? What about /usr/bin/gcc?
<blazes816> RomainT: sounds like maybe you need gcc
mahmoudimus has joined #ruby
nu7hatch has left #ruby [#ruby]
<Mon_Ouie> I think extconf usually defaults to using the compiler that had been used to compile Ruby
<RomainT> Yep but the developer tool are supposed to fix that
<RomainT> Since i have a GCC
TPFC-SYSTEM has joined #ruby
<RomainT> i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
<RomainT> (with gcc --version)
adeponte has joined #ruby
<Mon_Ouie> What about gcc-4.2?
Draco___ has joined #ruby
<RomainT> gcc-4.2 --version 1 ↵
<RomainT> i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
<RomainT> BRB
RomainT has left #ruby [#ruby]
<Mon_Ouie> And it is indeed located in /usr/bin, not another directory?
RomainT has joined #ruby
chichou has quit [Ping timeout: 276 seconds]
<RomainT> Still the error after a reboot
<RomainT> Should make a symlink on my gcc-4.2 in /usr/bin ?
BiHi has quit [Quit: Computer has gone to sleep]
<blazes816> RomainT: which gcc-4.2
Draco_ has quit [Ping timeout: 252 seconds]
<blazes816> to ensure it's not there
<RomainT> /usr/local/bin/gcc-4.2
<blazes816> bingo
<blazes816> check your env path
<blazes816> you could just append /usr/local/bin
<Mon_Ouie> I'd try to export CC=/usr/local/bin/gcc-4.2
Aaton_off is now known as Aaton
<RomainT> gcc-4.2 is in my path since the command works
<RomainT> But gem install seems to want it in /usr/bin :/
<RomainT> sudo ln -s `which gcc-4.2` gcc-4.2
<RomainT> After that it works
JustinCampbell has quit [Remote host closed the connection]
<RomainT> (from /usr/bin)
<RomainT> Strange that gem is not more intelligent about finding the binary…
mrsolo has joined #ruby
<Mon_Ouie> It has nothing to do with gem
<Mon_Ouie> It's from mkmf.rb
<RomainT> Strange that mkmf.rb is not more intelligent about finding the binary…
<RomainT> :x
asdfqwer has joined #ruby
asdfqwer has left #ruby [#ruby]
<RomainT> Thanks for your help anyway
<RomainT> But i would be glad to understand the problem with mkmf :x
<Mon_Ouie> Its completely unidiomatic and poor style would be a start :p
<Hanmac> rmagick gem seems to be dump :p gcc-4.2 is very outdated :P
<RomainT> Yes
cirwim has joined #ruby
<RomainT> Searching about Rmagick stuff is like studying antiquity
<Hanmac> my oldest version is 4.6
cirwim has quit [Client Quit]
superjoe has joined #ruby
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Mon_Ouie> Hanmac: That's the version provided by Apple actually — not a problem related to RMagick
blazes816 has quit [Read error: Operation timed out]
shadoi has quit [Quit: Leaving.]
blazes816 has joined #ruby
<RomainT> The problem is that we need a very old C compiler to install it :/
shadoi has joined #ruby
kichawa is now known as echo
Emmanuel_Chanel has quit [Quit: Leaving]
<RomainT> oO
AlbireoX`Away is now known as AlbireoX
<Mon_Ouie> No you don't, I just tried it with gcc 4.7.1 on Linux, it worked right away
bradhe has joined #ruby
<RomainT> So why gem install asked for 4.2 :/
<Mon_Ouie> Because that's the version you compiled Ruby with
<RomainT> Hmmm
jarred has joined #ruby
tatsuya_o has joined #ruby
<RomainT> Don't remember how i installed it but it might be true
beneggett has quit [Ping timeout: 255 seconds]
<Mon_Ouie> And you used it most likely because it's the only version provided by Apple
<RomainT> True
mathie has quit [Quit: Sleeping...]
<Mon_Ouie> (At least, it was when I last used OS X, using 10.6)
sailias has joined #ruby
<Ionic`> Mon_Ouie: GCC doesn't get updated anymore by Apple anyway so...
<RomainT> Can't Ruby be compiled by clang ?
<Ionic`> probably, I haven't tested it
jarred has quit [Remote host closed the connection]
Eldariof-ru has joined #ruby
<Mon_Ouie> I think it had problems due to optimizations performed by clang
<Ionic`> and won't, I don't like clang
<RomainT> Ok
jarred has joined #ruby
<RomainT> Why?
<RomainT> What is clang about ?
<Ionic`> I don't "trust" it enough to use it
<Mon_Ouie> I like clang's pretty error messages while I'm writing code :)
<Ionic`> Seeing way too many bugs
<RomainT> I only know that it's related to llvm
<RomainT> Compiled stuff is harsh :p
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
apok_ has joined #ruby
bowlowni has quit [Ping timeout: 244 seconds]
tiripamwe has joined #ruby
<Mon_Ouie> Ah, and yeah, as I thought, mkmf does use the CC env variable if it is set
echo is now known as kichawa
beneggett has joined #ruby
lolsuper_ has quit [Ping timeout: 276 seconds]
geekbri_ has joined #ruby
apok has quit [Ping timeout: 276 seconds]
apok_ is now known as apok
zemanel has joined #ruby
geekbri has quit [Ping timeout: 276 seconds]
asobrasil has joined #ruby
blazes816 has quit [Quit: Leaving]
Maniacal has joined #ruby
linoj has quit [Ping timeout: 276 seconds]
lolsuper_ has joined #ruby
elhu has quit [Read error: Operation timed out]
mrwalker has joined #ruby
bullicon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<RomainT> Cool :)
alfism has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
jrajav has quit [Quit: The best darkness is strange and surprising]
linoj has joined #ruby
apok has quit [Remote host closed the connection]
jchauncey has joined #ruby
apok has joined #ruby
<shevy> how does one go about compiling with clang anyway?
workmad3 has quit [Ping timeout: 244 seconds]
khakimov has joined #ruby
cbuxton has quit [Remote host closed the connection]
verto is now known as verto|off
<RomainT> Miss. sorry
cbuxton has joined #ruby
ghaydarov has joined #ruby
<shevy> Apple ID!
<shevy> I want this on my ass
verto|off is now known as verto
adamkittelson has joined #ruby
Emmanuel_Chanel has joined #ruby
adamkittelson has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
headius has joined #ruby
adamkittelson has joined #ruby
shadoi has quit [Quit: Leaving.]
minijupe has quit [Quit: minijupe]
MatthewGA has joined #ruby
strnx has quit [Excess Flood]
atmosx has joined #ruby
alfism has quit [Quit: alfism]
ghaydarov has quit [Ping timeout: 276 seconds]
Tomasso has quit [Read error: Operation timed out]
ryan0x2 has joined #ruby
shavus has joined #ruby
thecreators has quit [Quit: thecreators]
bbttxu has quit [Quit: bbttxu]
mk03 has quit [Remote host closed the connection]
dawtcawm has quit [Ping timeout: 252 seconds]
TheShadowFog has quit [Quit: Leaving]
timonv has quit [Remote host closed the connection]
lxsameer has quit [Quit: Leaving]
wilmoore has quit [Remote host closed the connection]
wilmoore has joined #ruby
wallerdev has quit [Quit: wallerdev]
carloslopes has joined #ruby
flip_digits has quit [Quit: Computer has gone to sleep.]
axl_ has quit [Quit: axl_]
Tomasso has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
jarred has quit [Quit: jarred]
wilmoore has quit [Read error: Operation timed out]
Markvilla has quit [Quit: Markvilla]
darren_ has joined #ruby
abstrusenick has joined #ruby
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
nilg has joined #ruby
cbuxton has quit [Quit: Leaving.]
prometheus has joined #ruby
<Ionic`> http://git.ionic.de/website.git/tree hmm, I'm rebuilding rails, or something
axl_ has joined #ruby
fflush has joined #ruby
dawtcawm has joined #ruby
prtksxna has quit [Remote host closed the connection]
<apeiros_> or something, I'd say
dawtcawm is now known as Guest67510
ph^ has joined #ruby
<shevy> lol
<Ionic`> yeah? :p
<shevy> Ionic`, some parts of your code can be simplified
<Ionic`> like?
<shevy> if (@file)
<shevy> if @file
<Ionic`> uhm
<Ionic`> that's not "simplified"
<Ionic`> that's personal style preference
Poapfel has joined #ruby
<shevy> why not
<shevy> if ((((((@file))))))))
<Ionic`> I always enclose conditions in
Poapfel has quit [Client Quit]
<Ionic`> err
<Ionic`> things
<apeiros_> parens
<Ionic`> parens
mrdodo has joined #ruby
<apeiros_> (short for parentheses)
<Ionic`> if you like "if ((((((@file))))))))", go for it :p
<apeiros_> @comments = Array.new(); … --> @comments = ['#', ';', '//']
lolsuper_ has quit [Ping timeout: 276 seconds]
<apeiros_> or even: @comments = %w[# ; //]
<apeiros_> same for @quotes
<apeiros_> and instead of: if (@comments) … end --> @comments ||= %w[ # ; // ]
<Ionic`> if (!@comments)?
EricKamsky_ has joined #ruby
<apeiros_> yeah, my fault. omitted the bang.
<apeiros_> get_* method names are not idiomatic ruby
EricKamsky has quit [Read error: Connection reset by peer]
<i0n> what zip gem do you guys like?
<Ionic`> yeah... I could've done the first thing but uhm
<apeiros_> get_foo, set_foo, is/has_foo --> foo, foo=, foo?
<shevy> i0n I hate them all equally
cbuxton has joined #ruby
<Ionic`> oh
arkiver has joined #ruby
<Ionic`> well, that I could definitely change
<Ionic`> and probably should
tvw has quit [Ping timeout: 276 seconds]
<Ionic`> although hm
<Ionic`> I'm already using foo? for checks
lkba has quit [Ping timeout: 244 seconds]
<apeiros_> def get_keys(section) definition --> def keys(section) @kv_pairs.select { |sect, key| section == sect } end
arkiver has quit [Max SendQ exceeded]
jrajav has joined #ruby
<apeiros_> (written on 3 lines of course, using a single line only in irc)
MasterLambaster has joined #ruby
arkiver has joined #ruby
<Ionic`> ah
<Ionic`> select, that's handy
iamjarvo has joined #ruby
<Ionic`> a lot of other places where I could use that too
<apeiros_> also you're inconsistent in the use of @kv_pairs contents
RomainT has quit [Quit: Leaving.]
<Ionic`> hmm but select doesn't break
shadoi has joined #ruby
jesly__ has quit [Ping timeout: 276 seconds]
<Ionic`> I'm "not"
<apeiros_> Ionic`: why should it? your code doesn't either…
<Ionic`> I just don't always need value
wallerdev has joined #ruby
Rojo has joined #ruby
n1x has joined #ruby
<Ionic`> I'll take a look at that later
aantix has joined #ruby
<Ionic`> first get/set_
digitalcakestudi has quit [Ping timeout: 246 seconds]
<apeiros_> Ionic`: also, github
<Ionic`> uhm, why?
<apeiros_> gitweb is just, um, well… let's say it's just gitweb :)
<shevy> it's better
<shevy> and we are all there!
thecreators has joined #ruby
<Ionic`> but I like my gitweb :p
<shevy> https://github.com/languages especially javascript
<apeiros_> you're probably the only one, though
<shevy> but ruby is a good second
mdickens has quit [Ping timeout: 245 seconds]
RomainT has joined #ruby
RomainT has quit [Client Quit]
n1x has left #ruby [#ruby]
jchauncey has quit [Read error: Operation timed out]
timonv has joined #ruby
<apeiros_> shevy: I'd guess most automatically generated docs contain js
voodoofish430 has joined #ruby
<shevy> hmmm
<apeiros_> so many projects that aren't js projects still include a good amount of js…
<shevy> never thought about that yet
Criztian has joined #ruby
TechCel has joined #ruby
berserkr has joined #ruby
Poapfel has joined #ruby
strnx has joined #ruby
cantonic has quit [Quit: cantonic]
kirun has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
prometheus has quit [Ping timeout: 255 seconds]
elhu has joined #ruby
abstrusenick has quit [Quit: abstrusenick]
robozahn has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
werdnativ has joined #ruby
jrist is now known as jrist-afk
ph^ has quit [Remote host closed the connection]
arkiver has quit [Ping timeout: 276 seconds]
geekbri_ has quit [Ping timeout: 276 seconds]
mrsolo has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
jarred has joined #ruby
axl_ has joined #ruby
richardcreme has quit [Ping timeout: 244 seconds]
theRoUS has quit [Ping timeout: 246 seconds]
crankycoder has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
richardcreme has joined #ruby
sebicas has joined #ruby
crankycoder has joined #ruby
robozahn has quit [Ping timeout: 265 seconds]
tatsuya_o has quit [Remote host closed the connection]
Axsuul has joined #ruby
ramblex has quit [Ping timeout: 276 seconds]
Synthead has joined #ruby
<banisterfiend`> burgestrand: check out this, pry on autopilot: https://gist.github.com/3177575
<i0n> anyone tell me what im doing wrong? http://pastie.org/private/489lidk9urrehh7okvqnoa .. this method created a file called #<Enumerable::Enumerator:0xb70a4a94>.zip
SQLStud has quit [Read error: Connection reset by peer]
axl__ has joined #ruby
mrdodo has quit [Remote host closed the connection]
abra has joined #ruby
<Hanmac> ion: files.each { |f| zipup(f) }
Aaton has left #ruby [#ruby]
mrdodo has joined #ruby
MasterLambaster has quit [Quit: MasterLambaster]
axl_ has quit [Ping timeout: 246 seconds]
axl__ is now known as axl_
beneggett has quit [Ping timeout: 244 seconds]
banisterfiend` is now known as banister`bina
<Ionic`> [19:49:11] ( apeiros_ ) also you're inconsistent in the use of @kv_pairs contents < what did you mean by that btw?
<Hanmac> i0n the problem is that file.each returns an enumerator object, and eiher the method must take care about it, or otherwise you need my line
beneggett has joined #ruby
Guest30221 has quit [Quit: Linkinus - http://linkinus.com]
jchauncey has joined #ruby
jonathancutrell has joined #ruby
ackz has joined #ruby
fflush has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<jonathancutrell> Hey folks. I'm using Zip::ZipFile in this: http://pastebin.com/0pdFkwyi and I'm getting an error, "undefined method `bytesize' for nil:NilClass" at file: zip_entry.rb location: read_c_dir_entry line: 302
<jonathancutrell> Is my implementation correct?
<jonathancutrell> (in the paste)
tatsuya_o has joined #ruby
dv310p3r has quit [Ping timeout: 252 seconds]
eywu has joined #ruby
beneggett has quit [Ping timeout: 276 seconds]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
fraser has joined #ruby
dv310p3r has joined #ruby
Petit_Dejeuner has quit [Ping timeout: 255 seconds]
<jonathancutrell> very quiet in here.
blazes816 has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
<fraser> Indeed, maybe people are hard at work... Or hardly working
elhu has quit [Quit: Computer has gone to sleep.]
<jonathancutrell> Indeed.
<jonathancutrell> I feel like working in that sentence begs to have it's "g" dropped.
<jonathancutrell> workin.
<sernin> fo' the man.
<jonathancutrell> tha.
<sernin> jonathancutrell: And I'd hazard a guess that your zipfile is not being found, or otherwise not populated, but this isn't caught
erichmenge has quit [Quit: Linkinus - http://linkinus.com]
<fraser> I guess it does. Although I always hate missing letters off words
<jonathancutrell> sernin: erg. It's showing up in the uploads folder correctly. Perhaps a permissions issue?
<jonathancutrell> But if it's writing it,
<jonathancutrell> I'm assuming it would by default have permissions to read it...
<sernin> jonathancutrell: Make sure explicitly.
<sernin> jonathancutrell: Although I see what you're saying.
williamcotton_ has joined #ruby
<jonathancutrell> I'm seeing rw r r
mdickens has joined #ruby
erichmenge has joined #ruby
<sernin> Then you're fine, but perhaps the path being looked for is wrong, subtly
williamcotton has quit [Ping timeout: 240 seconds]
williamcotton_ is now known as williamcotton
krz has joined #ruby
<jonathancutrell> Would a .zip need x?
<sernin> *shrug* I'm just making slightly educated guesses.
<sernin> No. Only directories need x for traversal, or anything that needs to be written.
<sernin> sorry, executed
imami|afk is now known as banseljaj
<sernin> That, and you would need write permissions in the dir where you're creating these files, as well as x for traversing into anything created that's new (mode 0755)
hynkle has quit [Read error: Connection reset by peer]
manolo has quit [Ping timeout: 246 seconds]
<jonathancutrell> I've got rwx xr x on the parent dir
manolo has joined #ruby
Pathou has joined #ruby
apeiros_ has quit [Remote host closed the connection]
Russell^^ has joined #ruby
a_a_g has joined #ruby
Pathou has left #ruby [#ruby]
cbuxton1 has joined #ruby
<jonathancutrell> I'm puts-ing the location of the file, and it's outputting correctly.
<sernin> (outputsing? heyyooo)
fermion has quit [Quit: P]
<jonathancutrell> sernin: sneaky sneaky.
the_mechanic has joined #ruby
<the_mechanic> Hi
<sernin> jonathancutrell: Yeah, that's just where I'd start to look, in any case. For me, it's nothing obvious in your code, but perhaps others could share some insight.
cbuxton has quit [Ping timeout: 276 seconds]
mathie has joined #ruby
<Ionic`> jonathancutrell: use p, not puts
<jonathancutrell> sernin: Hrm. I did it directly from irb - same error.
MasterIdler_ is now known as MasterIdler
<the_mechanic> I am writing a module which contains a class that deals with network device API. I am declaring a bunch of def self.create self.delete type methods which accepts a connection handler as an argument
<Ionic`> hmm
<the_mechanic> but I am also declaring an instance variable @connhandle which will be passed when .new is called
robozahn has joined #ruby
<Hanmac> jonathancutrell you didnt tell us your ruby version
<Ionic`> is there something like select/find_all, but which breaks?
<the_mechanic> is there a conflict, is that an okay practice?
<Ionic`> (after the first true condition)
hynkle has joined #ruby
<jonathancutrell> ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
<jonathancutrell> Hanmac: /\
<Ionic`> hmm
<Ionic`> find()
<Ionic`> but hmmm
<Ionic`> jonathancutrell: haha, darwin!
<jonathancutrell> ...
gmci has joined #ruby
<jonathancutrell> Oh.
<jonathancutrell> Rubyzip is not compatible with 1.9.3 according to some dude on SO.
mrsolo has quit [Quit: This computer has gone to sleep]
timonv has joined #ruby
<Ionic`> hmmm
<the_mechanic> actually my question had just become 2 question
<the_mechanic> if I declared @varname and then I have def method(varname='') that shouldn't cause me any grief ?
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
Bosma has joined #ruby
companion has quit [Ping timeout: 265 seconds]
mrsolo has joined #ruby
mrsolo has quit [Remote host closed the connection]
abra has quit [Ping timeout: 276 seconds]
mrsolo has joined #ruby
<Ionic`> the_mechanic: no, why would it?
<the_mechanic> just making sure they won't shadow/overwrite each other in some way
<Ionic`> the local variable will be varname
<the_mechanic> right
<Ionic`> also
<Ionic`> you can't just use varname to access @varname
abra has joined #ruby
<the_mechanic> yes
<Ionic`> anywhere
MasterLambaster has joined #ruby
<the_mechanic> yes, that is fine
<Ionic`> thus... how could it be overwritten?
<Ionic`> or shadow'd
<Ionic`> impossibru!
<the_mechanic> good, that is what I thought
workmad3 has joined #ruby
<blazes816> what about an accessor? if there's an accessor for @varname, could it not cause issues?
<the_mechanic> so declaring a bunch of self.method(varname) is totally acceptable, even if I have @varname decalred and used in the non class instance methods
<the_mechanic> yes?
<Ionic`> blazes816: probably, but you can specify it via varname() vs. varname
<Ionic`> sure
<blazes816> Ionic`: for sure, just figured I'd point out a possible issue later on, if it wasn't handled correctly.
<shevy> boobs!
cbuxton1 has quit [Quit: Leaving.]
<Ionic`> boobs?
minijupe has joined #ruby
<the_mechanic> but when I do MyClass.varname only the accessor is in play
<the_mechanic> so the scope shouldn't conflict, or is that wrong?
<shevy> Ionic` sorry, tried to get the discussion down to my level
<Ionic`> uhm, what?
<shevy> the_mechanic, .varname is a method yes
<shevy> Ionic`, yeah I think that is unprofessional. not because they mention boobs, but because I believe in engineering, the thinking pattern should try to focus on the problem at hand
<shevy> a robot would have no need to use such names
mrdodo has quit [Remote host closed the connection]
dv310p3r has quit [Ping timeout: 276 seconds]
<Ionic`> shevy: I think it's moot or rather showing the real issue all along (i.e., lawyers)
Criztian has quit [Remote host closed the connection]
abra has quit [Remote host closed the connection]
abra has joined #ruby
davidpk has joined #ruby
ryan0x2 has quit [Remote host closed the connection]
ringotwo has joined #ruby
companion has joined #ruby
jimeh has quit [Ping timeout: 252 seconds]
morodin has joined #ruby
cek has joined #ruby
beneggett has joined #ruby
bigkevmcd has quit [Ping timeout: 248 seconds]
<cek> What's a good mail distribution solution written in ruby? With unsub support, with user management, with ui possibly?
ryan0x2 has joined #ruby
jimeh has joined #ruby
Spooner has quit [Ping timeout: 276 seconds]
fbernier has quit [Ping timeout: 246 seconds]
<i0n> i hate this zipzip library
timonv has quit [Remote host closed the connection]
<the_mechanic> why doesn't Integer have a new method?
<jonathancutrell> Looks like my zip file wasn't making it all the way.
i0n has quit [Quit: leaving]
<jonathancutrell> (it's corrupted, apparently)
pdtpatrick has joined #ruby
<Mon_Ouie> Because it doesn't make sense to "create" an new integer since you'd need to pass an integer to create another integer
<blazes816> the_mechanic: every integer is already an instance of Integer
timonv has joined #ruby
<cek> integer is not an object
<Mon_Ouie> Plus the Integer class itself never gets instanced, and due to optimizations, there are Fixnums that cannot be instanced at all
asdfqwer_ has joined #ruby
Draco___ has quit [Remote host closed the connection]
<Mon_Ouie> (tagged pointers)
beneggett has quit [Ping timeout: 276 seconds]
<Hanmac> cek ?? integer numbers are ruby objects, and the class Integer is an object too
<fowl> RUBY!
asdfqwer_ is now known as asdfqwer
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
_bart has joined #ruby
elux has joined #ruby
<cek> inegers are not web-scale
<fraser> Correct me if I'm wrong, but isn't almost everything an object in ruby?
dv310p3r has joined #ruby
<Mon_Ouie> Every value you can manipulate, yes
<Mon_Ouie> The "almost" just comes from the fact that code isn't data in Ruby (unlike Lisp)
bbttxu has joined #ruby
anomaly has joined #ruby
hashpuppy has joined #ruby
Lachryma has quit [Quit: Leaving]
<hashpuppy> i've posted this poll in #haskell, #scala, #clojure, and a few other channels. i've received quite a few responses. i would like 20 more, though. if you guys get a few minutes, would you guys help me by filling out this poll on productivity and health in software engineering: https://docs.google.com/spreadsheet/viewform?pli=1&formkey=dGZpbHExdHZteXY4VkpaRnBQUzRPRHc6MQ#gid=0
beneggett has joined #ruby
kichawa has quit [Quit: Changing server]
duder has joined #ruby
wilmoore has joined #ruby
asdfqwer has quit [Client Quit]
i0n has joined #ruby
i0n has quit [Client Quit]
<Ionic`> hmmm
faulkner- is now known as faulkner
theRoUS has quit [Read error: Operation timed out]
<cek> no we won't submit your poll fat mister with big suitcase from gartner
<fowl> hashpuppy, please file a E4T D1CK request with the main office
<fowl> yeah you fascist pig
<hashpuppy> haha. i've asked in 6 other channels. and all have been really friendly about this
<cek> not in ruby!
<hashpuppy> heh. i'm sorry
<sernin> no ruby for you. one year.
<hashpuppy> thanks for those that have submitted
<shevy> lol
<hashpuppy> i love ruby, though!
<fowl> go back to the friendly world you know
<shevy> you must use php now
<jonathancutrell> So in my uploading portion… How might that file have not gotten completely copied over? The upload uses the tempfile.read of a multipart form, and reads it in in chunks.
<otters> I just submitted it
<otters> oh lawdy
bigkevmcd has joined #ruby
<otters> is that poll only for people who are out of high school
<shevy> jonathancutrell is that rails
MasterLambaster has quit [Quit: MasterLambaster]
<sernin> shevy: looks like sinatra
<jonathancutrell> shevy: nope - Sinatra.
<shevy> cool
<hashpuppy> otters: for anyone who develops software
xorgnak has joined #ruby
<shevy> hmm
<otters> oh okay
<shevy> what about those guys who do not develop software but just write code
sebastorama has quit [Read error: Operation timed out]
<hashpuppy> no
<the_mechanic> If I have a class Foo and it load module Bar and Module bar has a class Foo also
<the_mechanic> would that work?
<shevy> the_mechanic, yeah. the second class Foo is in a namespace
<Ionic`> shevy: how can you write code without developing software?
<jonathancutrell> in particular, the line I think isn't working is --> while blk = tmpfile.read(65536)
<shevy> (1) class Bar (2) module Foo; class Bar; <--- two different classes
apeiros_ has joined #ruby
<shevy> Ionic` poetry! creativity! getting nothing done, rather than getting things done :)
i0n has joined #ruby
mengu has joined #ruby
<Ionic`> shevy: getting nothing done and being verbose about it?
<the_mechanic> would I have to do Bar::Foo.method in class Foo which is not in the module Bar?
<xorgnak> that sounds like an extremely bad idea.
<shevy> Ionic`, lol yeah. and creative about it... I mean, we have languages like brainfuck
<fowl> Ionic`, long ago he finished the tron world and has been lost in it ever since, irc is his only method of communication to the outside
robbyoconnor has quit [Ping timeout: 246 seconds]
i0n has quit [Client Quit]
<Ionic`> hehe
<shevy> the_mechanic, yes, you must scope properly via ::
<shevy> well
<shevy> inside class Foo you can just call the methods
ramblex has joined #ruby
<shevy> you could also do include Bar
<xorgnak> wouldn't it make far more sense to generalize the class between the two and then just include the class in the module?
<shevy> then you can omit the Bar:: stuff
a_a_g has quit [Ping timeout: 255 seconds]
<the_mechanic> well I have a class which deals with a load balancer pool
<the_mechanic> I build a module which is LoadBalancerInterfaces , and that talks to the load balancer
beneggett has quit [Ping timeout: 252 seconds]
<the_mechanic> now I want to write a separate class which deals with pools without touching the load balancer interfaces
dhruvasagar has quit [Ping timeout: 246 seconds]
i0n has joined #ruby
<xorgnak> different name maybe?
<the_mechanic> so I can instantiate pools, convert format etc in the general business logic class and then only deal with the load balancer when I need persistence
ananthakumaran has quit [Quit: Leaving.]
<the_mechanic> that way I could test them separately as well
<Ionic`> hmm
<Ionic`> rb_block_call
<Ionic`> gimme implementation
<shevy> module Foo; class Bla; module Yippie; class Bla <--- two different class Bla
tatsuya_o has joined #ruby
mwilson_ has quit [Excess Flood]
chussenot has joined #ruby
mwilson_ has joined #ruby
<the_mechanic> yes but the problem is I wnt bla in foo to talk to bla in yippie when it is time to save the object to the device
<xorgnak> grab
<sernin> so you use Yippie::Bla instead of just Bla
<the_mechanic> that is all I asked :)
<the_mechanic> I was just wondering if I included yippie and then called Blah.method_from_yippie_blah
<Ionic`> hmmm
<shevy> well it is no different than two classes talking to one another even if they haven't been put into any module
<Ionic`> Enumerator::Lazy (r2.0)
MasterLambaster has joined #ruby
<shevy> and Blah.method is a class method, isn't it? There is no instance of Blah anywhere in that
xorgnak has quit [Remote host closed the connection]
<Ionic`> shevy: show me src for rb_block_call!
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
mwilson_ has quit [Excess Flood]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
mwilson_ has joined #ruby
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
ciopte7 has joined #ruby
a_a_g has joined #ruby
xorgnak has joined #ruby
<Ionic`> right
<Ionic`> about github
xorgnak has quit [Remote host closed the connection]
<Ionic`> you can't search for stuff
kirun_ has joined #ruby
mxweas has joined #ruby
xorgnak has joined #ruby
<apeiros_> o0
<apeiros_> of course you can
<Ionic`> how?
<Ionic`> well
<Ionic`> you can't "git grep" the repo
<Ionic`> this has always pissed me off
xorgnak has quit [Remote host closed the connection]
kirun has quit [Ping timeout: 272 seconds]
<Ionic`> apeiros_: yeah, I kow/found that too
<apeiros_> meh
<Ionic`> but there is no button
<apeiros_> gotta reinstall my stuff
dankest has joined #ruby
xorgnak has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
shavus has quit []
heikozeus has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
manizzle has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
vlad_starkov has joined #ruby
heikozeus has left #ruby [#ruby]
chson has quit [Remote host closed the connection]
Isolatr has joined #ruby
xorgnak has joined #ruby
milestone has quit [Ping timeout: 246 seconds]
chussenot has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<any-key> happy wednesday
beneggett has joined #ruby
cantonic has joined #ruby
<any-key> how is everyone's day?
chimkan_ has joined #ruby
duder has quit [Quit: Page closed]
anothervenue has joined #ruby
jrist-afk is now known as jrist
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
<jonathancutrell> Success.
<jonathancutrell> (For anyone who was listening.)
<sernin> jonathancutrell: hooray
<jonathancutrell> indeed.
dankest has quit [Quit: Linkinus - http://linkinus.com]
<jonathancutrell> there are much better ways to do it than the way I was attempting to do it.
<jonathancutrell> (and I found one of those ways.)
<jonathancutrell> The zip code (heh) was correct
<jonathancutrell> the file chunk reading was incorrect.
manolo has quit [Remote host closed the connection]
jonathancutrell has quit [Quit: jonathancutrell]
<apeiros_> hm, sad he left…
tiripamwe has quit [Ping timeout: 255 seconds]
<apeiros_> anybody seen his problem?
<apeiros_> was it that a zip file did not open using the rubyzip lib?
lkba has joined #ruby
tiripamwe has joined #ruby
<Ionic`> mh his paste is gone
<Ionic`> something like this
<Ionic`> it wasn't uploaded properly
Isolatr has quit [Quit: Isolatr]
bradhe_ has joined #ruby
chriskk has joined #ruby
bluenemo has quit [Ping timeout: 246 seconds]
anomaly has left #ruby [#ruby]
paval has joined #ruby
delinquentme has joined #ruby
<delinquentme> does for 1..100 in ruby work?
<delinquentme> or something akin?
<apeiros_> for i in 1..100, yes
<apeiros_> but it's rarely used
bradhe has quit [Ping timeout: 246 seconds]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
the_mechanic has quit [Quit: the_mechanic]
<Mon_Ouie> (1..100).each { |i| … } is the more common way of doing it
<apeiros_> 1.upto(100) { |i| is the nicer way for this specific case (IMO)
<apeiros_> also 2 characters shorter!
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
fayimora has joined #ruby
azm has joined #ruby
a_a_g has quit [Ping timeout: 244 seconds]
mwilson_ has quit [Excess Flood]
ron has joined #ruby
timonv has quit [Remote host closed the connection]
mwilson_ has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
<ron> hi, how do I know which ruby version that I have installed is active? I have both 1.8.7 and 1.9.2
baphled has quit [Ping timeout: 252 seconds]
<blazes816> ruby -v
the_mechanic has joined #ruby
the_mechanic has quit [Client Quit]
strife25 has quit [Quit: Computer has gone to sleep.]
<blazes816> ron^
<ron> thanks! :)
<blazes816> np
<Hanmac> ron what system? an debian?
<Ionic`> select and detect
<Ionic`> ok
<ron> centos. ruby -v gave me the answer :)
a_a_g has joined #ruby
MasterLambaster has quit [Quit: MasterLambaster]
<Mon_Ouie> CentOS actually has a package for Ruby 1.9?
<ron> oh, apparently I also need to check my rails version. how do I go about that?
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Hanmac> debian's has a system for switching the ruby version
<blazes816> ron: use rvm or something if you're not
<blazes816> to manage rubies
<Mon_Ouie> ron: gem list rails
<sernin> ron: start using rvm.
<paval> rails -v
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
<ron> hmm, okay, I have both 3.2.1 and 2.3.14. I need to have at least 3.2.6.
<Mon_Ouie> gem install rails will install the last version
chussenot has joined #ruby
<ron> thanks, sorry for the basic questions.
<Ionic`> mh nah
fflush has joined #ruby
<Ionic`> I can't just replace the whole block by return foo.select { }
ryannielson has quit [Quit: ryannielson]
ryan0x2 has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
sebastorama has joined #ruby
s0ber has quit [Read error: Connection reset by peer]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
s0ber has joined #ruby
a_a_g1 has joined #ruby
hynkle has quit [Ping timeout: 244 seconds]
a_a_g has quit [Ping timeout: 276 seconds]
jchauncey has quit [Read error: Connection reset by peer]
xorgnak has joined #ruby
Gm4n has quit [Ping timeout: 244 seconds]
sirecote has quit [Ping timeout: 244 seconds]
chussenot_ has joined #ruby
xorgnak has quit [Remote host closed the connection]
stringoO has joined #ruby
alindeman has quit [Remote host closed the connection]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
alindeman has joined #ruby
chussenot has quit [Client Quit]
chussenot_ is now known as chussenot
hynkle_ has joined #ruby
xorgnak has joined #ruby
Eldariof-ru has quit []
ron has left #ruby ["Leaving"]
beneggett has quit [Ping timeout: 255 seconds]
Gm4n_ has joined #ruby
lae has quit [Ping timeout: 244 seconds]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
sirecote has joined #ruby
lae has joined #ruby
xorgnak has quit [Remote host closed the connection]
beneggett has joined #ruby
fflush has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
xorgnak has joined #ruby
<Ionic`> apeiros_: http://pastie.org/private/ac5ductpqz3n9au4xujg am I weird, if I like my first solution better?
jeff_sebring has joined #ruby
vectorshelve has joined #ruby
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
t0mmyvyo is now known as tommyvyo
<apeiros_> um, no, because the 2nd is totally messed up…
<Ionic`> well, that's the only way I see to do it with select? :p
thecreators has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
Lachryma has joined #ruby
Poapfel has quit [Quit: WeeChat 0.3.7]
<cek> ,*_
<apeiros_> also, yard style docs++
Lachryma has quit [Client Quit]
<Ionic`> ah
<Ionic`> map
Lachryma has joined #ruby
<Ionic`> yard style docs?
<apeiros_> cek: more work for ruby for a single character. but yes, premature optimization.
<Ionic`> ,*_?
sendoushi has quit [Remote host closed the connection]
<apeiros_> Ionic`: he means |sect,*_| instead of |sect,_,_|
<apeiros_> *_ will "unsplat" the rest of the args into an array
jchauncey has joined #ruby
<vectorshelve> can anyone explain this concept -> http://pastie.org/4332165 line 7 is just name of another class.. and there is no instantiation happening there shouldnt it be TaxMediator.new ?
jchauncey has quit [Client Quit]
<Ionic`> ah
<cek> modules can't be instantiated
anothervenue has quit [Quit: WeeChat 0.3.8]
<vectorshelve> cek: TaxMediator is a class and not module
ringotwo has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
Goles has joined #ruby
ringotwo has joined #ruby
verbad has joined #ruby
s0ber_ has joined #ruby
<apeiros_> vectorshelve: classes are normal objects
<apeiros_> and this method happens to return an object that happens to be a class
<Ionic`> hmm
<Ionic`> where do I find this stuff
s0ber has quit [Read error: Operation timed out]
<apeiros_> without context, there isn't much more to say about that
<vectorshelve> apeiros_: u mean to say I dont need to do TaxMediator.new ?
s0ber_ is now known as s0ber
<apeiros_> vectorshelve: I mean to say that you only do TaxMediator.new when you actually want an instance of TaxMediator. obviously he doesn't
Jake232 has joined #ruby
Lachryma has quit [Read error: Connection reset by peer]
Lachryma has joined #ruby
Lachryma has quit [Read error: Connection reset by peer]
bwwrd has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
krusty_ar has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
Lachryma has joined #ruby
vlad_starkov has joined #ruby
brett has joined #ruby
<brett> hey, I've install 1.9.3 on ubuntu 11.04, but I'm getting this error: https://gist.github.com/5bfee4e20dbf2d2499cf
kbanman has joined #ruby
monkegjinni has joined #ruby
<kbanman> I'm working on installing gitlab, and am running into this error:
<kbanman> rake aborted!
<kbanman> cannot load such file -- omniauth/ldap
<kbanman> any ideas?
<apeiros_> you're missing the omniauth/ldap library?
<kbanman> is that its own gem?
<apeiros_> no idea, I'd google and/or check rubygems.org
<apeiros_> it's either part of omniauth or its own lib
joch_n has joined #ruby
<kbanman> I have omniauth installed, but googling that error gives me zero
mdickens has quit [Ping timeout: 244 seconds]
<kbanman> ah, yep. it's a separate gem: omniauth/ldap
ringotwo has quit [Read error: Connection reset by peer]
<kbanman> err, omniauth-ldap
ryanRT has quit [Read error: Connection reset by peer]
ryanRT has joined #ruby
ringotwo has joined #ruby
a_a_g1 has quit [Ping timeout: 276 seconds]
<Ionic`> apeiros_: where can I find documentation about replacing "ignored" members with _ or *_?
alekst has joined #ruby
<apeiros_> Ionic`: _ is a valid variable name
<Ionic`> oh
<apeiros_> I could have written |sect,foo,bar| too
<apeiros_> but _ is a better indicator for "not used"
<Ionic`> and obviously redefining/overwriting it is no problem
cek has quit [Quit: Object superclasses!]
Spooner has joined #ruby
baphled has joined #ruby
<apeiros_> nope
<Mon_Ouie> I prefer when the name is still there. Because someday, maybe someone will want to change the block, and they will need to use one of the other arguments, but won't know right away which does what.
<apeiros_> yes, sect,_key,_value is also a common pattern
Morkel has joined #ruby
chson has joined #ruby
Morkel has quit [Client Quit]
cbuxton has joined #ruby
Criztian has joined #ruby
Morkel has joined #ruby
elhu has joined #ruby
ghaydarov has joined #ruby
<apeiros_> Ionic`: as for *foo - google for 'ruby splat'
<apeiros_> I'm sure you'll find a good explanation
kbanman has left #ruby [#ruby]
vectorshelve has quit [Ping timeout: 245 seconds]
kaen has joined #ruby
strife25 has joined #ruby
<kaen> can anyone give me a clue as to why this returns false:
<kaen> lambda(&(proc do end)).lambda?
sebastorama has quit [Ping timeout: 252 seconds]
<kaen> i.e. why it doesn't produce a lambda Proc
<Ionic`> apeiros_: http://pastie.org/private/yeoqxmavjvjvmkkl9wd5w that should be ok (and better, because it breaks after the element has been found), right? :)
milestone has joined #ruby
<Mon_Ouie> |foo, *_| can be written as just |foo,| (also |foo, *|)
tommyvyo_ has joined #ruby
cbuxton has quit [Read error: Connection reset by peer]
<apeiros_> aw, man, I do that for methods, but I forgot that I can use it as a proc…
mathie has quit [Quit: Sleeping...]
cbuxton has joined #ruby
zoidfarb has left #ruby [#ruby]
christopherlee has joined #ruby
kaen has quit [Read error: Connection reset by peer]
devdazed has quit [Quit: Computer has gone to sleep.]
xorgnak has joined #ruby
alekst has quit [Quit: Leaving...]
xorgnak has quit [Remote host closed the connection]
mwilson_ has quit [Excess Flood]
fantazo has quit [Remote host closed the connection]
mwilson_ has joined #ruby
fraser has quit [Quit: Leaving]
xorgnak has joined #ruby
kylemcgill has joined #ruby
erichmenge has quit [Quit: Be back later]
azm has quit [Ping timeout: 255 seconds]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<apeiros_> s/as a/for this/
* apeiros_ is distracted by the mountain lion
nooodl has quit [Quit: Leaving]
Goles has quit [Ping timeout: 244 seconds]
minijupe has quit [Quit: minijupe]
xorgnak has quit [Remote host closed the connection]
khakimov has joined #ruby
xorgnak has joined #ruby
shell0x has joined #ruby
bowlowni has joined #ruby
billy_ran_away has joined #ruby
<billy_ran_away> Hi I'm making a commit where I enclose a module within another module, would I refer to that as nesting?
niklasb is now known as niklasb_
Markvilla has joined #ruby
ringotwo has quit [Remote host closed the connection]
<billy_ran_away> Here's what I'm referring to: http://cl.ly/IKcu
<billy_ran_away> I'm just trying to write a commit message for this...
blaxb has joined #ruby
Gavilan has joined #ruby
milestone has quit [Remote host closed the connection]
milestone has joined #ruby
milestone has quit [Client Quit]
<shevy> billy_ran_away yes
<shevy> module A nested in module B
<billy_ran_away> shevy: Thank you
<billy_ran_away> shevy: Okay cool
davidpk has quit [Quit: Computer has gone to sleep.]
TechCel has quit [Ping timeout: 244 seconds]
ianbrandt has joined #ruby
kaen has joined #ruby
niklasb_ is now known as niklasb
carloslopes has quit [Quit: Leaving.]
bluOxigen has quit [Ping timeout: 255 seconds]
hynkle_ has quit [Quit: Computer has gone to sleep.]
<brett> I am getting undefined symbol: rb_Digest_MD5_Init when trying to import digest/md5 - path issue?
<xclite> could be a scoping issue
<shevy> brett perhaps openssl is not available or something like that on your system
adeponte has quit [Remote host closed the connection]
jcooley has quit [Ping timeout: 264 seconds]
LBRapid has joined #ruby
<brett> shevy, it is installed, libssl 0.9.8o
<shevy> hmm
xorgnak has quit [Remote host closed the connection]
chichou has joined #ruby
kaen has quit [Quit: Leaving]
tommyvyo_ has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
xorgnak has joined #ruby
workmad3 has joined #ruby
Jay_Levitt has quit [Ping timeout: 246 seconds]
sepp2k has quit [Read error: Connection reset by peer]
xorgnak has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
berserkr has quit [Quit: Leaving.]
vlad_starkov has quit [Remote host closed the connection]
bequick has quit [Read error: Operation timed out]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
kvirani has quit [Remote host closed the connection]
jonathancutrell has joined #ruby
erichmenge has joined #ruby
paval has quit [Quit: Leaving]
<sernin> Will something like o.match(some_regex) { if o.match(another_regex) ...} not work as expected? I'm thinking that the match is consumed on the first iteration.
xorgnak has joined #ruby
bbttxu has quit [Quit: bbttxu]
<sernin> Sorry if that's confusing, but, basically, I am just wondering if I need to store this data elsewhere or I can just abuse String#match as above
sailias has quit [Ping timeout: 276 seconds]
blaxb has quit [Remote host closed the connection]
ringotwo has joined #ruby
Simon3 has joined #ruby
dangerousdave has quit [Quit: Leaving...]
xorgnak has quit [Remote host closed the connection]
spinagon has quit [Ping timeout: 276 seconds]
the_mechanic has joined #ruby
xorgnak has joined #ruby
the_mechanic has quit [Client Quit]
shavus has joined #ruby
stringoO has quit [Read error: Connection reset by peer]
stringoO has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
xorgnak has quit [Remote host closed the connection]
kpshek has quit []
mxweas has quit [Quit: Leaving...]
xorgnak has joined #ruby
chevdor_ has joined #ruby
nedbat has joined #ruby
<chevdor_> Hello, I am running into an issue and I was hoping someone could give my a clue(hint. I have described the topic here: http://goo.gl/b1uDN
xorgnak has quit [Remote host closed the connection]
wedgeV has joined #ruby
bradhe_ has quit [Remote host closed the connection]
<chevdor_> In short I am migrating an installation of Gitorious and rake is giving me a hard time
xorgnak has joined #ruby
Banistergalaxy has joined #ruby
morodin has quit [Read error: Operation timed out]
Simon3 has quit [Ping timeout: 246 seconds]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
etehtsea has quit []
verbad has quit []
chimkan_ has quit [Quit: chimkan_]
xorgnak has quit [Remote host closed the connection]
chimkan_ has joined #ruby
xorgnak has joined #ruby
stringoO has quit [Quit: stringoO]
xorgnak has quit [Remote host closed the connection]
lorandi has quit [Quit: Leaving]
bluOxigen has joined #ruby
banseljaj is now known as imami|afk
obryan has quit [Quit: Konversation terminated!]
jonathancutrell_ has joined #ruby
xorgnak has joined #ruby
crankycoder has quit [Remote host closed the connection]
jonathancutrell has quit [Ping timeout: 244 seconds]
jonathancutrell_ is now known as jonathancutrell
erichmenge has quit [Quit: Be back later]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
stephenjudkins has quit [Ping timeout: 255 seconds]
erichmenge has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
manizzle has quit [Ping timeout: 244 seconds]
indian has joined #ruby
bbttxu has joined #ruby
manizzle has joined #ruby
blacktulip has quit [Remote host closed the connection]
<shevy> sernin, hmm dont think I saw that before
wangr_ has quit [Ping timeout: 252 seconds]
chevdor_ has left #ruby ["Verlassend"]
stephenjudkins has joined #ruby
atmosx has joined #ruby
thone_ has joined #ruby
<sernin> shevy: Yeah, I'm going to tackle it when I get home. Enough BS for one day. :)
<sernin> (at the office, at least)
<Ionic`> urgh... that's ugly
xorgnak has quit [Remote host closed the connection]
Progster has joined #ruby
xorgnak has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
yoklov has joined #ruby
thone has quit [Ping timeout: 252 seconds]
prometheus has joined #ruby
xorgnak has quit [Remote host closed the connection]
piotr__ has quit [Remote host closed the connection]
<Ionic`> I actually need return [ @kv_pairs.detect { |sect,k,_value| (sect == section) && (key == k) } ].map { |_sect,_key,value| value }
<Ionic`> hmmm
linoj has quit [Read error: Operation timed out]
xorgnak has joined #ruby
justinmcp has joined #ruby
devdazed has joined #ruby
elux has quit [Quit: Bye!]
Shagane has joined #ruby
Shagane has quit [Client Quit]
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
Dr4g has quit [Quit: Connection closed for inactivity]
mehlah_ has joined #ruby
celm has joined #ruby
celm has quit [Client Quit]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
<Ionic`> at least if there is only one solution... crap
cantonic has quit [Quit: cantonic]
xorgnak has joined #ruby
Gavilan is now known as gavilan2
<apeiros_> o0
<apeiros_> I think you're breeding too much over details
<apeiros_> add some tests
khakimov has quit [Quit: Computer has gone to sleep.]
<apeiros_> get the thing working
pskosinski has joined #ruby
<apeiros_> then when you have too much time and prefer cleaning up over adding features (and cleaning up is a good idea), go and refactor code…
<Ionic`> wait what? it did work fine before, I'm just prettifying it with your suggestions :p
<Ionic`> but I'm running into some problems
pskosinski has quit [Client Quit]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
EricKamsky_ has quit [Ping timeout: 250 seconds]
bigkm has quit [Ping timeout: 276 seconds]
<Ionic`> hum no, the hell
xorgnak has quit [Remote host closed the connection]
bigkm has joined #ruby
brianpWins has quit [Quit: brianpWins]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
<Ionic`> ah, my bad
<blazes816> I just interviewed for a job over the phone. He asked how much I made currently. I told him (and the answer is about $20k less than the advertised salary) and he went off about how it was way too high. I fucking hate looking for work.
balki_ has joined #ruby
xorgnak has quit [Remote host closed the connection]
balki has quit [Read error: Connection reset by peer]
verto is now known as verto|off
chichou has quit [Remote host closed the connection]
chichou has joined #ruby
<shevy> blazes816 haha yeah, but hey. those are the times where you grab a beer, drink that, and don't think too much about anything else than the beer ;)
Markvilla has quit [Ping timeout: 244 seconds]
mpereira has quit [Ping timeout: 244 seconds]
<blazes816> shevy: beat you there
Markvilla has joined #ruby
xorgnak has joined #ruby
[Neurotic] has joined #ruby
Dreamer3 has joined #ruby
wedgeV has quit [Quit: wedgeV]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
nedbat has quit [Disconnected by services]
<xclite> blazes816 I really feel like a lot of hiring managers are clueless
chichou has quit [Ping timeout: 276 seconds]
<Progster> xclite: duh :)
nedbat_ has joined #ruby
graspee has joined #ruby
<blazes816> definitely
<blazes816> except me
<xclite> it's kind of like the
<xclite> "required: 6 years of knowledge in something that's been out for 4 years" thing
<blazes816> haha yeah
<xclite> or "you must know php, python, perl, ruby, oracle, mysql, sqlite, and postgres"
<xclite> it's like
<xclite> ...
<fowl> wallstreet sociopaths
Nisstyre has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 246 seconds]
Nisstyre has joined #ruby
axl_ has quit [Quit: axl_]
dv310p3r has quit [Ping timeout: 276 seconds]
CannedCorn has quit [Quit: Computer has gone to sleep.]
<billy_ran_away> Can anyone tell me why my gem isn't working? https://github.com/billy-ran-away/mm-revisionable
weasels has joined #ruby
cj3kim has left #ruby ["Leaving"]
otters has quit [Read error: Connection reset by peer]
<billy_ran_away> I'm getting a uninitialized constant NameError, but all my specs pass.
codora has joined #ruby
<billy_ran_away> The NameError only happens when I try to use in my project by adding it to the Gemfile.
<billy_ran_away> I mean all my development specs inside the gem work fine.
<Ionic`> http://pastie.org/private/gpjvrp3hdswrq3vigpeqw doesn't look too nice but it's probably the best I've got
ackz has quit [Quit: Leaving...]
<Ionic`> as detect is returning the array itself, I can't #map it
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
<Ionic`> I could use [ detect { ... } ].map { |s,k,v| v }.slice(0) but that's not really any better
xorgnak has quit [Remote host closed the connection]
wpaulson has joined #ruby
Speed has quit [Ping timeout: 252 seconds]
kpshek has joined #ruby
baphled has quit [Ping timeout: 246 seconds]
xorgnak has joined #ruby
the_jeebster has quit [Quit: Leaving.]
johnlcox has quit [Read error: Operation timed out]
<i0n> can someone tell me whats wrong with this? i get absolutely no output from it. http://pastie.org/private/a1pnus988b8ir5nvvkuboa
<apeiros_> Ionic`: um, why did you replace select with detect?
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
<Ionic`> apeiros_: I didn't replace it, (keys() is using select), value is returning one value and I want it to break once the section and key match (only detect does that)
<Ionic`> it's really more of an optimization
weasels has quit [Quit: WeeChat 0.3.8]
shiki has joined #ruby
otters has joined #ruby
wvms has joined #ruby
<apeiros_> Ionic`: ah, you're in a different method
<Ionic`> yeah
<apeiros_> _sect,_key,value = @kv_pairs.detect { |sect,k,_value| (sect == section) && (key == k) }
<Ionic`> select and map works fine for keys() which returns an array of keys anyway
<apeiros_> and s/detect/find|
<apeiros_> and s/detect/find/
<apeiros_> detect--
<Ionic`> it's just an alias? :p
verto|off is now known as verto
<apeiros_> yes. it's the ugly brother.
<Ionic`> mh yeah but I can't just return that
<Ionic`> oh well
khakimov has joined #ruby
<Ionic`> I'll slice(2) through it, no big deal
Jake232 has quit [Ping timeout: 276 seconds]
<apeiros_> Ionic`: you get an array back
<Ionic`> yeah
<apeiros_> slice? ok, odd choice of method…
JoshWines has joined #ruby
<Ionic`> uh? why?
verto is now known as verto|off
Vert has quit [Ping timeout: 252 seconds]
<apeiros_> well, usually people use [], not slice (aliases again)
<apeiros_> an alternative would be of course to use a proper class instead of just an array of arrays…
<Ionic`> yeah
stephenjudkins has quit [Ping timeout: 250 seconds]
joshman_ has quit [Ping timeout: 244 seconds]
caveat- has quit [Remote host closed the connection]
<Ionic`> wouldn't that be the same thing, really?
<apeiros_> um, no? it would *do* the same thing. it would not *be* the same thing.
<apeiros_> there's a reason we use ruby and not C
<apeiros_> one of the biggest is OOP
<apeiros_> anyway, bed time for me. gn8
apeiros_ has quit [Remote host closed the connection]
<Ionic`> night :/
nedbat_ has quit [Ping timeout: 244 seconds]
k_89 has quit [Ping timeout: 255 seconds]
tatsuya_o has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
shavus has quit []
Solnse has quit [Ping timeout: 244 seconds]
kirun_ has quit [Quit: Client exiting]
mpereira has joined #ruby
paradoja has joined #ruby
justinmcp has quit [Remote host closed the connection]
devdazed has quit [Quit: Computer has gone to sleep.]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
mneorr has quit [Quit: Leaving.]
mneorr has joined #ruby
mneorr has quit [Client Quit]
billy_ran_away has quit [Ping timeout: 246 seconds]
ph^ has joined #ruby
bbttxu has quit [Quit: bbttxu]
Progster has quit [Ping timeout: 244 seconds]
verto|off is now known as verto
billiam has quit [Quit: Leaving]
prometheus has quit [Ping timeout: 244 seconds]
stopbit has quit [Quit: Leaving]
mehlah_ has quit [Quit: Leaving...]
chrisbolton has joined #ruby
chussenot has quit [Quit: chussenot]
mehlah_ has joined #ruby
BigFatFatty has joined #ruby
jonathancutrell_ has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
verto is now known as verto|off
nedbat has joined #ruby
jonathancutrell has quit [Ping timeout: 250 seconds]
jonathancutrell_ is now known as jonathancutrell
elhu has quit [Quit: Computer has gone to sleep.]
<i0n> how would i do something like this? @single += i.split(/\//) << arrayitem 4
bowlowni has quit [Remote host closed the connection]
kpshek has quit []
Berglund has joined #ruby
jjang has joined #ruby
hunglin has quit [Quit: Leaving.]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
headius has quit [Quit: headius]
EricKamsky has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
monkegjinni has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
sebicas has quit [Quit: sebicas]
jjang has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
jjang has joined #ruby
xorgnak has joined #ruby
CannedCorn has joined #ruby
jrajav has joined #ruby
mwilson_ has quit [Excess Flood]
justsee|away has quit [Quit: Leaving...]
mwilson_ has joined #ruby
xorgnak has quit [Remote host closed the connection]
tectonic has quit [Ping timeout: 244 seconds]
jgarvey has quit [Quit: Leaving]
MasterIdler_ has joined #ruby
xorgnak has joined #ruby
axl_ has joined #ruby
wpaulson has joined #ruby
CannedCorn has quit [Client Quit]
xorgnak has quit [Remote host closed the connection]
joch_n has quit [Quit: Linkinus - http://linkinus.com]
tectonic has joined #ruby
MasterIdler has quit [Ping timeout: 252 seconds]
MasterIdler_ is now known as MasterIdler
chrisbolton has quit [Quit: chrisbolton]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
khakimov has joined #ruby
<vandemar> i0n: it's not obvious what you want to do there. what is it doing that you don't want it to do?
mucker has joined #ruby
<Spaceghostc2c> Apocalypse: I found a lulzy. https://gist.github.com/7e4967b75f0b0a53f525
<Spaceghostc2c> Damnit.
seungers has quit [Read error: Connection reset by peer]
uris has quit [Quit: leaving]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
tiripamwe has quit [Quit: Leaving]
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
xorgnak has joined #ruby
artOfWar has quit [Remote host closed the connection]
jeff_sebring has quit [Quit: Leaving]
jrist is now known as jrist-afk
xorgnak has quit [Remote host closed the connection]
nari has joined #ruby
zeen` has quit [Ping timeout: 248 seconds]
nedbat has quit [Ping timeout: 276 seconds]
artOfWar has joined #ruby
nedbat has joined #ruby
emmanuelux has joined #ruby
MasterIdler has quit [Quit: MasterIdler]
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
kjellski has quit [Quit: This computer has gone to sleep]
akem has quit [Read error: Connection reset by peer]
caveat- has joined #ruby
jonathancutrell has quit [Quit: jonathancutrell]
S1kx has quit [Read error: Connection reset by peer]
S1kx has joined #ruby
S1kx has joined #ruby
xorgnak has joined #ruby
deryl has quit [Quit: deryl]
xorgnak has quit [Remote host closed the connection]
jimeh has quit [Ping timeout: 246 seconds]
cantonic has joined #ruby
yxhuvud has quit [Ping timeout: 276 seconds]
balki_ is now known as balki
IceDragon has joined #ruby
asobrasil has left #ruby [#ruby]
Criztian has quit [Remote host closed the connection]
ceej1 has joined #ruby
ceej has quit [Read error: Connection reset by peer]
pdtpatrick_ has joined #ruby
LBRapid has quit [Quit: Computer has gone to sleep.]
pdtpatrick has quit [Read error: Connection reset by peer]
pdtpatrick_ is now known as pdtpatrick
mvangala_home has joined #ruby
Rojo has quit [Quit: Leaving]
ForSpareParts has quit [Disconnected by services]
oscardelben has joined #ruby
ForSpareParts has joined #ruby
<tightwork> I am trying to use ruby 1.9.2 with rails in rvm but when I run rails s it segfaults with a problem in json further stating it is using ruby 1.8.7? http://dpaste.com/775416/
<tightwork> help please
<ForSpareParts> Is there an easy way to reinstall gem? I installed a new version of ruby and my system is a bit of a mess, new ruby doesn't see gems when I install them...
akem has joined #ruby
<ForSpareParts> If it matters at all, I'm using Ubuntu 12.04.
akem has quit [Remote host closed the connection]
ceej1 has quit [Quit: Leaving.]
ramblex has quit [Ping timeout: 250 seconds]
<tightwork> ForSpareParts: I recall gem pristine --all should reinstall all gems... at own risk when taking advice like that from newb of course :)
<ForSpareParts> tightwork: Unfortunately, I believe my gems are in the wrong place -- I want to actually reinstall gem itself...
erichmenge has quit [Quit: Linkinus - http://linkinus.com]
theRoUS has joined #ruby
<tightwork> ForSpareParts: I forget, did gem come with ruby or is it a separate package? you could apt-get install --reinstall
rvmeier has joined #ruby
<ForSpareParts> I didn't get either of them from apt. Or, I did at one point, but I got rid of those -- I think they were out of date...?
<Spooner> Gem comes with ruby. It generally isn't the best plan to use apt-get to install ruby, ratehr than rvm/rbenv/etc., since they generally give you out of date versions.
<ForSpareParts> Spooner: That was what I thought, yeah.
<CaptainJet> apt-get ruby1.9.1 actually gives you 1.9.2
<CaptainJet> even then it's still not up to date
nateberkopec has quit [Quit: Leaving...]
stephenjudkins has quit [Quit: stephenjudkins]
Guedes has joined #ruby
<ForSpareParts> If I installed ruby from RVM, would I have to start a new terminal session for it to acknowledge the update gem utility?
<Spooner> ForSpareParts : Not sure what you mean by gems being in the wrong place. Are they not where you expect with "gem which GEM" or does gem not even recognise that it has them?
nateberkopec has joined #ruby
<Spooner> You can just "source ~/.bash_profile" (I think it is that dot file; not sure)
<ForSpareParts> Spooner: require '[name of gem]' is complaining that I haven't satisfied my dependencies, even after a gem install on everything I need.
<ForSpareParts> Spooner: Well, I already killed my SSH session and started a new one. Oh well.
<ForSpareParts> I'm doing gem install again right now, and maybe this'll fix it...
<otters> to be fair, homebrew installs ruby 1.9.3-p194
nari has quit [Read error: Operation timed out]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
<ForSpareParts> By the way, is there a reason that installing gems takes so long? Especially the documentation? Seems like it ought to be quick, I mean, these (generally) aren't massive packages, right?
greasegum has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<Spooner> The docs usually take a while, though you can disable them if you don't use them
<ForSpareParts> Alright, so this is weird. Did sudo gem install sinatra, then a gem which sinatra, and it tells me that it can't find the gem.
<Spooner> You definitely don't want to sudo gem if you used rvm
<ForSpareParts> Ah. My bad.
ckrailo has quit [Quit: Computer has gone to sleep.]
<Spooner> You need to sudo it if you install a system Ruby though. RVM generally puts everything in ~/.rvm/rubies
linguini has joined #ruby
<ForSpareParts> So sudo gem would actually be calling a different binary? Or is it just that the install location depends on the user running gem?
<Spooner> ForSpareParts : You can put "gem: --no-rdoc --no-ri" in ~/.gemrc if you want to disable the (painfully slow) gem doc generation.
Russell^^ has quit [Quit: Russell^^]
<Spooner> I'm not sure. Also depends if you sudo-ed the installation. I'm not an expert though; I have used RVM, but I don't enjoy it :D
yoklov has quit [Quit: bye!]
<Spooner> Wow, pik on Windows actually downloads ruby 1.9.3-p194. Last time I checked it was woefully behind the times.
<ForSpareParts> Spooner: Well, fair enough.