Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<rue> That's like 500 pictures already
<andrewvos> rue: But, but then it doesn't work :(
<rue> Rule of bad rules
<andrewvos> banister`sleep: Have you seen Anti Christ?
<banister`sleep> andrewvos: no, how are you watching melancholia? torrent?
<steveklabnik> antichrist is on netflix
<steveklabnik> it's in my queue
tomzx joined #ruby-lang
<andrewvos> Antichrist is worth a watch. It's quite graphic though.
<steveklabnik> i've been around the /b/lock a few times, i can deal
<andrewvos> steveklabnik: Yeah that's what I thought.
<andrewvos> I mean, when I watched it. Not that you had been around the block :)
<steveklabnik> :)
Heimidal_ joined #ruby-lang
spuk joined #ruby-lang
Banistergalaxy joined #ruby-lang
apeiros_ joined #ruby-lang
apeiros_ joined #ruby-lang
Banistertab joined #ruby-lang
tenderlove joined #ruby-lang
saLOUt_ joined #ruby-lang
Heimidal joined #ruby-lang
<jtoy> is there a way to see from ruby how many file descriptors I have open?
<andrewvos> jtoy: lsof?
<andrewvos> jtoy: Taking a guess here but `lsof |wc -l`
<andrewvos> Maybe grep that for your process or whatever.
S1kx joined #ruby-lang
S1kx joined #ruby-lang
retro|cz joined #ruby-lang
brianpWins joined #ruby-lang
<zenspider> jtoy: why?
<jtoy> zenspider: im trying to figure out why a ruby/eventmachine program i have is going so slow
<andrewvos> zenspider: Don't ask why, I've almost worked out how to do it :)
<andrewvos> jtoy: Ok well take a look at this: https://gist.github.com/1378239
<jtoy> cool, andrewvos , was jstu testig with lsof | grep pid
<zenspider> I _always_ ask why... how do you know you're solving the right problem otherwise?
<andrewvos> zenspider: Yeah I get that.
<zenspider> btw... lsof -p $pid
<andrewvos> jtoy: You can... Yeah what zenspider said
retro|cz joined #ruby-lang
<meth> can i get gdb or something to work to debug ffi calls ?
malev joined #ruby-lang
wyhaines joined #ruby-lang
retro|cz joined #ruby-lang
knu joined #ruby-lang
<meth> yea seems to work
<Banistertab> Hi
<andrewvos> Banistertab: Dude this movie
marcostoledo joined #ruby-lang
<slyphon> tpope: hey, i figured out how to avoid the issue i was having with the SEGV: https://gist.github.com/1378293
kith_ joined #ruby-lang
<Banistertab> Andrewvos it is mysterious andrew
retro|cz joined #ruby-lang
yfeldblum joined #ruby-lang
<Banistertab> Andrewvos like it
<shevy> dumdedum
<andrewvos> Banistertab: Yeah I enjoyed it.
<zenspider> sweet. wrote some code to temporally visualize my projects in omnifocus and I was able to reschedule them on a prime schedule and spread them out optimally
zmack joined #ruby-lang
<andrewvos> Banistertab: Enjoyed it more than antichrist. That movie fucked me up a bit no doubt.
<Banistertab> Andrewvos finished it already?
<andrewvos> Banistertab: yup
banister`sleep joined #ruby-lang
<andrewvos> Lars von Trier movies just all of a sudden twist on you.
tjgillies joined #ruby-lang
<Banistertab> I loved the enormous planet looming
<andrewvos> Yeah. The technicalities of it got me.
<Banistertab> And lol @ glass of wine while listening to beethovens ninth
<andrewvos> Banistertab: I missed that part! I heard what Dunst said afterwards.
<andrewvos> Wondered what she had said
<Banistertab> Also when she said only life in universe was on earth
<slyphon> that's what she said
* slyphon ducks
<Banistertab> And tha
<andrewvos> Yeah that was interesting.
<andrewvos> I think she meant life to her personally
<Banistertab> Well it just kicked the eyes out of cats
<zenspider> omnifocus-github 1.3.0 released
<mksm> hmmm, net/http doesn't set the encoding on the response's body string.
<andrewvos> Banistertab: Watch antichrist.
<slyphon> hrm
* slyphon notices '#' in vimscript function names
<andrewvos> Banistertab: I don't get what you mean about cats?
samshull joined #ruby-lang
Banistergalaxy joined #ruby-lang
<Banistergalaxy> andrewvos: just being poetic
<Banistergalaxy> Bish
flip_digits joined #ruby-lang
towski joined #ruby-lang
Banistertab joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
oddmunds joined #ruby-lang
banister`sleep joined #ruby-lang
resetexistence joined #ruby-lang
echoprinter left #ruby-lang
[2]maarten joined #ruby-lang
jeek_ joined #ruby-lang
diegoviola left #ruby-lang
Sapientzzzz joined #ruby-lang
artOfWar joined #ruby-lang
AndChat| joined #ruby-lang
robbyoconnor joined #ruby-lang
banister`sleep joined #ruby-lang
Banistertab joined #ruby-lang
wyhaines joined #ruby-lang
banister_ joined #ruby-lang
AndChat| joined #ruby-lang
banister`sleep joined #ruby-lang
ThatDudeGuy_ joined #ruby-lang
nuclearsandwich joined #ruby-lang
curtism joined #ruby-lang
ryanf joined #ruby-lang
samshull joined #ruby-lang
procelina joined #ruby-lang
towski joined #ruby-lang
<procelina> anyone know of something like kyoto cabinet only smaller and in ruby? it doesn't have to be fast or have more features than just the basic get and put...
<procelina> all i need is to use a file as a hashtable
x0F_ joined #ruby-lang
banister`sleep joined #ruby-lang
<mksm> procelina, redis is pretty simple
naz joined #ruby-lang
<ryanf> mksm: I think procelina is asking about something that can be embedded in a program
<ryanf> I don't know the answer though
<procelina> yeah, it really should be embedded, i can probably use redis until i find something better tho
curtism joined #ruby-lang
<ryanf> what about just using sqlite3?
<ryanf> if it doesn't have to be fast, you could just make one table and use it as a k/v store
<ryanf> depending on your definition of "doesn't have to be fast" I guesss
<procelina> uhm, i'm making a prototype
<procelina> so it really means "has to be fast later"
<procelina> but also has to be in c later
<ryanf> haha
<ryanf> well I guess if your semantics are just get and put
<ryanf> there is not exactly a high barrier for migrating to something else later
<procelina> yeah
<procelina> i think redis or sqlite is fine for now
<ryanf> actually i think you can use kyoto cabinet from ruby
<procelina> it's a massive install
<ryanf> ah
<procelina> i use it on my server and it took like 4 hours to compile
<ryanf> haha
<ryanf> wow
<procelina> well, my server's ancient
<procelina> haha
<procelina> it's probably faster on this machine
<procelina> but still
meth left #ruby-lang
macmartine joined #ruby-lang
takaokouji joined #ruby-lang
krz joined #ruby-lang
<mksm> use a Hash and Marshal :o
<procelina> lol, then i have to load entire dictionary from disk every time i want to look something up. >_<
RomyEatsDrupal joined #ruby-lang
<mksm> :D
curtism joined #ruby-lang
krz joined #ruby-lang
joooooo joined #ruby-lang
ryanf_ joined #ruby-lang
hunterman joined #ruby-lang
hunterman left #ruby-lang
marcostoledo joined #ruby-lang
macmartine joined #ruby-lang
daviscabral joined #ruby-lang
<shevy> where is the embedded ruby!
daviscabral_ joined #ruby-lang
<shevy> lua must be crushed
jxie joined #ruby-lang
daviscabral_ joined #ruby-lang
daviscabral left #ruby-lang
tomzx joined #ruby-lang
ryanf joined #ruby-lang
andersen joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
andersen joined #ruby-lang
jxie joined #ruby-lang
andersen joined #ruby-lang
<heftig> shevy: in libruby
SuperTaz joined #ruby-lang
andersen joined #ruby-lang
andersen joined #ruby-lang
macmartine joined #ruby-lang
jeek_ joined #ruby-lang
ujihisa joined #ruby-lang
macmartine joined #ruby-lang
ivorybishop joined #ruby-lang
srbaker joined #ruby-lang
ivorybishop joined #ruby-lang
gnufied joined #ruby-lang
macmartine joined #ruby-lang
dfr|mac joined #ruby-lang
ryanf_ joined #ruby-lang
curtism joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
macmartine_ joined #ruby-lang
artOfWar joined #ruby-lang
RomD joined #ruby-lang
towski joined #ruby-lang
wyhaines joined #ruby-lang
Austin__ left #ruby-lang
amerine joined #ruby-lang
oddmunds joined #ruby-lang
macmartine joined #ruby-lang
meth joined #ruby-lang
<meth> is it possible to pass a callback down to c using ffi ?
brianpWins joined #ruby-lang
macmartine joined #ruby-lang
sqbell joined #ruby-lang
meth left #ruby-lang
vesan joined #ruby-lang
tris joined #ruby-lang
rippa joined #ruby-lang
sirfilip1 joined #ruby-lang
RomD joined #ruby-lang
tris joined #ruby-lang
tomzx joined #ruby-lang
dragonkh joined #ruby-lang
<whitequark> shevy, heftig: libruby sucks as embedding engine. i.e. it mucks with stack a _lot_ and does not work with pthreads
<whitequark> it also only can be called from the thread where you have called ruby_init()
Oloryn_lt1 joined #ruby-lang
looopy joined #ruby-lang
s0ber joined #ruby-lang
bcardarella left #ruby-lang
workmad3 joined #ruby-lang
Newbs joined #ruby-lang
sirfilip1 left #ruby-lang
nuclearsandwich joined #ruby-lang
saLOUt joined #ruby-lang
amerine joined #ruby-lang
saLOUt joined #ruby-lang
RickHull left #ruby-lang
adambeynon joined #ruby-lang
GutenLinux joined #ruby-lang
saLOUt_ joined #ruby-lang
<erikh> I'm excited about mruby
benanne joined #ruby-lang
yxhuvud joined #ruby-lang
dnjaramba joined #ruby-lang
rippa joined #ruby-lang
jensn joined #ruby-lang
<Mon_Ouie> Second one clearly is the most exciting.
apeiros_ joined #ruby-lang
GutenLinux joined #ruby-lang
Manhose joined #ruby-lang
ksinkar joined #ruby-lang
Manhose_ joined #ruby-lang
banister`sleep joined #ruby-lang
Manhose__ joined #ruby-lang
Manhose joined #ruby-lang
Manhose_ joined #ruby-lang
woollyams joined #ruby-lang
muzone joined #ruby-lang
dougsko joined #ruby-lang
virunga joined #ruby-lang
sirfilip joined #ruby-lang
<sirfilip> morning
hebz0rl joined #ruby-lang
Mchl joined #ruby-lang
desmovalvo joined #ruby-lang
RB389 joined #ruby-lang
<RB389> Hi
Pip joined #ruby-lang
Carnage\ joined #ruby-lang
sirfilip left #ruby-lang
<gentz> How come string.split '\n' doesn't work like string.split /\n/ ?
<yxhuvud> hint: '\n' != "\n"
<rippa> '\n' == "\\n"
TvL2386 joined #ruby-lang
michael_mbp_ joined #ruby-lang
toretore joined #ruby-lang
zmack joined #ruby-lang
gnufied joined #ruby-lang
bubonicpestilenc joined #ruby-lang
<bubonicpestilenc> p
<bubonicpestilenc> hey all
yorickpeterse joined #ruby-lang
<rue> HI THERE
shevy joined #ruby-lang
<yorickpeterse> Always fun to see the IRC activity decline so much during the weekends :)
<yorickpeterse> "socal life" etc
mark_locklear joined #ruby-lang
<rue> Yeh
empity joined #ruby-lang
benanne joined #ruby-lang
yorickpeterse1 joined #ruby-lang
yorickpeterse1 joined #ruby-lang
retro|cz joined #ruby-lang
yfeldblum joined #ruby-lang
samshull joined #ruby-lang
zmack joined #ruby-lang
Newbs joined #ruby-lang
sepp2k joined #ruby-lang
workmad3 joined #ruby-lang
marcostoledo joined #ruby-lang
Spooner joined #ruby-lang
<andrewvos> (It's not about COMEFROM)
Newbs joined #ruby-lang
<Axsuul> more like gaming life
<Axsuul> or skyrim
<andrewvos> Damn thanks for reminding me about skyrim. Another day ruined.
<Axsuul> DOnt do it
<andrewvos> What's autoload?
<andrewvos> steveklabnik: Regarding your tweet ^
spuk joined #ruby-lang
retro|cz joined #ruby-lang
Manhose joined #ruby-lang
workmad3 joined #ruby-lang
<rue> Module.autoload
<andrewvos> Oh lordy.
<andrewvos> Ruby has some weird shit in it.
workmad3 joined #ruby-lang
coderrr joined #ruby-lang
[zaf]-Coral joined #ruby-lang
<coderrr> can anyone think of a reason not to have an option on JSON.parse to use BigDecimal instead of Float ?
qpingu joined #ruby-lang
wyhaines joined #ruby-lang
mnoble joined #ruby-lang
mnoble left #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
Manhose_ joined #ruby-lang
takaokouji joined #ruby-lang
Axsuul joined #ruby-lang
wyhaines joined #ruby-lang
qpingu joined #ruby-lang
nuclearsandwich joined #ruby-lang
Jake232 joined #ruby-lang
tbuehlmann joined #ruby-lang
RunYugin joined #ruby-lang
<RunYugin> привет, есть русско говорящие?
hack_ joined #ruby-lang
jordan` joined #ruby-lang
<yorickpeterse> What?
pgpkeys joined #ruby-lang
samshull joined #ruby-lang
nuclearsandwich joined #ruby-lang
wyhaines joined #ruby-lang
Manhose joined #ruby-lang
deryl joined #ruby-lang
scottschecter joined #ruby-lang
Austin__ joined #ruby-lang
spuk joined #ruby-lang
empity joined #ruby-lang
dr_bob joined #ruby-lang
retro|cz joined #ruby-lang
steph021 joined #ruby-lang
scottschecter joined #ruby-lang
samshull joined #ruby-lang
flexd joined #ruby-lang
Natch| joined #ruby-lang
macmartine joined #ruby-lang
nuclearsandwich joined #ruby-lang
Nisstyre joined #ruby-lang
curtism joined #ruby-lang
Manhose_ joined #ruby-lang
wyhaines joined #ruby-lang
Carnage\ joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
nofxx joined #ruby-lang
srbaker joined #ruby-lang
darkf joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
zmack joined #ruby-lang
gianlucadv joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
ecin joined #ruby-lang
echoprinter joined #ruby-lang
dv310p3r joined #ruby-lang
molgrew joined #ruby-lang
telotism joined #ruby-lang
zmack joined #ruby-lang
retro2 joined #ruby-lang
<telotism> can someone help me understand the use of the Ruby Index (ri) tool?
retro|cz joined #ruby-lang
<Mon_Ouie> It's used to read the documentation of Ruby methods or classes from the command line
<Mon_Ouie> e.g. ri Array#size
<telotism> it's returning "Nothing known about file" for me :(
<Mon_Ouie> Maybe you didn't install the documentation with Ruby
<Mon_Ouie> How did you install Ruby?
<telotism> I used the windows installer
<telotism> what is the documentation file called?
<Mon_Ouie> It's more than a single file (I don't remember where they are located exactly)
<telotism> oh, hmm
<telotism> well, I very well could have installed it incorrectly
<telotism> I'm a total green horn here
burgestrand joined #ruby-lang
<telotism> newby to ruby
<telotism> :)
<hagabaka> did you type "ri file"? what are you trying to look up?
<telotism> yep
<telotism> ri File.open actually
<telotism> or ri File
<telotism> and a number of others
<telotism> nothing's working
<hagabaka> you typed in the wrong case?
<telotism> sec
<telotism> nope
<telotism> neither work
Newbs joined #ruby-lang
<telotism> file or File
<yorickpeterse> It might be that the Ruby installer doesn't include the rdoc documentation
<yorickpeterse> Hence it can't find it
<telotism> crap
<hagabaka> the documentation should be a lot of .ri files
<telotism> anyway I can fix that?
<andrewvos> meh
<telotism> reinstall?
<yorickpeterse> Eeh, you could by manually installing Ruby probably but I have no experience with Ruby + Windows
<yorickpeterse> Perhaps give https://github.com/vertiginous/pik a try
<telotism> it's a gem?
<yorickpeterse> Seems so
<andrewvos> telotism: It's like rvm for windows
<telotism> let me try
<andrewvos> telotism: I would suggest "just using ubuntu". Install it in a vm or whatever.
<andrewvos> telotism: It will make your life a lot easier if you're playing around with ruby.
<telotism> ooof, that sounds painful
<telotism> i have a pretty old xp dell
<andrewvos> *That* sounds painful :)
<telotism> yeah,
<telotism> I'm easily lost
<telotism> new to programming in general
<telotism> figured the best choice would be ruby to start :)
corsican joined #ruby-lang
Carnage\ joined #ruby-lang
rolfb joined #ruby-lang
<hagabaka> you can also use ruby in mingw, I think it's pretty easy to install
<hagabaka> but you would still need some linux knowledge to use it well
<telotism> i've just run gem server
<mksm> telotism: try rebooting
tomzx joined #ruby-lang
<telotism> and it says I have rdoc 3.9.4
<telotism> ? :(
<andman> what version of ruby?
<telotism> 1.9.3 I believe
<telotism> very strange
<andman> with rvm all you'd have to do is rvm docs generate
<andman> never used ruby in windows so I'm not sure what the equivalent would be
<telotism> do i need to be in a special place in the console to access it?
<telotism> maybe a windows-specific question
<telotism> :(
<telotism> anyone else using Ruby and Windows?
<telotism> maybe even xp?
<telotism> btw, thank you andrewvos, andman, hagabaka, yorickpeterse, and Mon_Ouie :)
<andrewvos> telotism: NP. Sorry you have to deal with Windows.
<telotism> :D
<telotism> yeah
<telotism> poop
<telotism> ok
<telotism> thank you for trying ;)
<andrewvos> If I was stuck with a dell I would format that fucker and put Ubuntu on it immediately.
<erikh> not everyone wants to do that
<telotism> :)
<erikh> also, second day re-quitting smoking
<erikh> so don't push my buttons! :P
<andrewvos> erikh: Bad mood?
<andrewvos> hahah
<andrewvos> I've been through that. I will leave you well alone.
<erikh> actually it hasn't been bad
<telotism> the 3rd day is the hardest
<andrewvos> Although I will give you this advice: If you get through the first week, you're golden.
<erikh> few times I barked at people but most of this has been pretty mellow
<erikh> I did the last time
<erikh> I just relapsed when I moved
<erikh> no foreseeable moving in the future, so, time to quit again
<telotism> boredom, alcohol, caffiene, social smokers
<andrewvos> I have been smoking whenever I get drunk lately. After not smoking for years :(
<telotism> all bad for you
<telotism> right now
<telotism> i'm a pro at quitting :)
<telotism> unlike ruby :D
<erikh> plenty of booze and caffeine this weekend
<erikh> nothing overboard, but enough
<telotism> bad for the wagon
<andman> telotism: hey you could try installing the rdoc-data gem
<erikh> that only works for 1.8.7 and 1.9.1
misham joined #ruby-lang
<telotism> andman: well, do you think i need to ?
<telotism> it says i have the rdoc
<telotism> gem server
<ttilley> nicotine and caffeine are coaddictive.
<telotism> ttilley: agreed
<andman> according to https://github.com/rdoc/rdoc/issues/31 it could actually still work
<telotism> do I type "gem rdoc-data"
<telotism> ?
<andman> gem install rdoc-data
<telotism> sec
<telotism> fetching.. :)
workmad3 joined #ruby-lang
<telotism> ok..
<telotism> i suppose it's fetched
<telotism> tried again
<telotism> no dice
<andman> you need to run rdoc-data --install (which will probably give you an error but do it)
<telotism> I'm sorry
<ttilley> Chronic caffeine exposure potentiates
<ttilley> nicotine self-administration in rat
wyhaines joined #ruby-lang
<ttilley> sorry, didn't see the newline in the paste
<telotism> ttilley: :D
<telotism> In the end, we're all just rats
<andrewvos> mmmm reheated pizzza
<telotism> pizza hut?
<telotism> rdoc-data = no-go
<andman> telotism: error? paste the first two lines
<telotism> "not recognized as an internal or external command"
<Newbs> any experts on nested routes here?
<telotism> do i need to be in a special place in the console to access it?
<telotism> sec
<rue> Newbs: Presumably #rubyonrails routes?
<telotism> c:\documents and settings\logan\desktop>rdoc-data --install
<telotism> 'rdoc-data' is not recognized as an internal or external command,
<telotism> operable program or batch file.
<andman> needs to be in your path
<telotism> sorry, in my path?
<Newbs> yeah rue
<andrewvos> telotism: Piccante
Manhose_ joined #ruby-lang
<telotism> andrewvos: gorgonzola
<telotism> :)
<andman> telotism: the list of directories in which the console will look for the program you're trying to run
<telotism> I'm a REAL newby here
<telotism> so, andman, do I need to type something special in the console to get there?
livinded joined #ruby-lang
<telotism> I'm sorry for dragging you down the rookie hole with me
<telotism> it's cool
<telotism> thank you for helping
<andman> haha
<andman> no worries
<telotism> I'll keep giving it what I got :)
Nisstyre joined #ruby-lang
<andman> you could either go to the directory where rdoc-data resides, or put that directory in the system's path variable (google for that)
<telotism> andman: thanks man :)
<ttilley> telotism: if ruby itself is in your path but rdoc-data isn't, that's weird.
looopy joined #ruby-lang
<ttilley> telotism: can you ruby -S rdoc-data --install ?
<telotism> c:\documents and settings\logan\desktop>ruby -S rdoc-data --install
<telotism> ruby: No such file or directory -- rdoc-data (LoadError)
<Mon_Ouie> That's not weird. I don't have a rdoc-data binary either
<ttilley> telotism: ruby for windows has a menu item that starts a shell with ruby added to the path. use that and you should also be good with rdoc-data. and gem. and anything else living in that bin directory.
<ttilley> telotism: don't ask for details though, because i don't use windows. avoid it like the plague. =]
<andman> telotism: http://stackoverflow.com/questions/1587354/ruby-1-9-ri-problem/2726073 -- check out the second answer
dv310p3r joined #ruby-lang
<ttilley> telotism: it seems that people have the most success with jruby on windows though. less dicking around with C extensions. a java+jruby equivalent is almost always available, and jruby is more compatible with non-windows ruby than windows ruby is.
<telotism> andman, that did something
<telotism> c:\documents and settings\logan\desktop>ruby -S rdoc-data --install
<telotism> ruby: No such file or directory -- rdoc-data (LoadError)
<telotism> sorry
<telotism> sec
<telotism> Generating RI format into C:/Documents and Settings/Logan/.rdoc...
<telotism> Files: 16
<telotism> Classes: 1 (1 undocumented)
<telotism> Modules: 0 (0 undocumented)
<telotism> Constants: 0 (0 undocumented)
<telotism> Attributes: 0 (0 undocumented)
<telotism> Methods: 1 (1 undocumented)
<telotism> Total: 2 (2 undocumented)
<telotism> i think it's searching the desktop
Minalien joined #ruby-lang
solars joined #ruby-lang
Pip joined #ruby-lang
<telotism> oh! sec
<yorickpeterse> Please don't paste code in IRC
<yorickpeterse> Use pastie.org or gist.github.com or similar services
<telotism> yorickpeterse: :( sorry, ok
<telotism> my first time
<telotism> and last i guess
<telotism> very sorry
<andman> unless it's < 4 lines sez topic
<telotism> oh shite
<telotism> it's right there at the top!
<andrewvos> You don't have to apologise calm down :)
<yorickpeterse> :)
<telotism> well, i think you were right, andman
<telotism> i just forgot to go into the ruby folder
<telotism> it's installing a butt-load of stuff now
<telotism> using the rdoc --all --ri
jensn_ joined #ruby-lang
<andman> yeah, might take a while :)
Jake232 joined #ruby-lang
resetexistence joined #ruby-lang
dejongge joined #ruby-lang
zmack joined #ruby-lang
<telotism> is this what it's supposed to look like?
<andman> no
<telotism> crap
<andman> where did the generated ri files end up?
<telotism> c:/documents and settings/logan/.rdoc
<telotism> ttilley: so JRuby is better?
<andman> does ri --list-doc-dirs include that directory?
virunga joined #ruby-lang
nuclearsandwich joined #ruby-lang
<telotism> yes
Indian joined #ruby-lang
towski joined #ruby-lang
<echoprinter> anyone know why the 1st version of program run but the 2nd doesn't? http://www.pastie.org/2889443
<Mon_Ouie> Because there's no method a
<erikh> you need a semicolon between sum += a and the puts statement
<echoprinter> erikh: ah....
<echoprinter> damn
<Mon_Ouie> And you're trying to call the method a with puts(sum) (i.e. nil) as an argument
<erikh> two statements.
<echoprinter> I need to read more.
<erikh> shit happens. have fun
<echoprinter> :)
<erikh> anyone know of a canned solution for pidof that's also portabel?
<erikh> that's not ps aux | grep ...
<erikh> something in C
robbinnn joined #ruby-lang
<robbinnn> hi
<erikh> pidof doesn't seem to be doable outside of kernel interfaces, just wondering if anyone's seen a proper portable version out there
<robbinnn> i need to upload a image in a database and view images in the sites? did you have a tutoriel
<erikh> try #ror or railscasts.org
kmeehl joined #ruby-lang
<masterkorp> what's a cool, simple mail library for ruby ? :p
<erikh> pony or mail depending on your definition of simple
<masterkorp> erikh: well, what's the diference ? can you give me the link for both ?
<erikh> no, you can go to rubygems.org and search for them
<erikh> I'm not your personal google butler
<masterkorp> erikh: sorry
<telotism> google butler :D
<echoprinter> Why would the 1st program give me what I want but the 2nd using %w{} as an array give me an error? http://www.pastie.org/2889496
curtism joined #ruby-lang
samshull joined #ruby-lang
<shevy> echoprinter %w makes strings
scottschecter joined #ruby-lang
<Mon_Ouie> Because you're trying to add a string to an integer. %w-style arrays are for array of strings
<shevy> change to sum+=a.to_i
<Mon_Ouie> %w[… …] to […, …]
<shevy> echoprinter sum = 0; <-- also kill this ; please, it is visually annoying
<echoprinter> I tell ya, these books just don't go into this.
<echoprinter> thank you though, this helps.
<erikh> wait
<erikh> a semicolon is visually annoying? do you organize your socks by length and color?
<shevy> all my socks are black and the same size
<shevy> I am not looking at socks much though, unlike code :-)
<echoprinter> not adding a semicolon earlier caused my 30 minutes of hell...just figured I'd add now until I learn the language better.
<shevy> echoprinter less is more!
<echoprinter> :)
<shevy> hmm
<shevy> why does Array not have #to_i ?
RomD joined #ruby-lang
<shevy> aww
<Mon_Ouie> Why does Hash not have #to_io?
<shevy> what do you do with to_io ?
<Mon_Ouie> Convert my Hash into an IO object
<shevy> never seen to_io
<deryl> how would you convert an array to an integer?
<shevy> yeah
<shevy> problem is that it would become one integer, not a list of integers
<Mon_Ouie> We have #map already
<shevy> well .map(&:to_i) isn't much longer than .to_i
resetexistence joined #ruby-lang
havenn joined #ruby-lang
Jake232 joined #ruby-lang
qpingu joined #ruby-lang
<rue> erikh: I only *have* socks of a length
<rue> It's barbaric to have different socks.
<erikh> well then give me two handed axes
<echoprinter> And if I wanted a large array, not just a few element, like 1-1000?
<erikh> ideally you should use a range
<erikh> but this code will work
<erikh> (1..1000).to_a
<echoprinter> 1..1000?
<echoprinter> I'll look up range.
<erikh> yes, that's a Range object (ri Range)
<erikh> that's coerced to an array with #to_a
<erikh> you can check if an item is in the Range object
<erikh> (a Range object is just a tuple of first, last)
<erikh> they're significantly lighter in a lot of use cases
<erikh> if you need to mutate the array, use an array instead.
<echoprinter> Using a tuple is fine...works on first try...first time today that's happened. thanks.
<erikh> enjoy
<erikh> do you have a book to read? there are a few free ones on the intertubes
<erikh> like gratis free, not pirated free.
<manveru> erikh: anything by doctorow?
<erikh> heh.
malev joined #ruby-lang
<shevy> hmm
<shevy> is it bad to use plenty of small methods and plenty of aliases to those methods?
Carnage\ joined #ruby-lang
<rue> Indubitably yes
<shevy> why!
<shevy> I love aliases :(
<rue> Because of?
<shevy> aww I can't use that without a reason
artOfWar joined #ruby-lang
<yorickpeterse> Writing decent method names is too mainstream
<masterkorp> time to play with some ruby on rails
<shevy> oh project-internal the method names all seem to make sense, but I just realized I want a ".absolute_position = " method :(
<gentz> Where can I get the ruby documentation in the old format?
<rue> gentz: Old RDoc HTML output format?
<gentz> rue: yeah
<rue> I think you can find the old format files somewhere. Is there a reason you want that, in particular?
queequeg1 joined #ruby-lang
mpatel joined #ruby-lang
<gentz> rue: yeah. i think they're much more readable
thone_ joined #ruby-lang
<rue> You've tried darkfish, hanna and sdoc?
<gentz> rue: no. those look good though. i'll try them. thanks!
melter joined #ruby-lang
<mpatel> anyone know of a good resource that will help me understand how before, after, and around filters are constructed in ActiveModel? I'd really like to understand the code that implements these filters so I can implement similar functionality in a non-rails app that i am building. I don't mind requiring ActiveController libraries, but first I'd like to implement this functionality on my own so I can understand it.
<mpatel> i've googled around and found various references. but nothing really comprehensive. i suspect i will pour through them and piece together the implementation.
<manveru> mpatel: it's called aspect-oriented programming
Newbs joined #ruby-lang
<mpatel> ahhh. yes. i've encountered the term before.
flip_digits joined #ruby-lang
<manveru> there are few ways to pull that off in ruby
Newbs joined #ruby-lang
<rue> It's not really even AOP
<manveru> shevy: that's what happens when you get alias-happy
<rue> Since you're not injecting the code… it's just an agreed-upon sequence of filter hooks before, during and after the actual calls
<andrewvos> manveru: OMFG
<manveru> it's also the reason why i won't make ffi-tk API-compatible with the stdlib one
<manveru> why the hell do you need 6 ways to spell isopen
<yxhuvud> manveru: aieee my eyes they burn
burgestrand joined #ruby-lang
<andrewvos> manveru: Where's that from
<andrewvos> ?
<manveru> χ github/ruby/ruby % ack 'alias ' ext/tk/ | nopaste
LanceHaig left #ruby-lang
Jade joined #ruby-lang
Jade joined #ruby-lang
LanceHaig joined #ruby-lang
LanceHaig left #ruby-lang
lsegal joined #ruby-lang
[zaf]-Coral joined #ruby-lang
<shevy> whoa manveru
<shevy> manveru at first I wondered how you found out about my aliases when I saw that ... :-)
samshull joined #ruby-lang
infid joined #ruby-lang
<Radar> How can I customize the markup that RDoc uses for RDoc::ClassModule#description?
<Radar> drbrain: would you be able to help out on ^?
<TTilus> mpatel: aren't the filter chains in activesupport?
<TTilus> i might just be plain wrong again...
<drbrain> Radar: a) use --markup
<drbrain> b) use the :markup: directive on the comment
looopy joined #ruby-lang
<mpatel> TTilus: yes they are. i just want to understand how they are implemented.
<drbrain> Radar: note that currently only RDoc, TomDoc and rd format documentation are built-in to RDoc
<TTilus> mpatel: read the source, luke
<mpatel> mostly for educational purposes. then i can go to including them in my app.
<drbrain> I'm working on markdown in my free time, so it may not be another month or so
<TTilus> mpatel: its not that many lines of code
<mpatel> TTilus: yep. that's what'll do.
<Radar> drbrain: Yup, I've been reading the source. I'm just attempting to parse the Rails source and so adding :markup: to things isn't going to be (easily) possible I think.
<Radar> drbrain: I don't understand what I do with the --markup option still. Is there not a way to add new markups?
<drbrain> there is...
slyphon joined #ruby-lang
workmad3 joined #ruby-lang
<drbrain> Radar: I don't have it documented yet, but it's easy
<drbrain> well, "easy"
<andrewvos> I really didn't expect OWS and it's offshoots to last this long.
echoprinter left #ruby-lang
<drbrain> you write a parser that consumes text and emits an RDoc::Markup::Document tree
<drbrain> then you add your parser to RDoc::Text::MARKUP_FORMAT
steeljav joined #ruby-lang
<drbrain> RDoc::Text#parse looks up the markup based on the name and calls #parse on the returned parser
<drbrain> for all the existing parsers parse is class method on the Parser implementation
<drbrain> … the easy part is adding the parser
<drbrain> the not-as-easy part is writing a parser that emits the proper tree
<Radar> All of that is required just to change how description is output?
<Radar> Seems a bit excessive, no?
<drbrain> Radar: can you describe your broader problem then?
<drbrain> Radar: maybe you don't want to change the parser
<drbrain> Radar: if you want to create a new format for comments it needs to output as HTML, plain text and other formats to work for HTML, ri output, or PDF generation (someone has built such a thing)
<drbrain> so yes, it's a lot of work, but no more than necessary for all the formats that RDoc can output
<Radar> drbrain: http://api.rubyonrails.org sucks. It's like the same guys who dev'd Java got together and used their "design abilities" to design documentation.
<Radar> So I'm trying to make it better: http://radar.github.com/sume/
<Radar> But I need a way of indexing the docs, which is what I want to use RDoc for. I need separate HTML files for each class, module and method. Then I also need a separate JS file which acts as an index for these things.
<drbrain> so you're not editing the text of comments?
<Radar> No, that would be too large a task
<drbrain> ok, then you do not want to write a new parser
<drbrain> Radar: if you want a JS index, use this: http://rdoc.rubyforge.org/RDoc/Generator/JsonIndex.html
<drbrain> what you want to write is a generator, look at "Output Generation" here: https://github.com/rdoc/rdoc/blob/master/DEVELOPERS.rdoc
<drbrain> #description will give you HTML back for a class, method, etc.
<drbrain> you can combine that with a generator to get the individual pages you want
<yawnyawn> i am having some issues with this coding https://gist.github.com/1379376
<yawnyawn> can you guys tell me wht i am doing wrong?
<drbrain> here's what Darkfish currently does, you should be able to use it as a skeleton for your new thing: https://github.com/rdoc/rdoc/blob/master/lib/rdoc/generator/darkfish.rb#L164-180
<Radar> drbrain: alright thanks for your help, I'll look some more at that DEVELOPERS file and see if I can get this thing to work.
<drbrain> Radar: do you have some code already that I can look at?
<Radar> drbrain: Sure, https://gist.github.com/1379381. I've just been flailing wildly and figuring things out.
<yawnyawn> Radar and drbrain have u guys dealt with nested resources?
<drbrain> you're certainly on the right track
<drbrain> yawnyawn: I haven't, did you try #ror?
<Radar> yawnyawn: please ask in #rubyonrails
<yawnyawn> ok
<yawnyawn> thanks guys
<drbrain> Radar: JsonIndex should do what you need for searching
<drbrain> it's a slightly improved version of sdoc's search
<drbrain> (it adds the ability to type a class name like activerecord::base and get a hit)
<drbrain> you should be able to reuse the JS that it provides
Pip joined #ruby-lang
<Radar> Right, that sounds good.
Pip joined #ruby-lang
tomzx joined #ruby-lang
<drbrain> unfortunately I don't think I got around to documenting how to do that ☹
saLOUt joined #ruby-lang
Pip joined #ruby-lang
judofyr joined #ruby-lang
<drbrain> Radar: to proceed I would copy darkfish, rip out all the wrapper stuff you don't need (sidebars, footer) get that to work, then add back method lists or whatever other extra navigational info you want
<Radar> ok, I'll try that
<Radar> thanks again for your help
<drbrain> let me poke around to see if there's a better way to do fix_links
Pip joined #ruby-lang
Pip joined #ruby-lang
<drbrain> hrm, I don't think there is ☹
Pip joined #ruby-lang
<drbrain> it's too tied up with how #path works across all the CodeObject subclasses
<Radar> alright, no worries
<drbrain> which probably means I need to pull that out of the CodeObjects and stick it in a module somewhere
<rue> I'm kind of the opinion to not do too much work on it
<rue> Keeping it maintained and transitioning away would probably be better in the end. But that's usually my preference.
echoprinter joined #ruby-lang
postmodern joined #ruby-lang
Manhose joined #ruby-lang
echoprinter left #ruby-lang
<infid> is there a diff between map and each?
<andrewvos> infid: Yup
<andrewvos> infid: Map returns a list of what each block returns
<andrewvos> infid: Each iterates through a list.
<infid> i see, thanks
<andrewvos> [1,2,3].map {|a| "boobs" } # returns ["boobs", "boobs", "boobs"]
<lianj> ruby -e '[:each, :map].each{|m| p [:a].send(m){ :hello } }'
<deryl> hehe clear as mud reading it
<shevy> andrewvos what's with all those boos
<shevy> I mean boobs
<shevy> :(
<infid> that's the most i've ever seen
<shevy> infid, you can think of .map as .apply_on_each
<shevy> whereas .each just iterates through it
<shevy> [1,2,3].map {|x| x * 2} # => [2, 4, 6]
<shevy> see! every element gets multiplied by 2
<andrewvos> shevy: My example was far superior.
<infid> thanks
* infid drives shevy to the levee
resetexistence joined #ruby-lang
<shevy> andrewvos I am trying proper maths whereas you try it with boobs!
<andrewvos> shevy: FOR SCIENCE!
<lianj> :>
<infid> so [1,2,3].reduce {|x| x*2} is 4 because it does (1*1) = 1 * (2*1) = 2 * (2+2) = 4 ?
<infid> 2*2
<shevy> I am not sure what .reduce does
<burgestrand> reduce gives two parameters to the block
<shevy> oh
<shevy> never saw that one before
<shevy> Enumerable is really cool :)
<burgestrand> [1, 2, 3].reduce { |sum, current_item| sum + current_item }
<infid> it's supposed to go hand and hand with map in functional programming you always see map-reduce together
<shevy> 5..10).reduce(:+) vs (5..10).inject {|sum, n| sum + n }
<shevy> hmmmm
<shevy> it's shorter, so that is a plus
<infid> inject is just an alias
<andrewvos> yarp
<burgestrand> reduce/inject is useful when you have a list of values and want to reduce it to one value
<any-key> reduce is what it's named everywhere else
<shevy> but why the name "reduce"? When I read reduce I think of "reducing something"
<burgestrand> (but yes, you can also create lists if you want)
<lianj> shevy: inject(:+) works too..
<infid> haskell calls it fold instead of reduce
<burgestrand> shevy: you reduce a list of values to a single one
<burgestrand> sum of values, product of values, etc
<shevy> oh cool
<shevy> .inject :+
<shevy> that is almost readable now :)
<burgestrand> But not always, you could use it to reverse an array for example :)
robotmay joined #ruby-lang
<shevy> fold ... reduce ... inject ...
<mpatel> wow. that's the first Array I've seen with 3 boobs!
<lianj> 6
pxjorge joined #ruby-lang
macmartine joined #ruby-lang
<shevy> lol
<shevy> don't amazons have like 3 boobs
<andrewvos> shevy: Nice, but have you considered? ["b", "o", "o", "b", "s"].inject :+
<shevy> that does not work
<shevy> oh
<andrewvos> shevy: I beg to differ.
<shevy> odd. works when I use ()
<shevy> you are confusing my IRB andrewvos :(
<shevy> let's test in pry ...
<andrewvos> shevy: alias irb=pry
<shevy> hah! works in pry
<lianj> magic called recursion ;)
<shevy> andrewvos in a few years I'll have changed to pry, in a few decades to 1.9.x
<shevy> but that is really the first example I can think of where irb fails hmm
<andrewvos> shevy: Stop being so stubborn.
<yorickpeterse> ugh, 1.8
<shevy> I am slow, not stubborn. If things would work as they do, I would have changed, but I have no solution for using UTF-8 for my yaml files, retaining german umlauts in non-comments and still use my current editor.
<andrewvos> shevy: It doesn't work for me in irb either :|
<shevy> yeah!
<shevy> pry > irb finally in valid ruby code again
<shevy> hmm afk for a while, need to cook
<andrewvos> banister`sleep: Weird
<andrewvos> ?
<infid> does pry support all the plugins that irb does
<yorickpeterse> I doubt it
<andrewvos> infid: Which plugins?
<infid> wirble, awesome print, what_methods, etc
<infid> i had issue with some of them when i tried it
<andrewvos> infid: I think you'll find you what need those anymore
<andrewvos> what=won't
<lianj> shevy: can you show an example for your yaml issue? works fine here, dont make up excuses :P
towski joined #ruby-lang
<andrewvos> Whoa http://jpg.to/
<andrewvos> lianj: Haha that was the first thing I tried.
Bwild joined #ruby-lang
<banister`sleep> infid: pry has its own awesome print plugin, it doesnt support wirble but it has wirble-like features by default, and i dont know what what-methods is :)
<banister`sleep> infid: it's a very different implementatino to irb, so gems that monkey-patch irb's internals likely wont work
<andrewvos> banister`sleep: This works in pry but not irb: ["b", "o", "o", "b", "s"].inject :+
gix joined #ruby-lang
<banister`sleep> andrewvos: haha awesome
<banister`sleep> irb's a bit prudish
Manhose joined #ruby-lang
Locke23rus joined #ruby-lang
resetexistence joined #ruby-lang
<infid> banister`sleep: what's pry's print plugin called?
mnoble joined #ruby-lang
jeek_ joined #ruby-lang
<yorickpeterse> It's not a plugin
<yorickpeterse> It's a core feature :)
<yorickpeterse> But Pry uses pp for printing objects and such
<banister`sleep> a colorized pp yeah
<andrewvos> Python as a language has been seducing me lately.
benanne joined #ruby-lang
<erikh> so use it
<andrewvos> erikh: Nothing to use it on right now.
<erikh> it's not like ruby's gonna sit up all night wondering where the hell you've been
<andrewvos> erikh: But I have agreed with my pair that the next project we take on is going to be python.
<andrewvos> erikh: I hope you don't think I'm a "ruby person". I don't only write ruby.
<erikh> I don't know if you are or not
<erikh> lots of people in here aren't.
<andrewvos> Good.
macmartine joined #ruby-lang
wyhaines joined #ruby-lang
Manhose joined #ruby-lang
<rue> Blasphemy
<banister`sleep> andrewvos: wht other langaues do u use regularly
<shevy> I save it in geany as UTF-8, I display the content in my terminal or vim or in bluefish and the "�" is another character
macmartine joined #ruby-lang