apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
danielvdotcom has joined #ruby
keymone has joined #ruby
ZachBeta has joined #ruby
Natch has joined #ruby
danielvdotcom has joined #ruby
dagnachewa has joined #ruby
brngardner has joined #ruby
rsnake has joined #ruby
YasonBenDavid has joined #ruby
<YasonBenDavid> I have a request.
looopy has joined #ruby
<YasonBenDavid> full ha-Zohar preferrably in epub
<YasonBenDavid> pdf will also work
<banisterfiend> YasonBenDavid: what's ha-zohar
eignerchris has joined #ruby
rsnake has quit [#ruby]
tenseiten has joined #ruby
<YasonBenDavid> Jewish mystical school of thought. That the ruby designer mustve ascribed too.
<YasonBenDavid> Please help.
Guedes has joined #ruby
<YasonBenDavid> I donmt want to download a piece of it. And get tracking cookies like bait.
<YasonBenDavid> I just want the full volumes.
<startling> YasonBenDavid: not sure where you can get an epub. sacred-texts.com has you covered though: http://www.sacred-texts.com/jud/zdm/zdm000.htm
swarley has joined #ruby
linoj has joined #ruby
<banisterfiend> YasonBenDavid: why are you asking for that on a ruby programming channel? :)
nikhgupta has joined #ruby
netrealm has joined #ruby
<YasonBenDavid> banisterfiend: Why is it called "ruby" ?
<banisterfiend> YasonBenDavid: because it's a precious gem like "perl" (which ruby is somewhat inspired by)
<banisterfiend> YasonBenDavid: and matz liked the sound of it
carlyle has joined #ruby
<YasonBenDavid> Blue Letter Bible. "Revelation of Jesus Christ 21 - (RSV - Revised Standard Version)." Blue Letter Bible. 1996-2012. 28 Mar 2012. < http://www.blueletterbible.org/Bible.cfm?b=Rev&c=21&t=RSV >
ryanRT has joined #ruby
<YasonBenDavid> the eleventh jacinth,
Evixion has joined #ruby
icy--_afk has joined #ruby
<icy--_afk> hey can someone help me with a quick railsInstaller question?
asdasdasd has quit [#ruby]
Aaaarg has joined #ruby
seanstickle has joined #ruby
prometheus has joined #ruby
shevy has joined #ruby
keymone has joined #ruby
Russell^^ has joined #ruby
dnyy_ has joined #ruby
phantasm66 has joined #ruby
<havenn> asdasdasd: I'm sure someone here can help, but you might get a quicker response in #rails channel
looopy has joined #ruby
looopy has joined #ruby
h4mz1d has joined #ruby
swittenkamp has joined #ruby
<swittenkamp> does anyone know of a good tutorial or article on the 'mkmf' library for C extensions? I'm trying to compile sqlite3-ruby with some custom stuff and running into a bit of trouble.
havenn has joined #ruby
yoklov has joined #ruby
Natch has joined #ruby
CoverSli1e has joined #ruby
agustinvinao has joined #ruby
johnduhart has joined #ruby
kpshek has joined #ruby
DukeDave has joined #ruby
<DukeDave> This seems like a simple one, but I'm having trouble Googling it: I want to evaluate something n times and put each result in a list..
pu22l3r has joined #ruby
centipedefarmer has joined #ruby
<banisterfiend> DukeDave: Array.new(n) { what_u_wanna_evaluate() }
sbanwart has joined #ruby
<DukeDave> banisterfiend: Ah thank you, I knew there had to be an idiomatic way to express that :)
savage- has joined #ruby
nikhgupta has joined #ruby
<swarley> banisterfiend, i told you i finished with coolline right?
<banisterfiend> swarley: oh, no, how does it work? have you talked to Mon_Ouie about it? you should submit a pull request to him
<swarley> no i didnt, but it works with the up and down arrows now
<banisterfiend> swarley: you know how to submit pull requests? :)
<swarley> minimal changes
<banisterfiend> cool
liluo has joined #ruby
<swarley> no i dont actually
<swarley> lol
<banisterfiend> swarley: i think it's just matter of clicking 'pull request' button on your repo :)
<swarley> oh, kk
cloke_ has joined #ruby
<scientes> whats the ruby readline packgtea in centos 6.2?
DukeDave has quit [#ruby]
Urth|Away has joined #ruby
nonotza has joined #ruby
<banisterfiend> scientes: packaged tea?
<swarley> banisterfiend, just submitted the request
<scientes> package
<scientes> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- readline (LoadError)
<scientes> i have readline, and readline-devel installed
<swarley> why are you using 1.8?
<scientes> i know debian has a ruby-readline package
<scientes> cause im deploying a legacy rails app
<swarley> oh
<swarley> [49] pry(main)> Pokemon::Types::Electric.weaknesses
<swarley> => {:@Electric=>0.5, :@Grass=>0.5, :@Ground=>0.0, :@Dragon=>0.5}
<swarley> im going to get a full on pokemon battle engine
<swarley> sexy
nikhgupta has joined #ruby
<scientes> lol
Aaaarg has joined #ruby
m0nki3 has joined #ruby
kf8a has joined #ruby
justinmcp has joined #ruby
dv310p3r has joined #ruby
matti has joined #ruby
libertyprime has joined #ruby
frishi has joined #ruby
bhunt has joined #ruby
h4mz1d has joined #ruby
baroquebobcat has joined #ruby
<scientes> nice
<swarley> im really bored
<swarley> if you cant tell
<scientes> needs some graphics
<swarley> yeah xD
<swarley> im implementing the actual damage algorithm
<swarley> that takes types into account
<swarley> and accuracy blah blah
RORgasm has joined #ruby
ringotwo_ has joined #ruby
Natch has joined #ruby
<banisterfiend> swarley: learn how to make pull requests + learn git :)
<banisterfiend> learning git is fun
<swarley> yeah, i know enough to ... pull, push, add and commit xD
<scientes> its not that hard
<swarley> and the initial steps for creating a repo
<scientes> rebase -i is cool
<banisterfiend> swarley: did you make that pull request then? :)
<swarley> i use commit -m a lot because im too lazy to exit vim
<swarley> yes
<banisterfiend> swarley: cool
<swarley> i did a few minutes ago
<scientes> swarley, just change sensible-editor/EDITOR
<scientes> to use nano
* scientes uses nano with git
<swarley> if youwant to see before he accepts||denies it, its on my github
<banisterfiend> swarley: can u link the pull qreuqest here?
<swarley> sure
<scientes> pgp sign it :P
freeayu has joined #ruby
ZachBeta has joined #ruby
<swarley> at first i was looking in the source and i was like, GODDAMN IT i cant find any of the hilighting code!!! and then i realized it uses coderay lol
nikhil_ has joined #ruby
wefawa has joined #ruby
justinmcp has joined #ruby
BruceZu has joined #ruby
liluo has joined #ruby
wilmoore has joined #ruby
ghosTM55 has joined #ruby
dbgster has joined #ruby
swarley has joined #ruby
swarley has joined #ruby
CannedCorn has joined #ruby
<YasonBenDavid> yummy
kevinbond has joined #ruby
nonotza_ has joined #ruby
gift has joined #ruby
shtirlic has joined #ruby
fase has joined #ruby
hunzinker has joined #ruby
hunzinker has quit [#ruby]
keymone has joined #ruby
bryricker has joined #ruby
Natch has joined #ruby
tommyvyo has joined #ruby
ZachBeta has joined #ruby
drake_ has joined #ruby
drake10 has joined #ruby
nonotza_ has joined #ruby
zodiak has joined #ruby
nari has joined #ruby
bryricker1 has joined #ruby
ZachBeta has joined #ruby
qos has joined #ruby
nonotza_ has joined #ruby
hunterloftis has joined #ruby
ZachBeta has joined #ruby
<hunterloftis> What package gets the 'gem' command installed (on solaris)? I've tried 'ruby18-rubygems' 'ruby18-gemcutter' and 'ruby18-gem_plugin' with no luck
danielvdotcom has joined #ruby
dnyy has joined #ruby
scwh has joined #ruby
<Urthwhyte> hunterloftis: no result when you type "which gem"
<hunterloftis> Urthwhyte: correct, no result
nari has joined #ruby
<hunterloftis> I'm wondering if maybe it's installed, but not in my PATH
<Urthwhyte> I generally don't use my distro's packages for ruby/python
<Urthwhyte> if they were installed with your package manager thougj, I'd be very surprised for them not to be on the path
scwh has joined #ruby
nonotza has joined #ruby
syamajala has joined #ruby
freejohn has joined #ruby
bryricker has joined #ruby
bryricker has joined #ruby
csavola has joined #ruby
ghvandoorn has joined #ruby
AndChat| has joined #ruby
ed_hz_ has joined #ruby
adeponte has joined #ruby
ghosTM55 has joined #ruby
i8igmac has joined #ruby
qos has joined #ruby
shadoi has joined #ruby
Natch has joined #ruby
kinderman has joined #ruby
kinderman has joined #ruby
Drewch has joined #ruby
eywu has joined #ruby
voodoofish430 has joined #ruby
nikhgupta has joined #ruby
PragCypher has joined #ruby
radic_ has joined #ruby
mbriggs has joined #ruby
chimkan has joined #ruby
nonotza has joined #ruby
brngardner has joined #ruby
Clordio_ has joined #ruby
tommyvyo has joined #ruby
kevinbond has joined #ruby
eywu has joined #ruby
RORgasm has joined #ruby
keymone has joined #ruby
echosystm has joined #ruby
<echosystm> how can i install rvm with xcode 4.3?
<echosystm> i cant find a definitive answer
Natch has joined #ruby
<swarley> so im just wondering
<swarley> random brain thought here
<swarley> is there a method that is called whenever an object has a method called?
nerdy_ has joined #ruby
io_syl has joined #ruby
<banisterfiend> swarley: no
<swarley> :[
<swarley> that would have been cool
<banisterfiend> echosystm: i didnt have to do anything special, it 'just worked' for me
<banisterfiend> swarley: you can decorate the methods post-hoc to provide that functionality
jgrevich has joined #ruby
<echosystm> banisterfiend: how did you get gcc then?
<echosystm> xcode 4.2 onward doesnt have it
<echosystm> 4.2 on only has LLVM stuff
<banisterfiend> echosystm: does it need gcc? cant ruby now build with llvm?
<banisterfiend> at least i had no problems, it just worked for me. I didnt look into it
<echosystm> ruby can if you set the compiler to clang, but most gems wont build
<echosystm> apparently
<banisterfiend> echosystm: try #rvm
SphericalCow has joined #ruby
Banistergalaxy has joined #ruby
gift has joined #ruby
iocor has joined #ruby
jmfcool has joined #ruby
looopy has joined #ruby
madh_ has joined #ruby
iamjarvo has joined #ruby
ed_hz_ has joined #ruby
lewis1711 has joined #ruby
pdtpatr1ck has joined #ruby
shtirlic has joined #ruby
eignerchris has joined #ruby
srnty has joined #ruby
<lewis1711> why does ruby let you define a function with variables that don't exist? why not raise an error? dynamic typing isn't an excuse
<deryl> err?
<lewis1711> def foo x; bar x end
<lewis1711> bar is undefined. I can still stick that in a file and it will run no problem. no errors. no warnings
<deryl> you're not doing anything with it. even C will let you define a variable (and thats what you're doing there) even if its never used. unless you turn on warnings (like -wall) in C you won't even know.
<deryl> until the first time you try to use it
<lewis1711> ...people use C without wall?
<SirFunk> Anyone use rbenv? Isn't it supposed to setup my gem path? so i can run gems that i've installed?
apok has joined #ruby
<Spaceghostc2c> lewis1711: I'm assuming you haven't even bothered to look at the -h flag.
<lewis1711> what -h flag. ruby --help mentions no -h flag
<Spaceghostc2c> lol
Natch has joined #ruby
<lewis1711> trying to use ruby -h file.rb just gives me the --help dialogue
<Spaceghostc2c> Have you considered trying it?
<Spaceghostc2c> Read and perhaps consider each possible flag.
<Spaceghostc2c> When I use straight up ruby, I always use this flag, think about it.
<lewis1711> what you mean -W2?
<Spaceghostc2c> Try.
<Spaceghostc2c> Learn for self
<Spaceghostc2c> Hehe, 'self'.
<shevy> -W[level] set warning level; 0=silence, 1=medium, 2=verbose (default)
<shevy> lewis1711 ruby is not C
<lewis1711> that completely fails to catch the error
<lewis1711> I'd already tried it
CannedCorn has joined #ruby
<shevy> if you want a language with compile time checking, go use C
<lewis1711> shevy: I know dynamic languages that will catch such a bug
<Spaceghostc2c> That's the point!
<lewis1711> racket for example
<shevy> that is no fucking bug, it's a fucking feature
<Spaceghostc2c> Then use racket!
<shevy> yes, do us all a favour and use racket
<lewis1711> that's a feature?
<Spaceghostc2c> lewis1711: Yeah, for those who're more used to pure OO, it's a feature.
<Spaceghostc2c> Shit's crazy up in hurr.
<lewis1711> Seriously educate me here. I've been using ruby on and off for about a year. and I still don't get how stuff like this is a feature. don't get all defensive I like the language
<shevy> I am not defensive, I am offensive. Go stop use ruby and use racket.
<Spaceghostc2c> lewis1711: How would you want it to react?
<Spaceghostc2c> Flip the fuck out because a variable doesn't exist?
<shevy> he wants ruby to break, just like C, the moment the parser sees something it can not make sense of
<Spaceghostc2c> You can use your exception handling.
<lewis1711> return an error when you try and run it
<Spaceghostc2c> lewis1711: Sounds stupid.
<shevy> use begin/rescue
<lewis1711> ...over the whole file? :/
<shevy> oh, I see, so your whole code stinks
<lewis1711> can you give me one situation where allowing this would be an advantage
<shevy> yes. over the whole file then :>
<Spaceghostc2c> When ruby is running, shit gets busy with objects PDQ
<Spaceghostc2c> lewis1711: Try metaprogramming.
<shevy> lazy evaluation for instance
davidcelis has joined #ruby
<Boohbah> lewis1711: method_missing
<Boohbah> check it out
<lewis1711> Boohbah: what's that supposed to be an example of?
<Boohbah> an example of why this is a feature and not a bug
eignerchris has joined #ruby
<shevy> use racket
rippa has joined #ruby
<lewis1711> cry more
<Boohbah> troll harder
<Boohbah> hehehe
<shevy> only if you dont use racket
<joltz> PDQ?
<Boohbah> QED
riyonuk has joined #ruby
<Spaceghostc2c> Pretty Damn Quick.
<lewis1711> I asked a simple question and you started ranting on about C
<deryl> lewis1711: quit being so fucking combative and assholish about it. try to figure out from what people are telling you WHY its done the way it is
<joltz> oh. here I thought it was something technical.
<Boohbah> ok everyone, feeding time is over
<shevy> well C is too hard for you
<deryl> Boohbah: awwww
<deryl> but i still have cookies left!
<riyonuk> Hey guys, newbie here. I'm trying to print everything in a hash, but just the keys. How would I do this? So far I can do everything. array.each = { |x| puts x }
<shevy> riyonuk one way: hash.keys.each
shosti has joined #ruby
<riyonuk> ahh
<riyonuk> I was trying hash.each.keys
<Spaceghostc2c> Next time look at the awesome documentation!
<shevy> you could also use .each_pair and omit the values
<lewis1711> why would I troll? this has just irritated me about ruby from day one, and I wanted to know if there was a way around it, and failing that, what the reason was. I was of course met with butthurt
<Spaceghostc2c> lewis1711: It's clearly a taste thing.
<Spaceghostc2c> As in, yours is wrong for ruby.
<lewis1711> the method missing sort of makes sense
<deryl> no, you met with attitude because you're being a dick about it
<lewis1711> but you'd have to define a method missing on what self is at the top level..
<shevy> lewis1711 have a look at the nimrod language: http://nimrod-code.org/
<shevy> you even get types in it
<shevy> for x in lines("myfile.txt"): if x =~ re"(\w+)=(.*)":
<Spaceghostc2c> lewis1711: I don't see what you're trying to fix.
<shevy> proc yes(question: string): bool = echo(question, " (y/n)")
<Spaceghostc2c> Mostly because nothing is broken.
<lewis1711> Spaceghostc2c: just the amount of runtime errors over silly things like this
<lewis1711> how do you deal with it? just accept the run time errors? srs question
<Spaceghostc2c> lewis1711: Sounds more like you're just not very ruby.
<shevy> odd, my 5000 .rb files all dont run according to lewis1711 ...
<Spaceghostc2c> Perhaps consider gisting your code instead of coming in here and complaining. I bet you it's your code and skill.
<rippa> what runtime errors?
<rippa> I missed the discussion
<shevy> he says every ruby file has thousand runtime errors
<Spaceghostc2c> rippa: There are none, there's just pebcak galore.
<lewis1711> shevy: I'd appreciate if you stopped talking about me. I said no such thing.
<lewis1711> Spaceghostc2c: will do
<shevy> well you wrote: "how do you deal with it? just accept the run time errors?" that implies that there are runtime errors, right?
<shevy> so from now on, we need to accept it. there are runtime errors EVERYWHERE
<lewis1711> now who's trolling :)
<Spaceghostc2c> Objects not existing aren't a problem, if they are, please go scrub the shit language you learned that from out of your mind. We'll be here for you. :d
<shevy> I am just exaggerating
<Spaceghostc2c> shevy: That's because not only can't ruby scale, it can't even run!
<shevy> hehe
<shevy> well, twitter says ruby does not scale once you are rich
<shevy> I am willing to test that theory when the money lures me too :)
<rippa> Indentation must not contain tabulators so the compiler always sees the code the same way as you do.
<rippa> I already like Nimrod
<riyonuk> correct me if I'm wrong, but the "good" thing to do is use {} for one liners, and do/end for multiple?
<lewis1711> Spaceghostc2c: is it possible that I like ruby in general but this just annoys me and I don't see how you work around it? I mean you can accept surely that while this is an advantage for some... reason I still don't understand, it also introduces more errors? that there's a trade off?
shosti has joined #ruby
<Spaceghostc2c> Probably because you're just trying to use concepts foreign to ruby inside ruby.
<lewis1711> riyonuk: be aware that they have different precedence
<riyonuk> Oh? Didn't know that. :/
<deryl> lewis1711: I got a great workaround. DON'T DECLARE UNUSED VARS!
<shevy> riyonuk well, this is more a convention for the most part. you can decide to not follow it. do/end does not have the same ... uhm... binding ... what was the word, priority or something like that. I think {} has higher priority than do/end so they are not 100% the same
shosti has joined #ruby
<shevy> oh right. precedence
<lewis1711> deryl: what if I typo? :)
<Spaceghostc2c> lewis1711: You should probably learn the nil guard.
<deryl> learn to spell?
<Spaceghostc2c> lewis1711: Why don't you write tests?
<Spaceghostc2c> That's the fucked up thing about this whole conversation.
<deryl> check your code? write tests? ect
<shevy> he cant THE CODE IS FULL WITH RUNTIME ERRORS
<shevy> every line -> runtime error
<Spaceghostc2c> "My code don't work, cause so many runtime errorz guise." Where are your tests?
<lewis1711> you write tests for every single method to make sure you don't mispell something?
<deryl> shevy: excuse me while I try not to spit coffee on my screen from laughing so hard
<shevy> dont do that
<rippa> lewis1711: yes
<shevy> you make a runtime error that way deryl
<deryl> hehe
<lewis1711> ...seriously?
<rippa> code should be 100% covered with tests
<shevy> actually a friend once spilled beer over a laptop, 3 keys stopped working afterwards :(
<deryl> doh!
<Spaceghostc2c> lewis1711: You haven't gisted any code, or told us about your tests.
<Spaceghostc2c> So you're honestly kind of wasting at least my time.
<shevy> tests lead to runtime errors
<shevy> so why write them :)
<Spaceghostc2c> shevy: Have to make sure you're getting the right runtime errors.
<Spaceghostc2c> obvs
<shevy> the only code to not lead to runtime errors is -> no code
yoklov has joined #ruby
<shevy> I misspell "def initialize" sometimes
<lewis1711> can I get a general consensus... you all right tests for every single method you right?
<wefawa> lewis1711: The error catched by strong typing, and compilers or those kind of things are errors of the kind "your program doesn't make sense". They are the first things that fail when you run the code... Even in those kind of languages you need to use lot's of tests to be sure your program works as expected... The thing is that if you do all those same tests in a language like ruby, you'll surely
<wefawa> catch most or all of the errors usualyl caught by compiler, and static typing, etc... So actually, if you do tests, you aren't losing anything by not having those kind of checks....
luckyruby has joined #ruby
<lewis1711> *write
<shevy> def intialize
<lewis1711> wefawa: that's a good point.
<deryl> or explained how you're running into runtime errors, nor showed a single one. nor explained hwo you can typo SO badly SO commonly that you throw that many errors, nor explained why you think its the language's fault you fuck up your spelling so often that you have THAT many 'runtime errors'
<shevy> lewis1711, no, I like my runtime errors, I want them
<Spaceghostc2c> deryl: He's wasting your time.
<lewis1711> deryl: calm down
<deryl> OH NOES! I typed hwo not how!
<Spaceghostc2c> Just as long as you're down with that.
<lewis1711> Spaceghostc2c: it's not a specific problem witha piece of code, it's a general pattern
<deryl> lewis1711: I asked a simple set of questions. answer them honestly or stfu
<lewis1711> it's a general question
<shevy> the runtime error pattern
<shevy> but really, try nimrod
<lewis1711> deryl: I must've missed it amongst all the trolling
<deryl> lewis1711: yeah you're doing pretty good with the trolling
<shevy> Tasser here is using it, so you have a rubyista who is also using it
<Spaceghostc2c> lewis1711: Sounds like you just have no fucking idea what you're doing. :D
<lewis1711> why would I troll here? I come here fairly often
jmuniz has joined #ruby
<Spaceghostc2c> You've found a comfy bridge to live under?
<shevy> the bridge breaks down
<deryl> then please to be answering my very simplistic questions
<shevy> too many runtime errors :(
<Boohbah> trolling is a good way to extract information
<deryl> here i'll even repeat
<Boohbah> if you do it right
<deryl> or explained how you're running into runtime errors, nor showed a single one. nor explained hwo you can typo SO badly SO commonly that you throw that many errors, nor explained why you think its the language's fault you fuck up your spelling so often that you have THAT many 'runtime errors'
<riyonuk> Where do you guys go for documentation? ruby-doc.org?
<Spaceghostc2c> Boohbah: No it isn't.
<Spaceghostc2c> How do you think it is? Huh. It isn't.
<deryl> there, think you can answer those?
<Spaceghostc2c> riyonuk: Do you want rdoc or yard?
<shevy> riyonuk, usually I play russian roulette with google, then I write things down locally
<riyonuk> No idea what that means.
<shevy> the official docs are ok
<Spaceghostc2c> Probably something worth educating yourself on.
<riyonuk> For example, I know you need to use the .each method, but I kinda want to learn more about it.
<deryl> riyonuk: I personally use ri
cha1tanya has joined #ruby
<shevy> yeah you kinda have to know where these things are
<shevy> googled with "enumerator each"
<riyonuk> ri? I'm guessing that's from the command line? :p
<deryl> but if you want more you can also run (locally) gem server and use your webbrowser to view the docs for each gem installed, and as for the language itself, you can use ruby-lang.org if you don't have them installed locally.
strife25 has joined #ruby
<shevy> wow
<deryl> if you are using RVM you can run: rvm docs generate all for the ruby you're using
<shevy> what is #peek ?
<shevy> never saw that one before
<lewis1711> deryl: perhaps you are a more accurate typist than me. congratulations. I never said it was the languages fault that I "fuck up", I questioned why the interpreter couldn't at least throw a warning. I generally run into run time errors when I have too many arguments in applied to a method or a mispelled word, and it frustrates me. I also tend not reply to angry rants when I've had two or three people here comment with actual helpfulness
<deryl> we don't install them usually because of space
<shevy> e.next # StopIteration: iteration reached at end
<Spaceghostc2c> lewis1711: Are you used to programming languages handling your typos? Are you also the sort who thinks tests are a waste of time?
<deryl> lewis1711: whatever. wasted enough time.
rohit has joined #ruby
<Spaceghostc2c> Cause you could have saved me the last half hour if you only knew how to use them.
<riyonuk> to_enum? I thought there was only to_s, to_f, and to_i?
<lewis1711> Spaceghostc2c: yes, and when i write tests I have no clue what I am testing them for
ascarter has joined #ruby
<deryl> ri Object.to_enum
<lewis1711> I barely write any however
<shevy> to_enum does not seem to be used as much as to_s or to_i
<Spaceghostc2c> lewis1711: You're just chock full of missing base knowledge!
<Spaceghostc2c> This is the core of your problem.
<deryl> hehe
<lewis1711> Spaceghostc2c: yeap, I won't deny that.
<Spaceghostc2c> So uh, why the fuck are you wasting our time instead of improving yourself and your understanding?
<lewis1711> anyway, I've got all the answers I needed. Next time I will come back with testcases, and you can all tell me if they suck or not or I am testing the wrong thing
<Spaceghostc2c> I mean, people write books on this, blogposts, they make screencasts.
<shevy> and they write runtime errors
<Spaceghostc2c> I don't always test, but when I do, it's to make sure I've got enough runtime errors.
ScottNYC has joined #ruby
<shevy> hehe
<lewis1711> ...you write tests to catch them.
<Spaceghostc2c> To produce them!
<shevy> I am testfree and runtime errors free
<Spaceghostc2c> See how little you know!
<shevy> but lewis wont believe me.
<shevy> he thinks my code is riddled with runtime errors :(
<lewis1711> shevy: show me your tests plz
<shevy> what tests
<Spaceghostc2c> shevy: Metabrogramming's main concept is the discrete introduction of eigen runtime errors.
<shevy> well it depends what you mean with tests of course too :)
<lewis1711> Spaceghostc2c: if talking to me is such a waste of time, i suggest stopping. it's clearly not doing much for your blood pressure
<deryl> nor your education methinks
<shevy> I usually test within if __FILE__ == $PROGRAM_NAME
<shevy> x.test
<shevy> and when I dont need it I comment it out
<Spaceghostc2c> shevy: I don't believe in using variables that aren't global.
CheeToS has joined #ruby
<Spaceghostc2c> Why wouldn't you want to reach your variables everywhere?
<shevy> hehe
<lewis1711> see I'm not even sure if that's a joke
maletor has joined #ruby
<shevy> lewis1711 of course it is. what if you have conflicting use of global variables?
<shevy> your code becomes unpredictable suddenly
<lewis1711> shevy: ...you'd write a test case for it?
<shevy> THOUSAND OF RUNTIME ERRORS
<lewis1711> (sorry..)
<shevy> no, that wont solve the problem
<Spaceghostc2c> ALL THE RUNTIME ERRORS!
<Spaceghostc2c> The lovely errors!
<joltz> Spaceghostc2c, man I miss that show.
<Spaceghostc2c> joltz: I have every all of it.
<joltz> also the brak show.
<lewis1711> I was told freezing objects was bad form a couple of times here
<shevy> freeze is totally useless
<shevy> it's like throwing the object away
<Spaceghostc2c> lewis1711: You're bringing up vague and rather lulzy 'issues'
<Spaceghostc2c> shevy: It doesn't make more runtime errors that way.
<lewis1711> Spaceghostc2c: get over the fact I'm not trolling. you're being childish.
<shevy> lol
<Spaceghostc2c> Thusly, useless.
<shevy> lewis1711, that is so vague what you write
<shevy> from now on you should remember the REASONS
<Spaceghostc2c> lewis1711: Please, you really think that your questions are anywhere near what anyone here would call intelligible? Get real.
ehqhvm has joined #ruby
<lewis1711> Spaceghostc2c: I do
<shevy> " freezing objects was bad form" <-- useless way to remember it
<Spaceghostc2c> "I have issues, why does this happen? No code though, no context, no real data, just concept."
<Spaceghostc2c> lewis1711: You would.
<shevy> remember instead: .freeze renders the object totally USELESS
<lewis1711> have you heard of abstraction?
<shevy> ok that's it, I am outta here
<Spaceghostc2c> lewis1711: Didn't know abstraction had anything to do with effective communication, but I'm sure you're the very top in that field, right?
<Spaceghostc2c> shevy: Tell me, sir. Do you like runtime errors?
ehqhvm has quit [#ruby]
<Spaceghostc2c> Whenever I'm feeling emo, I just #freeze my objects. No runtime errors that way.
thecreators has joined #ruby
<deryl> i'm king of speaking conceptually to people in here yet I manage to put a CRAPLOAD more meat into my questions that you have. AND when I have issues on the level you're stating you're having you've moved past conceptualization into actual CODE. Which means you have something to gist, something to share, something to show, something that proves your point.. like all the rest of us usually do.
<lewis1711> Spaceghostc2c: I don't particularly think you're a good example of good communication, seeing as how you respond with sarcasm and hostility
<deryl> so try doing that instead of talking half assed
<Spaceghostc2c> lewis1711: Usually when people are intentionally not helping us help them, yeah.
<Spaceghostc2c> Where's your code for that original problem, eh?
<deryl> most of us are like taht
<scientes> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- readline (LoadError)
<scientes> -rwxr-xr-x 1 root root 19568 Mar 27 16:09 /usr/lib64/ruby/1.8/x86_64-linux/readline.so*
<deryl> show us SOMETHING (and not some contrived falsey bullshit)
<scientes> how do i get past this lib64 issue?
<scientes> its a centos/rhel thing
<Spaceghostc2c> Crap, I saw that issue pop up earlier.
<scientes> and fedora too
ScottNYC has joined #ruby
<deryl> scientes: oo oo see if mpapis is still up. he's got the solution to that
<Spaceghostc2c> ^
<deryl> he opened up a ticket for that
<deryl> crap let me see if i saved the url for it
* scientes personally like's debians no-special-casing thing
<scientes> and ruby of course is already dealing with that issue, by using the multiarch thing there
<riyonuk> Okay. Who here thinks they can explain symbols (:this) to someone that's pretty slow when it comes to programming? :p
<deryl> scientes: is this it? http://www.ruby-forum.com/topic/3937046
<riyonuk> From my findings, you can't assign things to it, and you can't really...do anything with it. But from Google, it's just the name of something? What?
<deryl> scientes: https://bugs.ruby-lang.org/issues/6207 is the related one i was thinking of
<scientes> deryl, that sounds like the proble, this was with centos 6.2 packages
<deryl> ok, yeah then its a known issue that was filed by michal. still open. filed 2d ago
<lewis1711> If anyone can recommend good resources on what to think about when writing tests, I'd be much obliged. I can find plenty of guides on *how* to do it, but not what things to test for, best practices etc
<rippa> riyonuk: symbols are interned strings
<riyonuk> interned? what does that mean?
<deryl> think thats the OS he found it on as well. I can ask him specifically in the morning
<scientes> couldn't ruby somhow manage to use normal /usr/lib/ with the lib64 os's, as they use multiarch pathnames for compiled stuff??
<scientes> or does rpm/yum not allow the flexibility to do that correctly?
<scientes> i guess ill just copy that x86_64 dir for now
<deryl> no no its that it hits lib not lib64 so unless lib64 is symlinked to lib it doesn't pick the 64bit libs
<scientes> yeah thats what i said--install to /usr/lib/, NOT lib64
<scientes> because ruby can handle multiarch properly and doesn't need the lib64 kludge
<scientes> right?
<scientes> maybe not, havn't tried to multi-install in multi-arch debian/ubuntu
<deryl> neither have i so i don't have an answer to that
nerdy_ has joined #ruby
<scientes> but i think that would be the proper way to handle it, all arch-specific stuff in that x86 dir
<scientes> now, debian/ubuntu multiarch uses a triplet, so its "x86_64-linux-gnu"
<scientes> and it would have to be seperated into the arch-independant package, and shared compiled libraries
<scientes> cause two packages cant have the same files, and be installed at the same time
jarred_ has joined #ruby
lewis1711 has quit [#ruby]
codezombie has joined #ruby
<deryl> well they could just the 2nd would overwrite the 1st. which would screw the pkg manifests but it could be done (especially if people do the --force which so many seem want to do for some reason)
queenlua has joined #ruby
* scientes doesn't use --force
<scientes> except when i have installed 32-bit packages on non-multiarch, but that is over
mikeric has joined #ruby
<deryl> ok wtf is up here. nokogiri *refuses* to see neither the system libxml nor the rvm pkg install.
<davidcelis> deryl: lolkogiri
<scientes> RedCloth (4.1.9)
<scientes> /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:268:in `==':NoMethodError: undefined method `name' for "RedCloth":String
<scientes> (and yes, ancient rails)
gokul has joined #ruby
<any-key> meh, I work on that version
<deryl> screw it. too tired to go banging on this tonight. i'll figur eit out in the morning
<deryl> any-key: still ancient
<scientes> ahh, could be another lib64 problem
<any-key> well, when your app is 5 years old and pretty huge the rails 3 upgrade is not worth it at all
<any-key> maybe some day, but not for a while
<scientes> if you are doing active development....errrrr
lewis1711 has joined #ruby
<scientes> anyways, we are migrating to a new server
<any-key> why should I spend several months migrating this codebase?
<scientes> i should shut up, it isn't even really my thing
robbyoconnor has joined #ruby
<scientes> LoadError: /home/om/.gem/ruby/1.8/gems/RedCloth-4.1.9/lib/redcloth_scan.so: wrong ELF class: ELFCLASS32 - /home/om/.gem/ruby/1.8/gems/RedCloth-4.1.9/lib/redcloth_scan.so
<scientes> ahh ffffff
<scientes> thats the problem
<Spaceghostc2c> any-key: Does your app run on 1.9?
Morkel has joined #ruby
<any-key> yes
<any-key> 1.9.2, it would only take a few minor tweaks for 1.9.3 but currently effort is being put on switching to JRuby for production
<Spaceghostc2c> YAY!
Morkel has joined #ruby
<any-key> see? not so bad
Natch has joined #ruby
<Spaceghostc2c> And you don't need support with your rails app? I'd worry about that part a bit.
<any-key> hmm?
<any-key> what do you mean by support?
helpa has joined #ruby
<helpa> I AM HAIKU BOT / REMINDING YOU TO TAKE RAILS / TO #RUBYONRAILS
helpa has quit [#ruby]
io_syl has joined #ruby
<any-key> haha
sirdeiu has joined #ruby
aces1up has joined #ruby
<Spaceghostc2c> Damnit celis.
<davidcelis> ¯\_(ツ)_/¯
<Spaceghostc2c> any-key: Um, when a project moves forwards, older versions tend to lose security fix privileges.
krz has joined #ruby
<any-key> we'll be transitioning eventually; that's not my decision to make
sirdeiu has joined #ruby
brianpWins has joined #ruby
lewis17111 has joined #ruby
startling has joined #ruby
<Spaceghostc2c> any-key: Just make sure it's on your radar. :D
robbyoconnor has joined #ruby
sleetdrop has joined #ruby
weasels has joined #ruby
Morkel has joined #ruby
burgestrand has joined #ruby
adamn_yyc has joined #ruby
yxhuvud has joined #ruby
bglusman has joined #ruby
gianlucadv has joined #ruby
Morkel has joined #ruby
RORgasm has joined #ruby
Banistergalaxy has joined #ruby
Morkel has joined #ruby
a_a_g has joined #ruby
savage- has joined #ruby
pygmael has joined #ruby
Natch has joined #ruby
JohnBat26 has joined #ruby
<pygmael> does anyone have a good example of a gem that monkeypatches another gem?
<pygmael> like legit monkeypatching, no railtie stuff
JohnBat26 has joined #ruby
<banisterfiend> pygmael: pry-nav monkeypatches pry
wallerdev has joined #ruby
<pygmael> excellent, thank you
<pygmael> so is putting your monkeypatched classes in lib/<your-lib>/<patched-lib>_ext.rb the standard way to do it?
philips has joined #ruby
two- has joined #ruby
ABK has joined #ruby
visof has joined #ruby
scwh has joined #ruby
bryricker1 has joined #ruby
bryricker1 has quit [#ruby]
sonkei has joined #ruby
rushed has joined #ruby
scwh has joined #ruby
x0F__ has joined #ruby
arturaz has joined #ruby
djdb has joined #ruby
lewis17111 has quit [#ruby]
Natch has joined #ruby
icy` has joined #ruby
tonini has joined #ruby
shruggar has joined #ruby
tijmencc has joined #ruby
abstrusenick has joined #ruby
keymone has joined #ruby
tewecske has joined #ruby
voodoofish430 has joined #ruby
abstrusenick has joined #ruby
ABK has joined #ruby
ph^ has joined #ruby
scalebyte has joined #ruby
<scalebyte> anybody wanna try a hack test, go for it -> https://gist.github.com/2234272 here's the challenge good luck :)
<scalebyte> shevy: Hai mate
Natch has joined #ruby
<banisterfiend> scalebyte: rm -rf scalebyte
<scalebyte> banisterfiend: why mate ?
emmanuelux has joined #ruby
<banisterfiend> scalebyte: cos it's inappropriate for anyone except australians and new zealanders to use 'mate' :)
<scalebyte> banisterfiend: ok sorry no offense... I will now start using the term "Friend". Hope you are fine with that :)
dkannan has joined #ruby
c0rn has joined #ruby
<banisterfiend> scalebyte: say 'babe'
<scalebyte> banisterfiend: babe you wanna try a hack challenge ? Prove the AUS mettle go for it -> https://gist.github.com/2234272
Eartz has joined #ruby
<scalebyte> banisterfiend: I hope ypu from down under (AUS/NZ)
<banisterfiend> scalebyte: do you want to do my coding challenege
<scalebyte> banisterfiend: I will love to try :)
<banisterfiend> scalebyte: are you familiar with fourier analysis?
schovi has joined #ruby
<scalebyte> banisterfiend: pretty much but not worked with too much
<banisterfiend> scalebyte: prove this: e^(x * i) = cos(x) + i.sin(x)
a_a_g has joined #ruby
<scalebyte> banisterfiend: theoritically or programatically ?
<banisterfiend> scalebyte: derive it mathematically ;)
cha1tanya has joined #ruby
db81 has joined #ruby
db81 has quit [#ruby]
rtdp has joined #ruby
zommi has joined #ruby
tijmencc has joined #ruby
d3c has joined #ruby
<scalebyte> banisterfiend: will take time :) long time since I refreshed my math knowledge :)
<scalebyte> banisterfiend: sinx + cosx = 0
<scalebyte> banisterfiend: (sinx + cosx) ^2 = 0
mxweas has joined #ruby
<scalebyte> banisterfiend: (sinx)^2 + 2sinxcosx + (cosx)^2 = 0
<scalebyte> banisterfiend: 1 + 2sinxcosx = 0 1 + sin(2x) = 0 sin(2x) = -1
<banisterfiend> scalebyte: im just trolling you :)
<scalebyte> banisterfiend: hmmm.. good luck to you with that :D
<scalebyte> banisterfiend: The hack challenge I offered you was easy considering the one you gave me (A math challenge to a budding programmer ) :)
InBar has joined #ruby
ephemerian has joined #ruby
lobolars has joined #ruby
abstrusenick has joined #ruby
fixl has joined #ruby
abstrusenick has joined #ruby
two- has joined #ruby
Banistergalaxy has joined #ruby
blacktulip has joined #ruby
baroquebobcat has joined #ruby
Maxou56800 has joined #ruby
artm has joined #ruby
sdeobald_ has joined #ruby
_null has joined #ruby
_null has joined #ruby
<artm> and the author compares Foo = Struct ... do ... end and Foo < Struct ... end
<artm> and sais "When using inheritance like this you are wasting resources (a class in this case)..."
<artm> I'm not sure I get it
<artm> how is a class resource "wasted" by inheritance?
<banisterfiend> artm: it's not
<artm> now I have to opinions to chose from. wonderful.
<artm> internet is not my friend :)
<banisterfiend> artm: where does he say that in the article?
Houdini has joined #ruby
<banisterfiend> oh found it
<artm> he recommends some undocumented feature vs something I was going to do
<artm> (inheritance)
carloshpf has joined #ruby
<artm> and I'm trying to understand his logick
mafolz has joined #ruby
<banisterfiend> artm: you're not wasting shit
<banisterfiend> it just sets the superclass pointer
<banisterfiend> the class already exists, so nothing is being wasted or even allocated
schovi has joined #ruby
<artm> ok. I'll subclass then. I'll blame you in the comments, ok? :-p
<banisterfiend> artm: the second example is also superior in that it uses the regular 'class' syntax for defining what is a class, rather than weird block syntax
<banisterfiend> that has some quirks and edge cases related to constant lookup
twqla has joined #ruby
akem has joined #ruby
RORgasm has joined #ruby
knopkodav has joined #ruby
mkutub has joined #ruby
<mkutub> hi
crazed has joined #ruby
swarley has joined #ruby
vjacob has joined #ruby
kevinbond has joined #ruby
akem has joined #ruby
nikhgupta has joined #ruby
LMolr has joined #ruby
davidcelis has joined #ruby
ukwiz has joined #ruby
<artm> when monkey-patching an existing method, super refers to the original?
<banisterfiend> artm: no
<banisterfiend> that's only when you override the method
<banisterfiend> to refer to the original in a monkeypatching scenario you have to use the alias_method trick
mdw has joined #ruby
<artm> ah, thanks.
shruggar has joined #ruby
baroquebobcat has joined #ruby
mengu has joined #ruby
sejo has joined #ruby
Helius has joined #ruby
becom33 has joined #ruby
<becom33> I'm having a little problem with regex
<becom33> I want to get content bitween <sa>somthinghere</sa> . but I cant get the regex for that ? help please
jlebrech has joined #ruby
* becom33 anyone ?
eldariof has joined #ruby
abstrusenick has joined #ruby
simao has joined #ruby
Dariakus has joined #ruby
eka has joined #ruby
Prezioso has joined #ruby
nikhil_ has joined #ruby
apeiros_ has joined #ruby
trivol has joined #ruby
a_a_g has joined #ruby
mdw has joined #ruby
pi3r has joined #ruby
masolino has joined #ruby
robotmay has joined #ruby
jds has joined #ruby
Dariakus was kicked from #ruby by apeiros_ [Dariakus]
roolo has joined #ruby
zaydana has joined #ruby
workmad3 has joined #ruby
zaydana has joined #ruby
<scalebyte> becom33: try rubular
looopy has joined #ruby
Ferdev has joined #ruby
gianlucadv has joined #ruby
BiHi has joined #ruby
etehtsea has joined #ruby
eka has joined #ruby
c0rn has joined #ruby
tatsuya_o has joined #ruby
francisfish has joined #ruby
scientes has joined #ruby
gianlucadv has joined #ruby
LMolr has joined #ruby
bier has joined #ruby
twinturbo has joined #ruby
daglees has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
gregorg_taf has joined #ruby
rohit has joined #ruby
ringotwo has joined #ruby
srnty_ has joined #ruby
diegok has joined #ruby
Maxou56800 has joined #ruby
wereHamster has joined #ruby
wereHamster has joined #ruby
falena has joined #ruby
DuoSRX has joined #ruby
Prezioso has joined #ruby
d3vic3 has joined #ruby
cocoadaemon has joined #ruby
<cocoadaemon> ola all. I've installed the whois gem, but it's not showing in the gem list and it's not loading. Installed other gem and it worked. The whois gem is in the gem folder. One gem install only, checked. How can I backtrack the problem?
pp01bit has joined #ruby
<cocoadaemon> help appreciated. virtual cookies delivered to your door by ninja squirrels.
srnty has joined #ruby
<bubu> /bin/bash -l -c 'cd /mnt/hd2/opt/kachng/inhousetest/releases/20120328165546 && ruby script/rails runner -e production '\''POSLog.post_pos_log_transactions'\'''
stefanp has joined #ruby
stefanp has joined #ruby
<bubu> spikes my CPU usage to 100% - any ideas?
<Tasser> it's doing something
<keymone> it's posting pos log transactions
<bubu> yeh but no matter how many transactions - it spikes cpu
<bubu> because it has to load the whole ruby env i think
<bubu> not sure if there is a better way to use the whenever gem
<keymone> start eliminating parts of your env and see what eats most cputime
<bubu> how could i do that keymone ? :/
<bubu> im not a ruby dev
<keymone> you're screwed then
<bubu> thx
gift has joined #ruby
francisfish has joined #ruby
BiHi has joined #ruby
<shevy> cocoadaemon can I hire a ninja squirrel?
<cocoadaemon> shevy: depends. Help me, I'll ask them to get in touch with you ;)
Squarepy has joined #ruby
<shevy> never tried the whois gem
<shevy> if other gems work fine, there may be a chance that the author of the whois gem was an idiot
IPGlider has joined #ruby
replore has joined #ruby
<cocoadaemon> ok, but isn't there a verbose way to know why the gem is not listed
RORgasm has joined #ruby
<cocoadaemon> i feel it's a requirement not matching or something like that (if that makes sense)
<shevy> well it should show up in "gem list"
<cocoadaemon> yes, it should
<shevy> an installed gem will always appear in gem list irrelevant of unmatched dependencies
<cocoadaemon> ah, ok
<shevy> going to install this whois gem
<cocoadaemon> mmm
<shevy> Fetching: whois-2.4.0.gem (100%)
<shevy> Successfully installed whois-2.4.0
<shevy> 1 gem installed
<shevy> Installing ri documentation for whois-2.4.0...
<shevy> *twiddle thumbs*
<shevy> this always takes 500% longer than the rest
<shevy> screw ri
<TTilus> shevy: don't forget --no-ri
<shevy> hmm to gem? as in
<shevy> gem --no-ri ?
<shevy> cocoadaemon "gem list" shows the whois gem now
araujo has joined #ruby
araujo has joined #ruby
<shevy> require 'whois' # => true
<cocoadaemon> damn
<TTilus> shevy: exactly
<shevy> cocoadaemon where is your gem folder btw ;)
mcwise has joined #ruby
<shevy> TTilus ok, will try that
srnty has joined #ruby
<cocoadaemon> /var/lib/gems/1.8/gems
<cocoadaemon> containing a whois-2.4.0 directory
<shevy> that sounds as if you poor soul are on debian
chimkan_ has joined #ruby
<shevy> my gems are at /usr/lib/ruby/gems/1.8/cache/
<shevy> well, or /usr/lib/ruby/gems/1.8/gems/
<shevy> but the .gem files are all backed up at /usr/lib/ruby/gems/1.8/cache/ anyway, so I look there first usually
<cocoadaemon> yes ubuntu on an ARM netbook ;)
<shevy> poor man :(
<cocoadaemon> no choice: only distro available
<cocoadaemon> yeah, well, poor man if you will, but still a better love story than android
zxiest has joined #ruby
<zxiest> Hello :-)
<shevy> cocoadaemon sure, the king of the hill stands taller than the common peons do :)
<shevy> but compared to the mountains of himalaya, the king is still a dwarf!
<zxiest> Do you guys know how to do "unimplemented" steps with rspec2 ?
<shevy> debian is known for its wicked black vodoo magic to break ruby
Banistergalaxy has joined #ruby
<cocoadaemon> drat
<banisterfiend> shevy: do you agree with this: "Ruby aside, pry alone makes everything else look lame. Ruby makes pry possible! :D"
ggherdov has joined #ruby
<shevy> banisterfiend with the general notion yes
<shevy> I still think that pry should replace irb :>
<banisterfiend> haha
<shevy> and i also want my squeak like IDE in ruby
<shevy> but the older I get, the less ambitious I become
srnty has joined #ruby
<shevy> my only hope is the younger generation
gtuckerkellogg has joined #ruby
<fabrice31> scuse me, but what are the benefits of pry ? I don't know what is it yet.
<banisterfiend> fabrice31: can you speak portugese
<fabrice31> banisterfiend: no :(
<banisterfiend> fabrice31: http://pry.github.com/screencasts.html
mkutub_1 has joined #ruby
<fabrice31> banisterfiend: I'll look that. Thanks ;)
srnty has joined #ruby
<shevy> fabrice31 you enter objects
<shevy> cd my_object
<shevy> ls
<shevy> there you go
<shevy> that's a completely different thinking pattern from when you use IRB alone
<ickmund> If I have an object obj with a variable objvar0, accessible with obj.objvar0, how can I access that given a variable i = 0? I mean like obj.objvar{i} or similar?
<shevy> and well you can do what irb does, in pry as well
<shevy> wat
<banisterfiend> ickmund: you mean a method not a variable?
<banisterfiend> ickmund: obj.send("objvar#{i}")
nikhgupta has quit [#ruby]
<fabrice31> shevy: I'm seeing that. I think I will try that this afternoon :)
mkutub_1 has quit [#ruby]
<ickmund> banisterfiend: I actually mean a variable
<banisterfiend> ickmund: well you cant access variables via obj.objvar so what u said doesnt make sense ;)
<banisterfiend> ickmund: it has to be a method, in which case use the code i gave above
<TTilus> ickmund: care to share the actual code?
<TTilus> ickmund: what you say does not really make much sense :(
<cocoadaemon> shevy: so you're sure gem list doesn't use specs for listing ?
<TTilus> ickmund: prolly an epic mixup with terminology or something...
<shevy> cocoadaemon I am not sure how gem list works or how a gem is registering itself how with it
<ickmund> It's a typical rails project (but I thought the question was ruby specific) with a model containing a bunch of similarily named variables I want to iterate over somehow
<cocoadaemon> k
<shevy> cocoadaemon all I know is that the whois gem installed for me here and that I dont have the problem you have, sorry cocoadaemon :)
<cocoadaemon> ok, thanks a lot
<TTilus> ickmund: ar model attributes have accessor methodes
<ickmund> But yea, my terminology is quite likely way off
<TTilus> ickmund: *methods
<shevy> I installed ruby from source into /usr prefix though, I think that often helps
<TTilus> ickmund: u r calling a method
<shevy> u r calling a mother!
Guest97939 has joined #ruby
<TTilus> ickmund: having a model with attributes like var0, var1, var2, ... really smells _bad_
<shevy> ickmund what annoys me is that you use numbers in method names
<ickmund> TTilus: Right, I see the errors of my way now. :)
<shevy> obj.objvar0 obj.objvar1 obj.objvar2 obj.objvar3
<TTilus> shevy: nono, motherfucking programmer!
<matti> LOL
<ickmund> The model is a keypad, I'm not using generic names here guys :)
<shevy> obj.objvar5
<rippa> I'd rather use an array then
<shevy> obj.objvar6
<rippa> keypad[0]
<shevy> :D
<rippa> keypad[6]
<TTilus> ickmund: why not provide the actual thing as an example
<rippa> or hash
<rippa> keypad[:enter]
<shevy> try to isolate the problem to the simplest question you can formulate
<zxiest> anybody using autotest ?
<ickmund> TTilus: No you were right, and I understand where I went wrong. I misunderstood the errors I was getting
<shevy> see, lately I learned that you have to do this when you want to define []=
<shevy> def []=(a,b)
<shevy> my brain is still not sure whether it likes it or not
bluOxigen has joined #ruby
<TTilus> shevy: def -@; ...; end is even more weird
<shevy> that one my brain has not understood yet
<TTilus> ickmund: do you _really_ have number postfixed var names?
<shevy> I really did not grok it yet :)
<shevy> it looks alien to me
<matti> -@?
<matti> LOL
<TTilus> ickmund: if you do, its pretty sure sign that you actually should have an association object instead of a bunc of attributes
<TTilus> matti: unary minus
<TTilus> class Foo; def -@; 1; end; end; -Foo.new # => 1
<ickmund> TTilus: I see your point and I was thinking about it. Might refactor like that later
Squarepy has joined #ruby
<matti> TTilus: Its this a 1.9 thing?
<banisterfiend> matti: no
<TTilus> ickmund: refactoring (and providing the old interface with delegator methods) is prolly way easier than building generic array-like access with .send("foo#{i}") hacks
gjaldon has joined #ruby
<matti> Um, I see.
<shevy> I still dont get -@
<shevy> what is the @ actually there?
<TTilus> matti: believe it or not, 1.8 has unary minus =D
<TTilus> shevy: dunno, ask matz
<shevy> hmm
<rippa> shevy: @ is yout object
<shevy> waaaah?
<banisterfiend> rippa: hey rippsy
<shevy> from where does it come?
<rippa> shevy: because why not
<rippa> banisterfiend: hi
<banisterfiend> rippa: what's up
<shevy> argh
<rippa> not much
visof_ has joined #ruby
<TTilus> shevy: -@ is totally specialcased thing, just like []= et.al.
<banisterfiend> rippa: do u have an android phone
<rippa> no
<matti> TTilus: As much as I appreciate the sarcasm ;p I was more about @ in the name of the function :)
<ickmund> TTilus: Thing is that since I know I'll always have a fixed amount of keys here, and I need to display all of them to the user in a form each time, I figured it'd be easier to add the attributes than to use an association object and provide methods to handle displaying the possible keys
<matti> TTilus: I did not know that it was even possible -- but then again, its Ruby ;p
<matti> TTilus: Ruby will make pigs fly.
<shevy> and then explode
<rippa> also, Struct
<ickmund> TTilus: And the only reason I iterate over them is to try to be DRY when building the form. Might be a stupid decision in itself
<matti> TTilus: And reason behind me going "ohhh" is because I had some code for 1.9 where somebody defined !~ methods, and these do not work in 1.8 :)
<TTilus> Ruby makes pigs fly (as runtime exceptions)
<matti> TTilus: There sould be "SpiderPig" runtime error.
<rippa> pigdog
cpruitt has joined #ruby
* artm is wondering what goes wrong here http://codepad.org/FpOJwNYq
<artm> (it shouldn't work yet, but i didn't expect it to fail like that)
baroquebobcat has joined #ruby
cpruitt has joined #ruby
venkatk_ has joined #ruby
<shevy> can I do conditional include?
<shevy> include Foo if Foo was not included yet
<rippa> sure why not
venkatk_ has joined #ruby
<banisterfiend> shevy: it doesnt (usually) make any difference if u include a module multiple times
gokul has joined #ruby
<banisterfiend> shevy: it just ignores subsequent includes (though not always in some cases)
<rippa> artm: somehow args is always empty
srnty has joined #ruby
sectionme has joined #ruby
<TTilus> artm: would it be the case, that Struct has special new, which does not work as one would expect with ruby
<artm> TTilus: it feels like that yes
<TTilus> artm: try deffing self.new instead of initialize
<TTilus> artm: dunno if there is a catch, but it might work out
<shevy> yeah just noticed that
<shevy> I was expecting an error or warning but none came
LMolr has joined #ruby
nikhil_ has joined #ruby
zxiest has quit [#ruby]
<artm> TTilus: thanks, i'll give it atry
<TTilus> artm: i already did, it seems to work
<artm> :) codepad rocks
<TTilus> oh, i didnt actually notice it was codepad =D
<TTilus> copy-pasted it to irb
<banisterfiend> TTilus: question for u
<TTilus> banisterfiend: where?
<banisterfiend> TTilus: when is the situation when `include` ing the same module into a class more than once can have an actual effect?
<banisterfiend> as opposed the second inclusion being ignored
Foxandxss has joined #ruby
srnty has joined #ruby
<TTilus> banisterfiend: module Mod; def self.included(base); puts 'foo'; end; end; class Foo; include Mod; include Mod; end
<TTilus> banisterfiend: what about it?
<banisterfiend> TTilus: without using the included() hook :)
<TTilus> banisterfiend: changing rules is unfair!!1
<banisterfiend> TTilus: no, because even using the included() hook has no real effect on the ancestor chain
<banisterfiend> im not interested in that
<banisterfiend> im interested in a change to the ancestor chain from multiple includes
<banisterfiend> of the same module :)
<TTilus> banisterfiend: you already ruled out included() being defined in the included module so i guess you'd also rule out overriding include() in the including class =D
<banisterfiend> TTilus: im not asking for any clever hacks
<banisterfiend> it's actually an interesting issue that arises from ruby naturally
<banisterfiend> you can illustrate it without weird hacks and tricks
<banisterfiend> TTilus: anyway the answer is if you subsequently include another module into the first
<banisterfiend> i.e
mdw has joined #ruby
<banisterfiend> module M; end; class C; include M; end module M; include N; end; class D; include M; end
<banisterfiend> D gets N in its ancestor chain too
<banisterfiend> but C does not :)
<TTilus> banisterfiend: true
<TTilus> banisterfiend: for a moment i thought the order or ancestor list might be subject to change on reinclude, but it wasnt
<TTilus> (tried it)
<banisterfiend> yeah
Ammar01 has joined #ruby
<TTilus> banisterfiend: hmm, you dont actually REinclude M in any class there
<banisterfiend> TTilus: ok, well reinclude it in C :)
mrwalker has joined #ruby
<TTilus> banisterfiend: hah, i misinterpreted rb_mod_append_features
tommyvyo has joined #ruby
<TTilus> banisterfiend: it sure does rb_include_module every time independent of the mod being previously included or not
<banisterfiend> TTilus: if you look at the details of the inner loop, it skips over modules that already exist in the ancestor chain
josephwilk has joined #ruby
<banisterfiend> TTilus: it would be stupid if it didnt ;)
d3vic3 has joined #ruby
dbgster has joined #ruby
albemuth has joined #ruby
A124 has joined #ruby
josephwi_ has joined #ruby
fermion has joined #ruby
keymone has joined #ruby
tommyvyo has joined #ruby
bjensen has joined #ruby
Rishi_ has joined #ruby
zetm has joined #ruby
TwoGunsAndADing has joined #ruby
nikhil_ has joined #ruby
shtirlic_ has joined #ruby
shtirlic_ has joined #ruby
ephemerian has joined #ruby
bawer has joined #ruby
nanderoo has joined #ruby
abstrusenick has joined #ruby
TwoGunsAndARuckR has joined #ruby
becom33 has joined #ruby
smeg has joined #ruby
<mfournier> I need to edit xml files but must keep comments and indentation after saving changes. Any suggestions which library does that ?
ScottNYC has joined #ruby
<Tasser> mfournier, nokogiri doesn't?
<Tasser> mfournier, and why do you need indentation?
<mfournier> Tasser: the need is to programmatically edit config files, which can also be manually edited by users.
* mfournier checking out nokogiri
mmokrysz has joined #ruby
mmokrysz has quit [#ruby]
<Tasser> mfournier, you could reindent the xml
BiHi has joined #ruby
strife25 has joined #ruby
<mfournier> Tasser: yes, this would be good enough. Any idea if <!-- --> comments would be kept on .to_xml ?
<Tasser> nope
<Tasser> no idea :-)
RORgasm has joined #ruby
<Tasser> mfournier, http://sprunge.us/YESE
<mfournier> Tasser: will test, thanks for the input :)
carlyle has joined #ruby
<mfournier> Tasser: cool, thanks ! :-)
poppiez has joined #ruby
<poppiez> I have a Rakefile where I want to include another .rb file. what's the way to do so? I'm doing something like this now http://pastie.org/3691222 but I think it sucks :D
pyreal has joined #ruby
d3vic3 has joined #ruby
scalebyte has joined #ruby
<scalebyte> are lambda and proc same ? I read somewhere that in proc the we can call a break and it will pass the value out unlike in lambda which will return the final value after the entire block is processed
albemuth has joined #ruby
<banisterfiend> scalebyte: no, they're not the same. But no, the difference you mentioned doesn't exist
jcromartie has joined #ruby
<scalebyte> banisterfiend: This cleared my doubt quite beautifully -> http://stackoverflow.com/questions/626/when-to-use-lambda-when-to-use-proc-new
Ferdev has joined #ruby
fr0gprince_mac has joined #ruby
iamjarvo has joined #ruby
davidpk has joined #ruby
banister_ has joined #ruby
havenn has joined #ruby
<apeiros_> somebody should have mentioned Proc.new (without a block) in that post
savr has joined #ruby
<savr> hi
chanakya- has joined #ruby
chanakya- has joined #ruby
kitsalami has joined #ruby
kitsalami has quit [#ruby]
<scalebyte> apeiros_: an interesting hack wanna give a try ? Here it is -> https://gist.github.com/2234272
lorandi has joined #ruby
fowl has joined #ruby
<apeiros_> scalebyte: I'm at work
<scalebyte> apeiros_: Sure.. carry on
<apeiros_> but should be easy to implement an O(n) solution
<fowl> all work and no play
chico has joined #ruby
LMolr has joined #ruby
`brendan has joined #ruby
<apeiros_> scalebyte: I've written an implementation
kleene has joined #ruby
Clordio_ has joined #ruby
visof has joined #ruby
Shrink has joined #ruby
g0bl1n has joined #ruby
simpleharmonicmo has joined #ruby
<shevy> hey
<shevy> did ruby eve work on dos? does anyone know?
<shevy> *ever
twinturbo_ has joined #ruby
<becom33> does any of you have a script for when I add a domain like example.com it check if it has http and www in it if not add them ?
<shevy> no
<fowl> becom33, use regex
<shevy> but that is like one line of ruby code
<shevy> string = "example.com"
<shevy> string[0,0] = 'http://www' unless string[0, 'http://www'.size] == 'http://www'
<shevy> forgot a '.'
<shevy> but you get the idea
<robert_> hai shevy :D
<shevy> I think .start_with also works, or however was the name
<shevy> hai robert_ !
<robert_> how goes it?
<shevy> robert_ I will never again do a full rewrite of anything I wrote
<fowl> shevy, you probably didnt try it
<becom33> shevy: Im still confused
<shevy> becom33 open irb
<robert_> shevy: lmao. what happened?
<fowl> lolol nvm it works
<shevy> robert_ well, I am still at like 20% rewrite status... and I dont want to rewrite the rest
<shevy> but it is a problem, because it worked BETTER before the rewrite :(
<robert_> shevy: ouch. I'm done with my rewrite.. mostly.
<shevy> even though the code sucked
<shevy> lucky you
<robert_> aha.
<robert_> yeah.
<shevy> I hate you now :P
<robert_> though it took me two weeks to get this far, so. :P
gtuckerkellogg has joined #ruby
latrommi has joined #ruby
Nss has joined #ruby
bier has joined #ruby
choffstein has joined #ruby
<becom33> shevy: on ur script you've checked if http://www is there if not you have added them right ? but I wanan check if http is there if not add and if www is add it
<shevy> becom33 where is the problem man
<scalebyte> apeiros_: where is the implementation ?
<shevy> string[0,0] = 'http://www' unless string.include 'www'
<shevy> there becom33 ^^^
<apeiros_> scalebyte: show me yours, I show you mine
<shevy> oops
<shevy> .include?
<shevy> apeiros_ yeah SHOW US!
<shevy> time to compare "implementation details"
<scalebyte> apeiros_: I am working on it
sectionme has joined #ruby
<shevy> ewww
<shevy> kinky!
<scalebyte> shevy: ||
<shevy> becom33 basically just assemble your string the way you need it to be
<fowl> becom33, ruby is an awesome. you said what you want, "if http:// isn't there add it, if www. isn't there, add it" can be translated almost directly to ruby
<shevy> yeah
<fowl> becom33, read this http://www.rubycentral.com/pickaxe/
<shevy> becom33, this is basic "ruby thinking"
<shevy> you decide in your brain what you need
<fowl> o wait is that the old version
<shevy> then you translate this intermediate into real ruby code
ScottNYC has joined #ruby
centipedefarmer has joined #ruby
Progster has joined #ruby
Beoran_ has joined #ruby
Apocalypse has joined #ruby
fbernier has joined #ruby
vandemar has joined #ruby
Progster has joined #ruby
Progster has joined #ruby
n1x has joined #ruby
td123 has joined #ruby
waxjar has joined #ruby
<becom33> shevy: I was confued I wasnt sure how your logic is gonna help me. well I got what you did there . well its much easire if you look at this http://pastebin.com/xrKaRuGH
n1x has joined #ruby
mcwise has joined #ruby
_kW has joined #ruby
linoj has joined #ruby
Morkel has joined #ruby
dql has joined #ruby
dv310p3r has joined #ruby
workmad3 has joined #ruby
mdw has joined #ruby
rohit has joined #ruby
<fbernier> fonction detat
ascarter_ has joined #ruby
fr0gprince_mac has joined #ruby
thecreators has joined #ruby
yoklov has joined #ruby
fmcgeough has joined #ruby
pu22l3r has joined #ruby
<shevy> becom33 zeah, that does not change the string though
<shevy> but if zou onlz need the result anyway, then that works
tvw has joined #ruby
rbanffy has joined #ruby
<fowl> wow
fowl has quit ["Leaving"]
royvandermeij has joined #ruby
<royvandermeij> hey guys, i'd like to make some core extensions which are only available in my own module
gianlucadv has joined #ruby
abstrusenick has joined #ruby
<royvandermeij> but I have no idea how to do that
<royvandermeij> it's for a gem and I don't want to interfere with other gems with my core extensions
<banisterfiend> royvandermeij: too bad i guess :)
<royvandermeij> hmm I see ruby 2.0 gets the refine method to do exactly what I want
fayimora has joined #ruby
choi0hun has joined #ruby
Ferdev_ has joined #ruby
rtdp has joined #ruby
choffstein has joined #ruby
dbgster has joined #ruby
<shevy> yeah my keyboard was confused
liluo has joined #ruby
badelat_ has joined #ruby
MrGando has joined #ruby
theRoUS has joined #ruby
luckyruby has joined #ruby
banister_ has joined #ruby
<workmad3> royvandermeij: you'd need to extend instances that you create and need to have your extra functionality, or create proxies for then that wrap them with your extra functionality that you use internally
<workmad3> royvandermeij: but until ruby 2.0 becomes widespread, you won't be able to extend core itslef in the controlled way you want
drake10 has joined #ruby
dv310p3r has joined #ruby
<royvandermeij> workmad3: that would be my last resort, but then you can't do just "bla".do_stuff
<workmad3> royvandermeij: indeed you can't
<royvandermeij> all right, thanks for the heads up :)
<workmad3> royvandermeij: you'd need to do "bla".extend(MyStuff).do_stuff instead ;)
AxonetBE has joined #ruby
Natch has joined #ruby
<AxonetBE> sometimes the map method fails because my object is nil, how can I fix this? https://gist.github.com/2237488
virunga has joined #ruby
RORgasm has joined #ruby
albemuth has joined #ruby
bbttxu has joined #ruby
bbttxu has joined #ruby
phantasm66 has joined #ruby
falena has joined #ruby
fearoffish has joined #ruby
Shrink has joined #ruby
sectionme has joined #ruby
delinquentme has joined #ruby
nari has joined #ruby
<delinquentme> hey all when it comes to class instances and using classes in your code ... at what point does it become ... necessary? I'm coming at this from rails .. and im about to sit down and rework a bunch of code and considering if I need to build it with classes and class instances
Drewch has joined #ruby
<delinquentme> basically I'm wondering the benefits of the practice ... specifically as it pertains to storage of that classes values
<banister_> delinquentme: how did u built it before?
dlilol has joined #ruby
<delinquentme> banister_, just using variables ( not instance vars ) and just saving them then overwriting on each iteration
<delinquentme> no new classes
<delinquentme> a few methods
geekbri has joined #ruby
<banister_> not really sure what you're talking about tbh maybe u should ask on #rubyonrails
<delinquentme> banister_, i think this is more of a ruby question as it pertains to proper ways to use classes and class instances
<banister_> delinquentme: but really if you're programming in a procedural way in an OO language
<delinquentme> where its not quite about rails idioms
<banister_> delinquentme: then you need to read a book on OOP :D
grafthez has joined #ruby
<delinquentme> banister_, got a more efficient option?
<banister_> delinquentme: i think it's more of a general OO question than a ruby question, and you normally get a basic handle on OOP through a book IMO
<delinquentme> rtfm == long and PITA
<banister_> some things you need to read about to get an understanding of the theory
<delinquentme> yeahh i need like OOP for nubs in 2 pages
<delinquentme> have any references sub 10 pages?
<banister_> delinquentme: well, i gues smost people here did a degree in computer science, so we spent 3-4 years rtfm :)
<delinquentme> yeahhh im sorry for those people :D
<delinquentme> im sure they know more than I do
<delinquentme> but im the kid after lifes TLDR
<grafthez> hey. I'm trying to grasp object model in ruby and gettin confused. I create class like: class Sample; def hello; puts "hello" end; end
<banister_> delinquentme: start with the wikipedia page on object oriented programming
<grafthez> now where is hello method stored?
lateau has joined #ruby
<grafthez> in Sample? in Sample.class
<grafthez> ?
<banister_> grafthez: in Sample
<grafthez> I'm doing Sample.methods.sort and can't see it there
<banister_> grafthez: Sample.instance_methods.sort
<delinquentme> banister_, I declare you a outstanding programmer.
<delinquentme> cream of the effing crop.
apok has joined #ruby
<banister_> delinquentme: wtf are you talking about
<delinquentme> banister_, i was being sincere .. most ppl old-man out when i say the shit i said
<banister_> grafthez: Sample.methods returns the list of class methods
<any-key> dood accept the award
<delinquentme> ^
<delinquentme> =]
<delinquentme> you didn't say "back in my day" so you win
<grafthez> ok, that sounds reasonable :)
<grafthez> thanks
<grafthez> I'm moving forward :)
mrwalker has joined #ruby
* any-key moonwalks backwards
NeV3rKilL has joined #ruby
<mcwise> n1 any-key
netrealm has joined #ruby
shosti has joined #ruby
kpshek has joined #ruby
<delinquentme> it seems misleading that its called "the gang of four" http://en.wikipedia.org/wiki/Object-oriented_programming#Design_patterns when there are 3 listed?
d3vic3 has joined #ruby
Norrin has joined #ruby
carlyle has joined #ruby
chson has joined #ruby
Helius has joined #ruby
<delinquentme> ruby modules ... do they contain classes?
<any-key> they can
<any-key> but they don't have to
<delinquentme> ok awesome
<any-key> a module can contain whathaveyou
<delinquentme> i was asked to compare modules and classes
<apeiros_> scalebyte: got your solution yet?
<apeiros_> delinquentme: job interview?
<scalebyte> apeiros_: no Now I am working.. give me your answer Leme have a look
<delinquentme> i said you can instantiate classes and theyll have associated methods ... but modules can contain classes and might contain classes
<delinquentme> apeiros_, correct!
<apeiros_> scalebyte: I'm here quite often, just ping me
<delinquentme> learned the apprope usage of 'monkey patching'
io_syl has joined #ruby
fr0gprince_mac has joined #ruby
<scalebyte> apeiros_: I am pinging you now !! :)
<apeiros_> delinquentme: good question, might use that one myself for job interviews
bwlang has joined #ruby
CannedCorn has joined #ruby
<apeiros_> delinquentme: note that Class subclasses Module
<apeiros_> and that Class can serve as namespace just the same as a module can
<delinquentme> namespace
<delinquentme> that was something I didn't know
<delinquentme> ohhh so Module < Class
<apeiros_> yes
<apeiros_> Class.superclass # => Module
<delinquentme> ahhh
<delinquentme> what??
<any-key> dooooood
<apeiros_> so technically, Module is the only thing in ruby that can hold methods
<any-key> that's deep
shruggar has joined #ruby
Natch| has joined #ruby
<delinquentme> wait so classes inherit from modules
<delinquentme> yes.
<apeiros_> no, Class inherits from Module. that's not the same as classes inherit from modules ;-)
<apeiros_> classes can inherit from modules, that's what you use include for (notice SomeClass.ancestors after you did `class SomeClass; include SomeModule; …`)
<delinquentme> wait if Class< Module ... then how Class.superclass #=> Module
<delinquentme> ?
shosti has joined #ruby
<delinquentme> wait wait
<delinquentme> derrrr
<delinquentme> whats the part of classes inheret from modules?
<Progster> delinquentme: what?
<delinquentme> no, Class inherits from Module. that's not the same as classes inherit from modules ;-)
<delinquentme> ^ ^
<delinquentme> meh!
shosti has joined #ruby
RORgasm has joined #ruby
nikhil_ has joined #ruby
twinturbo has joined #ruby
Indian has joined #ruby
trivol has joined #ruby
mafolz has joined #ruby
strife25 has joined #ruby
PaciFisT has joined #ruby
alek_b has joined #ruby
drknus has joined #ruby
<delinquentme> \# Assigns the preferred dog names to a class variable.
<delinquentme> whut is this notation
shosti has joined #ruby
DrShoggoth has joined #ruby
ceej has joined #ruby
<apeiros_> a non-existent
crankycoder has joined #ruby
CannedCorn has joined #ruby
philips has joined #ruby
choffstein has joined #ruby
zxiest has joined #ruby
<zxiest> Hello everybody :-)
<zxiest> Do you guys know if there's a way to get an UnboundMethod from a public_class_instance ?
JoeWoodward has joined #ruby
JoeWoodward has quit [#ruby]
* apeiros_ doesn't even know what a "public_class_instance" is supposed to be…
pygmael has joined #ruby
<apeiros_> you can get UnboundMethod objects only from a class' or a module's instance methods
<zxiest> apeiros_ I'm trying to get the source of a class method... I'm trying to create an "include_smart" that takes modules and replicates modules' class methods to become class methods for classes including the module.
<zxiest> apeiros_ I'm looking for something similar toinstance_method(:foo).source , but for class methods
swistak35 has joined #ruby
CharlieSu has quit [#ruby]
Natch has joined #ruby
ph^ has joined #ruby
heftig has joined #ruby
brngardner has joined #ruby
ScottNYC has joined #ruby
trivol_ has joined #ruby
kevinbond has joined #ruby
otters has joined #ruby
albemuth has joined #ruby
davidpk has joined #ruby
wenbert has joined #ruby
josephwilk has joined #ruby
<wenbert> hi. how would I convert this: 2012-02-21 12:13:27.273731000Z to something like this: 2000-10-29 (or vice-versa)
<any-key> DateTime.parse
mxweas_ has joined #ruby
alek_b_ has joined #ruby
internet_user has joined #ruby
cpruitt_ has joined #ruby
trivol__ has joined #ruby
zastav has joined #ruby
<any-key> then use one of its many methods for formatting dates
zxiest[a] has joined #ruby
<wenbert> looking up DateTime.parse
<any-key> it's in the standard ruby libs
steven- has joined #ruby
<zxiest[a]> apeiros_ nvm =) I found a way
Paoc_ has joined #ruby
<wenbert> any-key: thanks
Paoc_ has quit [#ruby]
<any-key> enjoy, working with dates and times always sucks, even though datetime is a decent lib
Rickmasta has joined #ruby
punkrawkR has joined #ruby
<any-key> :P
banseljaj has joined #ruby
edibrac has joined #ruby
elake has joined #ruby
alx- has joined #ruby
rippa has joined #ruby
fbernier has joined #ruby
netrealm has joined #ruby
flagg0204 has joined #ruby
alex__c2022 has joined #ruby
flagg0204 has joined #ruby
<cocoadaemon> shevy: followup to the whois trouble : works now. Forced ruby Debian install to update on its own.
dql has joined #ruby
bwlang has joined #ruby
davidrinnan has joined #ruby
bwlang has joined #ruby
chimkan has joined #ruby
<CannedCorn> hey guys, when i try to connect a socket using OpenSSL im getting an error SYSCALL returned=5
<CannedCorn> i know it has to do with certs, via google,
mdw has joined #ruby
<CannedCorn> but i wanted to understand it a bit more
Natch has joined #ruby
<shevy> cocoadaemon hehe
<CannedCorn> setting verify_none seems like a bad option
centipedefarmer has joined #ruby
shruggar has joined #ruby
<cocoadaemon> now I'm facing something else : installing gem requires gcc
choffste_ has joined #ruby
<any-key> yes, some gems include OS extensions that must be compiled first
<cocoadaemon> which is annoying for prod servers right
<cocoadaemon> ?
<any-key> meh
<any-key> it's not that bad, but tbh I'm not a deployment guru
<cocoadaemon> well, it's a pretty solid way to allow a hacker to gain permissions
<any-key> you stage, THEN go to production
phantomfakeBNC has joined #ruby
<any-key> you're referring to someone doing a man in the middle when you're pulling down gems?
dv310p3r has joined #ruby
mdw has joined #ruby
ghvandoorn has joined #ruby
<cocoadaemon> nope. more like gain access through a non root account and then compile your way to the top :)
wmoxam has joined #ruby
iocor has joined #ruby
<any-key> so you're referring to malicious code being placed in a gem?
<any-key> how is this any different than a BSD-style ports system?
<any-key> you only pull down and compile code from trusted sources
phantomfakeBNC has joined #ruby
wyhaines has joined #ruby
<cocoadaemon> nope that's not what I'm saying, it's more a system wide threat than only a ruby one
<ggherdov> Hi all. I have got a situation here. Briefing: I am competing for the Equal Pay Challenge, http://equalpay.challenge.gov/ , i.e. build an app on the theme "women are paid less than men to do the same thing". The goal of the game is to exploit governamental data to prove the point. The organizers point to http://developer.dol.gov/ which is a true gold mine for data. They provide a Ruby API. This API does GET requests like http://past
<ggherdov> plus some authentication.
<ggherdov> QUESTION: can you guess if this API support introspection? I'd like to know all the method that I can pass to the GET. I quite don't have time to write to the government for that. Given that they appear to be ruby people, how do you expect they implemented this? Is there any hidden ninja query I can try to get all supported method? I thinking of XMLRPC here, where this is supported by the standard (I think.)
bwlang_ has joined #ruby
looopy has joined #ruby
<any-key> cocoadaemon: I'm not following; yes, if an attacker can run code as an unprivileged user they can potentially escalate to root, but how is this attacker gaining access to your user account?
CannedCorn has joined #ruby
Notimik has joined #ruby
danishman has joined #ruby
<cocoadaemon> any-key: any compromised software or account.
<keymone> ggherdov: why don't you read api documentation?
<ggherdov> because it is very scarce.
<cocoadaemon> any-key: thanks for your help I'll investigate that
<ggherdov> I did read it.
<keymone> then read the code
<ggherdov> just to tell you, the sample code is a png screenshot.
<ggherdov> keymone: no code man! it's aGET. I cannot SSH into their server...
<wenbert> what is causing this: undefined method `gsub!' for Sun, 29 Oct 2000:Date ?
<any-key> wenbert: date isn't a string
<keymone> ggherdov: > They provide a Ruby API. This API does GET requests
<any-key> wenbert: you can convert the date object to a string
<ggherdov> keymone: correct.
<keymone> read the ruby api code they provide to know what requests you can send
<ggherdov> this request turned out to be a plain HTTP GET
<any-key> cocoadaemon: what does that have to do with ruby gems though?
<ggherdov> it's up to the client of their ruby lib to write the request.
<ggherdov> they just pass it to GET.
<ggherdov> *I* have to write the request.
<wenbert> any-key: :timeline_date => DateTime.parse(item.immunized_on.to_s) || item.created_at --> I get invalid date :|
<ggherdov> they just give one (1) example.
<cocoadaemon> any-key: that gem install requires gcc?
flagg0204 has joined #ruby
Maxou56800 has joined #ruby
phantomfakeBNC has joined #ruby
<any-key> cocoadaemon: there is probably a better way of deploying gems to production; that's not my area of expertise
<ggherdov> keymone: this delightful example is (in png format I repeat) a sample of client code . the only thing they give you.
<cocoadaemon> but that's a non problem : I'll install and once the gem repos is ok, then I'll uninstall
kvirani has joined #ruby
<cocoadaemon> any-key: I suppose that's why debian goes the apt-get way
lkba has joined #ruby
<ggherdov> keymone: do you see the 'DOLAgency/Agencies' thing ? That's up to you to write
<keymone> ggherdov: mkay, don't know how to help you then
AxonetBE has joined #ruby
<ggherdov> keymone: is there a standard way to write the other end ( the server) of such a service in Ruby? that is basically my question. If I know some info on the server, I might discover that it offers introspection by default, smthg like GET TellMeAllThings
goiken has joined #ruby
bawer has joined #ruby
sohocoke has joined #ruby
brianpWins has joined #ruby
Sailias has joined #ruby
<cocoadaemon> also, which recommandation for : tiny ruby web framework ?
becom33_ has joined #ruby
<ggherdov> keymone: anyway, thank you for your attention. I'll try to find the answer somehow. bye. --btw i'll lurk here some more time, in case you get any idea.
<any-key> cocoadaemon: sinatra
<goiken> having issues with bundler… (using rvm and ruby 1.9.2.) I successfully ran `gem install bundler` but `bundler install` isn’t found. http://pastehtml.com/view/bszevx824.txt
<cocoadaemon> I just need the most simple api : receive domain, return whois fields in json object
<cocoadaemon> any-key: ok
<any-key> goiken: bundle install, not bundler install
<goiken> y… sorry for that typo
CannedCorn has joined #ruby
sohocoke has joined #ruby
<any-key> does it work now?
<wenbert> any-key: http://pastie.org/3692419 how would I handle this?
<goiken> any-key: no… (i did it right in the link)
<any-key> wenbert: anything that isn't nil except for false is true
<any-key> wenbert: you can check for an empty string
<wenbert> thanks again any-key
<any-key> no problem
jgrevich has joined #ruby
chimkan has joined #ruby
<ggherdov> keymone: looks like I am a moron. There is 25 pages PDF on the sites detailing all possible calls. sorry for the noise.
<wenbert> any-key: now that i have it right http://pastie.org/3692446 how would I make those statements shorter? (ruby way)
sectionme has joined #ruby
Natch has joined #ruby
<Progster> Why do all the zip libraries I've looked at (rubyzip and zipruby), go off of filenames? I'm uploading a zip to a rails app, and I'd rather just pass it the damn stream.
Maxou56800 has joined #ruby
royvandermeij has quit [#ruby]
davidpk has joined #ruby
havenn has joined #ruby
twinturbo has joined #ruby
daniel_hinojosa has joined #ruby
refriedchicken has joined #ruby
<wenbert> am I able to sort an array of hashes using Date as the sort key?
albemuth has joined #ruby
vipaca has joined #ruby
vipaca has joined #ruby
mfridh has joined #ruby
<rippa> why not
cha1tanya has joined #ruby
Faris has joined #ruby
eywu has joined #ruby
<any-key> wenbert: why are you converting a Date object to a string and then back into a Date object?
<any-key> that seems silly
<td123> what is the line (comment) to include in a ruby source file if you plan to use unicode chars in it?
<wenbert> any-key: because either could a Date or DateTime :|
<any-key> DateTime::to_date is what you want
flagg0204 has joined #ruby
<keymone> ggherdov: heh it's ok good luck
<ggherdov> keymone: thx!
<td123> ah, found it finally after a couple of pages on google.. you need to put # encoding: utf-8 at the top of the file
bricker88 has joined #ruby
<wenbert> any-key: let me try to convert the DateTime to Date
<any-key> wenbert: http://pastie.org/3692538
<wenbert> any-key: wow thanks. especially for the ternary operator example
<any-key> the ternary operator is a bit silly, but that's the only "clever" thing I could think of to revise your code
IPGlider has joined #ruby
Paoc_ has joined #ruby
davidcelis has joined #ruby
kaneda__ has joined #ruby
brngardner has joined #ruby
<wenbert> thanks any-key... i was trying the .to_date earlier but got errors. now I understand why. I was hitting the nils
rohit_ has joined #ruby
adeponte has joined #ruby
falena has joined #ruby
bjensen has joined #ruby
Natch has joined #ruby
SegFaultAX|work has joined #ruby
bawer has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
choffstein has joined #ruby
williamcotton has joined #ruby
cloke has joined #ruby
artOfWar has joined #ruby
sirdeiu has joined #ruby
becom33 has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
a_meba has joined #ruby
banisterfiend has joined #ruby
Helius has joined #ruby
becom33 has joined #ruby
dv310p3r has joined #ruby
savage- has joined #ruby
zakwilson_ has joined #ruby
Araxia has joined #ruby
io_syl has joined #ruby
io_syl has joined #ruby
apok has joined #ruby
jcromartie has joined #ruby
rcrossan has joined #ruby
<rcrossan> for ruby logging, is there a command to have it ignore certain lines? Currently running it with win32/screenshots, but errors on screenshot lines
baroquebobcat has joined #ruby
jgarvey has joined #ruby
dql has joined #ruby
a_meba has joined #ruby
<any-key> I typically filter log files with some other thing that filters out lines that match a regex
bwlang has joined #ruby
schovi has joined #ruby
fbernier has joined #ruby
Natch| has joined #ruby
mib_mib has joined #ruby
senthil has joined #ruby
artOfWar has joined #ruby
akemrir has joined #ruby
banisterfiend has joined #ruby
ascarter_ has joined #ruby
apok has joined #ruby
nonotza has joined #ruby
ghvandoorn has joined #ruby
ed_hz_ has joined #ruby
apeiros_ has joined #ruby
a_a_g has joined #ruby
banister_ has joined #ruby
kaneda__ has joined #ruby
havenn has joined #ruby
ringotwo has joined #ruby
davidrinnan has joined #ruby
hadees has joined #ruby
hadees has quit [#ruby]
pdtpatr1ck has joined #ruby
Sacorpion has joined #ruby
lledet has joined #ruby
wfleming has joined #ruby
kW has joined #ruby
brianosborne has joined #ruby
<brianosborne> Hi all, I had ruby installed via RVM but have since decided to install ruby from source. I've completed that, and removed RVM by running "implode rvm"
<brianosborne> however, all my gems are still going to /usr/local/rvm/
<brianosborne> did I screw something up here?
<brianosborne> ah nvm think I got it
ryan0x2 has joined #ruby
goiken has quit [#ruby]
adamkittelson has joined #ruby
<`brendan> anyone have a good resource/tutorial on reading up on how to delete files based on age?
otters has joined #ruby
<`brendan> ie: delete files from 'x' dir older than 14days
evilgeenius has joined #ruby
wedgeV has joined #ruby
<evilgeenius> What decent and popular ruby libraries use blocks extensively?
<evilgeenius> My co-worker doesn't like rubys blocks
<evilgeenius> I just want to convince him that he's using them all the time!
<Sou|cutter> rspec
<norm> eventmachine
wedgeV has joined #ruby
<norm> not liking ruby blocks is like not liking santa claus
<any-key> eventmachine is an awesome example
lledet has quit [#ruby]
<evilgeenius> we don't use EM
<evilgeenius> does rails or activerecord use blocks much?
stkowski has joined #ruby
<any-key> all over the place
<apeiros_> evilgeenius: your coworker seems to be an idiot
<any-key> check out the form_for helpers
<n3m> Hi, how can i get input from a user while he is still typing? (in a command line app).
ph^ has joined #ruby
<evilgeenius> apeiros_: he's my boss :-)
Natch| has joined #ruby
<any-key> he must not understand ruby then
<otters> n3m: highline
<apeiros_> I'm not sure whether that was meant as acknowledgment… :)
<evilgeenius> my other co-worker who ony uses perl has just had a laugh at ruby's blocks as if they are shit
<apeiros_> evilgeenius: core/stdlib is chock full with block usage. Enumerable e.g.
<evilgeenius> form_for is a good one to throw in his face :-)
<any-key> evilgeenius: enumerable and all of the functional programming constructs are amazing
<evilgeenius> any-key: I know that for sure.
<evilgeenius> What about HAML?
<n3m> otters: thx
nfluxx has joined #ruby
looopy has joined #ruby
<any-key> evilgeenius: haml isn't ruby, it's just a language that gets parsed
schaerli has joined #ruby
<evilgeenius> any-key: ah ok, I thought it used blocks everywhere..
<any-key> nope, it's its own deal
<any-key> it gets translated to erb and stuff
<any-key> you embed ruby in it just like you do with erb templates
<evilgeenius> Does activerecord use blocks much?
<any-key> yes.
* any-key parts
<evilgeenius> any-key: in what ways? for scopes?
<apeiros_> yes, but scopes are bad examples
nacengineer has joined #ruby
sako has joined #ruby
<evilgeenius> apeiros_: what's a good example of block usage in rails? apart from form_for and the like..
antaine has joined #ruby
<Sou|cutter> evilgeenius: how about respond_to blocks?
<evilgeenius> Sou|cutter: hmm.. we don't use them much at all here
<Sou|cutter> evilgeenius: why don't you just search over your codebase then? Hard for us to guess what you're using
<evilgeenius> Sou|cutter: well this guy uses rails
<sako> hey all, we are using unicorn and are experiencing unusually high load today... is it possible we have too few workers running and are stalling up things?
<antaine> Hi, what is your advice to compare two excel files ? roo / spreadsheets gem ?
<sako> possibly longer requests taking over the workers and the short ones are there waiting for workers to free up? that wouldn't cause cpu% to spike up though right?
MrGando has joined #ruby
ascarter_ has joined #ruby
buschhardt has joined #ruby
mariusbutuc has joined #ruby
voodoofish430 has joined #ruby
brngardner has joined #ruby
mariusbutuc has joined #ruby
mariusbutuc has joined #ruby
tatsuya_o has joined #ruby
Trumma has joined #ruby
mariusbutuc has joined #ruby
artOfWar_ has joined #ruby
netrealm has joined #ruby
dbgster has joined #ruby
kvirani has joined #ruby
mengu has joined #ruby
mariusbutuc has joined #ruby
mariusbutuc has joined #ruby
techhelp has joined #ruby
shadoi has joined #ruby
ghostlines has joined #ruby
mariusbutuc has joined #ruby
Zolrath has joined #ruby
brngardner has joined #ruby
havenn has joined #ruby
nerdy_ has joined #ruby
ascarter_ has joined #ruby
artm has joined #ruby
savage- has joined #ruby
n1x has joined #ruby
ph^ has joined #ruby
kenichi has joined #ruby
Sailias has joined #ruby
kaneda__ has joined #ruby
NixNod has joined #ruby
mariusbutuc has quit [#ruby]
zodiak has joined #ruby
bwlang_ has joined #ruby
kpshek has joined #ruby
ringotwo has joined #ruby
<becom33> why isnt this working ? http://pastebin.com/Mw4NZjGY
* becom33 help anyone ?
banisterfiend has joined #ruby
<becom33> aloo ?
mcwise has joined #ruby
davidpk has joined #ruby
wefawa has joined #ruby
<a_a_g> becom33: try ver = string.scan(/\<s1\>/)
<a_a_g> what is the 'imu' for?
ascarter_ has joined #ruby
<becom33> a_a_g: I want the "1.1"
lorandi has joined #ruby
<a_a_g> my guess is ?, = , <, >, have to be escaped as well
<becom33> ok .. umm ?
zakwilson has joined #ruby
<a_a_g> how about /.*num.*(\d+)/ … unless you need to be really specific in the match
havenn has joined #ruby
<rippa> projecteuler is pretty fun
<becom33> a_a_g: I do need the 1.1
dcolebatch has joined #ruby
<becom33> rippa: u know what to do there ?
<rippa> solve problems
<becom33> :(
artm has joined #ruby
bawer has joined #ruby
banister_ has joined #ruby
prometheus has joined #ruby
<a_a_g> becom33: not sure what [^<>]* will do, but ([0-9]*\.[0-9]*) should work
<ged> becom33: pry(main)> string = "<s1>num?=1.1</s1>"; string[ /<s1>num\?=(.*?)<\/s1>/, 1 ]
<ged> => "1.1"
banisterfiend has joined #ruby
workmad3 has joined #ruby
<apeiros_> [0-9] --> \d
<becom33> a_a_g: thanks , and also ged thank you very much :)
<a_a_g> apeiros_: ah yes, stupid of me
mariusbutuc has joined #ruby
newfprag has joined #ruby
sacarlson has joined #ruby
bwlang_ has joined #ruby
fbernier has joined #ruby
RORgasm has joined #ruby
tobym has joined #ruby
bglusman has joined #ruby
madh_ has joined #ruby
daniel_hinojosa has joined #ruby
dzhulk has joined #ruby
berserkr has joined #ruby
<williamcotton> so… I'm trying to follow this guy: http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html
Houdini has joined #ruby
<williamcotton> and post with multiple values
<`brendan> irb(main):007:0> gem install rails
<`brendan> NameError: undefined local variable or method `rails' for main:Object
<`brendan> from (irb):7
<`brendan> from /usr/local/bin/irb:12:in `<main>'
<`brendan> ... just installed this from source
<`brendan> centos ruby 1.9.3
<williamcotton> literally following it to the T, but in my sinatra app, the params don't show an array
<`brendan> what am i doing wrong?!
<williamcotton> Net::HTTP.post_form(uri, 'q' => ['ruby', 'perl'], 'max' => '50')
<williamcotton> results in
<williamcotton> 127.0.0.1 - - [29/Mar/2012 11:38:15] "POST /new_job HTTP/1.1" 200 - 0.0016
<williamcotton> {"q"=>"perl", "max"=>"50"}
<apeiros_> `brendan: you're calling it in your irb
<`brendan> :/
<`brendan> just read that
<apeiros_> you should do that in your shell…
<`brendan> pardon me for being a wizard
brngardner has joined #ruby
<williamcotton> am I missing something super obvious here?
<apeiros_> williamcotton: try 'q[]' instead of 'q'
<williamcotton> ah
<williamcotton> just like in the html
<williamcotton> that'll be the ticket
<`brendan> sudo: gem: command not found
<`brendan> -bash: sudo:: command not found
<williamcotton> hah, thanks!
becom33 has joined #ruby
<`brendan> can't use sudo to make sure its installed at the highest level?
<`brendan> without using sudo, it errors out b/c of write permission
<apeiros_> that's not a ruby related problem
kirun has joined #ruby
<apeiros_> if sudo can't find your exes, it's an OS/env issue
<apeiros_> somebody in here might still be able to help you.
lorandi has joined #ruby
mariusbutuc has quit [#ruby]
<williamcotton> apeiros_: I was just forwarding along params from one request to another service...
<williamcotton> params["guests[]"] = params.delete("guests")
<williamcotton> :)
seifried has joined #ruby
<seifried> are there any announcement lists/mailing lists/etc where the ruby-gem updates/security updates are announced?
<ekaleido> i have an array [hello,hello there,hello there2] and i want to make everything separated by a comma its own object and im forgetting how
<ekaleido> ugh, split
venkatk_ has joined #ruby
blueOxigen has joined #ruby
SullX has joined #ruby
<SullX> what is the correct way to detect whether a ruby line throws an error? I want to do something like if ... causes except then do this ...
imsplitbit has joined #ruby
<SullX> excception*
<SullX> exception*
<williamcotton> SullX: rescue blocks
EvanR_ has joined #ruby
<williamcotton> check out "Handling an Exception" on http://rubylearning.com/satishtalim/ruby_exceptions.html
<SullX> williamcotton: can you use rescue blocks outside of have begin,rescue,retry,end etc
<SullX> having*
<williamcotton> hmm, I'm not sure if you can or not, but why would you want to?
<SullX> because I already am using a begin,rescue,retry,end set
IrishGringo has joined #ruby
<SullX> and I don't want to embed another (nor do I know if it is possible)
<williamcotton> can you paste your code somewhere so I can take a quick look?
<williamcotton> gist.github.com is a good place
<SullX> unfortunately no. it is very large, and it's internal (read: NDA)
<SullX> but
<williamcotton> well, write up something that sort of operates like it :)
EvanR has joined #ruby
<SullX> what I can say is that I am doing web application testing with watir, and the page I am testing loads a few elements that have an html class that cycles randomly on each http load. this makes selecting these elements more difficult to application test each time. so i want something like if browser.div(:class=>'class-that-cycles-01').click throws exception do browser.div(:class=>'class-that-cycles-02').click
<SullX> williamcotton: ^
c0rn has joined #ruby
<williamcotton> whoa, well I'm not very familiar with that approach… I do all my DOM programming in javascript :)
<williamcotton> including testing
bwlang_ has joined #ruby
<williamcotton> (he says, like he actually writes tests)
brngardn_ has joined #ruby
<SullX> ah, gotcha
<SullX> maybe I could do a search first..
<williamcotton> what I will say, is that if you're trying to catch all exceptions, you might be thinking about the problem wrong
<williamcotton> or not, who knows, but that's just from my experience
<`brendan> anyone able to take a quick peek at this: http://pastie.org/private/nvlhptvnivmhn98dfoxbw very basic.. but not sure if the Chronic.parse will work how i would like it
<ekaleido> can someone take a quick look and tell me the proper method, if mine is wrong? http://pastie.org/3693527
<williamcotton> and, if you're having to jump through a bunch of crazy hoops to test something out properly, it might be a sign that you need to refactor the code that you're trying to test
<SullX> no, your right. I could specify for this particular exception but I would need some way to get back in to the loop after the rescue
<williamcotton> one of the benefits to writing test is that it sort of forces you to write good, modular code
<williamcotton> (again, I'm saying this like I actually write a bunch of tests, haha)
n3m has joined #ruby
headius has joined #ruby
<SullX> williamcotton: well thanks for the help and advice
<SullX> :)
<williamcotton> no prob, sorry I couldn't help in a more direct manner!
<`brendan> past_time = Chronic.parse("#{time} + in days").to_i is what i want
<`brendan> ty
chimkan has joined #ruby
centipedefarmer has joined #ruby
justinmcp has joined #ruby
jscoder has joined #ruby
a_a_g has joined #ruby
Chryson has joined #ruby
<ekaleido> how can i combine the word line with the variable z that equals 0 to get line0
<ekaleido> i keep getting fixnum and string errors
scientes has joined #ruby
qos has joined #ruby
<ekaleido> exit
heftig has joined #ruby
raincole_ has joined #ruby
<jscoder> Hi, I'm new to Ruby and am reading about operators right now. I added ^ to the FixNum class. What would be the best way to add that function to all number classes?
Maxou56800 has joined #ruby
savr has quit [#ruby]
michael7 has joined #ruby
<any-key> Override Numeric, although that may not be a great idea
andys has joined #ruby
<jscoder> @any-key I replaced FixNum with Numeric, but now the function doesn't work anymore (2 ^ 3 returns 1). Any idea why?
codebeaker has joined #ruby
heftig has joined #ruby
startling has joined #ruby
<any-key> because you're overriding a very important operator...
shruggar has joined #ruby
<any-key> ^ is XOR
CrazyPickles has joined #ruby
<matti> ^ -- carrot ;d
<CrazyPickles> anyone here used OpenGL 3.3 and GLSL 330
<scientes> how do i recompile all my gems for x86-64?
<any-key> monkeypatching is cool and all, but it's really easy to shoot yourself in the foot
<scientes> i keep getting "wrong else class" errors
<matti> any-key: NO WAI
<matti> ;/
<scientes> *wrong ELF class
<matti> Elf class?
<matti> Dark Elf? ;d
<scientes> jscoder, power is **
tatsuya_o has joined #ruby
<jscoder> @scientes Did you look at my link?
<scientes> no
<scientes> don't override ^
<any-key> if it's a core ruby class and you're overwriting something rather than adding something, just don't do it
<apeiros_> jscoder: your method is overridden by the subclass
<scientes> anyways, how do i recompile all my gems for x86-64?
<scientes> when they are currently 32-bit
<any-key> the only time overwriting is acceptable is if you call super first, but even then it's not very safe :\
<any-key> but yeah XOR is like supah important
Vert has joined #ruby
<scientes> how do i do this, but keep my current versions?
<scientes> and is that really the only way to rebuild extentions?
venkatk_ has joined #ruby
<ged> scientes: 'gem pristine --all', like that article says.
<scientes> gem pristine --all --no-extensions
<scientes> i think thats the real one
<ged> No, --no-extensions skips the extensions.
<scientes> ooo
pdtpatr1ck has joined #ruby
<scientes> /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:268:in `==': undefined method `name' for "actionmailer":String (NoMethodError)
<scientes> erggggg
<scientes> i'm still getting the same errors
hooper has joined #ruby
<scientes> /usr/lib/ruby/gems/1.8/gems != /usr/lib64/ruby/gems/1.8/gems here
<scientes> i think that is the problem
tobago has joined #ruby
seifried has quit ["Leaving"]
choffstein has joined #ruby
Azure has joined #ruby
havenn has joined #ruby
shaatar has joined #ruby
mikeric has joined #ruby
bwlang has joined #ruby
mcero has joined #ruby
ScottNYC has joined #ruby
lorandi has joined #ruby
digdin has joined #ruby
luckyruby has joined #ruby
chimkan has joined #ruby
<digdin> have some thing like hibernate to ruby
Maxou56800 has joined #ruby
fbernier has joined #ruby
PaciFisT has quit [#ruby]
<`brendan> anyone able to check: http://pastie.org/3693847
<Spaceghostc2c> digdin: So, an orm?
<`brendan> getting unexpected end
centipedefarmer_ has joined #ruby
<`brendan> not sure why, its only 1 function + an if
ascarter_ has joined #ruby
bwlang_ has joined #ruby
Indian has joined #ruby
cczona has joined #ruby
havenn has joined #ruby
<`brendan> the .each is a loop & needs an end too
<shadoi> the Dir.glob
Norrin has joined #ruby
<digdin> Spaceghostc2c, yes
<shadoi> digdin: I recommend Sequel
<Spaceghostc2c> digdin: If only we had a way to search the internet using key words.
<digdin> thx
dmiller has joined #ruby
bglusman has joined #ruby
philcrissman has joined #ruby
strife25 has joined #ruby
CannedCorn has joined #ruby
TandemAdam has joined #ruby
VictorMartins has joined #ruby
SuperNewb1 has joined #ruby
timonv has joined #ruby
artm_ has joined #ruby
apok_ has joined #ruby
sacarlson has joined #ruby
Squarepy has joined #ruby
stephenjudkins has joined #ruby
joaoh82 has joined #ruby
odinswand has joined #ruby
dfibre has joined #ruby
<`brendan> ruby can't find the chronic gem when executive
<`brendan> executing
lorandi has joined #ruby
axl_ has joined #ruby
bwlang has joined #ruby
<`brendan> root@chef-server:~# ls -l /usr/bin/ruby*
<`brendan> lrwxrwxrwx 1 root root 7 2012-03-15 16:56 /usr/bin/ruby -> ruby1.8
<`brendan> -rwxr-xr-x 1 root root 6264 2012-02-21 20:42 /usr/bin/ruby1.8
<`brendan> root@chef-server:~# ls -l /usr/bin/gem*
<`brendan> lrwxrwxrwx 1 root root 15 2012-03-29 16:37 /usr/bin/gem -> /usr/bin/gem1.8
<`brendan> -rwxr-xr-x 1 root root 545 2009-10-09 20:51 /usr/bin/gem1.8
deryl has joined #ruby
Squarepy has joined #ruby
sparrovv has joined #ruby
VictorMartins has joined #ruby
<shevy> looks like debian shit
<shevy> I am sure your gem path is fucked up too
<shevy> what does "gem env" output
MasterIdler has joined #ruby
axl_ has joined #ruby
ascarte__ has joined #ruby
<shevy> `brendan, here is what this reports for me http://pastie.org/3694152
brngardner has joined #ruby
Kyril has joined #ruby
yoklov has joined #ruby
venkatk_ has joined #ruby
<`brendan> im just not familar enough to fix it
Kyril has joined #ruby
<`brendan> can't seem to locate the chronic gem & dont know what steps i can do to resolve it
headius has joined #ruby
nerdy_ has joined #ruby
<`brendan> shevy, one sec
<`brendan> its ubuntu btw
ScottNYC has joined #ruby
artm has joined #ruby
Norrin has joined #ruby
Guedes has joined #ruby
Guedes has joined #ruby
<shevy> yeah typical debian
<shevy> basically you are doomed
<matti> DOOOMED
<matti> Run for your life.
dv310p3r has joined #ruby
KarlFreeman has joined #ruby
thone_ has joined #ruby
<`brendan> i had better success on my windows box with ruby+chronic
<`brendan> unreal
<`brendan> :/
KarlFreeman has quit [#ruby]
<matti> shevy: Debian was made to punish peple.
<matti> shevy: Its 99th circle of hell.
madh_ has joined #ruby
<shevy> `brendan your loss for picking debian :>
<`brendan> not my decision to make
<`brendan> it could also be chef battling with it
<`brendan> but chef is made w/ ruby
<`brendan> :/
<shevy> your decision to use the apt-get disaster
<`brendan> didnt install chef via apt-get
<`brendan> :D
<Boohbah> debian is not the greatest ruby platform
<shevy> oh see, that is the first mistake
jbw has joined #ruby
<shevy> if you abandon the apt-get way, you cant expect things to work in this fragile framework anymore
<`brendan> why is the framework so fragile then? :D
<shevy> simple
<shevy> the people who created debian are idiots
<`brendan> how would you recommend ruby be installed for a centos machine?
<shevy> oh, you should not ask me. I would rip apart everything and compile ruby from source
<shevy> btw you notice how noone defends debian here? :)
<shevy> <Boohbah> debian is the greatest ruby platform
carloshpf has joined #ruby
<`brendan> ehh.. i'll install from source
<`brendan> its only production :/
Zolrath has joined #ruby
<`brendan> blah
<RubyPanther> well, Ruby is one of the upstream packages they have a history of hijacking, they think they know more about how to package Ruby than the core Ruby devs, so... what else is there to say?
twinturbo has joined #ruby
<`brendan> i just don't want to fuck this machine up
<`brendan> heh
<`brendan> lovely day
<shevy> `brendan yeah. stay within the boundaries of your distribution :)
<froy> shevy, what do you think is the best ruby platform?
<RubyPanther> Since a developer uses numerous tools, an ideal platform has to respect upstream broadly so that local best practices can apply to each tool
<shevy> frop a source installation of course
<shevy> ideally one that uses AppDirs
<froy> so linux-from-scratch or gentoo?
<shevy> nah
<shevy> LSF is just for teaching really
<froy> oh, roll-your-own package management?
<shevy> you need package management when you use appdirs? what for? :)
<froy> I'm actually a fan of gentoo. it's really easy to roll-your-own anything in it, and keep it all package managed.
<froy> dependency management
<`brendan> ehh
<`brendan> fuck it, uninstalling chef on the ubuntu box and going to do ruby via apt
<`brendan> see where that ends up
<shevy> in pain
<`brendan> either way, its the only machine i have to test
<`brendan> besides this windows laptop
<froy> all the people I know who use binary distros end up doing what you say, compile their own stuff outside of package management
<`brendan> im concerned about installing ruby on to our centos box b/c its the mail server
<shevy> froy, what package management? versioned directories = management
<froy> all fine and dandy until a c library changes or something
phantomfakeBNC has joined #ruby
deryl has joined #ruby
<`brendan> rvm a better solution for ubuntu?
<shevy> dunno
<shevy> I think they have their channel here #rvm
<shevy> you are going to leave your distribution-solution? ;)
greenarrow has joined #ruby
<RubyPanther> `brendan: you should have no troubles with Ruby anything in the RH family, but you should be using rvm or rbenv and bundler
newfprag has joined #ruby
<katya^> ruby was a bit frustrating the other night
<katya^> but a day of working with asp.net/webforms has made me appreciate it
<katya^> ruby+rails* i should say
bjensen has joined #ruby
phantomfakeBNC has joined #ruby
<Tasser> katya^, then say it in #rubyonrails
<katya^> there's a channel for that? :O
<shevy> they wont listen
<katya^> but regardless
<shevy> they are too busy making money
<katya^> it's nice that it's not as painful
<newfprag> I'm a Sinatra man myself, but meh
<Tasser> katya^, there are as many people there, probably even more
<Tasser> katya^, if you take a look at rubygems, rails is by far the most famous gem
<RubyPanther> Camping makes people quake and fear under animal carcasses.
ascarter_ has joined #ruby
phantomfakeBNC has joined #ruby
phantomfakeBNC has joined #ruby
buschhardt has joined #ruby
<davidcelis> or INSIDE animal carcasses
virunga has joined #ruby
musee has joined #ruby
robotmay has joined #ruby
fmcgeough has joined #ruby
lkba has joined #ruby
affix has joined #ruby
wefawa has quit [#ruby]
twinturbo has joined #ruby
prometheus has joined #ruby
fbernier has joined #ruby
phantomfakeBNC has joined #ruby
banisterfiend has joined #ruby
ccapndave3 has joined #ruby
Araxia has joined #ruby
netrealm has joined #ruby
ilkmgf has joined #ruby
alex__c2022 has joined #ruby
jwang has joined #ruby
simpleharmonicmo has joined #ruby
fbernier has joined #ruby
AxonetBE has joined #ruby
stephenjudkins has joined #ruby
jeekl has joined #ruby
VictorMartins has joined #ruby
Banistergalaxy has joined #ruby
sixdahs has joined #ruby
Vert has joined #ruby
wyhaines_ has joined #ruby
CannedCorn has joined #ruby
<sixdahs> anyone have any suggestions for renaming files with ruby based on a regex?
wyhaine__ has joined #ruby
freeayu has joined #ruby
Sailias has joined #ruby
<sixdahs> but gsub is not liking my variable
artOfWar has joined #ruby
tommyvyo has joined #ruby
sectionme has joined #ruby
carlyle has joined #ruby
<Squarepy> so what's the pattern?
iocor has joined #ruby
dwon has joined #ruby
stringoO has joined #ruby
Indian_ has joined #ruby
Indian_ has joined #ruby
liluo has joined #ruby
<sixdahs> that pattern is specified by the second argument
<denysonique> what is the easiest way to get up and running with Ruby CGI?
<sixdahs> ./script [path] "*\.txt" .text
CARL0S has joined #ruby
<sixdahs> would for instance change the file ext txt to text
schovi has joined #ruby
<sixdahs> this one does it hardcoded, i'm just trying to change it so it will take the two patterns as arguments
<denysonique> RubyPanther: yes, but how can I serve this app easily ?
keymone_ has joined #ruby
luckyruby has joined #ruby
startling has joined #ruby
king313 has joined #ruby
king313 has joined #ruby
indeterminate has joined #ruby
<RubyPanther> denysonique: everything uses rack http://m.onkey.org/ruby-on-rack-1-hello-rack so you can serve anything anywhere
<Squarepy> sixdahs, so is it a scope problem, it looks ok
<denysonique> RubyPanther: but I still don't see serving a pure CGI ruby app
<indeterminate> 1.methods lists things like :+, :-, and other operators. I'd like to iterate over some of those operators--the mathematical ones. What's the cleanest way to do that? (Assuming I already know the method names I'd like to iterate over.)
<denysonique> [200, {"Content-Type" => "text/html"}, "Hello Rack!"]
<denysonique> this isn't ruby cgi syntax, this is rack syntax
ascarter_ has joined #ruby
<RubyPanther> denysonique: you can use rack and create your run method just use CGI from the stdlib. rack just tells you how to call it, and allows the modern web server modules to run it via passenger (or unicorn or whatever)
<denysonique> RubyPanther: ok thanks
<RubyPanther> You could simply use traditional apache CGI and it would work fine with the stdlib CGI
<denysonique> but I am looking for a ready example, I hoped that someone already done this and could quickly explain how to, so I could start off in 10 second
<denysonique> s
<RubyPanther> there is a hello world in the CGI doc, yes?
gregorg_taf has joined #ruby
<denysonique> RubyPanther: but there is no example how to serve that CGI
<denysonique> no
* indeterminate is guessing his answer involves .send.
<Squarepy> sixdahs, how does the pattern look like when you parse it from the command line input (a string?)
<denysonique> my girfriend i not going to install that crap -- apache
<sixdahs> yeah it's a string
<sixdahs> the globbing seems ok
<RubyPanther> lol just follow the rack convention, it is one freakin method. Then you can run it with webrick or whatever.
<indeterminate> Never mind. Found it. obj.send(:methodnameassymbol,args)
<RubyPanther> or, read the webrick docs.
<Squarepy> sixdahs it will not be interpreted as a regex if it is a string, a gsub thin I think
<sixdahs> ahh, hmm.
senthil has joined #ruby
<sixdahs> Squarepy: i made some changes, and i saw that it was passing the same thing for both arguments to the Fileutils.mv
havenn has joined #ruby
<sixdahs> any trick ot get gsub or sub to recognize a string?
eam has joined #ruby
<UdontKnow> sixdahs: you mean you want to use regular expressions in what way? :)
<Squarepy> compile it?
<UdontKnow> sixdahs: give us an example of input and what you want out of it
<sixdahs> ./script . "*\.txt" .text
<sixdahs> would change every .txt file to .text in the cwd
<Squarepy> Regexp.new(string), compile the string to a regex
<UdontKnow> are you using shell expansion or expansion in ruby?
aetaric has joined #ruby
<sixdahs> I'm using Dir.glob to get the files
looopy has joined #ruby
wilmoore has joined #ruby
<UdontKnow> sixdahs: its just for suffix right?
<sixdahs> well it is supposed to take any regex
[Neurotic] has joined #ruby
<sixdahs> Squarepy, i'm getting invalid regexp
<sixdahs> with your Regexp.new(pattern)
<Squarepy> might have to do with escaping
<Squarepy> so what is the string you put in?
<UdontKnow> sixdahs: well, myregexp= Regexp.new("#{originalsuffix}$"); newname = thefile.gsub(myregexp, newsuffix); File.rename(thefile, newname)
<UdontKnow> sixdahs: this is one idea that works
eywu1 has joined #ruby
<UdontKnow> and it will avoid things like foo.txt.doc being renamed to foo.text.doc
<UdontKnow> since it's using the right regex anchoring ($)
eywu1 has joined #ruby
luigi has joined #ruby
looopy has joined #ruby
raz has joined #ruby
scwh has joined #ruby
cjlicata has joined #ruby
netrealm has joined #ruby
TandemAdam has joined #ruby
TandemAdam_ has joined #ruby
tatsuya_o has joined #ruby
TandemAdam has joined #ruby
jhowarth has quit [#ruby]
radic has joined #ruby
maletor has joined #ruby
radic has joined #ruby
libertyprime has joined #ruby
sixdahs has joined #ruby
kpshek has joined #ruby
<sixdahs> i guess i got disconnected :(
<sixdahs> i've been staring at this code for too long. It should be much easier than this lol
<Squarepy> well I am of to bed, good luck
<sixdahs> thanks for the help
<sixdahs> goodnight
Ontolog has joined #ruby
yoklov has joined #ruby
iocor has joined #ruby
pu22l3r has joined #ruby
jonteru has joined #ruby
<jonteru> hi, is anyone using google-api-client gem? I have a question about it
symb0l has joined #ruby
senthil has joined #ruby
iocor has joined #ruby
bwlang has joined #ruby
radic has joined #ruby
iamjarvo has joined #ruby
apok has joined #ruby
kpshek has joined #ruby
looopy has joined #ruby
havenn has joined #ruby
<ceej> If I'm using Thread.new { puts "moo" } once it's put moo is that thread killed?
<mfridh> when I return a hash like {:a => 'foo', :b => 'bar'} it's actually an array with a single hash.. is that avoidable?
<mfridh> [{:a => 'foo', :b => 'bar'}] is what's actually returned
<robacarp> mfridh: um, where are you returning it from?
<robacarp> ceej: what is your question?
<mfridh> robacarp: a method def something, I'll paste
fowl has joined #ruby
kvirani has joined #ruby
<ceej> robacarp: once Thread.new { puts "moo" } puts moo does that thread end?
<robacarp> ceej: yes.
yawniek has joined #ruby
<ceej> robacarp: ah ok great, thank you :)
<ceej> in php we used to exec process we wanted to run asynchronously but we're going to use Thread in ruby :)
<robacarp> ceej: don't forget to join up all your threads after your create them
<mfridh> robacarp: http://pastie.org/3695036
<mfridh> hmm, is it because of the f.grep block I return it from?
tar_ has joined #ruby
tar_ has joined #ruby
<robacarp> hold, grokking
<ceej> robacarp: k, is that so know when they are all done? (I'm googling now)
<robacarp> ceej: yes
<ceej> robacarp: k, thank you again
<mfridh> robacarp: it's line 16 that returns the hash inside an array
<robacarp> np, good luck. you might want to research mutexes too....
<robacarp> mfridh: I *think* you could sort this out a lot cleaner between lines 5 and 21, just from a glance, that would make it easier to understand.
<mfridh> yeah, probably. this is first stab
<mfridh> if I could just figure out why the hash is inside an array
<robacarp> that said, your 'output of value' section is calling dtectl, but the function as defined above is dcetl_monut
<robacarp> dcetl_mount, rather
<mfridh> robacarp: imagine you put the 'p dcetl' after line 24
i8igmac has joined #ruby
<robacarp> yes, but you don't have a function definition for dcetl
<mfridh> dcetl = dcetl_mount just sets the variable dcetl to the return from dcetl_mount
<fowl> returns an array of every element for every element where the pattern matches
<mfridh> fowl: right
<mfridh> fowl: *facepalm*
<robacarp> mfridh: okay, first think, you don't want to set a variable in an if statement, do you?
<robacarp> heh
<fowl> robacarp, where is that done
<mfridh> Guess I'll try to make it all cleaner then
<robacarp> line 24
<fowl> i do that all the time, whats wrong with it
<mfridh> I'm not sure how to solve it the cleanest way..
<fowl> if something_passes; x = something_passes .. might as well catch it when you call it with if x = something_passes; do_more_with_x
<robacarp> fowl: its...bloody nightmareish code to debug
<robacarp> mfridh: by the look of things, the only difference between your if/elsif is values_at().