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/
tommyvyo_ has joined #ruby
badabim__ has joined #ruby
ipsifendus has joined #ruby
sacarlson has joined #ruby
sbanwart has joined #ruby
johndbritton has joined #ruby
_obiJuan has joined #ruby
fr0gprince_mac has joined #ruby
jackhammer2022 has joined #ruby
<jackhammer2022> hi everyone
dnyy has joined #ruby
<jackhammer2022> i have to generate a graph from a ranking data of ipod songs
<jackhammer2022> any suggestions for a ruby graphing library ?
ascarter has joined #ruby
looopy has joined #ruby
ryannielson has joined #ruby
Knodi has joined #ruby
MasterIdler__ has joined #ruby
MasterBob has joined #ruby
cableray has joined #ruby
banisterfiend has joined #ruby
<MasterBob> Hello. Do I always have to make a new class object by using CLASS_NAME.new(params)?
pac1 has joined #ruby
<banisterfiend> MasterBob: no, u can use: class Hello; end
CannedCorn has joined #ruby
<heftig> MasterBob: do you want to create a factory?
<MasterBob> I am not familiar with what a factory is.
<MasterBob> So, I think no.
sbanwart has joined #ruby
<Nowaker> I have a related question. I cannot do: Integer.new 1. I know why. I can do Integer(1). However, I will want to do this dynamically, that is, Integer class will be passed via parameter.
<banisterfiend> Nowaker: then, Kernel.send(Integer, 1)
<banisterfiend> Nowaker: then, Kernel.send(:Integer, 1)
<Nowaker> yeah, great, thanks
<Nowaker> I was trying with Integer.send
<robert_> sup banisterfiend
<Nowaker> but I didn't know the name of the method (since there is no method :P)
<banisterfiend> robert_: not a lot, u
<heftig> Nowaker: Integer() is not ::Integer
<banisterfiend> Nowaker: Integer is a method, btw
<Nowaker> oh.
<robert_> working on trying to figure out prawn, lol
<heftig> methods and constants have their own namespaces
<Nowaker> so Integer is a class, whereas Integer() is a method
minijupe has joined #ruby
mikeycgto has joined #ruby
randym has joined #ruby
iocor has joined #ruby
patronus has joined #ruby
startling has quit [#ruby]
tomzx has joined #ruby
idletom has joined #ruby
Prometheus has joined #ruby
eregon has joined #ruby
johnduhart2 has joined #ruby
mattp_ has joined #ruby
<MasterBob> How do I check the class time of an object? Is it: obj.instance_of?(FixNum) ? or obj.kind_of?(FixNum)? or something else?
Husio has joined #ruby
<MasterBob> When I try the second one, I get a NameError with the reference to FixNum from that line.
sawjig has joined #ruby
Jb___ has joined #ruby
Knodi has quit [#ruby]
drbawb has joined #ruby
<ryannielson> MasterBob: Do you want to know the class, or check if it's a certain class?
shajen has joined #ruby
<MasterBob> ryannielson: check if it is a class that doesn't have a dup method. So actually, I'd need to do obj.methods?.include?(dup) right?
axl_ has joined #ruby
<robert_> so anyone have any positive experiences with prawn?
deavid has joined #ruby
<MasterBob> er, obj.methods.include?(dup) would be the correct syntax.
<heftig> MasterBob: obj.respond_to?(:dup)
ascarter has joined #ruby
<ryannielson> MasterBob: What he said.
<MasterBob> What's the difference? is respond_to syntactic sugar for what I had before?
<heftig> no, it's not
dnyy_ has joined #ruby
<heftig> repond_to? asks the object if it has a method
jbpros has joined #ruby
<heftig> public method.
mrmist has joined #ruby
<ryannielson> MasterBob: Wouldn't call it sugar. It's just a method that directly checks it. It'll probably be slightly faster
<ryannielson> MasterBob: I believe it's a method directly on the Object class
patronus has joined #ruby
shajen has joined #ruby
eregon_ has joined #ruby
<MasterBob> So then why do I get false with methods.include and true for respond_to?
mxweas_ has joined #ruby
<heftig> because "dup" is wrong
<heftig> you should use :dup
<heftig> if you just write "dup" it's basically the same as "self.dup", and you're looking for a duplicate of the current object in that methods array
<MasterBob> Okay, so then why are they both True when 4.dup results in a TypeError?
<heftig> because it does have the method "dup"
<heftig> it just immediately raises an error
TheNumb has joined #ruby
<MasterBob> Okay. So then if I need to dup a wide range of things (including FixNum), then I should do so in whatever the Ruby syntax is for an exception block.
looopy has joined #ruby
nobitanobi has joined #ruby
<ReinH> MasterBob: why do you need to "dup a wide range of things"?
<ReinH> seems very strange
<banisterfiend> ReinH: haven't you ever woken up one morning and realized everything in your house had been replaced by an exact copy?
<MasterBob> to make a deep copy of an object composed of other unspecified objects
<ReinH> ...
<ReinH> MasterBob: why do you need to do that?
<MasterBob> that's what happened to be banisterfiend
<sunaku> and made him into a fiend
<MasterBob> Because I want to return a new object in this method instead of references to the calling object or paramaters
<MasterBob> s/to be/to me/
coreydaley has joined #ruby
<ReinH> MasterBob: why?
sacarlson has joined #ruby
<ReinH> deep copies are a code smell
<sunaku> deep_copy = Marshal.load(Marshal.dump(orig_copy))
Drakx has joined #ruby
<MasterBob> Why? to keep the objects separate. Why? that's part of the design for this method
<MasterBob> why? those are the reqs. Why? aka this is homework in my Comparative Languages class
<MasterBob> Thanks sunaku.
<MasterBob> I like reading.
<ReinH> sounds like shitty homework
<sunaku> now now. that kind of attitude won't get us an A ;)
<MasterBob> ReinH: it's essentially an implementation of the Scheme cons
<ReinH> how on earth could cons involve a deep copy?
<ReinH> it's a primitive
macmartine has joined #ruby
<banisterfiend> ReinH: what kind of first name is "Rein" btw, are you german?
<banisterfiend> just curious
<MasterBob> ReinH: I'm not a Scheme expert.
<ReinH> banisterfiend: it's of Estonian origin
<banisterfiend> oh ok
<MasterBob> ReinH: how is it pronounced?
<sunaku> ReinH is no fiend :)
<ReinH> like the first syllable in *cons*truct
<ReinH> sometimes conz instead of cons
<MasterBob> Your name?
<ReinH> hah
<MasterBob> Rein is pronounced like cons?
<MasterBob> 0_o
<ReinH> you didn't specify the anticedent :p
dnyy has joined #ruby
<ReinH> like the rein on a horse
<MasterBob> True. My apologies.
<ReinH> or rain
<ReinH> one can't expect to transfer a concept from one paradigm to another without some loss of integrity
<ReinH> Ruby has mutable state and does not have "cons cells" or tuples or anything similar
<deryl> hey ReinH
<MasterBob> I think there is a subtle difference between rain and rein. ReinH that's a good point, but I guess it matters on the goal of the transfer
<ReinH> the idea that one should have to marshall and unmarshall an object to write cons in ruby I find to be quite ridiculous
<deryl> i say rein like the english word wren
<deryl> (the bird)
<ReinH> cons is one of the fundamental building blocks of lisp
<ReinH> its implementation in ruby should also be simple
<ReinH> requiring a deep copy makes it anything but simple
ipsifendus has joined #ruby
<MasterBob> this is in particular for append though ReinH
<ReinH> matti: rein/rain (and vein/vain) merged in pronounciation in English around the 14th century (http://en.wikipedia.org/wiki/Phonological_history_of_English_diphthongs#Vein.E2.80.93vain_merger)
<ReinH> in any event, Rein is Estonian
yoklov has joined #ruby
<ReinH> MasterBob: if you want to truly implement a lisp-like semantic in Ruby, you need to start with something like lambdas
<ReinH> anything else is of necessity going to be a compromise
<ReinH> (starting with something like untyped lambda calculus in Ruby http://cs.hofstra.edu/~cscccl/csc123/lambda.rb)
<MasterBob> ReinH: I don't actually want to do that.
<ReinH> Jim Weirich has a very interesting talk about implementing the basic lisp primitives in Ruby using lambdas as a data structure
nobitanobi has joined #ruby
Sailias|work has joined #ruby
<ReinH> I think so
<ReinH> hmm, not quite but close
<banisterfiend> ReinH: are you a fan of ->{} and .() ?
<ReinH> banisterfiend: I don't find myself using them very often in Ruby
<ReinH> obviously in CoffeeScript, Erlang, Haskell, etc I use the former
<ReinH> I think -> is a pretty reasonable alias for lambda
<ReinH> .() kind of annoys me though
sbanwart has joined #ruby
<ReinH> I don't understand the people that say that "->" *looks* like the letter lambda, though. It does not.
fermion has joined #ruby
<banisterfiend> ReinH: i'd prefer it as a shorthand for proc {} than lambda {} actually, as i tend to use procs and proc-like semantics more often
luckyruby has joined #ruby
badabim_ has joined #ruby
<banisterfiend> notably i'd like to use ->{} as a nice wa of passing multiple blocks, but when they behave like lambdas you have to be more careful
munx has joined #ruby
emocakes has joined #ruby
td123 has joined #ruby
<MasterBob> Thank you for your help ReinH , banisterfiend , sunaku , heftig , and ryannielson .
<banisterfiend> MasterBob: that'll be 50 pounds, thankyou!
<ryannielson> MasterBob: No worries, good luck
<MasterBob> banisterfiend: okay. I won't be able to pay you for, say another two months; I hope by then I'll have put on 50 pounds.
MrGando has joined #ruby
yoklov has joined #ruby
eywu has joined #ruby
axl_ has joined #ruby
stephenjudkins has joined #ruby
<MasterBob> I have one more question, my professor was looking for a new IDE as Netbeans (his old favorite) dropped support for Ruby. Do yall have any recomendations?
ziggles has joined #ruby
<stephenjudkins> MasterBob: not many people use an IDE with Ruby
<stephenjudkins> but RubyMine is the best-regarded
<MasterBob> Yeah, that's what I've been seeing online.
<stephenjudkins> I believe that RubyMine is essential equivalent to Intellij + Ruby plug-in
<stephenjudkins> but one or the other gets updates more quickly
<stephenjudkins> i use IntelliJ for scala development and it's very good at that
choffstein has joined #ruby
<stephenjudkins> but i have been using sublime text 2 for everything else. it is very good at being a text editor
sbanwart has joined #ruby
<MasterBob> stephenjudkins: if most people don't use an ide, do they use a debugger?
snip_it has joined #ruby
<stephenjudkins> MasterBob: even fewer people use a debugger
QaDeS_ has joined #ruby
<stephenjudkins> i'm personally opposed to use of a debugger
<stephenjudkins> though they are sometimes useful
<MasterBob> for philosophical reasons?
<stephenjudkins> yeah
hadees has joined #ruby
<Boohbah> can a deck of cards be an Array of Hashes?
<Boohbah> yes! it can!
<ereslibre> is there an easy way to obtain an object's list of attributes ? I am defining them with attr_accessor
<epochwolf> stephenjudkins: debugger is awesome
<epochwolf> stephenjudkins: I wouldn't be able to do my day job without it
<stephenjudkins> [citation needed]
<iamjarvo> i want to to iterate through an array and when i reach a certain value i want to take 10 values back is tehre a simple way of doing that
<epochwolf> stephenjudkins: enterprise rails with legacy code™
<stephenjudkins> epochwolf: i'm sorry. you should look for a new job! i am not joking,.
<epochwolf> you try figuring out why there is a bug in 3000 lines of code without a debugger.
<epochwolf> stephenjudkins: I've considered it.
<stephenjudkins> i worked for far too long at a place that kind of sucked
<stephenjudkins> because of laziness or some misguided sense of duty
<deryl> you use a debugger to help you? *gasp* get a new job, you're not qualified for this one" (rubbish)
<stephenjudkins> but if you're a good, or even decent, developer, there are places there for you
<stephenjudkins> deryl: epochwolf said himself he needs it because it's "legacy code"
<stephenjudkins> i know exactly what that means
undersc0re has joined #ruby
undersc0re has joined #ruby
<stephenjudkins> there is plenty of code that requires a smart competent programmer to use a debugger to understand it
<Sailias|work> iamjarvo, a = (1..20).to_a; a[a.index(13) - 10, a.index(13)] if a.index(13)
<epochwolf> stephenjudkins: my code rarely needs debugging.
<deryl> ok, then you're obvisouly in possession of information I am not, so i'll retract the barb.
<Sailias|work> iamjarvo, that could be cleaned up a lil prob, but i 1 lined it for you
drbawb has joined #ruby
<epochwolf> maybe twice in 7 months?
<deryl> s/iso/ios/
<deryl> even then i'm wrong and still end up with a typo. awesome!
<epochwolf> stephenjudkins: I'm slowly removing bad code and replacing it with my code.
porco has joined #ruby
<stephenjudkins> "p [__FILE__, __LINE__]; STDIN.readline" has been a sufficient debugger for me
<Sailias|work> iamjarvo, or in case i misunderstand and you want the single element 10 values back: a = (1..20).to_a; a[a.index(13) - 10] if a.index(13)
<stephenjudkins> but i have used a debugger on some crazy java codebases where it's been very helpful
<banisterfiend> stephenjudkins: i can solve problems without a debugger, but im usually faster with a debugger
<iamjarvo> Sailias|work: i think i will do .each_with_index and just minus 10
<stephenjudkins> do you use unit tests?
mxweas_ has joined #ruby
<banisterfiend> stephenjudkins: of course, but sometimes there's an edge case now caught by your tests
<sunaku> Sailias|work: a = (1..20).to_a; a.index(13).tap {|i| a[i-10, i] if i }
<deryl> banisterfiend: i think there is something specific to legacy stuff thats not apparent in fresh code. that i'd understand so is why i stepped back from my barb
<banisterfiend> stephenjudkins: and then you can have some subtle issues that are hard to untangle without a debugger
<banisterfiend> stephenjudkins: not caught*
<stephenjudkins> banisterfiend: hmm, i've found that most "subtle issues" that can only be found with a debugger
<stephenjudkins> frequently means over-use of stateful code
<banisterfiend> stephenjudkins: or, is actually a bug in a library you're depending on
<stephenjudkins> but i'm running my mouth over stuff that's honestly mostly opinion
<banisterfiend> stephenjudkins: or is a bug in ruby itself
<banisterfiend> stephenjudkins: or is an edge case of a ruby method that you didnt know about
<banisterfiend> i encounter that stuff a lot
_|christian|_ has joined #ruby
<sunaku> Sailias|work: never mind. #tap doesn't #map
<stephenjudkins> why not try to write a unit test to reproduce the issue first?
<banisterfiend> stephenjudkins: i do?
<banisterfiend> stephenjudkins: but getting in there and *understanding it* in an interactive manner is extremely helpful
<epochwolf> stephenjudkins: I do when possible.
mkscrg has joined #ruby
Targen has joined #ruby
<stephenjudkins> hmm, obviously we have different takes on this issue
<ereslibre> nvm... instance_variables, the variable wasn't defined yet so the list was empty
<epochwolf> One of the things that makes enterprise stuff really painful is having to make stuff like "We need to allow the user to select which things they want to copy from Test Environment A to Production B" when things is one of 5 top level objects which have foreign key relationships to 50 differnet
<epochwolf> 50 different objects.
lorandi has joined #ruby
<epochwolf> Working out the basic logic for that on paper takes over an hour for each instance IF I have all the records printed out.
<banisterfiend> stephenjudkins: obviously following TDD can significantly limit the number of times you need to use a debugger, but to say that it does away with the debugger altogether is kinda silly IMO. Though, you can, of course, eventually figure things out without debuggers, but once you become good with a debugger you can locate and fix the issue much more quickly.
<epochwolf> banisterfiend: exactly
<deryl> hehe i write tests daily, and it definitely hasn't eliminated the need for the debugger.
<deryl> cut down, yes. eliminate, not so much
<epochwolf> When a process takes 15 minutes to run each time, a debugger is much, much faster.
Willejs has joined #ruby
<epochwolf> especially when it produces 30+mb of log data.
tamarass has joined #ruby
<tamarass> ciao
<epochwolf> that should give you an idea of how many select *'s it's doing. >.<
<deryl> hehe i was blinking at that
pdtpatrick has joined #ruby
<epochwolf> deryl: it needs to compare the differences between two databases.
Willejs_ has joined #ruby
<banisterfiend> stephenjudkins: I also have a debugger than can open up on test failure at the point of a failing test, that's very handy too
<epochwolf> and then once that's done, it needs to calculate the dependencies between changes D:
albemuth has joined #ruby
<epochwolf> I wrote the second part.
<epochwolf> 7 fucking weeks and it still corrupts data :'(
<epochwolf> so maybe 9~11 weeks total dev time since last october.
kpshek has joined #ruby
<epochwolf> combined with the amount of corrupt data we've had to repair, it's not saving any time for anyone.
triptec has quit [#ruby]
<epochwolf> I hope I fixed the last bug yesterday. It's nearly impossible to get a decent test of this monster.
<epochwolf> I should write a blog on this.
<epochwolf> It'll be fun to point to on my resume.
nari has joined #ruby
mikepack has joined #ruby
v0yager has joined #ruby
<epochwolf> oh this isn't working very well. :(
thecreators has joined #ruby
<Boohbah> p CARD_HASH = Hash[*CARDS.zip(ENCODED).flatten] # splat!
shtirlic has joined #ruby
frishi has joined #ruby
<sunaku> p CARD_HASH = Hash[CARDS.zip(ENCODED)] # should work too
CannedCorn has joined #ruby
<Boohbah> sunaku: it does. i think i'll do that, thanks!
drbawb has joined #ruby
drbawb has joined #ruby
sdwrage has joined #ruby
sacarlson has joined #ruby
choffstein has joined #ruby
Willejs has joined #ruby
Indian has joined #ruby
dv310p3r has joined #ruby
sawjig has joined #ruby
nat2610 has joined #ruby
carlyle has joined #ruby
<nat2610> is there something similar to .methods but that will actually give you the paramters that the method expect ?
<deryl> respond_to?()
<deryl> oh params
<deryl> nevermind. wow that was stupid response.
wallerdev has joined #ruby
rickmasta has joined #ruby
<Nowaker> how do I override a method defined in Module class?
<Nowaker> let's say I want to override attr_accessor
<Nowaker> and I want to override it for current class only, not the module itself
CheeToS has joined #ruby
albemuth has joined #ruby
mdaisuke has joined #ruby
jesly has joined #ruby
<MasterBob> In ruby are there method comments like java's javadoc stuff?
<Nowaker> # description
<Nowaker> def my_method
wallerdev has joined #ruby
<Nowaker> when I press ctrl+q on usage of my_method in rubymine, I get the description
<MasterBob> Nowaker, is that then automatically "associated" with my_method?
<Nowaker> in my ide - rubymine - yes
<MasterBob> Okay. thanks.
<banisterfiend> MasterBob: check out YARD
<Nowaker> bit if you need 'persisent' "javadocs" in ruby, you would need to take a look at rdoc or yard
baroquebobcat has joined #ruby
<MasterBob> okay thanks Nowaker and banisterfiend
rickmasta has joined #ruby
mxweas_ has joined #ruby
wmoxam has joined #ruby
Mac_ has joined #ruby
ipsifendus has joined #ruby
kah has joined #ruby
<Nowaker> how to programatically call attr_accessor or any other method from Module class?
pp01bit has joined #ruby
<Nowaker> self.class.send :attr_accessor, name - it does not raise any exception
<kah> hey can anyone explain why code_words isn't defined? http://pastie.org/3493238
<Nowaker> but accessor doesn't look like defined
choffstein has joined #ruby
<kah> hey can anyone explain why code_words isn't defined? http://pastie.org/3493238
<Nowaker> you should define it as $code_words
<kah> Nowaker, yeah you're right!
pdtpatr1ck has joined #ruby
emocakes has joined #ruby
<banisterfiend> Nowaker: can you explain more what u mean, maybe with a gist
<kah> Nowaker, when you use require why do you loose the variable information?
<Nowaker> banisterfiend: ok
<Nowaker> kah: local variables are not seen from outside the current file
<Nowaker> $variable is a global
<kah> Nowaker, good to know, I guess poignant's guide has an error ;)
jitesh_shetty has joined #ruby
namidark[w] has joined #ruby
wmoxam_ has joined #ruby
<banisterfiend> Nowaker: gist
<banisterfiend> kah: link to that part in the poignant guide, cos i doubt _why would make a simple mistake like that ;)
<Nowaker> banisterfiend: http://pastie.org/3493269
etank has joined #ruby
<Nowaker> banisterfiend: this one: http://pastie.org/3493273
<banisterfiend> Nowaker: that's going to invoke it on the class
<banisterfiend> Nowaker: btw it's a bad idea to ovvride that method, why not just define your own one? my_attr_accessor
<banisterfiend> :P
<Nowaker> you see, I just to it for training :-)
<Nowaker> I could, of course
<banisterfiend> ok
<Nowaker> but I want to know how to override the method from Module class
al3xnull has joined #ruby
<Nowaker> and how to invoke the overridden one from the new method
<banisterfiend> Nowaker: call super
<Nowaker> there is no super
<Nowaker> super is nil
<axl_> how do i cleanly remove every trace of a gem that I had installed
<axl_> ?
<Nowaker> axl_: backtrace silencers in rails?
<banisterfiend> Nowaker: but in your case, call super(name)
<Nowaker> hmmm, well, I tried it half an hour and got nil super
<Nowaker> but maybe I forgot about "self"
<Nowaker> let's reproduce that
<banisterfiend> Nowaker: dont call: self.class
<banisterfiend> that's going to create an accessor on the Class class ;)
<Nowaker> ouh, not good :-)
<Nowaker> your solutions works from outside only - from the test
<Nowaker> the test passes, that's good
<Nowaker> but...
fbernier has joined #ruby
Willejs has quit [#ruby]
Guest__ has joined #ruby
<pp01bit> what do you position yourself in tech discipline?
<banisterfiend> Nowaker: this doesnt do what u think it does: send name.to_s + '=', default_value
<pp01bit> looking at myself, i'm more of a bit of everything with nothing specific
<banisterfiend> Nowaker: you are defining instance methods on a class, you dont have an instance yet
<banisterfiend> Nowaker: so u cant set any default values
namidark[w] has joined #ruby
<banisterfiend> Nowaker: in fact, i expect this to raise an exception send name.to_s + '=', default_value
<Nowaker> ok, but I define @properties too, and Ruby doesn't complain
philcrissman has joined #ruby
<Nowaker> I understand it's static context, but Ruby seems quite magic to me
<banisterfiend> Nowaker: because you're defining @properties on the class
<banisterfiend> and it's an ivar, not a method
<banisterfiend> methods have to exist to call them
<banisterfiend> ivars are created when they are referenced
<Nowaker> oh, great, good to know
wenbert has joined #ruby
<Nowaker> and I guess no default value can be set for ivar?
pu22l3r has joined #ruby
drbawb has joined #ruby
<banisterfiend> Nowaker: you can but it's complicated
<CannedCorn> hey guys, can someone explain why one thread gets starved here
<banisterfiend> Nowaker: not worth the effort :)
twelvechairs has joined #ruby
<kah> Nowaker, hey can you take a peak at this? I'm having a hard time understanding what |real,code| means... any where it came from
<Nowaker> banisterfiend: but i'd be interested, just to know how ;-)
<Nowaker> if you have any link to such a thing, please provide, i will read
<twelvechairs> kah: code_words will be an array in the form of [real, code]
<Nowaker> banisterfiend: also, could you look at this? https://gist.github.com/1946964 - this was my first attempt with "custom" attr_accessors. This has "self.class" too - so it's the worst implementation that could be made, huh? ;-)
ascarter has joined #ruby
<kah> twelvechairs, it's in a hash.. does that matter?
<twelvechairs> kah: oh. yeah. then will be a hash in form of {real=>code...}
kawa_xxx has joined #ruby
mutandi has joined #ruby
namidark_work has joined #ruby
<kah> twelvechairs, yeah! and real => code was defined in went it was introduced in |real,code| ??
<banisterfiend> Nowaker: one second
chaitanya has joined #ruby
ap0gee has joined #ruby
<mutandi> can someone help me think through a homework problem? I'm tasked with writing a replacement to attr_accessor that records the history of each variable assignment.
<twelvechairs> kah: not sure what you are saying. The actual hash would be defined before the code in your pastie. 'real' and 'code' are assigned as variables for the keys and values of the hash as part of .each do
<mutandi> i here's what I've got so far http://pastebin.com/CyHBnstT
<mutandi> but the auto grader completely rejects it
<kah> twelvechairs, ok, so by having a defined hash set up, real and code are already defined for the key and value? ... I guess my question is are they universal or just variables... does real and code always relate to a hash key and variable
<mutandi> Nowaker: i dont follow
BrenoPerucchi has joined #ruby
<Nowaker> mutandi: ok, I didn't understand you
Gosh has joined #ruby
nobitanobi has joined #ruby
<Gosh> What would be the cleanest way to check if an array has more than one "child"?
<banisterfiend> Gosh: if it contains another array u mean?
PragCypher has joined #ruby
ed_hz_ has joined #ruby
<Nowaker> banisterfiend: clever
<Nowaker> banisterfiend: the define_method defines a static or instance method?
<banisterfiend> Nowaker: instance
<banisterfiend> Nowaker: and dont think of class methods as 'static methods' you'll only confuse yourself later on ;)
shadoi has joined #ruby
<Nowaker> banisterfiend: ok, thank you very much :-)
Gosh has joined #ruby
<Nowaker> banisterfiend: so how would you call class methods if not static?
nobitanobi1 has joined #ruby
<Nowaker> you see, i'm programming in ruby for on year, but I still didn't get all those quirks
<banisterfiend> Nowaker: we typically call them 'class methods' :)
<Nowaker> ah, ok, so just a naming
<Gosh> Sorry for the late response, like if the array more than one element..sorry forget the terminology. eg. foo[0] would be valid, but foo[1] wouldn't? I could do it with an each but that's extremely messy and am looking for a cleaner way.
jergason has joined #ruby
<Nowaker> i thought that ruby class methods are something different than java static methods
<banisterfiend> Nowaker: they are very different
<Nowaker> and that's why you telling me not to call them static ;)
<banisterfiend> yeah
<banisterfiend> that's why i am, but 'class methods' doesnt have the same burden as 'static methods'
<Nowaker> ok, so what is the logical difference between those languages?
<Nowaker> between the ruby class methods and java static methods
<Nowaker> cause, for now, i considered them equal
<banisterfiend> Nowaker: in ruby classes are objects too, so a 'class method' in ruby, is an instance method on a class's class
<Nowaker> gotcha!
<Nowaker> banisterfiend: and that's excellent from the design view
<banisterfiend> Nowaker: yeah it's pretty clever
<banisterfiend> it brings a consistency and homogeneity to everything
<Nowaker> banisterfiend: i think I will save lots of time with knowing it
mike has joined #ruby
<Nowaker> whenever some problems with classes and modules hierarchy appears to me
Guest31738 has quit [#ruby]
<Nowaker> thank you banisterfiend
<banisterfiend> Nowaker: np
mxweas_ has joined #ruby
coreydaley has joined #ruby
Gosh has joined #ruby
<Nowaker> banisterfiend: one more question :) https://gist.github.com/1947108 - if two modules both contain a() method, is it possible to call the "first" defined?
technel has joined #ruby
<Nowaker> looking for something like "please call a() from the A module, not B"
<banisterfiend> Nowaker: b = Blah.new; A.instance_method(:a).bind(b).call
<banisterfiend> Nowaker: btw, you should use pry instead of irb ;) http://pry.github.com
<Nowaker> banisterfiend: nice. everything's accessible, it didn't get "hidden".
kah has joined #ruby
<banisterfiend> Nowaker: also use pry to get balls-deep in your code and figure out what's going on
<Nowaker> so under the hood ruby just does this binding to module any time the module method is to be called?
<Nowaker> ok, i will try it
<deryl> pry pry-doc pry-exception_explorer pry-stack_explorer, and pry-nav :)
<banisterfiend> deryl: hehe "le pack"
<deryl> :)
AndChat- has joined #ruby
<CannedCorn> you guys have any idea on that threading stuff i posted
<deryl> the only thing i'm confused on (haven't installed it yet so..) is pry_debug
mikeycgto has joined #ruby
<deryl> someone pointed me to it but i don't know if it requires ruby-debug19 or replaces it
<deryl> will probably become clear once i get some time to install and play.
berserkr has joined #ruby
Prometheus has joined #ruby
mmokrysz has joined #ruby
sdwrage has joined #ruby
<AndChat-> Deryl it's pure ruby, but pry-nav is more convenient I think
<Nowaker> banisterfiend: wow, it's quite awesome, it tells me the owner
<deryl> cool. then i'll stick with what i got
<Nowaker> it may sometimes help
<deryl> AndChat-: thanks
radic_ has joined #ruby
<Nowaker> deryl: are you debugging from the console?
<Nowaker> rubymine has awesome debugging features thanks to ruby-debug-ide
<AndChat-> Nowaker: what tells you the owner and how
<deryl> Nowaker: yes. i don't use IDEs
Choobie has joined #ruby
<deryl> I use either vim+snipmate or TextMate for my editor, and console
<Nowaker> deryl: are there refactoring features? I mean, rename the method and replace all the usages
<deryl> TM does it throughout the project, vim i haven't found that
td123 has joined #ruby
<deryl> bbiam cig break
<pdtpatr1ck> Can someone please help me with the following error
<Nowaker> AndChat-: show-method in `pry`
<deryl> hehe i love the gist support
<deryl> gist are my number one share tool :)
crescendo has joined #ruby
<AndChat-> Nowaker: pry has a good heart
sroy2_ has joined #ruby
<pdtpatr1ck> here's my gem list
<deryl> someone was giving me serious crapola for using it as a debugger. said it wasn't one so don't use it as such
<Nowaker> deryl: oh, that would be quite nice-to-have in my IDE
<deryl> rubymine does it
<Nowaker> i recall the plugin for that in intellij, the java ide
<AndChat-> Deryl who was
<Nowaker> deryl: not sure if in rubymine though, can't find it
<deryl> but their rvm support is a bit lacking. not sure about in 4.x my copy is a 3.2.x (sits collecting digital dust)
<deryl> AndChat-: i forget who it was someone in here or in #ruby-lang
<deryl> i quit paying attention
<AndChat-> deryl: cos with nav and stack explorer it is a debugger
<AndChat-> Deryl when was it?
<deryl> yesterday or the day before
<deryl> day before i think
<Nowaker> deryl: don't see the feature in my rubymine
<Nowaker> oh, there is
<deryl> was gonna say.
<deryl> didn't tjhink they'd remove that
<Nowaker> ok, let's assign a shortcut to 'create gist' :-)
ben_alman has joined #ruby
<deryl> AndChat-: and i think (if the conversation is coming back to me right) that *because* you have to add nav and stack *that* means that pry isn't a debugger. but i was using pry for one before i even knew about the other two
<deryl> but they were right that the next and step stuff is not working as expected.
<deryl> didn't step into and run through several times
<AndChat-> Sounds retarded
<deryl> ehh twas a semantics argument to me
<AndChat-> Sure yoy can't recall who said this shit?
<deryl> i quit listening i think about half way through
<AndChat-> Got a log?
<deryl> yeah cause i don't keep longs on my client
<deryl> err logs
<deryl> hah! answers that question :)
jfelchner has joined #ruby
headius has joined #ruby
<deryl> but if its any consolation it'll bug me that i can;t remember
banisterfiend has joined #ruby
<deryl> *anyone got logs of here and #ruby-lang that can grep it for me discussing pry over the last two days?
<deryl> that *is* bugging me now
<ryanf> it would be cool if someone wrote a pry plugin that hooks into ruby-debug's stepping functionality
<ryanf> I hate using ruby-debug because it doesn't show context, etc., so I feel like I am looking at the code through a tiny pinhole
<banisterfiend> ryanf: what's wrong with pry-nav ?
<deryl> someone wrote a ruby-debug-pry
<deryl> embedds pry into ruby-debug
<banisterfiend> ryanf: pry-nav is actually pretty good
<ryanf> keep hearing stuff like
<ryanf> 20:04 < deryl> didn't step into and run through several times
<deryl> don't know if it works with 1.9 though
<ryanf> I guess I haven't really given it a workout personally yet though, maybe it's fine
<banisterfiend> deryl: you had problems with pry-nav ?
<deryl> ryanf: yeah thats what i'm seeing
<ryanf> but usually when I break out the debugger
rohit has joined #ruby
<ryanf> it's because I'm trying to figure out some stupid rails shit where all the methods are defined in class_evals and stuff
<deryl> banisterfiend: yeah but its not *every* time
<ryanf> and that seems like the kind of situation where (I am assuming) pry-nav could have problems
<deryl> thats what confused me
<deryl> ryanf: hehe i haven't touched rails in months. everything i do is straight ruby these days
gentz has joined #ruby
<ryanf> btw there is a patch for 1.9.3 that makes ruby-debug work, and also improves performance quite a lot
<ryanf> and it's easy to install with rvm
<ryanf> I feel like more people should know that
<rohit> deryl: I'm curious, what is Ruby used for besides web development and automation/testing tools (like rspec, cucumber etc)?
<deryl> did you tell mpapis? he'll include it
undersc0re has joined #ruby
<deryl> rohit: testing freeswitch, writing automation stuff, writing backend linkage, tons of stuff
<ryanf> include it in what?
<deryl> rvm
<ryanf> I think they might already be doing that
<deryl> we apply patches optionally
<ryanf> saw a comment on something implying it'd be a new install target
<ryanf> "tcs" maybe?
mmokrysz has quit [#ruby]
<rohit> deryl: Are there any open source libraries for doing *different* stuff: like graphics, artificial intelligence, writing games etc?
<deryl> yeah we do that. that the one you referencing?
<ryanf> probably
<rohit> deryl: I mean there are, I know of a few
<banisterfiend> deryl: i have the last 2 days of #ruby-lang logs and there's no arguments :/
<deryl> rohit: tons of them out there. mainly i use just what ruby provides but i also work with fsr (freeswitcher) which is a ruby library for interfacing with freeswitch through its EventSocket
<rohit> deryl: Umm nm I don't exactly know what I want to ask ...
<deryl> banisterfiend: damn we had the discussion! i'm crazy not alzeimeric :)
<deryl> rohit: thats cool. just think on it a bit
<banisterfiend> deryl: who had the discussion? you and me?
<deryl> i have head injuries so i forget what i'm asking people sometimes *as* i'm typing it hehe. so a brainfart isn't a big deal
<deryl> banisterfiend: no, if YOU had told me it wasn't a debugger I wouild have said ok
<deryl> i know you wrote it. if you say its not then well its not
<banisterfiend> deryl: hmm, well im curious to see the argument, but it's def not from #ruby-lang the last 2 days
<banisterfiend> any other ideas?
<deryl> just here and *possibly* #eventmachine
<deryl> no, mind keeps saying it was here or r-l
btanaka has joined #ruby
<deryl> bbiab. doggie wants to play and i've ignored her most of the day
linopolus has joined #ruby
iamjarvo has joined #ruby
rippa has joined #ruby
xnm has joined #ruby
t0mmyvyo has joined #ruby
Murr has joined #ruby
gentz has joined #ruby
blueadept has joined #ruby
kinderman has joined #ruby
adeponte has joined #ruby
<Nowaker> banisterfiend: just one question :) since i'm thinking of all those class things. because class class is an object, you can do Myclass.class.new. Because lots of class class objects can appear, you can modify these classes for you, and leave unmodified for other clients. do i say correctly? (quite difficult to name these things xD)
ckrailo has joined #ruby
<banisterfiend> Nowaker: you can speak in polish if you prefer
jackhammer2022 has joined #ruby
<Nowaker> lol
ryanf has joined #ruby
<Nowaker> banisterfiend: priv
yoklov has joined #ruby
<Mammutpanzer> http://pastebin.com/fynf6F9f <--- Can anyone help me?
nerdy has joined #ruby
dbruns has joined #ruby
<dbruns> I"m having trouble installing 1.9.3 (with rvm) on my new MBP with OS X lion 10.7.3… I've got gcc installed via the osx-gcc-installer and libksba with homebrew I'm getting an error when I do rvm install 1.9.3 when it tries to compile
dlam has joined #ruby
<dlam> in the console, how do I print out all the methods or attributes of an object?
<dlam> like in python its dir(something) or something.__dict__
<Mammutpanzer> I found the solution for my problem. The application is connection via TCP/IP and I had disabled it for the server
<Mammutpanzer> *connecting
cableray has joined #ruby
pleiades has joined #ruby
snip_it has joined #ruby
<rippa> dlam: object.methods
<pleiades> i am sober for once
al3xnull has joined #ruby
stenno50 has joined #ruby
khakimov has joined #ruby
<Rorgo> anyone know of the best way to pre-compile gems on a server, so I can distribute them to identical servers without having to re-build them?
supergiantrobot_ has joined #ruby
<pleiades> yoda !!!. <3
snip_it_ has joined #ruby
flyingoctopus has joined #ruby
CodeZombie has joined #ruby
ryanf has joined #ruby
<flyingoctopus> okay, this an embarrasingly silly question: for arrays and hases of undefined lengths, what would one recommend to use in place of .each
<flyingoctopus> in the case of an array/hash w/ a single entry
<dlam> thx thx rippa
<rippa> flyingoctopus: why not just use .each?
<flyingoctopus> rippa: in the case of array = ['foo'], .each will return a no method error
<rippa> no
<rippa> it will not
<flyingoctopus> :O
<flyingoctopus> i just tried that in irb
<flyingoctopus> \o/
<flyingoctopus> i wonder if it behaves differently with a hash
<pleiades> LiquidNitrogen yeah we are social animals anyway... not meant to make it alone
<rippa> flyingoctopus: no, same with hash
ddv has joined #ruby
<flyingoctopus> rippa: k now i'm even more embarassed
<flyingoctopus> totally confused as to why this kept popping up:
<flyingoctopus> NoMethodError (undefined method `each' for nil:NilClass):
<flyingoctopus> mayybe i know
<flyingoctopus> k
<flyingoctopus> xoxo
* flyingoctopus figured it out
* flyingoctopus slinks away behind curtain
<flyingoctopus> thx rippa
kinderman has joined #ruby
Reckreations has joined #ruby
<Reckreations> hi all
<Reckreations> I need a little advice if anyone is free
tessi has joined #ruby
xnm has joined #ruby
igotnolegs has joined #ruby
artOfWar has joined #ruby
twelvechairs has joined #ruby
savage- has joined #ruby
rohit has joined #ruby
AndChat- has joined #ruby
nfluxx has joined #ruby
macmartine_ has joined #ruby
ap0gee has joined #ruby
JohnBat26 has joined #ruby
snip_it has joined #ruby
ed_hz_ has joined #ruby
ilyam has joined #ruby
ChampS666 has joined #ruby
banisterfiend has joined #ruby
c0rn has joined #ruby
Drewch has joined #ruby
x0F_ has joined #ruby
havenn has joined #ruby
Morkel has joined #ruby
CheeToS has joined #ruby
n3m has joined #ruby
CheeToS` has joined #ruby
greenarrow has joined #ruby
enherit has joined #ruby
yxhuvud has joined #ruby
Jonah11_ has joined #ruby
<Jonah11_> why are parentheses required for the invocation in this statement: "5.method(:+)"
havenn has joined #ruby
<burgestrand> Jonah11_: they aren’t
rohit has joined #ruby
<Jonah11_> burgestrand, when i type 5.method :+ into irb, nothing happens. i does a line continutation
<Jonah11_> it does*
<burgestrand> Hah, indeed it does, I tried it in pry and there it works, and if you run it from a file it works there as well
<Jonah11_> burgestrand, what is going on in irb?
<burgestrand> Not sure what IRB thinks it is
<burgestrand> I have to CTRL-D twice, but if I do that it’ll eventually work like normal
cpruitt has joined #ruby
<Jonah11_> burgestrand, hmm... does + have some special meaning in irb?
sabooky has joined #ruby
<sabooky> Is there a ruby gem to parse java .properties file?
<rippa> I guess it misinterprets it as
<rippa> 1 +
<rippa> 2
<rippa> or somthing
ph^ has joined #ruby
zakwilson has joined #ruby
dipix has joined #ruby
<banisterfiend> Jonah11_: i guess u should just switch to pry, like all the cool kids ;) / burgestrand
<banisterfiend> man typing messages like tweets
<cespare> sabooky: sabooky http://rubygems.org/gems/java_properties
<cespare> sabooky: also a bunch of code samples. It's such a trivial format that people tend to parse it manually, looks like
<cespare> sabooky: sorry *also a bunch of code samples available if you google around
<banisterfiend> burgestrand: oh a guy used pry-remote to fix a bug in production :D an exception arose, pry emailed him in the middle of the night waking him up, and it opened up a socket which he connected to fix it via pry-remote :))
<banisterfiend> all worked better than expected
<Mammutpanzer> Hi I got a weird problem. My Redmine website is printed out as html instead of being shown as html by my browser. (other websites work) Does anyone know why?
<sabooky> cespare: yeah, saw the code samples, most don't cover things like multiline and spaces, see: http://en.wikipedia.org/wiki/.properties#Format
<sabooky> cespare: I'm implementing a simple solution now, one that ignores multiline and spaces
cantbecool has joined #ruby
Gumpshion has joined #ruby
cantbecool has quit [#ruby]
cantbecool has joined #ruby
davidcelis has joined #ruby
Helius has joined #ruby
cantbecool has quit [#ruby]
cantbecool has joined #ruby
v0yager has joined #ruby
moshef has joined #ruby
bluOxigen has joined #ruby
fixl has joined #ruby
jsdrk has joined #ruby
CacheMoney has joined #ruby
mxweas_ has joined #ruby
tonini has joined #ruby
v0yager has joined #ruby
Husio has quit [#ruby]
mafolz has joined #ruby
tatsuya__ has joined #ruby
stoffus has joined #ruby
ccapndave has joined #ruby
Mammutpanzer has joined #ruby
ph^_ has joined #ruby
<Jonah11_> is "super" a special language construct in ruby or is it a method defined somewhere? i don't see it listed in the docs for Object
oposomme has joined #ruby
sspiff has joined #ruby
<xeno> Jonah11_: it's a reference to the superclass of an object
senny has joined #ruby
<Jonah11_> xeno, but it must be more than just that, otherwise how is it used in method_missing to automatically redispatch a method calling, along with arguments, to the superclass, using only the single line "super"?
<xeno> good question... I guess you should check the source/definition...
<DefV> it's a language construct
<pleiades> they are pocket sized..
<DefV> super points to the same method in the superclass
Sliker has joined #ruby
<banisterfiend> Jonah11_: it's not a method
<banisterfiend> Jonah11_: and it invokes the superclass method
<Jonah11_> banisterfiend, does it have different meaning depending on the context where it's used? or is the only use the one you see in method_missing?
<banisterfiend> Jonah11_: i dont know what you mean, basically you call it when you want a superclass to deal with it
<Jonah11_> banisterfiend, i'm asking if that's the only use of it
<banisterfiend> Jonah11_: yes, what other use could u expect
etehtsea has joined #ruby
zakwilson_ has joined #ruby
<Jonah11_> banisterfiend, eg, in java it is used differently, so i could imagine other uses
<banisterfiend> Jonah11_: what's the use in java
<banisterfiend> Jonah11_: oh i see, if you want to actually refer to the superclass in ruby you use the 'superclass' method
<pleiades> I;ve tried to kick never to ban.
<Jonah11_> banisterfiend, yes that's what i'm getting at
<pleiades> who makes a better monitor? samsung or dell?
<Jonah11_> thx
Targen has joined #ruby
lurch_1 has joined #ruby
bier has joined #ruby
KL-7 has joined #ruby
zommi has joined #ruby
pi3r has joined #ruby
Helius has joined #ruby
_obiJuan has quit [#ruby]
jsdrk has joined #ruby
jsdrk_ has joined #ruby
LMolr has joined #ruby
jsdrk has joined #ruby
zomgbie has joined #ruby
simao has joined #ruby
timonv has joined #ruby
nemesit has joined #ruby
randym_ has joined #ruby
Sliker has joined #ruby
berserkr has joined #ruby
randym has joined #ruby
Seisatsu has joined #ruby
krz has joined #ruby
QaDeS has joined #ruby
stepnem has joined #ruby
rickmasta has joined #ruby
timonv has joined #ruby
johndbritton has joined #ruby
jmeeuwen has joined #ruby
<ryanf> pleiades: I think dell is generally better-regarded at least at the high end
briankbuckley has joined #ruby
<pleiades> so you're high and trying to install gentoo, sensei. great idea
francisfish has joined #ruby
LMolr_ has joined #ruby
mdw has joined #ruby
shruggar has joined #ruby
mengu has joined #ruby
Guest60377 has joined #ruby
mikewintermute has joined #ruby
Blaster has joined #ruby
<Jonah11_> what is example of a class implenting "each" in ruby (ie, not in C)? i want to see how to create custom each methods
fortysixandtwo has joined #ruby
<Blaster> hey when something in the Ruby documentation shows method(string) #=> true Is the #=> the return value?
<Blaster> i mean, would true be the return value.
helllen has joined #ruby
<helllen> helllo
<helllen> how could I know if a string is a valid integer?
<Guest60377> when foo is a method returning 1, why cant i do foo = foo + 1
alem0lars has joined #ruby
<Guest60377> foo + 1 must be 2
<Guest60377> so 2 must be assigned to new variable foo
<Guest60377> ?
<ryanf> Blaster: yes
<ryanf> that's just a convention in documentation
<ryanf> to represent the next line in IRB or whatever
<Blaster> oh ok
<Blaster> thank you
<Blaster> good night
<Guest60377> any one
<pleiades> of those time life series almost every day it will snow there in many a bong session..
<rippa> Jonah11_: create a loop and yield members of the collection
<Guest60377> ryanf: when foo is a method returning 1, why cant i do foo = foo + 1
<Guest60377> foo + 1 must be 2
<Guest60377> so 2 must be assigned to new variable foo
<Jonah11_> rippa, thx. is there a well known library, 3rd part or otherwise, where i could see an example in action?
jlebrech has joined #ruby
moshef has joined #ruby
<rippa> Jonah11_: try rubinius source code
<moshef> how do i find a value within a hash (i don't know where it's located) and update it?
BiHi has joined #ruby
<moshef> is it possible to do it without going over the entire hash?
<Jonah11_> rippa, thx
<rippa> moshef: not possible
<moshef> no some find method ?
<moshef> there is no*
adambeynon has joined #ruby
al3xnull has joined #ruby
decentrality has quit [#ruby]
helllen has quit ["Saliendo"]
maletor has joined #ruby
<rippa> moshef: there is
<rippa> #assoc
<rippa> but it will go over entire hash
jmeeuwen has joined #ruby
<Guest60377> rippa: cant we do this
<Guest60377> yourhash.select {|key,val| val == "your_data"}
<pleiades> not as bad
Untouchab1e has joined #ruby
trivol has joined #ruby
<rippa> Guest60377: that's the same as yourhash.assoc "your_data"
<Guest60377> ok
<Untouchab1e> not sure if this is the right place to ask, but I am having some problems running the following: RAILS_ENV=production rake db:migrate
<pleiades> i have always been treated in montreal and sherbrooke horrible and paris people loved me
<Untouchab1e> keeps telling me I am missing rubytree >= 0
<Untouchab1e> and that I have to run rake gems:install
<Untouchab1e> and I do, and it says its succesfully installs rubytree
<Untouchab1e> but the problem persists
<Untouchab1e> any ideas on whats wrong?
<pleiades> queen elizabeth used cocaine in mariana wine
<rippa> in marijuana wine
the_hack has joined #ruby
speggey has joined #ruby
<moshef> rippa: is select better than values at?
nari has joined #ruby
<rippa> it's different
<moshef> what's better performance wise?
<rippa> also, select return hash
<rippa> no idea
<moshef> l. tnx
<moshef> ok*
Untouchab1e has quit [#ruby]
KJF has joined #ruby
ephemerian has joined #ruby
tomzx has joined #ruby
senthil has joined #ruby
<senthil> is there a way to redefine failure messages in rspec?
Gekz has joined #ruby
Gekz has joined #ruby
<Guest60377> def foo
<Guest60377> 1
<Guest60377> end
<Guest60377> why dont foo = foo + 1
<Guest60377> work
<Guest60377> ?
Ammar01 has joined #ruby
speggey has joined #ruby
simao has joined #ruby
<rippa> foo = foo() + 1 works though
mrake has joined #ruby
akemrir has joined #ruby
<rippa> Guest60377: when you do foo = foo + 1 foo assigns to nil
<rippa> for some reason
<rippa> and shadows method
<Guest60377> rippa: so that implies that LHS is executed first
<Guest60377> not RHS
<Eddiee> rippa: I am still not sure that LHS will be executed first
<rippa> when you try to assign anything to a var
<rippa> it becomes nil
bluenemo has joined #ruby
roolo has joined #ruby
ikaros has joined #ruby
odinswand has joined #ruby
<Stefunel> guys, is there a way I can make to_s limit to two chars when converting to hex? I need number that are up to 15 to be converted to hex in the 00 to 0f
Indian has joined #ruby
gianlucadv has joined #ruby
gianlucadv_ has joined #ruby
<matti> ReinH: ?
gianlucadv has joined #ruby
Shrink has joined #ruby
randym has joined #ruby
<ccapndave> Stefunel How about "0" + num.to_s(16)
<ccapndave> Stefunel If you are only going up to 15 the first number will always be 0 anyway
<rippa> "%02x" % num
<rippa> ("%02x" % num)[-2..-1]
<rippa> "%02x" % (num % 0xff)
<Stefunel> I have numbers that go to 255
<pleiades> .. then I will be hard..
stevecaney has joined #ruby
<Stefunel> so essentially up to ff
<rippa> *0x100
<rippa> Stefunel: "%02x" % num
<ccapndave> Much more elegant
tvo has joined #ruby
<Stefunel> rippa thanks I will give it a go
tatsuya_o has joined #ruby
glosoli has joined #ruby
tatsuya_o has joined #ruby
sohocoke has joined #ruby
Jonah11_ has joined #ruby
vraa has joined #ruby
iocor has joined #ruby
triptec has joined #ruby
dr_bob has joined #ruby
Progster has joined #ruby
d34th4ck3r has joined #ruby
TheNumb has joined #ruby
sohocoke has joined #ruby
francisfish has joined #ruby
Ferdev has joined #ruby
TheNumb has joined #ruby
kinderman has joined #ruby
tayy has joined #ruby
speggey has joined #ruby
mikewintermute has joined #ruby
Iszak has joined #ruby
<Iszak> Anyone recommend a gem that'll read a file and determine the mime type for Ruby 1.9.3?
Foxandxss has joined #ruby
oposomme has joined #ruby
pangur has joined #ruby
<pangur> I want to create a person using something like c.each_slice(6) { |surname, name, age, telephone, puppets, science| p surname, name, age, telephone, puppets, science }. However, I am currently baffled by how to access the new arrays generated by each_slice().
<pangur> I understand that the 'p' in the mapping stands for 'print' but I want to be able to manipulate the generated arrays.
<pangur> Each set of 6 elements in the array rerpresents data for a person. There are 60 such persons. How do I refer to the data for person 47, for instance, after doing each_slice?
<pangur> c[47] will give me the 47th element in array c.
<pangur> or the 48th, I suppose.
<rippa> which is 47th person
<rippa> 48th
<rippa> I'd use hash though
<rippa> c[47][:name]
<pangur> Does not work though - c[47][:name] gives me in `[]': can't convert Symbol into Integer (TypeError)
<pangur> c[44][0] gives me an 'E' :)
adman65 has joined #ruby
Karmaon has joined #ruby
<pangur> c[44] does not give me an array, it gives me an element of my original 360 element array.
<rippa> pangur: because you're using array and not a hash
<rippa> and you didn't change your original array
Drakx has joined #ruby
Drakx has joined #ruby
<pangur> I do not know how to do that ;)
<rippa> you can create a new one
<rippa> with Array#map
tayy has joined #ruby
<pangur> ok, thanks, I shall look that up
davidpk has joined #ruby
Ch4rAss has joined #ruby
<Iszak> Is there any way to inspect only the top level classes methods?
<rippa> Iszak: methods(false)
looopy has joined #ruby
<Iszak> heh.. thanks
<Iszak> Sorry I should have looked at the parameters for methods()
<pangur> rippa, I have used c.collect! {|x| ":" + x } to change my array. For print c[42][:name], I still get '[]': can't convert Symbol into Integer (TypeError)
<rippa> pangur: because it's an array
<rippa> use numbers
<rippa> or make it a hash
bluenemo has joined #ruby
bluenemo has joined #ruby
ap0gee has joined #ruby
<pangur> When I do c.each_slice(6) ... it prints out a series of 6 element arrays. If I wanted to select the 44th array, what would I need to write is really my basic question, I think.
<pangur> c[43] only gets me the 44th element in the original array.
<rippa> c.each_slice(6).to_a
<pangur> I have done c.each_slice(6).to_a { |surname, name, age, telephone, puppets, science| p surname, name, age, telephone, puppets, science } print c[43] gives me the forename of a person.
<rippa> block is ignored
<pangur> It seems only to be printing the arrays rather than storing them.
<rippa> because you don't store new array
<rippa> a = c.each_slice(6).to_a
<pangur> ah
<pangur> That's it, rippa - thanks!
naequs has joined #ruby
<pangur> I can now do a[43] and it gives me the anticipated six element array :)
* pangur is very grateful to rippa.
bluenemo has joined #ruby
mdw has joined #ruby
ninor has joined #ruby
fearoffish has joined #ruby
tatsuya__ has joined #ruby
tk__ has joined #ruby
ap0gee has joined #ruby
ecolitan has joined #ruby
glosoli has joined #ruby
tayy_ has joined #ruby
Helius has joined #ruby
glosoli_ has joined #ruby
KJF has joined #ruby
mdw_ has joined #ruby
johndbritton has joined #ruby
Talvino has joined #ruby
a_meba has joined #ruby
sohocoke has joined #ruby
iocor has joined #ruby
iocor has joined #ruby
tilde` has joined #ruby
Nathandim has joined #ruby
glosoli has joined #ruby
lkba has joined #ruby
X66Mammut has joined #ruby
tayy_ has joined #ruby
rohit has joined #ruby
Shrink has joined #ruby
lucaspiller has joined #ruby
kah has joined #ruby
Talvino has joined #ruby
Divinite has joined #ruby
<Divinite> Hello all!
Sliker has joined #ruby
Spockz has joined #ruby
jonathan___ has joined #ruby
hasrb has joined #ruby
<jonathan___> Hi all, I've difficulties with rvm
<jonathan___> I'm trying to set a ruby version for all the users with sudo rvm use xxx -default
<jonathan___> and I get a "RVM is not a function, selecting rubies with 'rvm use ...' will not work."
tayy has joined #ruby
<jonathan___> but the sudo rvm install xxxx works perfectly before
mdw has joined #ruby
<jonathan___> any hints ?
Vert has joined #ruby
<JonnieCache> i know that the environment is not preserved when you sudo
<jonathan___> and I can do a "rvm use xxx" for my user
<jds> jonathan___: The #rvm channel tends to be pretty good, I'd try there
<JonnieCache> AAARGH how can I make rake show tracebacks every time
<Divinite> I love it when that happens
<JonnieCache> i hate it so much when Im trying to test a long running rake task and it just gives me the exception and not the backtrace
<JonnieCache> and helpfully tells you to run it again with --trace
glosoli has joined #ruby
<JonnieCache> it may as well show a great big ascii middle finger
<Divinite> LOL
Richmond has joined #ruby
frishi has joined #ruby
philcrissman has joined #ruby
Ammar01 has joined #ruby
fr0gprince_mac has joined #ruby
visof has joined #ruby
visof has joined #ruby
thone_ has joined #ruby
joppe_ has joined #ruby
randym_ has joined #ruby
jonathan___ has joined #ruby
<shevy> rake never worked for me
<Tasser> shevy, yep. $ARGV.shift ftw
<shevy> hehe
bashdy has joined #ruby
glosoli has joined #ruby
moshef has joined #ruby
pu22l3r has joined #ruby
KL-7 has joined #ruby
briankbuckley has joined #ruby
nanderoo has joined #ruby
baniseterfiend` has joined #ruby
<JonnieCache> omg omg its an impersonator. dont think we wont notice the extra e...
zaydana has joined #ruby
Divinite has joined #ruby
zomgbie has joined #ruby
LMolr has joined #ruby
BiHi has joined #ruby
alem0lars has joined #ruby
RubyPanther has joined #ruby
jmcphers has joined #ruby
nari has joined #ruby
Helius has joined #ruby
al3xnull has joined #ruby
wyhaines has joined #ruby
waxjar has joined #ruby
Vert has joined #ruby
cachemoney has joined #ruby
`brendan has joined #ruby
<`brendan> morning
cachemoney has joined #ruby
<JonnieCache> afternoon
kaneda_ has joined #ruby
kaneda_ has joined #ruby
choffstein has joined #ruby
the_hack has joined #ruby
fearoffish has joined #ruby
arturaz has joined #ruby
peterhellberg has joined #ruby
avalarion has joined #ruby
<JonnieCache> `@success = if block_given?` wtf state_machine
imsplitbit has joined #ruby
<JonnieCache> ah ok just odd indentation...
<avalarion> Aloha, I have never worked with ruby, only with PHP, Java, C#, ... I need to open mygit/config and read url = (MYNEEDS)... Is it easy in Ruby?
speggey has joined #ruby
fermion has joined #ruby
<JonnieCache> yeah you can use the normal file api and there's a git library that could read that out
<avalarion> JonnieCache: are you able to tell me the preg_match variant of ruby?^^
PragCypher has joined #ruby
vermiciousKnid has joined #ruby
<JonnieCache> /regex_here/.match("string")
<JonnieCache> theres various ways to do it
neurodrone has joined #ruby
neurodrone has joined #ruby
hasrb has joined #ruby
<avalarion> if( $regex ) $var = myString.replace(/url = /u, '');
<avalarion> is this easy?
<drizz> string.sub! "url = " if regex
<avalarion> thanks drizz, will try to do it now *sfz*
<avalarion> I try to implement git support from bitbucket to redmine^^
_adeponte has joined #ruby
adeponte has joined #ruby
Seisatsu has joined #ruby
speggey has joined #ruby
Jackneill has joined #ruby
musee has joined #ruby
jitesh_shetty has joined #ruby
mikeycgto has joined #ruby
iamjarvo has joined #ruby
scalebyte has joined #ruby
<scalebyte> kindly help me solve this : https://gist.github.com/1949945 thanks
Sailias|work has joined #ruby
archaic has joined #ruby
<JonnieCache> fucking hell
<JonnieCache> stuff like this makes me want to become a python developer:
<JonnieCache> %w(Dirty Observing Validations).any? {|feature| ::ActiveModel.const_defined?(feature) && klass <= ::ActiveModel.const_get(feature)}
<JonnieCache> wtf does <= do to a class
<banisterfiend> JonnieCache: is a subclass
choffstein has joined #ruby
<scalebyte> banisterfiend: ^^
ceej has joined #ruby
<banisterfiend> or in the case of <= is a subclass or is that class itself
<JonnieCache> ok so maybe that line isnt so bad. im chewing through the codebase of state_machine and its getting pretty wacky
<LMolr> is there a way to check whether a Rakefile declares a given task? (..from a ruby program..)
<Tasser> LMolr, yes, there is ;-)
<LMolr> Tasser: w00t!
<LMolr> how? :)
albemuth has joined #ruby
<Tasser> don't know
<scalebyte> kindly help me solve this : https://gist.github.com/1949945 thanks
g0bl1n has joined #ruby
rotor has joined #ruby
<Tasser> scalebyte, a) which error b) #rubyonrails
<LMolr> Tasser: aw. ok, thanks anyways
<scalebyte> Tasser: I am banned there
<Tasser> scalebyte, fail
<scalebyte> Tasser: a) mass assignment error...
<Tasser> full backtrace n stuff
<scalebyte> Tasser: need help
<Tasser> scalebyte, full backtrace as with rails s
<scalebyte> Tasser: what is back trace ?
<Tasser> O.o
<LMolr> o.O
dr_bob has quit [#ruby]
lorandi has joined #ruby
looopy has joined #ruby
<scalebyte> @user.stat.location_id = loc_id if loc_id not null how can I do this in a line ?
<scalebyte> Tasser: ^
ascarter has joined #ruby
drbawb has joined #ruby
drbawb has joined #ruby
codebeake has joined #ruby
Ammar_Frameworks has joined #ruby
jesly has joined #ruby
<LMolr> scalebyte: I guess @user.stat.location_id = loc_id if !loc_id.nil?
drbawb has joined #ruby
drbawb has joined #ruby
zomgbie has joined #ruby
<scalebyte> LMolr: thanks
shruggar has joined #ruby
<LMolr> npnp
philcrissman has joined #ruby
d34th4ck3r has joined #ruby
dv310p3r has joined #ruby
simao_ has joined #ruby
havenn has joined #ruby
emmanuelux has joined #ruby
crankycoder has joined #ruby
oposomme has joined #ruby
liluo has joined #ruby
oposomme has joined #ruby
ryannielson has joined #ruby
virunga has joined #ruby
cjs226 has joined #ruby
geekbri has joined #ruby
JonSchuff has joined #ruby
philips has joined #ruby
carlyle has joined #ruby
cantbecool has joined #ruby
csherin has joined #ruby
btanaka has joined #ruby
heftig has joined #ruby
td123 has joined #ruby
speggey has joined #ruby
conntrack has joined #ruby
vraa has joined #ruby
fbernier has joined #ruby
LBRapid has joined #ruby
<philcrissman> scalebyte: if you're getting a mass assignment error, then you are probably trying to assign to an attribute that is not listed in attr_accessible
<philcrissman> scalebyte: that is a wild guess. check. :)
<scalebyte> philcrissman: yes... hw can I handle it
<philcrissman> scalebyte: do you understand what attr_accessible is?
<scalebyte> philcrissman: no
<philcrissman> scalebyte: then why are you using it?
<scalebyte> philcrissman: where did i use it ?
<scalebyte> philcrissman: https://gist.github.com/1949945 this is my code
<philcrissman> scalebyte: oh for crying out loud. It would be in your model.
<scalebyte> philcrissman: didnt get you
ChampS666 has joined #ruby
<philcrissman> I saw the code. You don't get a mass assignment error unless you've restricted which attributes can be mass assigned.
<JonnieCache> lol its definitely time for lunch
<JonnieCache> good luck boys and girls
<philcrissman> JonnieCache: :)
<scalebyte> philcrissman: actually the user attributes are updates via two ways..
<philcrissman> scalebyte: what does your model look like?
berkes has joined #ruby
theishi has quit [#ruby]
<scalebyte> model has user preferences which are hash values
<philcrissman> ...
<philcrissman> scalebyte: okay, man. Good luck.
<scalebyte> thanks :)
<shevy> haha
<shevy> rails. kills. brains.
<scalebyte> philcrissman: its tought to explain neverthless il try it !! thanks
phantasm66 has joined #ruby
<philcrissman> scalebyte: look in your model for an attr_accessible line. Or the inverse of it, whatever that is, I forget.
<scalebyte> philcrissman: sure thanks
quicoju has joined #ruby
workmad3 has joined #ruby
<philcrissman> attr_protected, that's it.
__sri has joined #ruby
kenyabob has joined #ruby
<shevy> that exists???
<shevy> is that another railism madness?
<shevy> come on say you are kidding
bbttxu_ has joined #ruby
BRMatt has joined #ruby
briankbuckley has joined #ruby
polysics has joined #ruby
<polysics> hello! got this weird thing
<polysics> i am using Celluloid as a requirement for another project
<polysics> when i run tests on a freshly cloned repo on my Mac, i get all sorts of dead actor failures
<polysics> on Debian, everything works correctly
<polysics> others in the team do not have the same issues
<Tasser> so use debian :-)
<polysics> we have NO idea whatsoever about what is causing that
<polysics> Tasser: ok, that's a good option, i wanted to delve into the issue a bit though :-D
NotMyself has joined #ruby
<polysics> i am suspecting the issue could be with "ffi"
<polysics> Celluloid has gem 'ffi', :platform => :mri in the gemfile
<polysics> oh, btw, i am running on 1.9.3 installed through RVM
KL-7 has joined #ruby
francisfish has joined #ruby
<ceej> so I've been running rdoc -a --ri to generate the ri docs, but it's taking a looong time with all the gems now every time I need to update them. Is it possible to just re-generate the docs for a certain file/folder?
tvo has joined #ruby
<fbernier> polysics: cool to hear people using celluloid :)
<polysics> it's very good and solves a lot of problems, yet this is pretty odd
<polysics> again, i think i should actually blam FFI
<fbernier> polysics: I believe celluloid uses nio4r which uses libev. Maybe it's something about the libev version installed
<polysics> i have a Snow Leopard machine with LLVM on it because of XCode 4 needs
<polysics> i strongly suspect there's some mismatch in there, yes
<polysics> how does one find out which version of libev i have?
<fbernier> no clue :P
<philcrissman> shevy: what? attr_accessible and attr_protected? Yes, both rails methods.
<fbernier> the celluloid author also hangs on #celluloid.
<philcrissman> shevy: where's the madness? o_O
rippa has joined #ruby
Seisatsu has joined #ruby
axl_ has joined #ruby
<fbernier> polysics: looks like you can install libev using homebrew: brew install libev
tvw has joined #ruby
Jay_Levitt has joined #ruby
tobym has joined #ruby
speggey has joined #ruby
abstrusenick has joined #ruby
trivol has joined #ruby
polysics has joined #ruby
simao has joined #ruby
mrake has joined #ruby
Morkel has joined #ruby
virunga has joined #ruby
<polysics> i installed libev through homebrew
<polysics> is there a flag i can pass to have ffi find it?
<fbernier> I don't know ... =/
hydrozen has joined #ruby
<fbernier> maybe clean your gemset and rerun bundle
<polysics> i have just done that
<fbernier> k
<fbernier> dunno then
<fbernier> im running xubuntu and it works .. :P
<polysics> recompiling ruby won't do anything i suppose
havenn has joined #ruby
Sailias|work has joined #ruby
segora has joined #ruby
PragCypher has joined #ruby
martman has joined #ruby
<martman> im using self.send to call a method. i have a variable that when its not nill should be passed
davidpk has joined #ruby
briankbuckley has joined #ruby
<martman> and im doing this in a bunch of locations
<martman> is there a clean way of doing this?
snip_it has joined #ruby
<martman> can i avoid having a if statement before every single send?
andynu has joined #ruby
jpreyer has joined #ruby
<martman> can i treat everything after the method name as a string, and remove all nils?
<martman> in a one liner maybe
PragCypher has joined #ruby
becom33 has joined #ruby
<JonnieCache> martman: post your code
yairgo has joined #ruby
darthdeus has joined #ruby
linkbuck has joined #ruby
<martman> JonnieCache: http://pastie.org/3497043 so if arg isnt nil, i want that used in my sends
<martman> otherwise its not needed and shouldnt be passed
<JonnieCache> shevy: yes attr_protected does exist. its a blacklist to attr_accessible's whitelist
<JonnieCache> i dont think its so bad, but yes its just one more thing
<becom33> after pra.host , the next word goes bounce to next line http://pastebin.com/2pDTevXw , how can I stop that
<becom33> fix that *
<darthdeus> hey guys, is there any simple way to create a paused thread that I can start later? I don't see any method like #pause in the docs
<JonnieCache> darthdeus: look up Thread#join
davidcelis has joined #ruby
<darthdeus> JonnieCache: isn't #join for synchronization? I want to be able to create a bunch of threads, and then start them in batches
<becom33> anyone ?
<polysics> why create them before?
<JonnieCache> darthdeus: yes join is for synchronisation, and what you want to do is a special case of synchronisation
<darthdeus> because their proc is a closure
<JonnieCache> unless ive misunderstoodf
<polysics> becom33: file.gets.chomp maybe?
__sri has quit ["Leaving..."]
<any-key> file.gets.nom
undersc0re has joined #ruby
undersc0re has joined #ruby
<yairgo> I'm trying to install 1.9.3-p125 from source and ./configure gives me an error, `configure: error: could not make ./config.status` anyone have any ideas?
<darthdeus> i basically have a list of http requests, and i'm executing each in a separate thread and then join them all at once ... so my idea was to create them paused, and then resume in bulks, such as 20 threads at a time, so they won't just hit the server all at once
<any-key> yairgo: are there any log files?
cpruitt has joined #ruby
<any-key> you may not have gcc and the other necessary development tools installed
<martman> JonnieCache: did that make any sense?
carlyle has joined #ruby
<yairgo> any-key https://gist.github.com/1950472 is the output, no log file or log dir from what I can tell
<yairgo> any-key gcc is installed, I THINK I have all other dependencies
<any-key> looks like you do
undersc0re has joined #ruby
undersc0re has joined #ruby
<JonnieCache> martman: http://pastie.org/3497095
<JonnieCache> i hope thats better
<becom33> polysics: now Im getting a error http://pastebin.com/wUF3aZ0a . maby bcoz last loop doesnt have a value . how can I fix dat >
<becom33> ?
<JonnieCache> i changed some of your variable names too because i didnt like them :)
<any-key> yairgo: I'm not sure; googling for it doesn't return much either
<JonnieCache> tbh that code is a nightmare, you should rewrite it in a less clever way
<JonnieCache> at the very least add some comments
<yairgo> any-key found conf.log, not seeing anything exciting in it though(but it is 20186 lines...)
<yairgo> any-key yeah I know, that's why I'm here
<any-key> wish I could help more :\
<martman> JonnieCache: how does that help? if arg isnt nill, id like it passed for both setter and getter
<martman> JonnieCache but if it is nil it shouldnt be
<JonnieCache> ah right sorry
<JonnieCache> why not just send it anyway and have the other method ignore the nil?
jesly has joined #ruby
wmoxam has joined #ruby
shellox_ has joined #ruby
<martman> JonnieCache: more code to change that way. seems better to have the unit testing coding bending over backwards for the code than the other way around too
<martman> if possible
<JonnieCache> ah ok its some testing code. that makes more sense
<martman> yup
<JonnieCache> didnt catch that if you said so, sorry
kevinbond has joined #ruby
<martman> nah thats fine
<martman> just keep thinking theres a clever way todo this
<JonnieCache> so you want to pass the arg variable in the send calls on lines 5, 7 and 9, but only if its not nil?
<martman> in a way thats not ugly
gianlucadv has joined #ruby
<martman> JonnieCache for all send lines, yes
<martman> if one needs arg, they all do
<yairgo> trying to install 1.9.3-p125 from source on ubuntu. ./configure is giving me an error. here is the output https://gist.github.com/1950472 and here is the conf.log file https://gist.github.com/1950526 if anyone can help.
workmad3 has joined #ruby
<becom33> anyone ?
<JonnieCache> martman: http://pastie.org/3497157
<becom33> now Im getting a error http://pastebin.com/wUF3aZ0a . maby bcoz last loop doesnt have a value . how can I fix dat >
<JonnieCache> mart whoops
<JonnieCache> martman: http://pastie.org/3497157 there we go
Progster has joined #ruby
hashpuppy has joined #ruby
<hashpuppy> given the string "foo:bar:dong" how could i get everything after the last ':'? I want 'dong'.
<JonnieCache> string.split(":").last
<becom33> aanyone for me ?
<hashpuppy> ha. bad variable name in that context
<martman> JonnieCache awesome thanks alot
<hashpuppy> thanks
speggey has joined #ruby
<JonnieCache> martman: its still kinda unreadable though
lurch_1 has joined #ruby
<becom33> now Im getting a error http://pastebin.com/wUF3aZ0a . maby bcoz last loop doesnt have a value . how can I fix dat ?
<martman> JonnieCache: yup, working on that next
<martman> still getting the hang of things
Sliker has joined #ruby
<becom33> I tried putting a if condition to check the value if its nil but still its giving me the same error
<JonnieCache> martman: am I to infer that you're learning ruby by writing your own test framework?
mikepack has joined #ruby
<martman> JonnieCache: yup
<JonnieCache> respek
<becom33> oh come on any one /
<becom33> ?
<andynu> becom33: move your chomp inside the loop, "line.chomp!"
Seisatsu has joined #ruby
workmad3 has joined #ruby
Spockz has joined #ruby
<andynu> gets is probably giving you a nil at the end of the file
<philcrissman> andynu: ++
looopy_ has joined #ruby
<philcrissman> becom33: that is probably all it is. at the end of the file, gets is nil; and nil has no "chomp" method.
<becom33> andynu: yes it worked thanks :) , philcrissman thank you what andynu said worked
chrisrhoden has joined #ruby
JonnieCache has quit [#ruby]
coreydaley has joined #ruby
workmad3 has joined #ruby
Targen has joined #ruby
macmartine has joined #ruby
jgarvey has joined #ruby
ElitestFX has joined #ruby
JNZ has joined #ruby
speggey has joined #ruby
simao has joined #ruby
ph^ has joined #ruby
jmeeuwen has joined #ruby
<JNZ> So it turns out I've been surprised yet again by Ruby. Big integer support :o
<JNZ> But the question is... does it use libgmp in the background?
hasrb has joined #ruby
Vert has joined #ruby
JonnieCache has joined #ruby
<scalebyte> kindly help me : https://gist.github.com/1949945
neurodrone has joined #ruby
neurodrone has joined #ruby
<scalebyte> andynu: shevy hashpuppy banisterfiend ^^^^
minijupe has joined #ruby
ckrailo has joined #ruby
albemuth has joined #ruby
tex3l has joined #ruby
<tex3l> hey guys stupid question. is there a method like Enumerable#detect that returns the result of the block rather than the collection element?
Sailias|work has joined #ruby
theishi has joined #ruby
<theishi> any reason why I should get an error when i run this 'p my_hash'?
<tex3l> theishi: depends on what error
<rippa> tex3l: wouldn't result typically be <true> ?
<tex3l> rippa: typically, but if it's truthy then it's useful to get the object itself
jmeeuwen has joined #ruby
<theishi> actually I mispoke... here is the command I am trying to run 'p { "a" => 100, "b" => 200 }'
<rippa> tex3l: I'd just use #each and break then
<theishi> syntax error, unexpected tASSOC, expecting '}' (SyntaxError)
<rippa> theishi: use parens
<scalebyte> rippa: kindly help me : https://gist.github.com/1949945
<rippa> you can't pass literal hash without them
<theishi> thanks
<scalebyte> rippa: ^^
<rippa> scalebyte: I can't parse your code
baroquebobcat has joined #ruby
<scalebyte> rippa: each time i update the other attributes the preferences params are getiing {}
speggey has joined #ruby
<andynu> scalebyte: could be a few things, first I'd add a few parens. precidence on that preferences= line is unclear. Second are you certain that you are ALWAYS passing params[:preferences]?
<any-key> that could use some refactoring...
<any-key> keep lines under 80 chars, bro
<tex3l> rippa: something like that
<tex3l> where the result is either useful, or nil
<tex3l> i could write this, but i'm surprised it doesn't already exist
<scalebyte> andynu: preferences are updated via another page using checkboxes and if params[:user][:preferences] is nil, then we pass an empty hash (if user unchecks all checkboxes)
<andynu> I bet you're getting evaluated like this: @user.preferences = (UserPreference.new params[:user].nil?) ? {} : params[:user].delete(:preferences)
<rippa> tex3l: i guess, it's not very common usecase
<scalebyte> andynu: but when i update the other user attributes from other page it again gets params[:user][:preferences] as null since i am not upadting preferences there so it updates the preferences again with empty hash
al3xnull has joined #ruby
<tex3l> rippa: must be- granted this is the first time I've needed it too
alex__c2022 has joined #ruby
<tex3l> rippa: each w/ break is a great shorthand for it though- didn't realize that breaking from each returned the block result!
tayy has joined #ruby
<andynu> I suggest splitting it out into two calls, update_preferences, update_attributes
<scalebyte> andynu: but eventually for updating the update action will be called ryt ?
nw has joined #ruby
<andynu> oh, resources mapping in rails? yeah.
eldariof has joined #ruby
<andynu> scalebyte: try interrogating your @user object a bit, you're blindly resetting preferences there every time without checking what you already have on your found object.
chaitanya has joined #ruby
<scalebyte> andynu: ok so can I do something like set a hidden field in the form and then if the value is true update preferences ?
<andynu> sure.
<scalebyte> andynu: this is hw my form for updating rpeferences look like https://gist.github.com/1951009
<scalebyte> andynu: cud u tell me where i can add the hidden field in the form so that I can check the value while updating ?
<andynu> second line
<andynu> = hidden_field ...
pleiades has joined #ruby
<scalebyte> andynu: cud u etll me hw the line wud b ? i hv never used it !!
<any-key> what the hell does "cud" mean in this context?
davidpk has joined #ruby
<scalebyte> andynu: Could u pls tell me ... Thats what I meant mate :)
<andynu> I presume his txtlish meant "could you please"
DrShoggoth has joined #ruby
<pleiades> i'm the psycho....
<andynu> haha
shaman42 has joined #ruby
Drewch has joined #ruby
nachtwandler has joined #ruby
<any-key> I thought txtlish died a long time ago :\
<scalebyte> andynu: Yes Mate... So how can i go about it ?
<andynu> anyhow, = hidden_field :really_update_prefs, true
hashpuppy has joined #ruby
<andynu> but I don't know how you want to go about setting that boolean, true on one page, false on another?
<pleiades> I keep thinking about getting a modern console. I still have a NES :/
<andynu> then if params[:really_update_prefs]\n\t@user.preferences=...
<hashpuppy> given h1 = {"a" => 2}; h2 = {"a" => 3}; is there something h1?? h2 that will yield {"a" => [2, 3]}
<scalebyte> andynu: just in that page il set true and while updating if the hidden field is true.. il do that or else not update preferences
<pleiades> psilo draws: VI. LOVERS http://www.learntarot.com/maj06.htm
<pleiades> to youtube myself freeclimbing a skyscraper.. pwca is on.. thats why i want see if i want to come.. hes a single core 1.2ghz with 768mb ram..
<pleiades> but i have multiple HDDs in the national guard was there.. i love those kind..
<andynu> hashpuppy: i've always done that manually. :(
<pleiades> is long asyou arenoy locked up try to behave but if yoiu areagain dont in jail or psyche wardsitsbetter if peoplearescared of you
<hashpuppy> yeah... think i found a SO answer to this
<pleiades> have to look after my previous record of 0%..
<pleiades> ill idle for 6 hours straight..
<pleiades> grub is just a little shell. grub is the default bootloader that ubuntu puts there.. escape on boot gets you into grub.
axl_ has joined #ruby
<pleiades> do you know someone you could be using a pseudonym of wilfred jenkins the third
adamjleonard has joined #ruby
mikepack has joined #ruby
g0bl1n has joined #ruby
blueadept has joined #ruby
axl__ has joined #ruby
Sailias|work has joined #ruby
Spockz has joined #ruby
<theishi> what is the best way to extract the portion of a string surrounded by parenthesis? 'blah (info) foo'.... turn that into 'info' for example?
aibo has joined #ruby
andrewhl has joined #ruby
ph^ has joined #ruby
glosoli has joined #ruby
<v0n> hi guys
<v0n> can @obj.a.b in a loop be a performance issue (instead of a = @obj.a; a.b)?
<scalebyte> andynu: i added hidden field in the form like this https://gist.github.com/1951009 and also modified the update action like this https://gist.github.com/1949945 but getting the error : ActiveModel::MassAssignmentSecurity::Error in UsersController#update Can't mass-assign protected attributes: hidden, preferences
<scalebyte> andynu: where am I going wrong ?
flak has joined #ruby
davidcelis has joined #ruby
lorandi has joined #ruby
<andynu> do not use f.hidden, f.hidden is differen then hidden_field_tag in that the input that generates is named user[hidden] instead of just hidden
<andynu> so now your user update part is trying to set a "hidden" attribute of your user object, which is not what you want
kidoz has joined #ruby
<andynu> just swap out f.hidden to hidden_field_tag instead.
<andynu> hidden_field_tag :hidden, true
<andynu> skip the rest of that hash stuff that is only for f.hidden
bagratte has joined #ruby
<scalebyte> andynu: so u meant o say hidden_field_tag :hidden, true instead of the second line ?
<andynu> correct.
<andynu> take a look at the generated html now, and after the change.
<scalebyte> andynu: sure
<scalebyte> andynu: ok now i get
<scalebyte> andynu: <input id="hidden" type="hidden" value="true" name="hidden">
<andynu> instead of user[hidden], so it won't get caught up in your update user attributes stuff.
<scalebyte> so what can i have in the controller instead of unless params[:hidden] == "true" @user.preferences = UserPreference.new params[:user][:preferences].nil? ? {} : params[:user].delete(:preferences) end
<andynu> yup
JonnieCache has joined #ruby
<andynu> a moment ago your field was actually params[:user][:hidden]
j0bk has joined #ruby
<scalebyte> andynu: yes u r right... now hw to modify the controller for checking it
_obiJuan has joined #ruby
<andynu> your controller looks good.
<philcrissman> scalebyte: weren't we talking about this earlier? Did you look in your model for attr_accessible or attr_protected?
rippa has joined #ruby
<scalebyte> andynu: https://gist.github.com/1949945 this is the controller
<philcrissman> scalebyte: the error is "can't mass assign protected attributes".
enherit has joined #ruby
<scalebyte> philcrissman: yes mate but i think a hidden field and check in the controller for its value will solve the problem rest all is done :)
<scalebyte> andynu: so u mean i dnt have to change the controlle now ?
<andynu> nope. your controller was referencing the hidden param correctly.
glosoli has joined #ruby
<scalebyte> andynu: i still get the same error.
<philcrissman> scalebyte: how will it do that? You'll need to either change your model, or explicitly assign the hidden and preferences column in the action.
<andynu> `p params` for us.
<philcrissman> scalebyte: is there a "hidden" column in your model?
<scalebyte> philcrissman: no
<andynu> philcrissman: he just wants a variable to switch off of for updating the preferences on one screen and not on others.
<scalebyte> andynu: dude https://gist.github.com/1949945 wt change do i need to make in the controller ?
<philcrissman> scalebyte: it's trying to update the model in the first "if" line. You'd want to check for and assign params[:preference] BEFORE you call update_attributes
<scalebyte> andynu: exactly.. thats why we have hiden fields for... :)
<philcrissman> scalebyte: otherwise you'll keep getting that error.
<scalebyte> philcrissman: so please modify the controller ///
<philcrissman> scalebyte: !
<philcrissman> wft
<philcrissman> scalebyte: so please learn rails.
<scalebyte> andynu: what next we r close to the goal i guess..
<philcrissman> scalebyte: I just told you (as have others, probably) both earlier and now what the issue is and how to fix it. I'm not writing your code for you.
<andynu> We need to see what your params are.
<philcrissman> scalebyte: !try
<andynu> I think you didn't update the form correctly.
<scalebyte> andynu: leme try
<scalebyte> andynu: thanks
<philcrissman> oops, not in #ror, no helpa. :(
nw has joined #ruby
nixmaniack has joined #ruby
<andynu> hrmn, good point, this quickly strayed from pure ruby.
<scalebyte> andynu: same error mate
<andynu> ah, but now you should have some output on the console that you can show us the params
<philcrissman> scalebyte: I just told you what to change.
<scalebyte> philcrissman: please repeat il do that
<philcrissman> philcrissman: scalebyte: it's trying to update the model in the first "if" line. You'd want to check for and assign params[:preference] BEFORE you call update_attributes
<philcrissman> and you'll want do delete it from params before calling update_attributes. That or just update your model; is there are reason that attribute is protected>
<philcrissman> ?
<andynu> philcrissman: yup. if it is expecting a UserPreferences object and it is really plucking some hash out of params in the update_attributes, you're right.
<scalebyte> philcrissman: andynu : how is this ? https://gist.github.com/1951408
apeiros_ has joined #ruby
<philcrissman> andynu: according to the error he posted about, it's trying to mass assign preference, which is protected. That's set in his model. I don't know how it's set, as scalebyte hasn't posted the model.
<philcrissman> andynu: he asked this way earlier this morning, I tried to tell him the same thing hours ago.
<philcrissman> scalebyte: that new gist might work, try it.
<philcrissman> scalebyte: looks like you're on the right track.
<philcrissman> scalebyte: but again; this is a lot of trouble to go to if there is no reason for that attribute to be protected.
<scalebyte> philcrissman: the assignment does happen as usual... it was working also bt when the other attributes were updates preferences were also getting over written with it so i thgt of having a hidden field in the submit form
kpshek has joined #ruby
* apeiros_ senses #rubyonrails
<andynu> https://gist.github.com/1951384 - i think you'd have tinge of trouble if you inadvertantly pass preferences on a page without the hidden form field, you want to be deleting the params[:user][:preferences] either way.
<scalebyte> philcrissman: the gist i told worked
cbuxton has joined #ruby
<scalebyte> philcrissman: andynu : let me confirm by updating the other attribyes as well if preferences are also over writter or not
<philcrissman> scalebyte: but do you know _why_ it worked? You should really read about mass assignment. You wouldn't have had to take this long to figure it out. :)
<andynu> philcrissman: ++
<scalebyte> philcrissman: it works perfectly mates.. thanks a ton andynu and philcrissman :)
<philcrissman> sheesh
<philcrissman> i give up
<andynu> lead a horse to water.
<philcrissman> "It works I don't care why"
<scalebyte> philcrissman: il really agree with u and will learn abt those concepts its just that i was in a hurry to get this done... and i will seriously consider your points :)
<philcrissman> scalebyte: ok. That is all we ask. :)
havenn has joined #ruby
banisterfiend has joined #ruby
savage- has joined #ruby
<scalebyte> philcrissman: I am not somebody as u said who just wanna get things done... I will definety go learn those concepts u mentioned once I am done with this ;)
<scalebyte> and thanks once again andynu and philcrissman :)
<andynu> and now back to your regularly schedule ruby. Hash rockets, I don't miss'm.
<philcrissman> scalebyte: alright, sorry. :) Have fun; glad that it is working. You could have solved it much quicker, though. Just saying.
SegFaultAX|work has joined #ruby
<scalebyte> philcrissman: i understand will look into actually I am a rails newbie.. hardly few months into bt lots of work at office :) So
s_dana has joined #ruby
banisterfiend has joined #ruby
tkellen has joined #ruby
KL-7 has joined #ruby
davidcelis has joined #ruby
pantsman has joined #ruby
artOfWar has joined #ruby
davidpk has joined #ruby
coucher has joined #ruby
dhruvasagar has joined #ruby
hooper has joined #ruby
<scalebyte> andynu: philcrissman : mates everythings working fine exept for when i uncheck all the checkboxes and submit .. I get an error : NoMethodError in UsersController#update undefined method `[]' for nil:NilClass
mdw has joined #ruby
<scalebyte> andynu: philcrissman : This is hw my controller looks like : https://gist.github.com/1951408
pietr0 has joined #ruby
<philcrissman> scalebyte: you'll have to look for which line it is. and see why.
<philcrissman> scalebyte: something is nil.
<scalebyte> philcrissman: but I already have this line @user.preferences = UserPreference.new(params[:user][:preferences].nil? ? {} : params[:user][:preferences])
<apeiros_> you guys know that there's #rubyonrails ?
<philcrissman> scalebyte: oh, then clearly the error is wrong. tell it to run your code.
<scalebyte> philcrissman: in my controller that takes care of the empty hash (all checkboxes unselected)
<scalebyte> philcrissman: :-/
nachtwandler has joined #ruby
<philcrissman> apeiros_: you're totally right. I just started to help and kept helping. Or trying.
<philcrissman> scalebyte: apeiros_ makes a good point. /join #rubyonrails
<JonnieCache> hes b& from the rubyonrails channel
<JonnieCache> cant think why
<philcrissman> JonnieCache: ooh.
<philcrissman> lol
<apeiros_> prolly due to webchat
<JonnieCache> unless im thinking of someone else in which case i apologise unreservedly
jgrevich has joined #ruby
kenperkins has joined #ruby
<scalebyte> philcrissman: ppl talk less abt rails in that room :)
<philcrissman> scalebyte: that's not true. But, whatever.
<scalebyte> philcrissman: just help me fix this bug and i am done :) and then to study all the concepts
<apeiros_> JonnieCache: it doesn't seem like he's banned - at least I see no matching mask…
<philcrissman> scalebyte: dude, I am working. I'm not fixing it for you. Learn to use a debugger. ruby-debug.
<JonnieCache> the thing is, fixing the bug and learning about the concepts are *one and the same*
CannedCorn has joined #ruby
<philcrissman> put in logger statements. whatever. I have my own work to do. :/
adeponte has joined #ruby
<CannedCorn> rails log colors, what do they indicate?
<CannedCorn> active record rather
<philcrissman> CannedCorn: colors?
<CannedCorn> nvm, will ask in #ror
artOfWar has joined #ruby
<JonnieCache> CannedCorn: i think they just alternate so you can pick out one line from another more easily
<JonnieCache> they dont mean anything afaik. or maybe im wrong
<CannedCorn> ah
<CannedCorn> lame, i thought they indicated read/write
<scalebyte> philcrissman: please help me and go... we did it together.. ur lil help ccould help me fix this faster pls mate !!
tewecske has joined #ruby
<philcrissman> scalebyte: read the error.
<philcrissman> scalebyte: or join #rubyonrails
<philcrissman> scalebyte: or actually figure out how to use ruby-debug. I learned rails in the console and by peppering my code with logger statements. You can figure it out, just try.
<JonnieCache> CannedCorn: they could well indicate read/write. that would make sense.
<scalebyte> philcrissman: got it fixed
becom33 has joined #ruby
<philcrissman> scalebyte: see, I told you you could do it.
<philcrissman> That took you 2 minutes.
<scalebyte> philcrissman: yes thanks just had to add an else for loc_id
probst has joined #ruby
<scalebyte> philcrissman: thanks mate for encouraging me :)
tdelam has joined #ruby
badabim has joined #ruby
the_hack has joined #ruby
<philcrissman> scalebyte: np. seriously, though. #rubyonrails is the channel for questions having more to do with rails than with ruby.
<scalebyte> philcrissman: yes I will b there once I get unbanned :)
<philcrissman> uhm. oh.
<andynu> good grief.
eywu has joined #ruby
<becom33> I wanna print a ascii banner in ruby script . its multi line how can i print that ?
<JonnieCache> use the heredoc syntax
<becom33> JonnieCache: is that for me ?
<JonnieCache> yes sorry
<becom33> JonnieCache: is has some special caractor would that be a problem ?
<apeiros_> JonnieCache: was that for him too? :)
tdelam has joined #ruby
triptec has joined #ruby
Wizek has joined #ruby
apok has joined #ruby
speggey has joined #ruby
greenarrow has joined #ruby
ascarter has joined #ruby
savage- has joined #ruby
nachtwandler has joined #ruby
ph^ has joined #ruby
maletor has joined #ruby
steakknife has joined #ruby
crankycoder has joined #ruby
sungji has joined #ruby
Ammar01 has joined #ruby
<steakknife> Looking at arity and parameters methods, is there a way to retrieve a default parameter's expression?
Araxia has joined #ruby
nixmaniack has joined #ruby
kenichi has joined #ruby
<Mon_Ouie> Nope, parameter name is as far as you can go
nw has joined #ruby
philcrissman has joined #ruby
briankbuckley has joined #ruby
jesly has joined #ruby
tenshihan has joined #ruby
<tenshihan> ipc?
Wizek has quit ["Leaving"]
vraa has joined #ruby
dnyy has joined #ruby
ddv has joined #ruby
skipper has joined #ruby
<steakknife> Seems like patching parameters to add a third element would be okay.
ed_hz_ has joined #ruby
oooPaul has joined #ruby
<steakknife> I'll work on a patch to MRI rb_method_parameters.
ipsifendus has joined #ruby
nfluxx has joined #ruby
iamjarvo has joined #ruby
oposomme has joined #ruby
sacarlson has joined #ruby
pdtpatr1ck has joined #ruby
PragCypher has joined #ruby
shadoi1 has joined #ruby
oposomme has joined #ruby
<Mon_Ouie> Except that involves keeping the actual expression of the parameter
<Mon_Ouie> I assume only the bytecode is kept currently
CacheMoney has joined #ruby
Azure has joined #ruby
<apeiros_> you could use Ripper
<apeiros_> only works for ruby sources, but still…
wallerdev has joined #ruby
techhelp has joined #ruby
nachtwandler has joined #ruby
CoderCR|work has joined #ruby
Russell^^ has joined #ruby
notjohn has joined #ruby
oposomme has joined #ruby
tayy has joined #ruby
<steakknife> Might be simpler in some cases to rewrite using send semantics.
amerine has joined #ruby
lkba has joined #ruby
skitrees has joined #ruby
bbttxu_ has joined #ruby
<apeiros_> oh you don't want it for inspection/debugging?
<apeiros_> then put your arguments into an array and use splat
<JonnieCache> *args ftw
tvo has joined #ruby
d34th4ck3r has joined #ruby
tvo has joined #ruby
<CannedCorn> best way to check if evironment supporst color output to STDOUT?
Indian has joined #ruby
<apeiros_> I usually check for .tty?
Jay_Levitt has joined #ruby
adamkittelson has joined #ruby
snearch has joined #ruby
glosoli has joined #ruby
pangur has joined #ruby
alem0lars has joined #ruby
<steakknife> Just tried the colorize gem. It handles tty / no tty.
<pangur> patrons.sort allows me to sort an array of people. I would like sort patrons by the third element in each persons' array. Should I do it that way or should I create persons instead and then sort by an attribute?
<JonnieCache> you can use sort_by with a block to sort however you want
<apeiros_> sort itself takes a block too
nachtwandler has joined #ruby
voodoofish430 has joined #ruby
<pangur> I can sort by surname easily enough because surname is the first element in each array.
<steakknife> CannedCorn: note : colorize gem seems to be incompatible with awesome_print
<pangur> It is the default for patrons.sort in my case.
* pangur looks into sort_by and blocks
jrist has joined #ruby
<JonnieCache> http://www.youtube.com/watch?v=MvaEmPQnbWk <== good to see that bjork is still bjork :D
cableray has joined #ruby
<yxhuvud> I'd have been quite surprised if she turned into britney
shruggar has joined #ruby
tkellen has joined #ruby
bbttxu_ has joined #ruby
daglees has joined #ruby
jesly has joined #ruby
iocor has joined #ruby
danishkhan has joined #ruby
<lectrick> what does "bundle exec" before a command do?
carlyle has joined #ruby
speggey_ has joined #ruby
<yxhuvud> it invokes the environment defined in your Gemfile
hadees has joined #ruby
Progster has joined #ruby
adman65 has joined #ruby
shruggar has joined #ruby
<lectrick> doesn't the Gemfile just list a bunch of gems expected to be run in the current ruby?
jordanstephens has joined #ruby
nanderoo has joined #ruby
ascarter has joined #ruby
stephenjudkins has joined #ruby
zomgbie has joined #ruby
hydrozen has joined #ruby
oposomme has joined #ruby
daglees has joined #ruby
<oooPaul> lectrick, it's a list of required gems.
tylerwillingham has joined #ruby
<oooPaul> Gemfile.lock is the definitive list of gems required, along with specific versions.
shruggar has joined #ruby
bluOxigen has joined #ruby
oposomme has joined #ruby
namidark[w] has joined #ruby
Tearan has joined #ruby
ascarter has joined #ruby
n3m has joined #ruby
<plato> hi guys
bluOxigen has joined #ruby
<plato> is there a way for my script foo/lib/import.rb to open the file foo/test/testdata.txt without using an absolute path?
Helius has joined #ruby
<steakknife> plato: will the text file be relative to the source file or the project/gem root?
<plato> oh this might work - cd foo; ruby -I lib:test lib/import.rb
savage- has joined #ruby
<plato> i hadn't tested it properly, i had placed testdata.txt in the foo (project root) folder, and was trying to access it from lib/import.rb without doing ruby -I lib:test:.
sonkei has joined #ruby
<pangur> http://fpaste.org/YETn/ shows my program so far. I am wondering how to instantiate Person objects. I take it that I need to have something around line 53 that will do the trick? Line 52 works fine as it stands.
<steakknife> plato: -I adjusts $LOAD_PATH, it doesn't affect file operations.
<oooPaul> Person.new(opt, opt, opt, opt...) is the way to instantiate an object in Ruby.
<plato> steakknife: in import.rb i was loading test/testdata.txt, which seemed to work since i was calling it from the parent "foo" directory
<plato> it ddin't work if i called it from "lib"
<pangur> so something like Person.new(surname, fore, age, tel, pup, sci) should work in my case, oooPaul?
<mackid> if you have that many options, i hope you're using an options hash...
danishkhan has joined #ruby
bbttxu_ has joined #ruby
<steakknife> plato: calling load for a text file? o.O
<plato> open*
Indian has quit [#ruby]
<plato> pangur: is data.rb a csv file with one person's data on each line?
<oooPaul> pangur: Yes.
Targen has joined #ruby
sacarlson has joined #ruby
<pangur> No, it is just one line of csv, with 360 elements. There are 60 people.
<pangur> six elements per person, obviously, I suppose
bbttxu_ has joined #ruby
<pangur> That's why line 39
startling has joined #ruby
<pangur> It breaks one long csv into 60 arrays.
<plato> well, if you have an array of 6 things called asdf, you can do Person.new(*asdf) and it will plug the first element into surname, second into fore...
startling has quit [#ruby]
<pangur> ah, thanks :)
eka has joined #ruby
<pangur> That is all I need to know, I think :)
<plato> it works the other way too
* pangur needs to go to a meeting but thanks :)
<plato> if you define initialize(*ghjk) in Person, ghjk will be an array containing the stuff that got passed in
<pangur> ah ta
imami has joined #ruby
<plato> pangur: bookmark this for later http://www.skorks.com/2009/08/method-arguments-in-ruby/
* pangur_away is away: Gone away for now
<pangur_away> bookmarks
ascarter has joined #ruby
<plato> gl hf
amerine has joined #ruby
savage- has joined #ruby
<steakknife> Given &block, is it possible to define a named method from it (or it's lambda equivalent) at the class level with subclass inheritance?
imami has joined #ruby
<apeiros_> define_metho
<apeiros_> +d
denom has joined #ruby
jakky has joined #ruby
danishkh_ has joined #ruby
<steakknife> apeiros: oops, a gotcha : the resulting function must be allowed to have its own block passed to it.
Sailias|work has joined #ruby
<geekbri> Is it valid to do something like this in an ERB? <% my_generic_variable = "#{blah['key1']}/#{blah['key2']}" %> ?
<twixmix> geekbri: It should be as long as blah is set. It'll return the string blah1/blah2
<steakknife> geekbri: proly not a good idea to put logic in a template. define a method or accessor elsewhere and read it.
<geekbri> twixmix: thanks!
<twixmix> And set generic_variable to it.
<geekbri> twixmix, steakknife: yeah unfortunately I'm actually working around some limitations in chef so I have to access this stuff directly in the template
<steakknife> There's another reason I don't use chef.
<oooPaul> geekbri, very legal, but as noted, may not be an optimal design. I do that a lot if something in my view is checking the same value over and over again, as a kind of local cache.
MrGando has joined #ruby
shruggar has joined #ruby
<steakknife> It's amazing how configuration management frameworks unintentionally forget there's an MVC pattern going on, but that's best trolled in ##infra-talk. : )
bbttxu_ has joined #ruby
<geekbri> steakknife: Well chef typically lets you pass variables into erb's, my issue has more to do with an issue regarding compile time vs execution time of chef and when ruby_blocks are executed vs built in chef directives :)
pantsman has quit ["Leaving"]
sacarlson has joined #ruby
Kyril has joined #ruby
jergason has joined #ruby
<steakknife> geekbri: doesn't everything execute in chef on the client as ruby code? is there some sort of production performance impact with that alternative implementation?
<Veejay> How does one create three variables through three method calls on the same line? Something like a,b,c = * whatever with method call
<Mon_Ouie> a, b, c = call_one, call_two, call_three
<geekbri> steakknife: chef-client itself is ruby yes, but in the recipes you can use their directives, but there is also something called ruby_block which basically just lets you write any arbitrary ruby that will be run at execution time, instead of the compile time. The ruby you write in a recipe itself is run at compile time
<Veejay> Say that method call is call to a FactoryClass that creates objects with random values for the attributes, isn't there anything more concise?
jergason has joined #ruby
<Veejay> I tried [Factory(whatever)]*3 but that creates the same object three times, as expected :/
<Mon_Ouie> Use an array
<Mon_Ouie> Array.new(3) { … }
<Veejay> Nice
justinmcp has joined #ruby
<Veejay> I'll try that
<Veejay> Thanks
<lectrick> How do I set a shell environment variable from a Ruby script I am running in the shell?
<mackid> i'm thinking it's ENV["MY_ENV_VAR"] = "new_value" but i'm not sure if you can write it that way
<Mon_Ouie> Sure
a10n__ has joined #ruby
<sunaku> mackid: that is correct
<mackid> lectrick: yeah, what i said
<a10n__> Hi, can someone help me please. How do I fix this error: "another rubygems is already loaded from /usr/lib/jruby/lib/ruby/site_ruby/1.8/rubygems.rb"
n8ji has joined #ruby
<sunaku> a10n__: show us the output of: ruby -ve 'p $:'
ilyam has joined #ruby
<steakknife> lectrick: ENV, sometimes i've used gdb to inject a syscall into another process to change a variable of a non-child process.
imami has joined #ruby
<plato> sunaku: what's $: do
<a10n__> Here is the bash output of my error if any ruby pros can take a look: http://pastebin.com/86YcUWz6
<steakknife> lectrick: btw kinda related http://⌘.ws/rbexportenv
<sunaku> plato: $: is $LOAD_PATH. it will show us where the 1st place his `require 'rubygems'` will resolve to
<plato> i've seen a couple similar variables, $!, $0 etc but i havne't found a reference explaining those yet
<sunaku> a10n__: ruby 1.9 contains its own rubygems definition (the "prelude") and ships with its own copy of rubygems
<plato> any recommendation?
Vert has joined #ruby
lewix has joined #ruby
lewix has joined #ruby
<a10n__> sunaku: Thanks, so what do I have to do? I used RVM to install ruby 1.9
<plato> ty sunaku
marvin_ has joined #ruby
<sunaku> a10n__: in this case, you're using jruby with --1.9 flag, so it will do gem_prelude stuff (which conflicts with your jruby 1.8 rubygems)
<steakknife> plato: special vars and more http://➡.ws/rbquickref
<sunaku> a10n__: since you're on RVM, make a new gemset for jruby 1.9
professor__ has joined #ruby
<sunaku> steakknife: what in the? they allow unicode chars in domain names now?
<steakknife> snaku: yep, and gtlds for a cool million
briankbuckley has joined #ruby
<steakknife> s/snaku/sunaku/
<sunaku> wow
rramsden has joined #ruby
tatsuya_o has joined #ruby
<sunaku> was this a recent thing?
<steakknife> sunaku: nope
coreydaley has joined #ruby
i8igmac has joined #ruby
<a10n__> sunaku: can you provide instructions?
trend has joined #ruby
<sunaku> i remember there was opposition to unicode in domain names because it's so easy for phishers to register URLs that appear similar to the real thing
sacarlson has joined #ruby
Ferdev has joined #ruby
<sunaku> a10n__: no, try asking in #rvm
savage- has joined #ruby
<plato> sunaku: yeah i was concerned about that too
<steakknife> sunaku: http://‽.ws/i18ndns
<sunaku> steakknife: thanks!
<plato> time for a browser extension that highlights unicode chars with a colored background in the address bar....
<steakknife> sunaku: btw, theres going to be a bazillion talks at defcon20 about unicode *ishing
danishkhan has joined #ruby
<a10n__> sunaku: okay thanks, i'll try to fumble around
ephemerian has joined #ruby
<sunaku> steakknife: fun stuff for CAPTCHAs and machine learning / computer vision researchers
the_hack has joined #ruby
Foxandxss has joined #ruby
Shtirlic1 has joined #ruby
<steakknife> apparently, there's even a wikipedia page: http://‽.ws/unicode_dns_phising
shruggar has joined #ruby
dv310p3r has joined #ruby
<steakknife> btw, check it out . . . a unicode gtld http://рнидс.срб
delinquentme has joined #ruby
<lectrick> mackid: sunaku: My understanding is that ENV[whatever]=whatever only sets env variables for shells fired off from the current ruby process, not the parent shell
erikstraub has joined #ruby
<delinquentme> hey all I'm installing jruby on an ec2 instance .. and trying to figure out which file I need to execute on to install JRubah
<lectrick> steakknife: ^ (also, nice unicode url!)
<Mon_Ouie> You can't set env variables on parent process
<lectrick> Mon_Ouie: Meh.
<Mon_Ouie> You can only set it on the current process, and any child process you create will inherit them
<delinquentme> wow
<delinquentme> sorry there guys :D
Squarepy has joined #ruby
Squarepy has joined #ruby
professor__ has joined #ruby
stephenjudkins has joined #ruby
jroes has joined #ruby
zomgbie has joined #ruby
<steakknife> Mon_Ouie, lectric: actually there is a way to set it on the parent if you have gdb and permission to the process (or can sudo)
<jroes> how can I define a class that only lives in the context of a spec? I need to create a class to stub something that I don't want to require
<Mon_Ouie> There's no standard/portable way, anyway
<jroes> by "context of a spec" I just mean the current ruby file I have, I guess
virunga has joined #ruby
nixmaniack has joined #ruby
<erikstraub> mock('some_class')
<erikstraub> would that not work?
jergason has joined #ruby
glosoli has quit ["Leaving"]
<Mon_Ouie> Would help to know where your mock method comes from
glosoli has joined #ruby
A_D has joined #ruby
sacarlson has joined #ruby
<A_D> Hi there
delinquentme has quit ["Leaving"]
<A_D> I'm testing ruby scanf method and compare it with some C tests
idletom has joined #ruby
the_hack has joined #ruby
MrGando has joined #ruby
sacarlson has joined #ruby
<Mon_Ouie> Your C test would be more fair if you only compiled the regexp once
ylluminate has joined #ruby
<Mon_Ouie> Since that's what Ruby will do
kirun has joined #ruby
the_hack has joined #ruby
<steakknife> Mon_Ouie: setenv is part of POSIX.1, so if there's a debugger that can attach to running processes and inject system calls, then there's a way.
kevinbond has joined #ruby
jergason has joined #ruby
jroes has quit [#ruby]
libertyp1ime has joined #ruby
speggey has joined #ruby
sacarlson has joined #ruby
PragCypher has joined #ruby
twixmix has quit [#ruby]
fermion_ has joined #ruby
Redjack1964 has joined #ruby
davidcelis has joined #ruby
Indian has joined #ruby
jrist has joined #ruby
<lectrick> How do I figure out which process is holding a port open?
tkellen has joined #ruby
<cespare> lectrick: one thing to do is 'lsof -i :4567'
<cespare> where 4567 is the port you care about, obviously :)
sacarlson has joined #ruby
cjs226 has joined #ruby
banseljaj has joined #ruby
vraa has joined #ruby
havenn has joined #ruby
<sunaku> lectrick: that is how the underlying setenv() syscall is designed
CoverSlide has joined #ruby
davidpk has joined #ruby
Nisstyre has joined #ruby
tkellen has joined #ruby
sacarlson has joined #ruby
denom has joined #ruby
kevinbond has quit [#ruby]
fermion has joined #ruby
headius has joined #ruby
Squee-D has joined #ruby
Nisstyre has joined #ruby
iocor has joined #ruby
<kapowaz> is there a standard library mechanism for determining the distance between two dates as an integer (rather than in words), in years?
<banseljaj> shevy: thanks for the gtk2 suggestion. it is working out quite nicely
the_hack has joined #ruby
Russell^^ has joined #ruby
Azure|dc has joined #ruby
<pietr0> kapowaz: (time_1.to-i - time_2.to_i) / (60 * 24 * 365)
undersc0re has joined #ruby
iocor has joined #ruby
<kapowaz> pietr0: that doesn't sound like a particularly accurate way of working it out, if you're always assuming 365 days a year
<shevy> banseljaj cool
<shevy> banseljaj, how far are you with your gtk app?
<shevy> my peak time with ruby-gtk is already +3 years over :(
musee has joined #ruby
<shevy> I want a toolkit that is implementation-agnostic
<shevy> and works on the WWW as well
<banseljaj> Not much, but i'm halfway through the tutorial. and i get most of it. :)
<shevy> for a while I thought I could do with thingsl ike
Russell^^_ has joined #ruby
<shevy> foo = Button.new
<shevy> and then allow this button to be a gtk button... or a qt button... or an <input> field in HTML ...
<shevy> I see banseljaj
<pietr0> kapowaz: yeah, but that's a close enough approximation
<shevy> when you understand ruby-gtk, you will understand 85% of the other toolkits too
<pietr0> better than: time_1.year - time_2.year
tkellen has joined #ruby
<robert_> shevy: I finally figured out Prawn. :D
<shevy> really?
<shevy> and it works for ya?
<robert_> yup.
<shevy> :(
<shevy> I am cursed
<kapowaz> are there no good libraries for working with date calculations?
<robert_> I'll show you what I have in a bit. :D
stevecaney has joined #ruby
briankbuckley has joined #ruby
denom has joined #ruby
jmrtn has joined #ruby
coucher has joined #ruby
tatsuya_o has joined #ruby
Azure has joined #ruby
sacarlson has joined #ruby
phantasm66 has joined #ruby
jlogsdon has joined #ruby
glosoli has joined #ruby
jlogsdon_ has joined #ruby
<jmrtn> Hi all
<jmrtn> This code works but I'm guessing it could be more idiomatic: http://pastie.org/3499346
musee has joined #ruby
<jmrtn> Anyone have any suggestions?
skitrees has joined #ruby
<Mon_Ouie> Use #zip
<Mon_Ouie> sorted_groups.zip(labels) { |group, label| group["group"] = label }
<Mon_Ouie> Not sure why you used an Enumerator
virunga has joined #ruby
camilo has joined #ruby
<jmrtn> Mon_Ouie: I didn't know about zip… And there may not always be an equal quantity of labels and groups
norex has joined #ruby
sacarlson has joined #ruby
<dominikh> zip will fill in nils if the second array is too small
<jmrtn> dominikh: yeah, I see that.
<jmrtn> It was one of those problems where I had a strong feeling there was a method that would do what I need but I just couldn't think of it. :-)
<jmrtn> Anyways, thanks to you both
blischalk has joined #ruby
amerine has joined #ruby
TOMMY-PENGAMEN has joined #ruby
jlogsdon has joined #ruby
tkellen has quit [#ruby]
dekz has joined #ruby
PragCypher has joined #ruby
jlogsdon has joined #ruby
the_hack has joined #ruby
bluedino has joined #ruby
jbw_ has joined #ruby
Vert has joined #ruby
chiel has joined #ruby
artOfWar has joined #ruby
<chiel> anyone ever experienced CGI::escapeHTML double-escaping a string?
<chiel> hmm nevermind, i'm being an idiot
j0bk has joined #ruby
alaska has joined #ruby
tayy has joined #ruby
<oooPaul> chiel: Heehee. :)
<oooPaul> chiel, Been there, done that, don't feel so bad. ;)
<chiel> oooPaul: yeah, for a moment i lost my mind. :D
Nisstyre has joined #ruby
akem has joined #ruby
PragCypher has joined #ruby
bgupta has joined #ruby
sacarlson has joined #ruby
jmeeuwen has joined #ruby
<alaska> playing around with runtime monkey patching of individual objects and have run into an interesting question. As an illustrative example, I'd like a module to define an attr_reader for an instance, not a class, and to set the value for that instance variable: http://pastie.org/3499217 The problem is that neither of the methods I'm attempting work.
<alaska> So, I need to fix my understanding.
Spockz has joined #ruby
munx has joined #ruby
odinswand has joined #ruby
<CacheMoney> I'm stuck and unsure how to proceed... I want to create a Game class that takes on Player objects http://pastie.org/3499570 and allows me to allocate stats to the specific player, while keeping a running total for the game instance.
<CacheMoney> shevy: you were helping me with this yesterday.. any ideas?
chiel has quit [#ruby]
zen_ has joined #ruby
<CacheMoney> My specific questions would be: How would a Game class create new Player objects? And how would the Game class access Player instance variables?
fayimora has joined #ruby
<shevy> CacheMoney I would bundle all this initialization into its own method
<shevy> I usually call it "reset"
internet_user has joined #ruby
<shevy> you need a second class
<shevy> Game
<shevy> let that file then require your player class
<shevy> then inside of class Game, you can create new player objects
<shevy> class Game
<shevy> def add_player(name_of_player = 'Joe')
<shevy> @player << Player.new(name_of_player)
<shevy> end
<shevy> end
<shevy> there are 10000 more ways
<lectrick> Objects A and B are interdependent via API. Either object can be promoted to a new version independently (at least for a period of time) which may change the API. Suppose you have to be able to do this without breaking anything. Is this a solved problem?
<CacheMoney> shevy: ahh okay... You have me going in the right direction. Thanks a bunch for the guidance
<lectrick> Some sort of API versioning?
glosoli has joined #ruby
undersc0re has joined #ruby
philcrissman has joined #ruby
kpshek has joined #ruby
ChampS666 has joined #ruby
shtirlic has joined #ruby
bwlang has joined #ruby
sacarlson has joined #ruby
hobodave has joined #ruby
jmeeuwen has joined #ruby
<shevy> CacheMoney also
<shevy> I would try to write a second player class
<shevy> and try to use not more than one instance variable in it
<shevy> the reason is, you use many strange methods, and I think this could all be done better
Morkel has joined #ruby
shruggar has joined #ruby
<shevy> def threemake
<shevy> @threeAttempted += 1
<shevy> they are all counters
fowl has joined #ruby
zomgbie has joined #ruby
<shevy> hmm
<CacheMoney> shevy: what do you mean? how should I store the different shot attempts then?
<shevy> or perhaps don't rewrite. it's easier to keep it that way for now
<shevy> CacheMoney, in a hash for instance
<shevy> @hash['threeMade'] = 5
<shevy> and use a method to count on that
<shevy> add 1,'threeMade'
<shevy> add 2,'block'
<shevy> that hash would keep all the counters
<shevy> but I think
<shevy> it is better to not rewrite it soon
<shevy> stick to your current way :)
<fowl> good ol shevy and his walls of text
<shevy> the method could be vice-versa too
<shevy> add 'block', 2
<shevy> or in symbol format
<shevy> add :block, 2
philcrissman has joined #ruby
<shevy> fowl, you are dead man. skyrim ate you ... :(
<CacheMoney> shevy: ahh okay... I'll contemplate that and come up with something a little more concise once I get a Game class up and running
<CacheMoney> I really appreciate your advice
dr_bob has joined #ruby
sacarlson has joined #ruby
<shevy> well most importantly find your own style to write code in
shtirlic has joined #ruby
snip_it has joined #ruby
tvw has joined #ruby
shadoi has joined #ruby
SullX has joined #ruby
<SullX> hello
<SullX> why can't I chat in #mysql
<SullX> ?
<shevy> SullX what error msg do u get
<SullX> shevy: Cannot send to channel: #mysql
<fowl> maybe you have to be registered?
<shevy> SullX yeah register your nick then authentify, via something like: /msg nickserv identify YOUR_PASSWORD_COMES_HERE
<dominikh> s/authentify/authenticate
<dominikh> and to make this easier: /msg nickserv help register
<dominikh> will outline the whole process
bwlang has joined #ruby
sacarlson has joined #ruby
kpshek has joined #ruby
scroat has joined #ruby
<scroat> hi
<scroat> Is there a way to do an http get using only standard libraries ?
timeout has joined #ruby
<scroat> If not I can't use ruby. (no offense I'm just deciding if ruby is what I need. im a ruby n00by)
<timeout> I have a hash structure with three layers and i'd like to expand the middle layer sometimes, what's the best way to do that?
notjohn has joined #ruby
<robacarp> scroat: yes
<robacarp> Net:HTTP
<timeout> so, I mean I have something like filename -> path -> version and sometimes I want to add paths to a filename.
<robacarp> timeout: uh. hsh['filename']['new_path'] = { :version => :seven } ?
<timeout> robacarp: consulting code...
musee has joined #ruby
etank has joined #ruby
musee has joined #ruby
sacarlson has joined #ruby
<banisterfiend> robacarp: scroat has a good nickname dont u think
<robacarp> um
<robacarp> yes?
<banisterfiend> robacarp: glad u agree
emocakes has joined #ruby
<timeout> robacarp: *scratches head* thanks. Don't know what I was thinking.
CodeZombie has joined #ruby
<robacarp> timeout: np. may I suggest a coffee break? :-)
<shevy> hehe
<shevy> are you two making out again
<banisterfiend> shevy: hey marcus
<shevy> banisterfiend hey. fowl is here but skyrim has changed him
<timeout> robacarp: can't stop now!! :D
<banisterfiend> shevy: yeah, fowl is jewish but he was never a practicing jew, now he goes to the synagogue regularly
<emocakes> nazis
<emocakes> whats wrong with being jewish?
<robacarp> this is going to get awkward isn't it
<banisterfiend> emocakes: nothing, i never said there was. I'm just talking about how he's changed
sacarlson has joined #ruby
musee has joined #ruby
aroop has joined #ruby
MrGando has joined #ruby
mengu has joined #ruby
pting has joined #ruby
musee has joined #ruby
musee has joined #ruby
musee has joined #ruby
sizz has joined #ruby
<scroat> If there were no jews and muslims, we'd have lower gas prices.
<pangur_away> I am struggling with http://fpaste.org/3dyE/ - especially how to generate and then access a Person.
<pangur_away> Line 55 works for me as long as there is no line after it.
dbe has joined #ruby
dbe has joined #ruby
<pangur_away> When I try a[i]= Person.new(... in line 56, it still does not seem to work for me.
Squarepy has joined #ruby
Squarepy has joined #ruby
<robacarp> pangur_away: uhhh
<robacarp> what error does it give
* pangur is back.
<pangur> sorry
<pangur> I had forgotten
<apeiros_> pangur: an `else` does NOT have a condition
<apeiros_> if it has a condition, it's an `elsif`
<pangur> oh
<robacarp> hah. apeiros_ nice catch
<pangur> I have now changed the else to an elsif and added a new else ...end
<apeiros_> pangur: line 32-36 can be replaced with: contents = File.read('data.rb')
eka has joined #ruby
<apeiros_> also, you probably shouldn't name it .rb if it isn't ruby code…
Redjack1964 has joined #ruby
<apeiros_> there's quite a lot of code improvements that could be done with that pastie…
<pangur> I have now changed lines 32-36
tommyvyo has joined #ruby
banisterfiend has joined #ruby
Sliker has joined #ruby
<CacheMoney> Are there any websites that provide online irb's or the ability to run Ruby scripts/commands and see the output? Say for example I'm at a buddy's house and his computer doesn't have Ruby installed on it
<apeiros_> google for tryruby
<apeiros_> not sure how complete those are
<jordanstephens> can I include a module into a class through a method at runtime?
<apeiros_> jordanstephens: of course
<apeiros_> jordanstephens: include is just a method
<apeiros_> and there is no other thing *but* runtime in ruby.
<apeiros_> (except for native extensions of course…)
IAmNotMyself has joined #ruby
<jordanstephens> that's what I thought... i guess the issue is something else
Sailias|work has joined #ruby
CodeZombie has joined #ruby
the_hack has joined #ruby
<jordanstephens> i'm trying to require a gem only if a certain method is called
arnihermann has joined #ruby
<pangur> When I do ruby ./index.rb I get (offline mode: enter name=value pairs on standard input)
<pangur> This is getting stranger for me
<apeiros_> pangur: that's because you use cgi
<apeiros_> it's supposed to be run by a webserver
<apeiros_> if you've installed the docs properly, read `ri CGI`
<pangur> http://fpaste.org/OF1w/ is what I have currently
rgrinberg has joined #ruby
<pangur> Is there a ruby-supporting webserver that I should be running?
<pangur> I have managed with cgi up until this point.
sungji has joined #ruby
<apeiros_> hrm, seems ri CGI doesn't actually cover offline mode
sungji has joined #ruby
<pangur> But then, maybe that is why cgi is no good :)
<apeiros_> pangur: you only need a *cgi* supporting webserver with cgi.
<pangur> Is there a server that you would recommend I install to enable me to run ruby without cgi?
<apeiros_> if you want to go bare metal, I'd use rack
<pangur> Is thin such a thing?
sizz has joined #ruby
<pangur> Basically, I just want something that I can set up with the least amount of awkward configuration.
<apeiros_> you can run rack apps with rackup quite a big range of webservers. the simplest being to just use the rackup executable that ships with rack.
<apeiros_> well, if you consider cgi to be awkward config, you'll be pretty much lost with *anything* webbased…
<apeiros_> (no matter the language)
Asebolka has joined #ruby
<burgestrand> It sounds like he needs a link to Sinatra
<fowl> banisterfiend is maori, you cant trust anything he says
<pangur> I have Sinatra on my machine, burgestrand.
<banisterfiend> burger stand
<banisterfiend> fowl: what's up fowldogg
<apeiros_> you may want to take a look at rack-server-pages
<burgestrand> pangur: what’s wrong with it?
<pangur> It is simply that I can run cgi in one file - it was just a short prog I had hoped.
emocakes has joined #ruby
<pangur> There was not much to it apart from shoving the shebang at the start etc. I just wanted to get the hang of getting the program to work before I started worrying about whether the framework might be the cause of my problems.
<pangur> I know that the real cause of my problems is my ignorance but that is a given :-)
<pangur> http://fpaste.org/NKCC/ is the output from my console
<pangur> Could it be that I am using eclipse as editor and that I did not start ruby using rvm?
Vert has joined #ruby
Teddy2steper has joined #ruby
Mammutpanzer has joined #ruby
<apeiros_> pangur: look, you already identified your source of problems - your ignorance
<apeiros_> how about you just effing google on "ruby cgi offline mode"?
carlyle has joined #ruby
<apeiros_> it's not rocket-science, yknow?
Indian has joined #ruby
<pangur> apeiros_: when I changed to contents = File.read("data.csv") and changed the name of data.rb to data.csv, print contents[0] does not give me the first element of array.
<apeiros_> pangur: of course, because you haven't split it yet…
<pangur> It gives me 77 rather than a surname
<pangur> ok
<apeiros_> I didn't tell you to remove the splitting part…
eka has joined #ruby
<apeiros_> so with the code you currently have, it'd be c[0]
<apeiros_> not contents[0]
the_hack has joined #ruby
<pangur> yeah, that works :)
<apeiros_> knowing & understanding your own code == big win :-p
briankbuckley has joined #ruby
<pangur> I a newbie :)
<apeiros_> all the more should you invest time to actually understand the code you write…
sacarlson has joined #ruby
<pangur> I guess it is too late in the evening for me.
* pangur is going to his bed
<pangur> Sorry for irritating you.
<geekbri> Is it possible in ruby to tell the backticks to invoke bash instead of sh ?
<apeiros_> `bash foo` :-p
<apeiros_> other than that, I think it's not ruby whom you have to tell to use bash instead of sh in subshells. afair that's something configured in your OS
<geekbri> apeiros_: i suspected as much.. I planned on trying bash -c "", i guess thats what i'll have to do :)
liluo has joined #ruby
Norrin_ has joined #ruby
compcube has joined #ruby
pu22l3r has joined #ruby
josephap has joined #ruby
josephap has quit [#ruby]
banisterfiend has joined #ruby
nari has joined #ruby
sacarlson has joined #ruby
havenn has joined #ruby
cjs226 has joined #ruby
pu22l3r has joined #ruby
Helius has joined #ruby
sacarlson has joined #ruby
<dekz> rubyists, what's the best way to have a range of methods mapping to commands, where each command may has a fixed number of arguments but a callback is wanted. Would you def ping(host, port, cb, *otherargs) or something else?
<dekz> may have*
Nathandim has joined #ruby
notjohn has joined #ruby
drbawb has joined #ruby
drbawb has joined #ruby
skrewler has joined #ruby
sdwrage has joined #ruby
sako has joined #ruby
<sako> hey guys so in python, i can do dir(object) and get all the methods
<sako> is there an equivalent in ruby
snip_it has joined #ruby
<sako> er.. object.methods.sort
* sako slaps himself.
vraa_ has joined #ruby
dv310p3r has joined #ruby
kah has joined #ruby
albemuth has joined #ruby
shevy2 has joined #ruby
Banistergalaxy has joined #ruby