Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<kandinski> I was precisely experimenting with a hash of default empty arrays
<kandinski> so Hash[0] is illegal, it has to be Hash.new 0
<kandinski> but when you make a Hash from zipping two arrays, you can call it either way
<gytis_z> banister_: thanks!
<gytis_z> kandinski: very interesting
<kandinski> Hash[k.zip(v)] or Hash.new k.zip(v)
<kandinski> gytis_z: I am a noob, even my question could be wrong
<kandinski> ah
burns180_ has joined #ruby
<kandinski> Hash[] creates a new array from an array of pairs, or an array of k,v,k2,v2 etc
<kandinski> Hash.new creates an empty array with a default value
dnyy has joined #ruby
<kandinski> an empty hash with the default value of an empty array, I mean
jamesaxl has joined #ruby
booginga has joined #ruby
tommyvyo has joined #ruby
<kandinski> so [] can mean in ruby: 1) subscript for hashes and arrays, 2) synonym for .call (in procs), 3) generate new object and populate from given arguments (in the case of Hash, for instance). Any other possible meaning of []?
apeiros_ has joined #ruby
<RegEchse> kandinski: i'd suggest reading through ri '[]' ;)
zul has joined #ruby
<kandinski> RegEchse: oh
<kandinski> thanks
zul has joined #ruby
<kandinski> RegEchse: you can tell I'm new, I just did ri '[]' in irb and got an undefined local error
noyb has joined #ruby
havenn has joined #ruby
zul has joined #ruby
nopolitica has joined #ruby
<RegEchse> kandinski: ri is a separate program; from the man page: "ri — Ruby API reference front end"
<kandinski> oh, right, ta
nopolitica has joined #ruby
nopolitica has joined #ruby
<kandinski> RegEchse: nothing known about [], but thanks for the tip anyway. I'll use it often.
redgetan has joined #ruby
pu22l3r_ has joined #ruby
kyledr has joined #ruby
io_syl has joined #ruby
lkba has joined #ruby
fixl has joined #ruby
CacheMoney has joined #ruby
steve1 has joined #ruby
burns180 has joined #ruby
boondox has joined #ruby
albemuth has joined #ruby
<gid0> am I missing a paramater?
mikeric has joined #ruby
thone has joined #ruby
* tommylommykins stares at symbols
<tommylommykins> I guess there's not really all that many operations that can be performed on symbols
neurodrone has joined #ruby
fayimora has joined #ruby
UForgotten has quit [#ruby]
codezombie has joined #ruby
kyledr_ has joined #ruby
jaminkle has joined #ruby
MasterBob has joined #ruby
Banistergalaxy has joined #ruby
burns180_ has joined #ruby
looopy has joined #ruby
superguenter1 has joined #ruby
jacktrick has joined #ruby
zulax has joined #ruby
stringoO has joined #ruby
akem_ has joined #ruby
<MasterBob> Hello. Is abort the clean way to gracefully exit a Ruby program?
<cout> exit()
<deryldoucette> exit, or return if its the last
<MasterBob> Why use exit() instead of abort?
<deryldoucette> think about it
<deryldoucette> what does abort signify to you? usually an error or a problem right?
<MasterBob> Hold on.
phantomfakeBNC has joined #ruby
<deryldoucette> most of the words selected generally make sense if you think of them in a real world situation.
<MasterBob> But if my program expects only 2 parameters and I want to exit if I don't receive two parameters...I'd want to use exit then, as that's how it's designed.
<MasterBob> oh-kay.
<MasterBob> thanks
<deryldoucette> some aren't quite sensible (at least to me) but the VAST majority are bang on.
tommyvyo has joined #ruby
<deryldoucette> no then you would use abort
<deryldoucette> that would make sense then
<deryldoucette> you're aborting because of a problem or error. in this case the lack of something thats needed
<deryldoucette> I would question exit then
<MasterBob> okay.
badabim has joined #ruby
<MasterBob> Do I have to explicitly state exit at the end of my program then?
<deryldoucette> no because ruby falls through with the last instruction
<deryldoucette> You might want to if you want to be pedantic but its not needed if you're just ending the program
<MasterBob> Okay. thanks deryldoucette
<deryldoucette> no problem :)
<mythmon> with StringScanner, can i match a string, but return only a subset of it?
<mythmon> in particular, I want to match a quoted string, but then not include the quotes.
<deryldoucette> for ME i try to make things semantically straight. i try to keep as close to what woul dbe natural english both in thought and form
<deryldoucette> doesn't mean you HAVE to, just that i think by doing that it helps you in the thought process behind what you're doing as well
<deryldoucette> like slice, map, ect don't *quite* match what i would use for natural english (my native language) but i completely understand why they DID choose the words.
<deryldoucette> and no, while i disagree with the terms i don't have better ones to suggest. :/
<deryldoucette> thus why i've not offered patches heheh
albemuth has joined #ruby
c0rn has joined #ruby
yoklov has joined #ruby
Banistergalaxy has joined #ruby
rexbutler has joined #ruby
<rexbutler> Question: would ruby optimize something like [xv,yv].min > 0 to xv > 0 and yv.min > 0 or something like
<mythmon> rexbutler: probably not
<rexbutler> mythmon: Hmm
<mythmon> or, simpler, how can I chop the first and last characters off a string?
<rexbutler> mythmon: Can't you just slice out the right portion?
kyledr has joined #ruby
<mythmon> in python i would say [1:-1], but it doesn't appear to work like that in ruby.
<rexbutler> your_string[1..-1] doesn't work?
<pastjean> mythmon: you can actually a = "\"asd\"" a
<pastjean> [1..-2]
<pastjean> since -1 is the last character and is the quote
<mythmon> ah, ok. i tried [1,-2]
<pastjean> "\"asd\""[1..-2]
<mythmon> yeah, thanks.
ap0gee has joined #ruby
<pastjean> mythmon: no problems
<rexbutler> pastjean: or better, my_string[1...-1]
<mythmon> in python it is -1, because its not inclusive of the end. 1.-2 works great
<mythmon> er, 1..-2
<pastjean> rexbutler: that's what I was meaning tough it's not -1 but -2
<rexbutler> pastjean: I mean, if you use '...' not '..' it doesn't include the character at the last index
<pastjean> ahhh did not know that trick :)
<Quadlex> So, load paths
waxjar has joined #ruby
<Quadlex> When loading a gem, /lib is added to the load path
<Quadlex> So what's the best practice for writing the gem during testing, manually adding /lib to the load path in your tests?
btanaka has joined #ruby
banister_ has joined #ruby
liluo has joined #ruby
phantomfakeBNC has joined #ruby
burns180 has joined #ruby
dagnachewa has joined #ruby
AndChat- has joined #ruby
btanaka has joined #ruby
<MasterBob> Does ruby have a version of the C++ vector?
arvidkahl has joined #ruby
<banister_> MasterBob: what features are oyu looking for
nari has joined #ruby
<MasterBob> just the ability to hold an unspecified number of variables
<pastjean> MasterBob: the normal array can do that
<MasterBob> pastjean: okay thanks.
<pastjean> MasterBob: http://www.ruby-doc.org/core-1.9.3/Array.html .. look at push and <<
dbgster has joined #ruby
<MasterBob> Thanks again pastjean
rburton- has joined #ruby
j3r0m3 has joined #ruby
jaminkle has joined #ruby
Vert has joined #ruby
apeiros has joined #ruby
ap0gee has joined #ruby
apeiros_ has joined #ruby
nobitanobi has joined #ruby
apeiros has joined #ruby
<nobitanobi> given an array like this [{"id" => 1, "value" => 10},{"id" => 2, "value" => 20} ... ] - How can I add all the values without having to do an each ?
apeiros_ has joined #ruby
apeiros_ has joined #ruby
apeiros_ has joined #ruby
shtirlic has joined #ruby
<banister_> nobitanobi: [{"id" => 1, "value" => 10},{"id" => 2, "value" => 20}].inject(0) { |a, v| a + v["value"] }
<nobitanobi> mm le me check
<nobitanobi> thanks
arvidkahl has joined #ruby
undersc0re has joined #ruby
CacheMoney has joined #ruby
pu22l3r has joined #ruby
nobitanobi has joined #ruby
tommyvyo has joined #ruby
wadkar has joined #ruby
nobitanobi has joined #ruby
burns180_ has joined #ruby
jaminkle has quit [#ruby]
sacarlson has joined #ruby
Guest47031 has quit [#ruby]
nobitanobi has joined #ruby
arvidkahl has joined #ruby
chessguy has joined #ruby
nobitanobi has joined #ruby
rdesfo has quit [#ruby]
swarley has joined #ruby
ansii has joined #ruby
Rishi_ has joined #ruby
xrfang has joined #ruby
arvidkahl has joined #ruby
<xrfang> hi, I installed ruby1.8 on ubuntu, and then do a gem install rdoc, but rdoc refused to be upgraded, after install 3.1.2, the system still use v1.0.1 comes with the ruby1.8 deb installation. why?
apeiros_ has joined #ruby
nobitanobi has joined #ruby
nopolitica has joined #ruby
ap0gee has joined #ruby
pu22l3r has joined #ruby
pu22l3r has joined #ruby
bigkm has joined #ruby
ed_hz_ has joined #ruby
burns180 has joined #ruby
dlam has joined #ruby
odinswand has joined #ruby
cantbecool has joined #ruby
cantbecool has quit [#ruby]
vraa has joined #ruby
igotnolegs has joined #ruby
apeiros has joined #ruby
nobitanobi has joined #ruby
Bosma has joined #ruby
_jak has joined #ruby
_jak has quit [#ruby]
Corey has joined #ruby
nobitanobi has joined #ruby
jankly has joined #ruby
chimkan__ has joined #ruby
rramsden has joined #ruby
sroy2_ has joined #ruby
sohocoke has joined #ruby
nobitanobi has joined #ruby
sohocoke_ has joined #ruby
Sailias has joined #ruby
odinswand has joined #ruby
paydro has joined #ruby
nobitanobi has joined #ruby
albemuth has joined #ruby
burns180_ has joined #ruby
nobitanobi has joined #ruby
Phrogz has joined #ruby
nfluxx has joined #ruby
heftig has joined #ruby
<shevy2> xrfang probably your ubuntu version interferes
<shevy> ubuntu hates if you dont use their way
<xrfang> shevy2: yes I found there is a rdoc under /usr/bin, which is not in the gem way. and there is a gem one under /usr/local/bin
blazento has joined #ruby
<shevy> well one is the wrong one I suppose
<shevy> also upload the output of `gem env`
<shevy> also of the gem in /usr/local/bin and compare the two
<shevy> you should ask the ubuntu guys how to use gems the ubuntu-way. as they create the mess in the first place
<banister_> shevy: sup markus
<shevy> banister_ hey I am poaching another ubuntu victim right now!
<banister_> shevy: do you consider yourself evil and german
<shevy> those poor souls are eternally scorched by the unholy flame that burns in ubuntu
<shevy> evil is relative
Seisatsu has joined #ruby
<xrfang> ok, I will continue the ruby way, instead that I am reluctant to compile ruby myself.
<xrfang> seem all ok, until I try to start the webrick server
<xrfang> e.g. ruby script/server webrick -e production
<xrfang> btw, I am trying to install the redmine server
<shevy> well it can always lead to confusion when your system is messed up
<shevy> you can:
<shevy> (a) stick to the debian way
<xrfang> the above command generated an eacces error, on the /var/www/redmine/tmp/pids file. my question is, do webrick usually run as ROOT?
<shevy> (b) get rid of the old ruby and compile ruby for yourself into i.e. /usr prefix, but you probably have to get some header files before you can compile things
<libertyprime> Hey guys. I don't know why ruby isn't finding sqlite3 in my script. At the top of my script I have "require 'sqlite3'", and the gem has been installed. However it's giving me "no such file to load". How can I figure out what's going wrong?
<shevy> (c) install RVM and manage ruby that way http://beginrescueend.com/
<xrfang> shevy, RVM sounds interesting. I will take a look now
<shevy> (d) try to find the proper version to call (or just kill the wrong gem or wrong gem paths, but I never tried that)
<shevy> xrfang, I don't think so. I think you can run webrick without being root
<shevy> it's just a webserver that comes with ruby, so if you are able to use ruby as non-root, webrick should work as well
<shevy> but perhaps you had no user access to that directory
<xrfang> hm... a quick browse I found RVM maybe overkilling, I will take your advice (b).
<shevy> yay :)
<shevy> it's what I did
<xrfang> but first, I would like to understand why webrick is "access denied".
<shevy> I got rid of all of ruby that debian had and compiled into /usr (though actually, I compile into a versioned directory, a bit how RVM does too)
<shevy> how to install, gemm install redmine ?
<shevy> *gem
<xrfang> noticed that in step 7, it chmod the tmp folder to 755, but then webrick complains no access...
<xrfang> shevy, no I just downloaded redmine directly.
<xrfang> shall I install using gem?
<shevy> I dont know
<shevy> I dont think I installed redmine before
<shevy> ERROR: Could not find a valid gem 'redmine' (>= 0) in any repository
<shevy> ERROR: Possible alternatives: redline, radmin, rediline, redcuine, redmiso
<shevy> it does not seem to exist as gem
<xrfang> ok
Natch| has joined #ruby
<xrfang> I tried to ask the same question on #redmine, now will try to do a clean installation of ruby...
nobitanobi has joined #ruby
<libertyprime> ignore my last question. worked it out -.-
td123 has joined #ruby
btfriar has joined #ruby
snip_it has joined #ruby
c0rn has joined #ruby
nobitanobi has joined #ruby
pu22l3r_ has joined #ruby
xrfang has joined #ruby
macmartine has joined #ruby
looopy has joined #ruby
caiges has joined #ruby
nikhil_ has joined #ruby
rburton- has joined #ruby
burns180 has joined #ruby
nobitanobi has joined #ruby
arvidkahl has joined #ruby
Transcended has joined #ruby
nobitanobi has joined #ruby
demian`_ has joined #ruby
adeponte has joined #ruby
Jay_Levitt has joined #ruby
nobitanobi has joined #ruby
JNZ` has joined #ruby
nobitanobi has joined #ruby
EvanR has joined #ruby
thebastl has joined #ruby
j3r0m3 has joined #ruby
Banistergalaxy has joined #ruby
gogiel has joined #ruby
pielgrzym has joined #ruby
startling has joined #ruby
j3r0m3 has joined #ruby
iamjarvo has joined #ruby
ceej has joined #ruby
<iamjarvo> does anyone have a good article on ruby and immediate values ?
j3r0m3 has joined #ruby
yeltzooo has joined #ruby
startling has quit [#ruby]
russfrank has joined #ruby
blazento has joined #ruby
j3r0m3 has joined #ruby
ged has joined #ruby
j3r0m3 has joined #ruby
libertyprime has joined #ruby
fismo has joined #ruby
timonv has joined #ruby
rohit has joined #ruby
nobitanobi has joined #ruby
nikhil_ has joined #ruby
cantbecool has joined #ruby
arvidkahl has joined #ruby
nobitanobi has joined #ruby
cantbecool has joined #ruby
rippa has joined #ruby
burns180_ has joined #ruby
mdel has joined #ruby
nobitanobi has joined #ruby
gokul has joined #ruby
waxjar has joined #ruby
nobitanobi has joined #ruby
AndChat| has joined #ruby
pp01bit has joined #ruby
pen has joined #ruby
nobitanobi has joined #ruby
banistergalaxy has joined #ruby
j3r0m3 has joined #ruby
nobitanobi has joined #ruby
snip_it has joined #ruby
Zolrath has joined #ruby
AndChat- has joined #ruby
nobitanobi has joined #ruby
AndChat| has joined #ruby
k_89_ has joined #ruby
arvidkahl has joined #ruby
nobitanobi has joined #ruby
burns180 has joined #ruby
nobitanobi has joined #ruby
camilo_ has joined #ruby
<camilo_> Any way for a mock to yield with just minitest or do I need to bring mocha in?
booginga has joined #ruby
nobitanobi has joined #ruby
macmartine has joined #ruby
S0lign0c has joined #ruby
mikeric has joined #ruby
noyb has joined #ruby
apeiros_ has joined #ruby
kevinbond has joined #ruby
arvidkahl has joined #ruby
rohit has joined #ruby
guns has joined #ruby
krz has joined #ruby
dross has joined #ruby
bier has joined #ruby
AndChat- has joined #ruby
pen has joined #ruby
burns180_ has joined #ruby
eldariof has joined #ruby
drake10 has joined #ruby
nobitanobi has joined #ruby
<nikhil_> hi
<nikhil_> anyone around?
<nikhil_> I have a question about super()
<nikhil_> I am doing SaaS class from coursera
nobitanobi has joined #ruby
dross_ has joined #ruby
<nikhil_> When they call super in method_missing, they don't pass it any arguments
<nikhil_> and somehow the superclass just 'gets' the method_id and args
k_89_ has joined #ruby
DrShoggoth has joined #ruby
<nikhil_> however, i have seen ruby code where the superclass is passed arguments via super
<nikhil_> what is the mechanism behind this -- how to think about it?
<banistergalaxy> nikhil_: you can do both, if you invoke super without any args it automatically just passes up the same args it received in the subclass
<banistergalaxy> nikhil_: however if you explicitly pass up args then the superclass *only* gets those args
<banistergalaxy> nikhil_: again, it's ruby optimizing for the common case :)
<banistergalaxy> most cases you will just want to pass up the same args u got, so it would be annoying just typing that out each time
<nikhil_> banistergalaxy, so it would be legal to have a constructor in a child class which just initialized its own variables (even though it is passed those belonging to the super) and then just call super?
<banistergalaxy> but, in the case you wnat to pass up different args, then ruby allows that too
<nikhil_> yeah, ruby is really cool man
<nikhil_> and i thought python was awesome
<nikhil_> ^_^
<nikhil_> i thought it was something i would be doing because i wanted to learn SaaS, but here I am considering so many things --- it's opening up my mind in so many ways
yoklov has joined #ruby
<banistergalaxy> cool
<banistergalaxy> nikhil_: wait till you learn about metaprogramming, then things get fun :)
<nikhil_> banistergalaxy, we are learning about metaprogramming! it's amazing!
<nikhil_> although I am struggling with class_eval a bit
<nikhil_> that bit while you're trying to wrap your brain around something before it all actually wraps
hamcore has joined #ruby
nobitanobi has joined #ruby
Transcended has joined #ruby
<banistergalaxy> nikhil_: Yeah, you'll get there just test a lot of stuff out in the repls (irb or pry)
<banistergalaxy> nikhil_: i recommend pry ;) :D
<nikhil_> while i'm taking the course they use irb so i'll stick to that. pry is another interpreter?
nobitanobi has quit [#ruby]
nfluxx has joined #ruby
<banistergalaxy> nikhil_: pry is exactly like irb, but 50x more powerful http://pry.github.com
<banistergalaxy> nikhil_: you might even get an advantage if you use it (it wont set u back, since all the instructions for irb will still work)
CheeToS has joined #ruby
<nikhil_> banistergalaxy, i'll take a look
<nikhil_> banistergalaxy, do you know anything about metaprogramming using class_eval?
<banistergalaxy> nikhil_: yep
<nikhil_> how exactly are you supposed to define a method inside a string?
looopy has joined #ruby
billgui has joined #ruby
<banistergalaxy> nikhil_: are you using string evals rather than block-based evals?
<nikhil_> i'm not asking you for an answer -- that would be against the code of conduct
<nikhil_> string evals
<nikhil_> part 5 of this: class Dessert
<nikhil_> attr_accessor :name
<nikhil_> attr_accessor :calories
<nikhil_> def initialize(name, calories)
<nikhil_> @name = name
<nikhil_> @calories = calories
<nikhil_> end
<nikhil_>
<nikhil_> def healthy?
<nikhil_> return true unless @calories >= 200
<nikhil_> end<
<nikhil_>
<nikhil_> def delicious?
<nikhil_> return true
<banistergalaxy> nikhil_: learn to gist
<nikhil_> end
<nikhil_> end
<nikhil_> class JellyBean < Dessert
<nikhil_> attr_accessor :flavor
<nikhil_> def initialize(name, calories, flavor)
<banistergalaxy> nikhil_: gist.github.com
<nikhil_> super(name, calories)
<nikhil_> @flavor = flavor
<banistergalaxy> ffs
<nikhil_> end
<nikhil_>
<nikhil_> def delicious?
<banistergalaxy> nikhil_: stop
<nikhil_> `SORRY
* nikhil_ apologises for the flood
<banistergalaxy> nikhil_: why did u do that? you could have just put it on a pastie site
<nikhil_> banistergalaxy, i have already pasted -- the server is slowing down the output
Shrink has joined #ruby
Shrink has joined #ruby
<nikhil_> banistergalaxy, that was in my clipboard by mistake
<nikhil_> i didn't mean to paste that code at all
<nikhil_> only the last URL was of interest
<nikhil_> back to the issue, i'm not sure what they're asking in p5 of that question
ap0gee has joined #ruby
twelvechairs has joined #ruby
trivol has joined #ruby
<banistergalaxy> nikhil_: brb
<nikhil_> kk
nikhgupta has joined #ruby
burns180 has joined #ruby
<krz> in ruby 1.9.2 is this a good way to get random range number: (4..8).to_a.sample
<krz> in 1.9.3 i can do rand(4..8)
rohit has joined #ruby
JohnBat26 has joined #ruby
<banistergalaxy> nikhil_: ok done
<banistergalaxy> sorry i got called away to make dinner
<nikhil_> that was quick!
<nikhil_> could you take a look at part 5 of the url pasted above?
Richmond has joined #ruby
undersc0re has joined #ruby
nikhgupta has quit [#ruby]
pen has joined #ruby
<Mon_Ouie> krz: rand(max - min) + min
Shrink has joined #ruby
<nikhil_> without giving the answer in code
<krz> Mon_Ouie what would be wrong with sample though?
<nikhil_> ^^ that's amazing that you did that that fast.
<Mon_Ouie> krz: it creates an array with all the elements of the range
<Mon_Ouie> i.e. it's much slower
<nikhil_> banistergalaxy, hmm
<banistergalaxy> nikhil_: updated it, i had an unnecessary line in there
<banistergalaxy> nikhil_: Yep, their hint solution code is stupid
<banistergalaxy> imo
<nikhil_> why's that?
<banistergalaxy> nikhil_: because it doenst need to use string-based evals
<nikhil_> banistergalaxy, is there any reason they could be asking us to do that? and our solution has to use string based evals because it's marked by a computer
<banistergalaxy> nikhil_: probably because they dont know about instance_variable_set
<nikhil_> i'm still not understanding programmatically what's going on...
x0F__ has joined #ruby
sleetdrop has joined #ruby
<shevy> ewwwww
<shevy> evals
greenarrow has joined #ruby
iMe has joined #ruby
ryanf has joined #ruby
<shevy> hmm
<shevy> a goto within an evail
<shevy> eval
OpenJuicer has joined #ruby
<shevy> now that would be something
<banistergalaxy> Mon_Ouie: sup monny
<banistergalaxy> Mon_Ouie: how's your objc chops?
<ryanf> banistergalaxy: how's your obj-c coming anyway?
Morkel has joined #ruby
banistergalaxy has joined #ruby
manizzle has joined #ruby
<banistergalaxy> ryanf: pretty good, im about 1-2 chapters a day
<banistergalaxy> ryanf: just still getting a sense of things like memory management and so on
<banistergalaxy> before i start
jimmy has joined #ruby
<banistergalaxy> ryanf: what's up
baroquebobcat has joined #ruby
<ryanf> not a lot
<ryanf> my phone got stolen :(
<ryanf> luckily, apparently I signed up for insurance and then forgot about it
burns180_ has joined #ruby
<banistergalaxy> ryanf: oh you didnt install a phone locator app?
<banistergalaxy> ryanf: if anyone steals my phone i can hunt them down on gps
<banistergalaxy> :))
<ryanf> I did actually. I told the cops where the little dot is
<ryanf> I'm not gonna go like hunt it down
<banistergalaxy> ryanf: you should go around to the house with a few of your homies
<ryanf> yeah good plan
<ryanf> on the bright side, when I chased after the guy who took it, I completely forgot about my guitar and left it on the subway
<ryanf> and someone turned it in to the lost and found
wadkar has joined #ruby
<wadkar> can I define a method in a class which is private ? I haven't come across private/public/protected identifier in Ruby yet, thats why I ask
<ryanf> yes, just put "private" or "protected" above the definition of the method
<ryanf> every method definition from that point onward will have the given privacy
<ryanf> the definitions are a little weird though, I recommend looking them up so you understand what you're actually getting
<wadkar> ryanf: and by default methods are public? whatif I want to selectively give a method some_privacy?
<banistergalaxy> ryanf: so he literally just ripped it out of your hands?
<ryanf> banistergalaxy: yeah, I wasn't holding it very tightly I guess
<ryanf> he and his buds were getting off the train and he just took it on the way by
<ryanf> I also got very slightly pepper sprayed, which was interesting
<banistergalaxy> ryanf: haha
<banistergalaxy> ryanf: do police act on the gps locator? or i guess they cant be assed
<wadkar> ryanf: thanks, I read the docs, and I can give arguments to the private/protected statement as name of the method, which I want to declare as private/public
<banistergalaxy> hahaha
<banistergalaxy> i recognize a number of these 'homework problems' http://spark-university.s3.amazonaws.com/berkeley-saas/homework/hw1.pdf
<banistergalaxy> wadkar: you cheat! :)
<wadkar> banistergalaxy: I don't, I ask what I don't understand; and then do my homework from whatever I understand :) asking for help is not cheating
<banistergalaxy> wadkar: hehe, i remember solving the anagram problem from scratch for you :) ah well
<banistergalaxy> it's just a free course anyway
nikhil_ has joined #ruby
<wadkar> banistergalaxy: free or not, I am bound by that 'i-wont-cheat-oath-statement', and I take that part seriously :)
<ryanf> banistergalaxy: it sounds like sometimes they do. but it's not precise enough to do anything if they're at home, really
<ryanf> only if they're just like standing around, or in public somewhere
<banistergalaxy> ryanf: ah ok
<ryanf> I figure if I gave him the current location, at least maybe they could correlate that with something else someday
<ryanf> he did ask me to do it
heftig has joined #ruby
<banistergalaxy> ryanf: how fine grained is the gps in sf? i imagine it's got pretty high resolution, much higher than we have anyway
Zolrath has joined #ruby
<ryanf> why's that? it's all satellites anyway
<ryanf> although if you have wifi turned on, it can be more precise because they go by what ssids you're seeing
<heftig> sf == san francisco?
<ryanf> also this was in Oakland, not SF, but I guess it doesn't really matter
<ryanf> yeah
<banistergalaxy> ryanf: cos it's expensive apparently; supposedly in large rich american cities the reslution is much better than for us here in nz
<banistergalaxy> we get like 20m^2, wehreas you guys get like 2m^2 iirc
<ryanf> I don't really get how that would be. aren't the GPS satellites equidistant around the entire world?
<banistergalaxy> maybe 5m^2
<ryanf> tall buildings kind of fuck with it though, so sometimes that's a problem
<banistergalaxy> i dont know
billgui has quit [#ruby]
<banistergalaxy> ill read up on it after tea
<banistergalaxy> bbs
yxhuvud has joined #ruby
burns180 has joined #ruby
gokul has joined #ruby
eddie_ has joined #ruby
Shrink has joined #ruby
Shrink has joined #ruby
res0nat0r has joined #ruby
res0nat0r has joined #ruby
<artOfWar> trying to figure out the think about it section while working on ruby koans over here, https://gist.github.com/c2b86d72f1a9ae27afec, any hints?
FFForever has joined #ruby
<FFForever> How can I can run sort on a string and turn ababa to aaabb?
<rippa> string.chars.sort
<FFForever> thanks! I've been racking my head on that.
<artOfWar> any reason why list of symbols have to be converted to strings and compare against the string value rather than comparing against the symbols directly?
<rippa> artOfWar: because if you compare against symbol, you create that symbol even if it wasn't present
burns180 has joined #ruby
GoBin has joined #ruby
<artOfWar> rippa: in the above case where I pasted the link, we are first putting all the symbols into an array and then checking if it has a we are looking for, so in this case even if we create a symbol on the symbol table it shouldn't matter as we already have a snapshot of our symbol table's previous state
<artOfWar> rippa: correct me if I'm wrong
<rippa> artOfWar: try it yourself
<rippa> it is created when the method definition is executed
<artOfWar> rippa: what I mean't is in a different case, like here https://gist.github.com/5a171904b3b6e002d9d6
<rippa> artOfWar: because you didn't use that symbol before
<artOfWar> rippa: thanks, that is what I'm trying to make sure if my understanding is correct or not, thanks for confirming
<rippa> artOfWar: http://ideone.com/P9Yrp
tonini has joined #ruby
djdb has joined #ruby
Shrink has joined #ruby
rramsden has joined #ruby
cha1tanya has joined #ruby
pen has joined #ruby
Jay_Levitt has joined #ruby
<wadkar> guys, this pry thingy is cool, I can look up the definitions, and docs, this is way cool than irb !
<banistergalaxy> wadkar: yeah, it makes my dick hard.
michal_sz has joined #ruby
Zolrath has joined #ruby
Teomari has joined #ruby
burns180_ has joined #ruby
burgestrand has joined #ruby
mechanicalturk has joined #ruby
nikhil_ has joined #ruby
ap0gee has joined #ruby
timonv has joined #ruby
<banistergalaxy> wadkar: did u watch the screencast
<nikhil_> banistergalaxy, i ended up not using your implementation and using class_eval strings...
<nikhil_> but thanks for the help
<banistergalaxy> nikhil_: np
<banistergalaxy> nikhil_: can i see your code
<nikhil_> sure
mfridh has joined #ruby
looopy has joined #ruby
shruggar has joined #ruby
<banistergalaxy> nikhil_: ?
mafolz has joined #ruby
<nikhil_> pm...
<nikhil_> banistergalaxy, ^^
FND has joined #ruby
heftig has joined #ruby
timonv_ has joined #ruby
ph^ has joined #ruby
schovi has joined #ruby
<FND> how can I make bundler use ~/.gem instead of /usr/lib/ruby/gems? (I recently abandoned RVM since I only need Ruby 1.9 these days)
headius has joined #ruby
matt__ has joined #ruby
<matt__> Hy guys, I've been struggling on something for the last hour, can someone help me please
<matt__> I'm tryin gto achieve this assert_equal true, false
<matt__> I've tried to monkey patch TrueClass, update the TRUE constant value but no success
<matt__> but I know it's possibl
<matt__> e
mikeric has joined #ruby
KL-7 has joined #ruby
Avanine has joined #ruby
<matt__> assert_equal(true, false)
<matt__> anyone?
shruggar has joined #ruby
Mchl has joined #ruby
nikhgupta has joined #ruby
sspiff has joined #ruby
zommi has joined #ruby
burns180 has joined #ruby
nachtwandler has joined #ruby
Playb3yond has joined #ruby
omry_ has joined #ruby
yeggeps has joined #ruby
twqla has joined #ruby
pen has joined #ruby
gianlucadv has joined #ruby
scalebyte has joined #ruby
<scalebyte> this code isnto wroking : unless @user.about_me.length > "100"
<scalebyte> this code isnto wroking : unless @user.about_me.length > 100
<banistergalaxy> scalebyte: leave now and never come back!!!!!!!!!
dekroning has joined #ruby
<scalebyte> banistergalaxy: my mistake i wanted < instaed of > sorry
LMolr has joined #ruby
trivol has joined #ruby
rpgsimmaster has joined #ruby
blacktulip has joined #ruby
KL-7 has joined #ruby
Helius has joined #ruby
FND has quit [#ruby]
AxonetBE has joined #ruby
<scalebyte> banistergalaxy: why did u say that ?
<banistergalaxy> scalebyte: because i think you're a dick
<scalebyte> banistergalaxy: u hardly know me
<banistergalaxy> scalebyte: just on this channel then :)
<scalebyte> banistergalaxy: please talk properly.. I have just started learning ruby so some of my doubts might seems very stupid to you guys.. that's understandable
<banistergalaxy> scalebyte: a few reasons, mainly because the majority of your questions are rails-related on a non-rails channel, also because your questions are usually phrased in such obscure ways that no one would help you anyway.
<scalebyte> banistergalaxy: I always keep my questions simple... anyway since you made this statement, I will definitely try and improve on those points.. Thanks
A124 has joined #ruby
aj910martin has joined #ruby
InBar has joined #ruby
etehtsea has joined #ruby
pi3r has joined #ruby
burns180_ has joined #ruby
keymone has joined #ruby
cyri_ has joined #ruby
johndbritton has joined #ruby
visof has joined #ruby
schovi has joined #ruby
luoluoluo has joined #ruby
shruggar has joined #ruby
flippingbits has joined #ruby
alem0lars has joined #ruby
d3vic3 has joined #ruby
Jay_Levitt has joined #ruby
adman65 has joined #ruby
ping-pong has joined #ruby
Vert has joined #ruby
robbyoconnor has joined #ruby
mikewintermute has joined #ruby
trivol has joined #ruby
kaiwren has joined #ruby
mdw has joined #ruby
eldariof has joined #ruby
simao has joined #ruby
<avalarion> Is someone able to read through my plugin for issues, especially security ones? https://bitbucket.org/Avalarion/redmine-bitbucket-git
DuoSRX has joined #ruby
burgestrand has joined #ruby
KL-7 has joined #ruby
poppiez has joined #ruby
LMolr has joined #ruby
<poppiez> how do you pass array parameters to a rake task?
<poppiez> I want to pass a bunch of file paths to a task
mklappstuhl has joined #ruby
Talvino has joined #ruby
sdeobald has joined #ruby
burns180 has joined #ruby
iocor has joined #ruby
nari has joined #ruby
pp01bit has joined #ruby
chimkan__ has joined #ruby
<wadkar> is there a method for array meaning include?(all_elements_of_this_array)
iocor has joined #ruby
wulfgarpro has joined #ruby
d3vic3 has joined #ruby
jlebrech has joined #ruby
canton7 has joined #ruby
<rippa> wadkar: what?
<wadkar> a = [1,2,3,4] ; b = [1,2] ; a.some_method?(b) #=> true as a contains all of b; b = [1,5]; a.some_method?(b) #=> false as a does not contain all of b
alem0lars_ has joined #ruby
<rippa> b.all? {|i| a.include? i}
Natch| has joined #ruby
bondar has joined #ruby
visof has joined #ruby
visof has joined #ruby
Natch| has joined #ruby
<wadkar> rippa: ohh, block with all? and compare, I was thinking on the lines of reject block, and lesson (re)learned, negations are hard to grasp at first hand
Norrin has joined #ruby
<banistergalaxy> wadkar: instead of spending time learning ruby why dont u take silver in the arm and walk head-high on highways
d3vic3 has joined #ruby
gianlucadv has joined #ruby
heftig has joined #ruby
fayimora has joined #ruby
zul_ has joined #ruby
<wadkar> banistergalaxy: I don't understand 'take silver in the arm ...'
Ferdev has joined #ruby
Shrink has joined #ruby
<cout> silver == a bullet
<banistergalaxy> wadkar: inject heroin
mengu has joined #ruby
<cout> oh
<cout> never mind
<cout> wrong metaphor L)
<banistergalaxy> cout: hehe, or just me choosing the wrong words ;)
pen has joined #ruby
* wadkar is clueless
iocor has joined #ruby
<cout> me too
<banistergalaxy> nm, im drinking whiskey with my flatmate and talking nonsense
visof has joined #ruby
<banistergalaxy> cout: do you have any experience with objc?
d3vic3 has joined #ruby
<cout> not really
simao has joined #ruby
igaiga has joined #ruby
fayimora has joined #ruby
A124 has joined #ruby
nikhgupta has quit [#ruby]
tvw has joined #ruby
burns180_ has joined #ruby
Ammar01 has joined #ruby
<LMolr> is there a collect variant that gives a Set instead of an Array?
n1x has joined #ruby
<Tasser> LMolr, require 'set'
<banistergalaxy> Tasser: just call to_set on the result
aibo has joined #ruby
pencilcheck has joined #ruby
snearch has joined #ruby
<LMolr> i'm not expert in ruby internals (neither external, really), but wouldn't this be inefficient instead of a native set collect?
<LMolr> (wow my english is awesome today)
sdeobald has joined #ruby
justinmcp has joined #ruby
Vadim2 has joined #ruby
alup has joined #ruby
virunga has joined #ruby
virunga_ has joined #ruby
ephemerian has joined #ruby
<banistergalaxy> LMolr: there is no native set collect, cos sets are a rarely used datatype they didnt think to build them into core
<banistergalaxy> datastructure
<LMolr> banistergalaxy: ok, thanks. I'm using a set to keep an unordered list of children in a composite structure, and using collect to walk children and collect values.
<banistergalaxy> LMolr: leave the kids alone, man
eka has joined #ruby
<LMolr> banistergalaxy: lol , what?
BrianE|mobile has joined #ruby
k_89_ has joined #ruby
Playb3yond has joined #ruby
tomzx has joined #ruby
thecreators has joined #ruby
Vadim has joined #ruby
visof has joined #ruby
snearch has joined #ruby
burns180 has joined #ruby
Foxandxss has joined #ruby
visof has joined #ruby
visof has joined #ruby
bluenemo has joined #ruby
scalebyte has joined #ruby
<scalebyte> Kindly help me with this : https://gist.github.com/2021140
<scalebyte> RubyPanther: ^^ wierd behaviour by ruby
visof has joined #ruby
<philcrissman|afk> scalebyte: that's not weird behavior. Your conditionals are wrong...
fayimora has joined #ruby
<scalebyte> philcrissman|afk: where am I going wrong ? all assginments are correct except line 7... its assiging line 5 hash for line 6 attributes
rohit has joined #ruby
<scalebyte> philcrissman|afk: could u help me pls
n1x has joined #ruby
norex_ has joined #ruby
<philcrissman|afk> scalebyte: if you say "if a == b || c" and a is not b, the it will return c
<philcrissman|afk> and in your case, since c is a symbol, it's not nil, so it's true. your first "if" is always returning true.
<philcrissman|afk> scalebyte: it's not the assignments, it's your conditionals; the if statement.
<philcrissman|afk> you can't say "if a == b || c", you'd need to say "if a == b || a == c"
visof has joined #ruby
<eddie_> scalebyte: try this scalebyte
<philcrissman|afk> scalebyte: or... if [b, c].include?(a)
<scalebyte> philcrissman|afk: but i am doing a == b||c||d since i want the same thing to be done for b,c,d
<philcrissman|afk> scalebyte: you don't understand what I'm saying; that syntax is wrong. It doesn't say what you think it says. It will return d. Which is true.
<scalebyte> eddie_: philcrissman|afk thanks... I will try and correct the code
<eddie_> scalebyte: i am not using or or || in the conditions
<eddie_> check that
<eddie_> check the pastie
<wadkar> bit puzzled : http://pastie.org/private/cchi64uuqxgjvsopm0qxq ; the debugger tells me that it is evaluating if Movies.attribute_names.include? conditional when it should be short-circuited; or am I reading something wrong in the debugger ?
<scalebyte> eddie_: ya am checking it :)
<eddie_> ok
mdw has joined #ruby
<philcrissman|afk> eddie_: yep, include? is the way to go. scalebyte could expand the conditionals, but that would get really long (ie, if a== b || a == c || a == d)
<eddie_> yes
<eddie_> thats not a good looking code
<eddie_> or or or and or
Rishi_ has joined #ruby
<scalebyte> eddie_: worked perfectly thanks :)
<eddie_> welcome
<philcrissman|afk> eddie_: yep. include? is ideal for this sort of check.
<scalebyte> eddie_: i should use include? from now on for such things.. rather than going for ||
<scalebyte> philcrissman|afk: thanks.. ryt
<philcrissman|afk> wadkar: does Movie have an attribute named :order_by?
<eddie_> scalebyte: next time paste your code in a named gist
<wadkar> philcrissman|afk: nope
<philcrissman|afk> wadkar: nevermind, read that wrong; it's checking the value of that param.
<wadkar> philcrissman|afk: yes, and thats why I am wondering, the session is nil, the params is nil, but still
<scalebyte> eddie_: sure
<wadkar> (nil as in the hash key doesn't exists so hash['foo'] is nil)
<philcrissman|afk> wadkar: not totally sure. The line in your debugging session doesn't seem to be the same as any of the lines pasted above.
dhruvasagar has joined #ruby
Morkel has joined #ruby
tk_ has joined #ruby
<philcrissman|afk> wadkar: also, this might be better asked on #rubyonrails
<wadkar> updated the pasite with full code , check now http://pastie.org/private/cchi64uuqxgjvsopm0qxq
<eddie_> scalebyte: Are you placing the value of variable value for :message
<eddie_> ?
<wadkar> well, if you consider session and params as just another variables available in the scope, it should still make sense right, i mean, the debugger shows that session and params dont have :order_by key, but it still tries and evaluates Movie.attribute_names.include?
<scalebyte> eddie_: no this is for some different purpose.... live notification
<scalebyte> eddie_: i am settings values while initialization.. default values... for email and message notification
<eddie_> scalebyte: i see that when value is true you make :message = true
<eddie_> and when value = true
<scalebyte> eddie_: yeah
<eddie_> Then
<eddie_> there is another solution
<philcrissman|afk> wadkar: still doesn't make sense. Where does the line "if Movie.attribute_names.include? params[:order_by]" come from? It isn't in the controller code you pasted.
tatsuya_o has joined #ruby
<eddie_> would you mind that?
<scalebyte> eddie_: instead of if value == true i cud just do if value.. ryt !!
<eddie_> scalebyte: Yes also some more addition
<eddie_> using a case thing
<eddie_> i will give you a pastie
nopolitica has joined #ruby
<wadkar> philcrissman|afk: erm, do I need to restart the webrick server if I change the controller ?
<scalebyte> eddie_: thanks.. u r so helpful...
AndChat| has joined #ruby
<eddie_> scalebyte: See if this works for you. http://pastie.org/private/kuag95czwzhsbppdzdy4ea
<scalebyte> eddie_: suer thanks
<Stefunel> guys, how can I see all the methods of a certain object? .methods doesn't list anything
<eddie_> :)
<eddie_> Stefunel: is it a custom class?
<wadkar> strange (or maybe I am dumb) I restarted the webrick server, and now its working fine (apparently)
<Stefunel> eddie_ yes
<scalebyte> eddie_: this is nice.. but there are many cases where am assigning same values for multiple attributes.. so i guess include? will b more better ryt?
maasha has joined #ruby
<eddie_> Stefunel: will get back to you
<maasha> does ruby have some clever ways to report memory usage of data structures?
<Stefunel> ok eddie_ thanks
emocakes has joined #ruby
malkomalko has joined #ruby
<eddie_> Stefunel: Check if you have done it right
<eddie_> Stefunel: I am getting it. Check the pastie
jjp has joined #ruby
<Stefunel> thanks eddie_
<Stefunel> it works
burns180_ has joined #ruby
<wadkar> thanks philcrissman|afk , your keen eye on the line number solved this problem that I had for so long
<eddie_> philcrissman: Dude can i use you as a debugger?
<eddie_> i am too bad in it
<eddie_> and pron to those
sacarlson has joined #ruby
<wadkar> eddie_: hehe
<eddie_> wadkar: "foobar" is still my ancient way of debugging
chimkan__ has joined #ruby
<wadkar> eddie_: me too, but I want to learn more about debugging, so I tried it out
sacarlson has joined #ruby
<scalebyte> eddie_: objects.methods to list all methods... it was enlightning ;)
<banistergalaxy> wadkar: you can use pry as a debugger
darthdeus has joined #ruby
<wadkar> banistergalaxy: huh? how can it capture the rails server's interrupts?
nanderoo has joined #ruby
<banistergalaxy> wadkar: ? since when has that been the definition of a debugger? im ot saying it cant do that, but a 'debugger' is simply a tool that can examine callstack, advance execution a line at a time and enable inspection of runtime state.
<wadkar> banistergalaxy: hmm, so if I can find a way to trigger the rails server from within pyr ... aha! command mode?
<wadkar> nah, I need to get pry in the RoR mode
<banistergalaxy> wadkar: no, just put 'binding.pry' where you currently have 'debugger'
<banistergalaxy> wadkar: read the documentation & watch the screencast :)
visof has joined #ruby
<wadkar> banistergalaxy: ohh, well I didn't watch the screencast (in office), and just skimmed through basics
ethd has joined #ruby
ethd has joined #ruby
<wadkar> is it the same as on the official webpage?
<banistergalaxy> wadkar: no, that's a special rails-oriented screencast
<philcrissman|afk> wadkar: np. You always need to look, the debugger will tell you what line it is on. Glad it helped. :)
M- has joined #ruby
<wadkar> banistergalaxy: thanks, that should give all pry screencasts at one go (*bookmarks the link*)
flippingbits has joined #ruby
kevinbond has joined #ruby
kevinbond_ has joined #ruby
IAD has joined #ruby
visof has joined #ruby
albemuth has joined #ruby
`brendan has joined #ruby
<Azure> Hm. Lets say that I want to write a way to grab QDB entries from several websites (with selectors.) What would be a good way to go about writing such a facility?
lateau has joined #ruby
<Azure> QDB Base (with attributes, etc. for storing rating, url, quote, etc.) -> QDB class (for instance, QDB::Bash) (for parsing the page and storing the results) -> whatever class that I use the single QDB classes in?
nikhil_ has joined #ruby
burns180 has joined #ruby
neurodrone has joined #ruby
n1x has joined #ruby
<Sp4rKy> /W 4
nopolitica has joined #ruby
fearoffish has joined #ruby
Richmond has joined #ruby
tingo has joined #ruby
jrist has joined #ruby
arvidkahl has joined #ruby
tommyvyo has joined #ruby
burns180_ has joined #ruby
pastjean has joined #ruby
mklappstuhl has joined #ruby
alem0lars has joined #ruby
virgil_ has joined #ruby
john2x has joined #ruby
<virgil_> hi, I am new to ruby and I have one question
<virgil_> I have a function aaa?(string) and I also want to be able to write "string".aaa?
moemen has joined #ruby
<virgil_> I overwrite String class and define the method but I don;t know how to call the function with the same name from outside the class in the class
LMolr has joined #ruby
<virgil_> :)
<philcrissman> virgil_: you should just put the method inside the class, if that's what you want to do.
<philcrissman> or put it in a module, and include the module inside String
<virgil_> but I also want it outside the class
<virgil_> how do I do that?
<philcrissman> virgil_: then I'd put it in a module.
<philcrissman> virgil_: ...
<virgil_> I'll google it, thanks
pu22l3r has joined #ruby
Jippi has joined #ruby
dql has joined #ruby
A_D has joined #ruby
EvanR has joined #ruby
Sailias has joined #ruby
fr0gprince_mac has joined #ruby
josephwilk has joined #ruby
lorandi has joined #ruby
Sailias_ has joined #ruby
burns180 has joined #ruby
yalue has joined #ruby
canton7 has joined #ruby
sgmac has joined #ruby
sgmac has quit [#ruby]
LBRapid has joined #ruby
wroathe has joined #ruby
workmad3 has joined #ruby
paissad has joined #ruby
Asher has joined #ruby
luke-- has joined #ruby
_null has joined #ruby
geekbri has joined #ruby
_null has joined #ruby
_null has joined #ruby
_null has joined #ruby
_null has joined #ruby
_null has joined #ruby
capelio has joined #ruby
capelio has quit [#ruby]
_null has joined #ruby
bglusman has joined #ruby
iocor has joined #ruby
tatsuya_o has joined #ruby
geekbri has joined #ruby
dv310p3r has joined #ruby
bondar has joined #ruby
PragCypher has joined #ruby
v0n has joined #ruby
burns180_ has joined #ruby
rfloriano has joined #ruby
cmasseraf has joined #ruby
choffstein has joined #ruby
nikhgupta has joined #ruby
raluxgaza has joined #ruby
nikhgupta has quit [#ruby]
ansii has joined #ruby
mikewintermute has joined #ruby
ansii has joined #ruby
poseid has joined #ruby
jman6 has joined #ruby
nemesit has joined #ruby
crankycoder has joined #ruby
KL-7 has joined #ruby
mkscrg has joined #ruby
davidpk has joined #ruby
PragCypher has joined #ruby
Sailias_ has joined #ruby
visof_ has joined #ruby
mensvaga has joined #ruby
ckrough has quit [#ruby]
waxjar has joined #ruby
td123 has joined #ruby
<A_D> hi there!
<A_D> any help with rb_scan_args function?
<poseid> where did you get that function from?
<philcrissman> poseid: it's a C function.
<philcrissman> A_D: the only description I found with a quick search was on http://www.ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html
imsplitbit has joined #ruby
<philcrissman> A_D search the page for rb_scan_args
nikhgupta has joined #ruby
<A_D> let me see
<philcrissman> A_D: I've never used it. :) So I'm not really any more help than that.
nikhgupta has quit [#ruby]
ukwiz has joined #ruby
EvanR has joined #ruby
<A_D> philcrissman: thanks! Thats what I'm looking for
<philcrissman> A_D: :D
trivol has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
EddieS has joined #ruby
nelsonblaha has joined #ruby
ceej has joined #ruby
thecreators has joined #ruby
ank has joined #ruby
<nelsonblaha> anyone mind helping a new rubyist? I guess I don't understand file access yet. This line is causing a file not found: if oldlog != (newlog = File.read(watch))
Sailias_ has joined #ruby
<nelsonblaha> I've tried making watch equal to the filename (same folder) and the absolute filepath, no luck with either
thecreators has quit [#ruby]
<poseid> also not much experience with rb_scan_args
<poseid> but aren't there projects/gems in github where there are examples?
<poseid> libxml ...
neurodrone has joined #ruby
<canton7> nelsonblaha, what are you trying to do? Compare the contents of two files?
<nelsonblaha> canton7, yes
luxurymode has joined #ruby
thecreators has joined #ruby
<A_D> libxml, pg ....
twqla has joined #ruby
looopy has joined #ruby
ryannielson has joined #ruby
<canton7> nelsonblaha, there's FileUtils.compare_file if you want to do the comparison without reading the entire file into memory. As for why your example's failing? Not sure. Are you absolutely sure that the contents of oldlog are correctg?
burns180 has joined #ruby
macmartine has joined #ruby
theRoUS has joined #ruby
<nelsonblaha> canton7, thanks for the tip. oldlog starts out empty on the first loop. is that no good?
<canton7> nelsonblaha, do you ever write to oldlog?
<nelsonblaha> canton7, I do at the end of my loop
pen has joined #ruby
<nelsonblaha> canton7, I'll pastebin
<canton7> nelsonblaha, works for me
<canton7> nelsonblaha, might the problem be that you're opening changelog.txt in mode 'w'?
<canton7> instead of 'a'
<nelsonblaha> canton7, I'll give it a shot
<canton7> since re-opening it with mode 'w' will overwrite whatever's in it
DrShoggoth has joined #ruby
syamajala has joined #ruby
OpenJuicer has joined #ruby
<nelsonblaha> canton7, it's not even getting to the changelog part though. It's complaining that it can't find the file watch
<nelsonblaha> canton7, I give it a plaintext file called watchme when I run it. It says watchme: no file or directory
<nelsonblaha> test.rb:13:in `read': No such file or directory - watchme (Errno::ENOENT)
wmoxam has joined #ruby
<nelsonblaha> canton7, I created watchme with touch watchme but left it empty
<canton7> nelsonblaha, aha. What directly is the script running in? Print out Dir.pwd and Dir['*']
Drewch has joined #ruby
tatsuya_o has joined #ruby
<nelsonblaha> canton7, is that a command I should run in my linux shell or in the ruby script?
<canton7> nelsonblaha, in the ruby script, at the top
fbernier has joined #ruby
Squarepy has joined #ruby
sdeobald has joined #ruby
<nelsonblaha> canton7, I get /home/nelson/rubytest.rbwatchmewhat file should I watch?
<canton7> nelsonblaha, I didn't catch that. 1. Where is the script running? 2. Where is the file located? 3. What are you passing to File.open?
caiges has joined #ruby
jgarvey has joined #ruby
<nelsonblaha> canton7, script is running in /home/nelson/ruby/
<nelsonblaha> canton7, file is located in the same directory
<nelsonblaha> canton7, the string I'm passing to File.open is watchme
<nelsonblaha> "watchme"
dbgster has joined #ruby
<canton7> nelsonblaha, are you passing "watchme" or "watchme\n"?
<nelsonblaha> aha
<nelsonblaha> I need to strip it
<nelsonblaha> right?
<canton7> nelsonblaha, I should have spotted this earler. Line 2 should be watch = gets.chomp
<canton7> *earlier
trivol has joined #ruby
snip_it has joined #ruby
<nelsonblaha> canton7, thanks, this has been extremely educational. Probably a common mistake for java programmers. I have different errors to try in google now
axl_ has joined #ruby
renanoronfle has joined #ruby
iamjarvo has joined #ruby
<canton7> nelsonblaha, haha, no worries. Some languages do the chomping for you; some don't
bbttxu has joined #ruby
<shevy> java chomps by default?
<shevy> hmm is .strip calling .chomp actually?
lateau has joined #ruby
davidpk has joined #ruby
wadkar has quit ["Leaving"]
phantasm66 has joined #ruby
<Tasser> shouldn't
Nathandim has joined #ruby
sbanwart has joined #ruby
heftig has joined #ruby
mklappst_ has joined #ruby
adambeynon has joined #ruby
emmanuelux has joined #ruby
burns180_ has joined #ruby
kpshek has joined #ruby
zul_ has joined #ruby
res0nat0r has joined #ruby
res0nat0r has joined #ruby
Helius has joined #ruby
rippa has joined #ruby
artm has joined #ruby
dv310p3r has joined #ruby
Squarepy has joined #ruby
flippingbits has joined #ruby
idoru has joined #ruby
mikepack has joined #ruby
ElitestFX has joined #ruby
k_89_ has joined #ruby
fayimora has joined #ruby
phreax has joined #ruby
CheeToS has joined #ruby
<phreax> \join #redmine
baroquebobcat has joined #ruby
<phreax> uups
ckrailo has joined #ruby
zakwilson has joined #ruby
CheeToS has joined #ruby
elliot_ has joined #ruby
mengu has joined #ruby
startling has joined #ruby
startling has quit [#ruby]
nachtwandler has joined #ruby
lectrick has joined #ruby
CheeToS has joined #ruby
pen has joined #ruby
zeninfinity has joined #ruby
byped has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
PaciFisT has joined #ruby
coreydaley has joined #ruby
CheeToS has joined #ruby
raluxgaza has joined #ruby
Phrogz has joined #ruby
albemuth has joined #ruby
Indian has joined #ruby
<JonnieCache> whats the command to check a .gemspec file is valid
<JonnieCache> ?
burns180 has joined #ruby
yann_ck has joined #ruby
eywu has joined #ruby
CheeToS has joined #ruby
metakungfu has joined #ruby
metakungfu has quit [#ruby]
artOfWar has joined #ruby
vmatiyko has joined #ruby
trivol_ has joined #ruby
CheeToS has joined #ruby
foxdie has joined #ruby
<foxdie> Hooray, it exists :)
<foxdie> Hi all, quick ruby question if I may, to provide backward compatibility to some changes I'm making to a ruby application, is there a way to execute a command and ignore warnings about redefining constants?
scalebyte has joined #ruby
blueadept has joined #ruby
<scalebyte> I have this for validating special characters presence
<scalebyte> but hw can I inculde numbers also in this?
<scalebyte> /^[A-Za-z0-9.&]*\z/
thecreators has joined #ruby
artOfWar has joined #ruby
CheeToS has joined #ruby
dhruvasagar has joined #ruby
alex__c2022 has joined #ruby
asobrasil has joined #ruby
ron has joined #ruby
ph^ has joined #ruby
<scalebyte> is this called a regular expression? /^[A-Za-z0-9.&]*\z/
<ron> Maybe someone could assist. Java has a nice little application called Sonar (http://www.sonarsource.org/) to help reduce technical debt. Is there anything similar for Ruby?
chimkan has joined #ruby
<foxdie> scalebyte: Yep that looks like a regular expression
<scalebyte> foxdie: thanks... what essentially defines a regex ? in short if you could throw some light !!
<foxdie> Although by the looks of it, it might be matching every character, the . can match any character, it might need escaping with a backslash
drake_ has joined #ruby
<foxdie> I recommend reading: http://www.regular-expressions.info/
<scalebyte> foxdie: i have a backslach to the end of it as u can see
<scalebyte> foxdie: thanks for the link
<rippa> foxdie: . inside character class is literal
drake10 has joined #ruby
<foxdie> Fair enough, I wasn't 100% sure either way
<foxdie> I escape it just to be safe
yann_ck has joined #ruby
rushed_ has joined #ruby
<rippa> foxdie: I'M COVERED IN BEES
<foxdie> BEES!
<foxdie> Oprah would love you :)
canton7 has joined #ruby
drake10 has quit [#ruby]
mneorr has joined #ruby
<foxdie> rippa, don't suppose you've got a comment on my question about temporarily turning off warnings in ruby? :)
<foxdie> Like in PHP, you can prefix a command with the @ symbol
<Asher> you can't
dhruvasagar has joined #ruby
<rippa> tried that?
davidpk has joined #ruby
nelsonblaha has joined #ruby
<workmad3> foxdie: warnings are warnings... you should pay attention to them :)
<foxdie> Everyone says that
<foxdie> I have a legitimate reason for doing it
sdeobald has joined #ruby
<foxdie> But thanks, I'll use $VERBOSE
<nelsonblaha> I guess I don't know how to include in ruby. I keep getting uninitialized constant Diffy (NameError) when I try to include Diffy
<nelsonblaha> same when I try to use it
<foxdie> nelsonblaha: require 'external_file'
dr_bob has joined #ruby
<foxdie> Where external_file is the relative path to the ruby script you wanna include, WITHOUT the .rb file extension
<foxdie> So if you wanted to include functions.rb, you'd use: require 'functions'
<foxdie> Still haven't gotten them
<foxdie> (wrong window for that last line)
n1x has joined #ruby
ron has quit ["Leaving"]
<nelsonblaha> foxdie, thanks. trying it.
<nelsonblaha> foxdie, any tips on locating this diffy script? I installed it with sudo gem install diffy
<foxdie> Sorry nope, no clue on that
JNZ` has joined #ruby
lkba has joined #ruby
kenperkins has joined #ruby
<shevy> nelsonblaha gems are stored in a directory
<shevy> a .gem file is usually stored at /usr/lib/ruby/gems/1.8/cache/
<shevy> not sure how that path changed for 1.9.x
<shevy> but when you installed a gem, let's say "foobar" is the name, then usually require 'foobar' would work
raluxgaza has joined #ruby
yann_ck has joined #ruby
<scalebyte> shevy: require 'rubygems' # puts gem libraries in the require path and require 'whatever' # loads your library
S2kx has joined #ruby
<scalebyte> shevy: nelsonblaha : http://docs.rubygems.org/read/chapter/20
drbawb has joined #ruby
leoncamel has joined #ruby
burns180_ has joined #ruby
foxdie has quit [#ruby]
philips has joined #ruby
shell0x_ has joined #ruby
Richmond has joined #ruby
blueadept has joined #ruby
<phreax> has anyone come across a "stack level too deep" error (infinit recursion) when using extend with the facets gem (v2.9.3)
<phreax> ?
cbuxton has joined #ruby
<phreax> i didnt tried othere versions yet
diegok has joined #ruby
johndbri_ has joined #ruby
adeponte has joined #ruby
moshee has joined #ruby
<phreax> it yields an ininit recursion, since facets seems to override the extend method
<phreax> am i missing something, or is this indeed a bug ?
pdtpatr1ck has joined #ruby
cloke has joined #ruby
<shevy> phreax that is such a specialized question man
<shevy> def foo; foo; end
Richmond_ has joined #ruby
<shevy> that code you showed there on http://svn.tylerrick.com/public/examples/ruby/method_aliasing//using_alias_method_chain_for_class_methods.rb really looks as if someone is cramming as much complication into as few lines as possible
<shevy> base.extend ClassMethods
<shevy> base.class_eval do
<shevy> waaaaaaah
<shevy> :P
maletor has joined #ruby
* JonnieCache flinches
adman65 has joined #ruby
<scalebyte> shevy: not all are prodigies like you :)
sdeobald_ has joined #ruby
zeninfinity has joined #ruby
<scalebyte> shevy: tum toh mast ho ruby mein
francisfish has joined #ruby
OpenJuicer has joined #ruby
<phreax> shevy: yeah this kinda sucks, but i dont see any other way
dr_bob has quit [#ruby]
<phreax> any suggestions?
t0mmyvyo has joined #ruby
roolo has joined #ruby
<scalebyte> phreax: where r u from ?
<phreax> actually i just need to extend class methods of a class (while still have access to the old method)
robacarp has joined #ruby
thecreators has joined #ruby
<phreax> it works though for me, using alias_method. making it even more complicated
hobodave has joined #ruby
<mneorr> Hi all, I have one question regarding the @variable ||= something_true in a method. If something_true isn't just a variable, or a method call, is there a way to pass in the block?
Avanine has joined #ruby
amscotti has joined #ruby
<shevy> scalebyte what does this have to do with prodigies? people use overcomplicated code and then are wondering why things don't work
<shevy> in ancient times people liked simplicity
<shevy> then came the agile everything and then the metamagic wave
nvez has joined #ruby
nvez has joined #ruby
<shevy> soon enough there will be the hipster wave and there will be pink unicorns hidden in ruby code
<scalebyte> shevy: right... ruby looks neat concise
<scalebyte> shevy: where u from ?
c0rn has joined #ruby
<shevy> people can write the most horrible code
amscotti has joined #ruby
axl_ has joined #ruby
* deryldoucette hides his codezors from shevy
<robacarp> now wait a minute whats wrong with pink unicorns in code?
amscotti has joined #ruby
<shevy> well they are better than eval but still
audy has joined #ruby
kaiwren has joined #ruby
<robacarp> metaprogramming is an irritating practice.
PragCypher has joined #ruby
<shevy> yes!
<shevy> I want a very creative language that is also insanely simple
sbabiy has joined #ruby
nemesit has joined #ruby
nemesit|osx has joined #ruby
<shevy> but it seems the moment a language allows for creativity it is no longer very simple
cha1tanya has joined #ruby
Pheen has joined #ruby
fmcgeough has joined #ruby
jgrevich has joined #ruby
stkowski_ has joined #ruby
artm has joined #ruby
badabim has joined #ruby
<JonnieCache> shevy: LISP
manizzle has joined #ruby
badabim has joined #ruby
SegFaultAX|work has joined #ruby
arvidkahl has joined #ruby
<shevy> hmm
centipedefarmer has joined #ruby
<JonnieCache> the thing is lisp has very simple rules but that doesnt garuantee simple code
<shevy> :(
<JonnieCache> emergent complexity and all that
mdw_ has joined #ruby
<jwang> is there a good way to estimate the size of a hash? in b/kb/mb?
n1x has joined #ruby
<shevy> jwang cool question
<shevy> I dont think I read it before :)
rippa has joined #ruby
ed_hz_ has joined #ruby
Milner08 has joined #ruby
mdw has joined #ruby
Norrin has joined #ruby
burns180 has joined #ruby
<jwang> shevy: thx :) I just found ObjectSpace.memsize_of(): http://doc.okkez.net/192/view/class/ObjectSpace
nfluxx has joined #ruby
<shevy> cool
<shevy> never saw that one before
<shevy> ewwww japanese docu :(
<scalebyte> I am trying to do a simple if key == "linkedin_profile" where key is the key of a hash but not working
<scalebyte> any idea
cmasseraf has joined #ruby
<scalebyte> it is escaping the comparison... even when key is "linkedin_profile"
gjaldon has joined #ruby
<shevy> how can this be
<shevy> your datastructure is really a hash?
adamkittelson has joined #ruby
alfism has joined #ruby
Foxandxss has joined #ruby
<mneorr> is there a way to declare @variable ||= some code here ?
ringotwo has joined #ruby
<scalebyte> shevy: i even tried doing if key.to_sym == "linkedin_profile"
<shevy> well
<mneorr> def array
<mneorr> @array ||= initialize_array #instead of calling the method, do the initialization inline?
<mneorr> end
<shevy> of course that can not work scalebyte
<shevy> because "linkedin_profile".to_sym becomes :linkedin_profile
<scalebyte> shevy: oh k then what do I need to do ?
<scalebyte> shevy: if key == "linkedin_profile".to_sym worked :)
<shevy> do you have your hash in code?
<shevy> I mean how does your hash look like
<shevy> just a sample
blueadept has joined #ruby
macmartine has joined #ruby
burns180 has joined #ruby
cableray has joined #ruby
<cableray> Is there a regex symbol for all whitespace except newlines?
Jay_Levitt has joined #ruby
aldodelgado has joined #ruby
cmasseraf has joined #ruby
<gjaldon> try checking out rubiulus
<mneorr> sorry for trolling, I'm not sure if I'm actually posting here? anyone sees this msg? thanks
<cableray> do you mean rubular
<cableray> ?
<cableray> ello mneorr
schovi has joined #ruby
<mneorr> alright, thanks cableray :) just haven't got a reply then
burns180 has joined #ruby
danishkhan has joined #ruby
burns180 has joined #ruby
babinho has joined #ruby
tayy has joined #ruby
Draco_ has joined #ruby
yann_ck has joined #ruby
looopy has joined #ruby
virunga has joined #ruby
gianlucadv has joined #ruby
c0rn has joined #ruby
eugynon has joined #ruby
sungji has joined #ruby
SullX has joined #ruby
Eiam has joined #ruby
Eiam has joined #ruby
leoncame` has joined #ruby
facefox has joined #ruby
alex__c2022 has joined #ruby
Synthead has joined #ruby
ringotwo has joined #ruby
artm has joined #ruby
kf8a has joined #ruby
headius has joined #ruby
nemesit has joined #ruby
<Phrogz> mneorr: What do you mean by "declare @variable ||= some code here"?
omry_ has joined #ruby
dr_bob has joined #ruby
Azure has joined #ruby
Targen has joined #ruby
g0bl1n has joined #ruby
pu22l3r_ has joined #ruby
badabim_ has joined #ruby
<Eiam> i need to go read up on ||=
<Eiam> ruby has some unique assignment operators
<deryldoucette> basically it means if its empty or nil then assign
<deryldoucette> otherwise use the value stored
<philcrissman|afk> Eiam: it's pretty straight forward; for a ||= 1, it will assign 1 (or, whatever); if it's _not_ nil, it retains its value
<philcrissman|afk> or, what deryldoucette said. :)
<Phrogz> Except throw in `false` as well as `nil`.
badabim__ has joined #ruby
<shevy> throw kittens!
daniel_hinojosa has joined #ruby
<Phrogz> And then find out that this is a good mental model, but not entirely accurate when dealing with, for example, my_hash[:k] ||= :bar
<philcrissman|afk> Phrogz: that's right.
<Phrogz> Eiam: But yes, in general in Ruby foo OP= bar is basically equivalent to foo = foo OP bar
<Eiam> if the operation to the right is not nil or false, it will assign to the left?
badabim has joined #ruby
* Eiam goes to check what happens if its empty
<philcrissman|afk> Phrogz: yep, was just going to say that. n += 1 => n = n +1 ; n ||= 1 => n = n || 1
looopy has joined #ruby
<Eiam> [] = false apparently too
<Mon_Ouie> No, empty array is true-ish
<Mon_Ouie> Only nil and false are considered as being false
<philcrissman|afk> Eiam, Mon_Ouie: yeah; ([] ||= "something") == []
<Phrogz> Or "falsey", as they say in JavaScript, meaning that !obj == true
<Eiam> Mon_Ouie: hmm.. a="something"; a||=[];
<Eiam> a is "something" still
<philcrissman|afk> Eiam: that's because a has a value; "something"
<Eiam> thats interesting that the reverse case is differnt
<mneorr> okay, got that one. but what happens if the right side of assigment isn't just a variable?
<Eiam> hmm
<mneorr> I can paste a snippet
axl_ has joined #ruby
<philcrissman|afk> Eiam: it shouldn't be. a = []; a ||= "something"; a == []
<mneorr> for now, I've just called a new method; But for the learning purposes of the syntax, thought there might be a way to do it inline
<mneorr> def array
<mneorr> @array ||= initialize_array
<mneorr> end
<mneorr> def initialize_array
<mneorr> array = []
<mneorr> 1.upto(234) do |numbah|
<mneorr> array << numbah
<mneorr> end
<mneorr>
<mneorr> array
<mneorr> end
<Eiam> philcrissman|afk: thats the same case you posted initially
<shevy> lol
<shevy> |numbah|
<philcrissman|afk> Eiam: yes, it is.
<shevy> best name ever :)
<philcrissman|afk> Eiam: and the same result.
<mneorr> yeah, picked it up from one guy I've used to pair program in the US :D
<mneorr> *program with
<Eiam> =/ I just use x & i
<Eiam> << not very creative
Targen has joined #ruby
dr_bob has quit [#ruby]
greenarrow has joined #ruby
<shevy> being too clever is annoying
<Eiam> philcrissman|afk: okay so to rephrase again then.. a ||= value assigns value if a is nil and value is not nil
<shevy> like that roman class that implements roman numbers via method_missing
<Phrogz> mneorr: Next time, please use pastie.org or another paste service.
<mneorr> okay sure, I'm a newbie here
<Phrogz> mneorr: @array ||= (1..234).to_a
apok has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
<mneorr> :D I knew someone will make an inliner for it. this is awesome
<Phrogz> mneorr: Or in general: @array ||= [].tap{ |a| .. do mutating things with a here ... }
dnyy has joined #ruby
<mneorr> okay, got this one with the block passed in,. that was more a question
<mneorr> like, is there any other way to do a multiline as well?
apok has joined #ruby
<mneorr> e.g. , I've tried to use just @array ||= { some code here } , but obviously that didn't work
<Phrogz> mneorr: You could convert my tap block to a do/end and multiline it. But if you want to just run arbitrary code, you'd need unless @array ... multiline code here that sets @array ... end
<Phrogz> And then @array at the end.
<Phrogz> mneorr: You want a begin/end block to evaluate many lines as the last expression.
pen has joined #ruby
<Phrogz> mneorr: For example: http://pastie.org/3579341
<mneorr> #Phrogz thanks! you've definately gave me the right direction
Tearan has joined #ruby
Helius has joined #ruby
shadoi has joined #ruby
lep-delete has joined #ruby
AndChat| has joined #ruby
burgestrand has joined #ruby
abstrakt has joined #ruby
sacarlson1 has joined #ruby
fowl has joined #ruby
friskd has joined #ruby
<fowl> -ChanServ- [#ruby] Welcome to #ruby. || http://www.ruby-lang.org || http://www.modruby.net
<fowl> why do i get this message about modruby, a dead project
johndbritton has joined #ruby
ringotwo has joined #ruby
alx- has joined #ruby
<wmoxam> fowl: it throws off the noobs
* wmoxam is only slightly joking, doesn't see why else it would be there
Draco_ has joined #ruby
<philcrissman|afk> Eiam: yep
<Eiam> man thats going to clean up a lot of my code
<Eiam> i do tons of silly checks like that
<philcrissman|afk> Eiam: well, technically, I guess it would assign nil to it, as well. Not that there would be a difference; a = nil; a ||= nil; a == nil. ;-)
musl has joined #ruby
havenn has joined #ruby
Sailias has joined #ruby
<philcrissman|afk> Eiam: though; that would be significant if you wanted it to become explicitly false; a = nil; a ||= false; a == false;
dr_bob1 has joined #ruby
<philcrissman|afk> Eiam: just play around with that in irb for awhile, you will see exactly how it works.
<philcrissman|afk> Eiam: well, it sounds like you got it already. But nothing like seeing how it works.
<Eiam> tap? /me goes to look up
<Eiam> philcrissman|afk: right but that makes sense, false is not nil
<Eiam> philcrissman|afk: so I'd expect a ||=false; a == false
seoaqua has joined #ruby
<philcrissman|afk> Eiam: yep. but remember, if it starts out false, it would be reassingned to something truthy. a = false; a ||= "something"; a == "something"
<philcrissman|afk> s/reassigned
<seoaqua> hi guys, which is the right way to iterate a hash when deleting some elements of it? e.g. hash.each_key {|k| hash.delete k}
<Eiam> ahh okay thats a minor catch but important
<Eiam> philcrissman|afk: whats the logic behind that assignment? false is not nil, so it seems like it should keep false
<Eiam> seoaqua: wouldn't that be mutating something while you are iterating it?
<Eiam> not sure how ruby handles that, but I know objc doesn't like that =)
<Eiam> crashy crash
shruggar has joined #ruby
<Eiam> philcrissman|afk: I guess "truthiness" is the logic used there. still seems slightly inconsistent
cbuxton has joined #ruby
<philcrissman|afk> Eiam: not exactly; nil and false are both "falsey".
panpainter has joined #ruby
zodiak has joined #ruby
<Eiam> philcrissman|afk: sure, but as pointed out, a ||=false == false, but false ||='something' == 'something'
<seoaqua> Eiam, im doing like hash_copy = hash; hash_copy.each_key{...}; hash = hash_copy; are there any better ways
facefox has joined #ruby
<philcrissman|afk> Eiam: so, in most cases, it's seeing if a is "truthy", and if not, assigning whatever to it. In the case of nil and false, it just so happens that "false" is a little better defined than nil; so a nil ||= false would become explicitly false.
musl has joined #ruby
<philcrissman|afk> Eiam: exactly.
<seoaqua> Eiam, sorry not a correct example
zul has joined #ruby
<Eiam> philcrissman|afk: right. I follow
dr_bob1 has quit [#ruby]
<Eiam> nil and false are the same except when you are comparing them directly
<Eiam> for purposes of ||=
gianlucadv has joined #ruby
<Mon_Ouie> seoaqua: #delete_if?
<Mon_Ouie> Also do you realize hash_copy isn't a copy of the hash?
fowl has joined #ruby
<philcrissman|afk> Eiam: mmm more or less, sure. As far as the truth value goes.
<deryldoucette> Mon_Ouie: oo i didn't know that myself
schovi has joined #ruby
<seoaqua> Mon_Ouie, yes,maybe, i'll look into it, thanks~
<Eiam> seoaqua: also, did you try what you posted, cause that worked fine for me
<deryldoucette> building my docs now, so will look that up when it completes
<Mon_Ouie> When you do var_a = var_b you're making var_a reference the same object as var_b
<philcrissman|afk> Eiam: I'd stop short of saying that nil and false are the same.... they're each their own class. nil.class == NilClass; false.class == FalseClass
<Mon_Ouie> You're not copying that object in any way, which is what calling #dup would do
<havenn> Hrm, didn't realize that: hsh.dup.delete_if == hsh.reject
<seoaqua> Eiam, its an old problem, i need some time to find the segment,sorry
musl has joined #ruby
<Mon_Ouie> Eiam: Actually, I think the behavior when modifying a hash while iterating over it isn't clearly defined
<Mon_Ouie> And should thus be avoided
shruggar has joined #ruby
<fowl> #each will warn you if you try to do that
vmatiyko has quit [#ruby]
<ekaleido> anyone use the twitter cassandra client by chance?
<Eiam> Mon_Ouie: odd, it lest me do it fine (in that case anyway)
<Eiam> I know obj-c would barf all over you if you tried it
<Mon_Ouie> Yes, I didn't check, and it's quite possible it works there
<Mon_Ouie> But it varies depending on Ruby version and implementation, and whether you can do it or not isn't documented
<Eiam> I mean, I wouldn't blame ruby if it didn't let me do it
IrishGringo has joined #ruby
<Eiam> but i thought it was kind of cool that it did =)
<Eiam> i figured it would just do a dupe behind the scenes
<Eiam> and mutate THAT object, and return it
<Eiam> which is probably what the programmer would do anyway, so why not do it for them
<fowl> if you find a place where ruby dups something for you without you using #dup, let me know
<Eiam> well now im curious what happens in that case then (and how it works)
<Mon_Ouie> I think it just happens to work due to Ruby 1.9 maintaining a linked list to keep hashes orderd
<Mon_Ouie> ordered*
k_89_ has joined #ruby
<Eiam> ah
Seisatsu has joined #ruby
gy4e8d has joined #ruby
mrsolo has joined #ruby
shruggar has joined #ruby
Evixion has joined #ruby
jwang has joined #ruby
Seisatsu has quit [#ruby]
davidcelis has joined #ruby
rmaceissoft has joined #ruby
n3m has joined #ruby
apok has joined #ruby
iocor has joined #ruby
danishkh_ has joined #ruby
jxpx777 has joined #ruby
jxpx777_ has joined #ruby
justinmcp has joined #ruby
eywu has joined #ruby
rmaceissoft has joined #ruby
cmasseraf has joined #ruby
<rmaceissoft> Hi guys, I'm having the following trouble http://pastebin.com/TEWwMY3L
<rmaceissoft> I need a generic way to check if variable is nil, even when that variable take values of type FixNum
<fowl> rmaceissoft: 5.nil? #=> false
<fowl> there is no method empty? for Fixnum
<Mon_Ouie> And empty? doesn't mean nil
facefox has joined #ruby
<Mon_Ouie> nil doesn't even respond to #empty?
aibo_ has joined #ruby
<fowl> rmaceissoft: you could do @client_id.nil? || (@client_id.is_a?(String) && @client_id.empty?)
<rmaceissoft> "client_id.nil? break when is of type FixNum
<rmaceissoft> fowl: @client_id.nil? break when is of type FixNum
zakwilson has joined #ruby
<fowl> rmaceissoft: try in irb: 5.nil?
iocor has joined #ruby
ccapndave has joined #ruby
<havenn> rmaceissoft: ActiveSupport's blank? is done like so: 5.respond_to?(:empty?) ? empty? : !self #=> false
lorandi has joined #ruby
mcwise has joined #ruby
<mcwise> Hello guys
francisfish has joined #ruby
<fowl> mcwise: sup
<rmaceissoft> fowl: you are right, thanks, but when I debug (i'm using aptana) @client_id.nil? does return false
<mcwise> hey, just new to the ruby community
<rmaceissoft> it returns nil
cmasseraf has joined #ruby
<fowl> rmaceissoft: it's probably not getting set to nil because the default value (in the method param) is "", maybe you could use nil ?
nikhgupta has joined #ruby
<fowl> oh and unless is an inverted if, it gets complicated if you have more logic than something simple like unless x.nil?
<rmaceissoft> fowl: thanks
FACEFOX has joined #ruby
<rmaceissoft> I'm getting my first steps into ruby world, I come from python worl :-)
<fowl> rmaceissoft: i recommend change it to an if, then you're working with positive logic
Husel has joined #ruby
ilyam has joined #ruby
<fowl> sry i didnt even notice that was an unless until now
bwlang has joined #ruby
leoncamel has joined #ruby
yoklov has joined #ruby
apeiros_ has joined #ruby
danishkhan has joined #ruby
dekroning has joined #ruby
bwlang_ has joined #ruby
Tomasso has joined #ruby
havenn has joined #ruby
Seisatsu has joined #ruby
Karmaon has joined #ruby
tewecske has joined #ruby
<JonnieCache|home> /j ableton
<JonnieCache|home> wtf
davidpk has joined #ruby
<fowl> rmaceissoft: did you get it working?
<rmaceissoft> sure, thanks for your help
undersc0re has joined #ruby
<fowl> np
petercoulton has joined #ruby
scalebyte has joined #ruby
n1x has joined #ruby
ephemerian has joined #ruby
bwlang_ has joined #ruby
KL-7 has joined #ruby
lorandi has joined #ruby
mcwise has joined #ruby
kirun has joined #ruby
codebeake has joined #ruby
rbennacer has joined #ruby
<rbennacer> hello
nanderoo has quit [#ruby]
<rbennacer> anybody here?
<mcwise> yea, plenty :)
<rbennacer> :)
<rbennacer> in activeRecord , how can i do something like this Movie.where("rating in ??", ["PG","R"])
<rbennacer> what is the correct syntax
<rbennacer> ?
<JonnieCache|home> Movie.where :rating => ["PG", "R"] maybe
<apeiros_> rbennacer: AR is #rubyonrails, the syntax is as JonnieCache|home just said
<apeiros_> alternatively .where("rating IN ?", ["PG", "R"])
<JonnieCache|home> i find that i can usually guess the AR syntax and it ust works
havenn has joined #ruby
iocor has joined #ruby
<JonnieCache|home> that applies to a lot of ruby. one of the reasons i like it
<rbennacer> yaaaay
<rbennacer> you are the best
<rbennacer> thanks
chimkan_ has joined #ruby
* JonnieCache|home has his midi keyboard back
<JonnieCache|home> its knob twiddling time
<JonnieCache|home> i hardly every use the keys heh
theRoUS has joined #ruby
<cmasseraf> I'm trying to learn ruyb... and I have two classes (Part1 and Part2) however in part2.rb whe I do require 'part1' it cannot find the file
theoros has joined #ruby
bwlang_ has joined #ruby
c0rn has joined #ruby
<JonnieCache|home> cmasseraf: you need to understand the load path
<JonnieCache|home> the load path is the list of dirs it looks in when you require stuff
<JonnieCache|home> by default, the current dir is not included in that
<cmasseraf> so... I need to add my current dir to it?
<JonnieCache|home> yes you can do that, with $LOAD_PATH << '.'
Banistergalaxy has joined #ruby
<JonnieCache|home> thats not generally encouraged but its fine for learning
<JonnieCache|home> generally what you do is put everything in a lib directory and put that in the load path
sterNiX has joined #ruby
rbennacer has quit ["Leaving"]
davidcelis has joined #ruby
danishkhan has joined #ruby
adit has joined #ruby
medik has joined #ruby
PragCypher has joined #ruby
libertyprime has joined #ruby
adamkitt_ has joined #ruby
libertyprime has joined #ruby
artm has joined #ruby
cbuxton has joined #ruby
torrancew has joined #ruby
<Mon_Ouie> File.dirname(__FILE__) is the directory that contains the current file
<Mon_Ouie> . is the current working directory, which is different
<JonnieCache|home> ah right
<torrancew> Anyone know why this CGI snippet would silently fail to print the h1 and h2 fields? http://pastie.org/private/o9vdnbtwksjj5vigjnydeq
sobering has joined #ruby
sobering has quit [#ruby]
<JonnieCache|home> Mon_Ouie: is . what it does in 1.8, the behaviour which was removed for security reasons if i understood correctly?
<JonnieCache|home> because the working dir could be anything
libertyprime has joined #ruby
<Mon_Ouie> Yeah, and therefore it breaks your script when you run it from a different directory
Gue______ has joined #ruby
<JonnieCache|home> i thought it was a security thng
<JonnieCache|home> people could sneak files in and have them required. but i suppose . was at the bottom of the load path so that wouldnt work
Banistergalaxy has joined #ruby
v3n0m has joined #ruby
PragCypher has joined #ruby
adman65 has joined #ruby
Natch has joined #ruby
bwlang_ has joined #ruby
macmartine has joined #ruby
ezkl has joined #ruby
jeremytarling has joined #ruby
dzhulk has joined #ruby
Nisstyre has joined #ruby
y3llow_ has joined #ruby
s0ber_ has joined #ruby
bwlang_ has joined #ruby
y3llow has joined #ruby
oooPaul has joined #ruby
trivol has joined #ruby
FACEFOX has joined #ruby
y3llow has joined #ruby
y3llow has joined #ruby
Helius has joined #ruby
nikhgupta has quit [#ruby]
y3llow has joined #ruby
fayimora has joined #ruby
schovi has joined #ruby
c0rn has joined #ruby
luke-- has joined #ruby
tobym has joined #ruby
artm_ has joined #ruby
macmartine has joined #ruby
flippingbits has joined #ruby
trivol has joined #ruby
Teddy2steper has joined #ruby
trivol_ has joined #ruby
nemesit has joined #ruby
havenn has joined #ruby
adamkittelson has joined #ruby
linoj_ has joined #ruby
havenn has joined #ruby
adambeynon has joined #ruby
io_syl has joined #ruby
AxonetBE has joined #ruby
libertyprime has joined #ruby
PragCypher has joined #ruby
flu- has joined #ruby
c0rn has joined #ruby
Foxandxss has joined #ruby
emocakes has joined #ruby
iocor has joined #ruby
jbw_ has joined #ruby
daniel_hinojosa has joined #ruby
davidpk has joined #ruby
ericdfields has joined #ruby
<ericdfields> is there a more concise way i can do this? http://pastie.org/3580749
<burgestrand> ericdfields: (1..8).map { |i| … }
<canton7> ericdfields, http://pastie.org/3580768
<fowl> canton7: he wants an array of arrays
<ericdfields> right
fayimora has joined #ruby
<ericdfields> in this case map does work tho
<ericdfields> thanks burgestrand
<canton7> fowl, oops, missed that. updated the pastie
linoj_ has joined #ruby
PragCypher has joined #ruby
<Phrogz> Or duration_array = (1..8).map{ |i| pluralize(i, 'hour') }.zip(1..8) :)
sahli_ has joined #ruby
* Phrogz loves Array#product and Array#zip
wroathe has joined #ruby
<Phrogz> ericdfields: BTW, what are you using this datastructur for? Smells...wrong.
rexbutler has joined #ruby
Targen has joined #ruby
<Phrogz> I'm still surprised how the presence or absence of a single character can transform an otherwise-good sentence into something that appears to come from a 12 y/o fool.
chsonnu has joined #ruby
<deryldoucette> lol
banister_ has joined #ruby
Foxandxss has joined #ruby
sbabiy_ has joined #ruby
kylemcgill has joined #ruby
srid has joined #ruby
srid has joined #ruby
srid has joined #ruby
zakwilson has joined #ruby
axl_ has joined #ruby
pastjean has joined #ruby
Vadim2 has joined #ruby
workmad3 has joined #ruby
ryannielson has joined #ruby
AxonetBE has joined #ruby
undersc0re has joined #ruby
undersc0re has joined #ruby
joshmbrown has joined #ruby
artm has joined #ruby
igaiga has joined #ruby
blackflys has joined #ruby
blackflys has quit [#ruby]
trivol_ has joined #ruby
blackflys has joined #ruby
squidz has joined #ruby
virunga has joined #ruby
FACEFOX has joined #ruby
<squidz> I tried to run a block in ruby every 194 times by using the modulo condiational if(index%194 ==1) then run block, but it doesnt seem to do it every 194 times
<squidz> any idea why?
albemuth has joined #ruby
PragCypher has joined #ruby
visof has joined #ruby
visof has joined #ruby
<squidz> could it be that ruby is rounding the division result?
<burgestrand> squidz: 5.5 % 5 # => 0.5
<burgestrand> so, no rounding
<burgestrand> but floats can be scary to deal with at times
<fowl> squidz: 1000.times { |x| next unless x % 194 == 0; p x } #=> 0, 194, 388, etc
<fowl> i dunno if thats what you need but you can use something like that in irb to model the results
<Phrogz> squidz: On the face of it what you're doing works fine.
<squidz> fowl: it looks like that might well be what I am trying ill look into it, thanks
* Phrogz ponders what makes 194 special
phantasm66 has joined #ruby
<Phrogz> 194.prime_division #=> [[2, 1], [97, 1]]
MrGando has joined #ruby
<shadoi> wow, there are a lot of "facts" associated with 194.
<shadoi> heh
<squidz> Phrogz: I am trying to scrape a 974 links, which should be no problem except that I seem to time out becaues of excessive traffic so I want to break those 947 page visits up with a sleep every now and then. I though 194 divides 974 evenly but it looks like that was a mistake. Maybe I am approaching this wrongly
booginga has joined #ruby
<robacarp> o-O
<shadoi> hehe
<Phrogz> Oo indeed
spox has joined #ruby
<Phrogz> squidz: Why not just a) put a small sleep after each fetch, and b) rescue the timeouts and handle them appropriatel?
<robacarp> this is one of my favorite wikipedia articles: http://en.wikipedia.org/wiki/List_of_numbers
<shadoi> better yet, spawn a thread for #-cores at a time, and let them finish before spawning new threads.
<robacarp> "This is an incomplete list"
<shadoi> hahha
<Phrogz> And no, c) 974.prime_division #=> [[2, 1], [487, 1]]
Banistergalaxy has joined #ruby
<squidz> rescuing the timeouts looks like a nice solution but i'm not sure that sleeping after each call with prevent my problem
<shadoi> wikipedia is so FAIL, they can't even list all numbers!
<squidz> damn you 974
ph^ has joined #ruby
<robacarp> you don't need to divide you request blocks evenly to make it happen
<robacarp> just make it sleep every 100 or so.
<robacarp> the last block will only be 74...so what...
<squidz> robacarp: yeah I thought about that too, but I think just rescuing with a timeout would be more efficient
mmokrysz has joined #ruby
<squidz> preventing unneeded sleeps
mmokrysz has quit [#ruby]
<squidz> but this is the first time ive done anything with error/exception handling with ruby, since it is only my second thing ive done in ruby
<squidz> but so far i'm really diggin it
<shadoi> squidz: did you look at Scrubyt and Mechanize?
<robacarp> I mean...the reality of the problem is that you are being rate-limited by the server, which is inherently a chronographic problem. Implementing chronographic delay solutions to a chonographic problem seems reasonable to me.
<robacarp> but, now that I think about it....I agree with you...
<robacarp> rescue a timeoutt, then sleep.
doublethink has joined #ruby
<robacarp> /but/ that might not be the fastest way to scrape all the links. If you stay within the bounds you don't need to wait for the timeout.
tomzx has joined #ruby
<robacarp> I suppose it depends on how long the timeout takes compared to how long you'd need to sleep between requests.
lep-delete has quit [#ruby]
iocor has joined #ruby
wilmoore has joined #ruby
bglusman has joined #ruby
<squidz> robacarp: true
<robacarp> MATH!
<squidz> thanks for the help and advice guys, the ruby community seems pretty friendly. Yall make it a good experience
alaa_ has joined #ruby
wallerdev has joined #ruby
<booginga> hey all this is more a rails question but the guys in #RubyOnRails are talking about hair cuts :) Anyone know why something like this would be giving me a routing error format.html { render 'admin/users/show', :layout => true }
<booginga> but this format.html { render 'admin/users/index', :layout => true } works fine? Im trying to render a partial from another controller that lives in the namespace admin
<alaa_> Hello guys, I need to build my final project using Sinatra and MongoDB, but I need to learn Ruby first, I have good exeprince with PHP, JAVA, OOP, and design patters. Would you give some resrouces to learn the latest ruby. thank you.
<gogiel> alaa_: Eloquent Ruby book
pingfloyd has joined #ruby
Vadim has joined #ruby
<alaa_> gogiel: thank you
bwlang has joined #ruby
<squidz> shadoi: yeah I am using mechanize
<gogiel> alaa_: this is my favourite. you can read any book/tutorial and go deeper with google
<squidz> shadoi: it's handy as hell
<undersc0re> booginga: Ask in #RubyOnRails anyways
libertyprime has joined #ruby
<undersc0re> i dunno why so many people come here for rails questions ._.
libertyp1ime has joined #ruby
pablo__ has joined #ruby
<doublethink> undersc0re, because they think that ruby is rails
<undersc0re> RoR should change it's name to Rails on Ruby
<undersc0re> Because Ruby doesn't ride on Rails
<fowl> thankfully
<philcrissman|afk> booginga: if you stop and think about your routes you'll see the answer. Ask in #rubyonrails, I'll tell you. :)
asobrasil has quit [#ruby]
<philcrissman|afk> ah heck. I guess I can tell you here. But; think about the show route. How's it different from an index route?
<booginga> needs an id
<philcrissman|afk> and what did you not give it?
albemuth has joined #ruby
<philcrissman|afk> sorry, just saw that you did ask in ROR. Maybe someone will answer it there, too. :)
<booginga> thats weird though because i can pass admin/users/edit
<booginga> and its fine
<booginga> how should i pass it it
<philcrissman|afk> booginga: ...
<booginga> :id => @user.id
<doublethink> params[:id]?
<philcrissman|afk> actually edit should not work without an id either. That's interesting. Would have to see your routes to know why.
<philcrissman|afk> booginga: see #ror, answering now
adit has joined #ruby
<booginga> i would its invite only i think
<philcrissman|afk> booginga: nonsense. you've already asked several questions.
<booginga> oh sorry thought you were actually saying #ror
<philcrissman|afk> booginga: #ror is just shorthand for #rubyonrails. if there's an actual #ror channel, I've never bothered with it.
<philcrissman|afk> booginga: no, I see how you could think that, sorry. less typing. :)
tatsuya_o has joined #ruby
jbhewitt has joined #ruby
<undersc0re> philcrissman|afk, booginga: #ror redirects to #RubyOnRails
<philcrissman|afk> undersc0re: aha. Well, there you are.
<philcrissman|afk> undersc0re: hm. Actually, for me, it does say "cannot join channel, must be invited" (#ror)
<undersc0re> uh
tommyvyo has joined #ruby
<bingomanatee_> For some reason my metal class is not kicking in - is there something you have to do to disable/enable the "metal" directory in a 3.0 app?
sungji has joined #ruby
sungji has joined #ruby
Boohbah has joined #ruby
<apeiros_> bingomanatee_: #rubyonrails
<bingomanatee_> thx
<sungji> Hi! I'd like to add a function to "enumerables", e.g. [54,692,830, 3240].great? However, apparently, Enumerable isn't a class :/ so how can I add a function to enumerables?
<fowl> sungji: Enumerable is a module
coreydaley has joined #ruby
dagnachewa has joined #ruby
carlyle has joined #ruby
<fowl> module Enumerable; stuff; end
<sungji> fowl, oh, I see
<burgestrand> won’t work for objects that have already included/extended Enumerable
<apeiros_> sungji: you may be looking for the already existing method `max`
<apeiros_> assuming you want: [54, 692, 830, 3240].max # => 3240
<booginga> underscOre: ahh thanks
<sungji> apeiros_: thanks!
<sungji> fowl, thank you
i8igmac has joined #ruby
<fowl> apeiros_: can i suggest taking the modruby.net link out of the channel greeting and replacing it with something about rails having separate channel
apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
<apeiros_> I should probably put the rails part to the front…
tayy has joined #ruby
mxbtty has joined #ruby
<apeiros_> fowl: oh, channel greeting is done by chanserv
<apeiros_> can't change that…
<fowl> apeiros_: i meant the chanserv greeting you get when you join
<fowl> ah
<apeiros_> I'm trying to get fflush to change ownership of the channel or at least give me more power for years now… I don't think it'll ever happen.
<undersc0re> -Notice- {from ChanServ} Registered : Feb 05 15:20:56 2003 (9 years, 5 weeks, 3 days, 07:56:50 ago)
<undersc0re> apeiros_: wow
<apeiros_> undersc0re: now do /ns info fflush
<apeiros_> pay attention to the 'last seen'
<undersc0re> apeiros_: :|
wallerdev has joined #ruby
<apeiros_> undersc0re: yeah, that's my face. except - 2 years ago
<apeiros_> now it's just =(
<undersc0re> apeiros_: you may be able to convince freenode staff to transfer ownership
<apeiros_> no
<apeiros_> I asked a bit around
<apeiros_> not a way I can go
<apeiros_> neither #ruby nor #ruby-lang is an official channel, they actually already violate freenode policy
<apeiros_> (#ruby-lang is at least half-way official by being acknowledged on ruby-lang.org)
<undersc0re> Wow.. I'm surprised they haven't shut this place down
<apeiros_> I'm not
<apeiros_> I've started the process to get my hostmask about 5y ago
<apeiros_> it should have taken a week or something
<apeiros_> I still don't have it
<undersc0re> o_O
<apeiros_> not surprised by a bit that stuff like shutting down a channel doesn't happen in the blink of an eye…
manizzle has joined #ruby
smgt has joined #ruby
pu22l3r has joined #ruby
GSpotAssassin has joined #ruby
Banistergalaxy has joined #ruby
havenn has joined #ruby
tomzx has joined #ruby
MasterBob has joined #ruby
MasterBob has joined #ruby
y3llow has joined #ruby
bondar has joined #ruby
<bpgoldsb> If I have a class (foo) inside another class (bar), how do I access the baz method of bar from insize foo?
bwlang has joined #ruby
mxbtty has quit [#ruby]
<apeiros_> bpgoldsb: the nesting of classes doesn't change anything about accessibility
mengu has joined #ruby
S0lign0c has joined #ruby
<apeiros_> also, for the sake of clarity, capitalize your classnames in your questions…
<bpgoldsb> apeiros_: Well, inside bar, I can call notice. When I try to call it from within foo, I get undefined method.
<fowl> bar::foo.baz ?
<bpgoldsb> Admittedly, I'm new to ruby, so it could be another issue. But I'm having problems tracking it
leoncamel has joined #ruby
gokul has joined #ruby
iocor has joined #ruby
<apeiros_> bpgoldsb: yes, because methods of Foo have nothing to do with methods of Foo::Bar
<fowl> nm, i didnt read it right
<apeiros_> the two classes are unrelated
jbw_ has joined #ruby
_null has joined #ruby
<apeiros_> it's no different than if you had a class Foo and a class Bar, without Bar beint nested in Foo.
<apeiros_> *being
aroop has joined #ruby
cespare has joined #ruby
nari has joined #ruby
colinwd has joined #ruby
<frontendloader> http://pastebin.com/vVYWz5xf what broke this going from ruby 1.8 to ruby 1.9
<fowl> lol @ pingfloyd
<fowl> frontendloader: whats the error
pu22l3r has joined #ruby
<frontendloader> line 45, trying to bitwise and on a string
<frontendloader> (digest[digest[19] & 0x0F, 4]
<apeiros_> frontendloader: any reason to use a pastebin with ads?
<robacarp> gist!
<frontendloader> how will you ever survive!
<fowl> lol
nik_-_ has joined #ruby
<fowl> not sure what a bitwise & is supposed to do to a string
macmartine has joined #ruby
<robacarp> this is some gnarly code
<frontendloader> that code /should/ work in 1.8.7
<apeiros_> frontendloader: if you'd have given the actual error, you could have gotten a quicker answer
<apeiros_> String#[index] used to return an int
<apeiros_> it doesn't anymore
<frontendloader> thanks for the answer without the snark
<apeiros_> use unpack or String#ord
<apeiros_> frontendloader: I can easily give you a boot too…
<frontendloader> you reap what you sow man, was I snarky to you at the outset?
<fowl> everybody calm down and drink appletinis with me
<apeiros_> frontendloader: I have not much left for people who make half-assed questions, and fail to provide proper info even when explicitly asked for it.
M- has joined #ruby
pingfloyd has joined #ruby
havenn has joined #ruby
Targen has joined #ruby
_2easy has joined #ruby
mikeric has joined #ruby
wroathe has joined #ruby
<frontendloader> getbyte/byteslice are the new methods for that then?
<robacarp> ord
<robacarp> string.ord(5)
<robacarp> er
<robacarp> string[5].ord
<frontendloader> ord's for chars I think
IrishGringo has joined #ruby
<robacarp> that syntax works under both 1.8 and 1.9 rubies, iirc
shevy has joined #ruby
workmad3 has joined #ruby
<td123> so
<apeiros_> it doesn't work pre 1.8.7
<td123> does ruby keep a copy of past ruby releases as a .bz2? it seems ruby 1.9.3p125 has done a silent release and only updated the md5sum on the pkg