ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
ryanf has joined #ruby-lang
chimkan has joined #ruby-lang
ryanf has joined #ruby-lang
wallerdev has joined #ruby-lang
takaokouji has joined #ruby-lang
datanoise has joined #ruby-lang
ryanf_ has joined #ruby-lang
shevy has joined #ruby-lang
<whitequark> why?! why is there no kawaii operator?!
<whitequark> a ^^= b
<whitequark> i SOOO miss it
savage- has joined #ruby-lang
owen1 has joined #ruby-lang
gregmoreno has joined #ruby-lang
nif_ has joined #ruby-lang
<mistym> whitequark: a ^^ b ==>?
tonesfrommars has joined #ruby-lang
retro_ has joined #ruby-lang
retro|cz has joined #ruby-lang
neoesque has joined #ruby-lang
gregmoreno has joined #ruby-lang
nif has joined #ruby-lang
cirwin has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
seanstickle has joined #ruby-lang
senthil has joined #ruby-lang
neoesque has joined #ruby-lang
<imperator> whitequark, ruby can't parse it
indeterminate has joined #ruby-lang
<imperator> it can't parse def ??? either, unless i need some special encoding
<imperator> oh, wait, 1.9 can, nm
<imperator> #encoding: utf-8; def ???; puts "Cute"; end; ??? #=> "Cute"
<bawer> what is a kawaii operator? what would it do exactly?
<imperator> bawer, kawaii is a japanese cultural thing; basically, cutesy shit
chimkan_ has joined #ruby-lang
igotnolegs has joined #ruby-lang
schroedinbug has joined #ruby-lang
arooni-mobile has joined #ruby-lang
chimkan has joined #ruby-lang
gsav has joined #ruby-lang
<whitequark> mistym: logical xor
<whitequark> like & and &&
<whitequark> we have ^, but no ^^
<whitequark> imperator: why can't it?
<whitequark> I think we don't have the ^^ operator by another reason
<whitequark> && and || are shortcuts
<whitequark> and, er, the shortcut behavior of ^^ would be _very_ unobvious
<whitequark> OTOH, there are TrueClass#^ and FalseClass#^
<erikh> perl has logical xor as well
<whitequark> godwin's law
<whitequark> er, a variation. "in any discussion about computer languages the probability of someone mentioning that perl has feature X rises to 1 with time"
<whitequark> that has some subtle implications.
arooni-mobile has joined #ruby-lang
<whitequark> imperator: what's with ??? ?
<imperator> whitequark, no idea what yer talking bout
<whitequark> imperator: > 05:17 < imperator> it can't parse def ??? either
<whitequark> why would you want to have a method named ??? :)
<imperator> you need a better irc client
<whitequark> irssi with utf-8 enabled
Sailias has joined #ruby-lang
<imperator> showed up as japanese in xchat
<imperator> my irc client can obviously beat up your irc client
RORgasm has joined #ruby-lang
<whitequark> はるひすずみやのゆううつ
<imperator> i see that fine, too
<whitequark> interesting
<whitequark> er, my IME did not handle kanji correctly. anyway.
lsegal has joined #ruby-lang
<whitequark> your irc client obviously does not have a proper encoding set for the connection
<whitequark> irclog.wq.org does not try to interpret the stream of bytes in any way and just spits it out to the browser with utf-8 header
<imperator> and yet, mine worked and yours did not
<imperator> pfffttttt
<imperator> nyah nyah
<whitequark> imperator: I bet your client does not send your lines to server, then receive them and display the result
<whitequark> it just adds what you have typed to the log
<whitequark> hence, it would work for you regardless of config correctness
<imperator> works for me!
<whitequark> oh, you're one of those bugzilla guys
<whitequark> RESOLVED WONTFIX
<whitequark> always looks like WEDONTCARE FUCKOFF for me...
<imperator> i see no configuration option for encoding, so whaddya want from me?
<imperator> I'M A VICTIM IN ALL THIS
<whitequark> nah, nothing. just was saying that encoding in your client is clearly broken. if you don't care, I neither :)
shtirlic_ has joined #ruby-lang
Teddy2steper has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
ryanf_ has joined #ruby-lang
postmodern has joined #ruby-lang
gnufied1 has joined #ruby-lang
nif has joined #ruby-lang
Teddy2steper has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
hexreel has joined #ruby-lang
gix has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
elalande has joined #ruby-lang
gregmoreno has joined #ruby-lang
ridders24 has joined #ruby-lang
Gekz has joined #ruby-lang
seanstickle has joined #ruby-lang
arooni-mobile has joined #ruby-lang
fgomez has joined #ruby-lang
Jade has joined #ruby-lang
nif has joined #ruby-lang
slyphon has joined #ruby-lang
dr0id has joined #ruby-lang
<imperator> slyphon, yo
<slyphon> imperator: hai!
elalande has joined #ruby-lang
RORgasm has joined #ruby-lang
fgomez has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
slyphon has joined #ruby-lang
Boohbah has joined #ruby-lang
nif has joined #ruby-lang
AndChat| has joined #ruby-lang
imperator has quit ["Leaving"]
takaokouji has joined #ruby-lang
rippa has joined #ruby-lang
Teddy2steper has joined #ruby-lang
dabradley has joined #ruby-lang
jayne has joined #ruby-lang
spuk has joined #ruby-lang
srbaker has joined #ruby-lang
fayimora has joined #ruby-lang
bhrgunatha has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
My_Hearing has joined #ruby-lang
deobald has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
gokul has joined #ruby-lang
RORgasm has joined #ruby-lang
JohnBat26 has joined #ruby-lang
stanis has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
rippa has joined #ruby-lang
x0F__ has joined #ruby-lang
dabradley has joined #ruby-lang
Fullmoon has joined #ruby-lang
H2H has joined #ruby-lang
yxhuvud has joined #ruby-lang
<jarred> For something I'm working on, I need to parse Nginx's config file. Has anyone heard of a gem or C library that does this? I'd prefer to avoid writing my own
zmack has joined #ruby-lang
ryez has joined #ruby-lang
francisfish has joined #ruby-lang
thrcka has joined #ruby-lang
cola_zero has joined #ruby-lang
publicvoid__ has joined #ruby-lang
gokul has joined #ruby-lang
kitallis has joined #ruby-lang
frangiz has joined #ruby-lang
frangiz_ has joined #ruby-lang
tjadc has joined #ruby-lang
tjadc_ has joined #ruby-lang
frangiz has joined #ruby-lang
thrcka_ has joined #ruby-lang
deobald has joined #ruby-lang
thrcka_ has joined #ruby-lang
elalande has joined #ruby-lang
RORgasm has joined #ruby-lang
<shevy> <imperator> I'M A VICTIM IN ALL THIS
jxie has joined #ruby-lang
<shevy> ^^^ ahhhh... somehow that makes me happy... in an evil sort of way
jxie_ has joined #ruby-lang
jxie has joined #ruby-lang
mikeric has joined #ruby-lang
frangiz_ has joined #ruby-lang
gnufied has joined #ruby-lang
gnufied has joined #ruby-lang
workmad3 has joined #ruby-lang
jfelchner has joined #ruby-lang
gokul has joined #ruby-lang
dhruvasagar has joined #ruby-lang
mikkelb has joined #ruby-lang
srbartlett has joined #ruby-lang
<mikkelb> Does anybody know if I can use Ruby to build Windows 8 Metro Style apps? http://www.zdnet.com/blog/microsoft/microsoft-to-developers-metro-is-your-future/10611
<shevy> if it is just html and css, sure why not
apeiros_ has joined #ruby-lang
gunboat has joined #ruby-lang
<mikkelb> shevy: What do you mean?
<mikkelb> Yeah it allows you to use HTML and CSS, but for the low-level stuff I was hoping I'd get to use Ruby instead of C#, C++ or Visual Basic?
drumond19 has joined #ruby-lang
<Mon_Ouie> I think he just means you can get the same result using Ruby, just not using the same tools
drumond19 has joined #ruby-lang
rohit has joined #ruby-lang
seoaqua has joined #ruby-lang
gokul has joined #ruby-lang
solars has joined #ruby-lang
kyrylo has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Indian has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
<andrewvos> This is what it's like hanging out here http://www.invisiblehairsuit.com/nothing_happens.htm
ngw has joined #ruby-lang
<Asher> anyone know offhand how well ruby2c works?
RORgasm has joined #ruby-lang
esad has joined #ruby-lang
gokul has joined #ruby-lang
gokul has joined #ruby-lang
spencerward has joined #ruby-lang
rushed has joined #ruby-lang
gokul has joined #ruby-lang
kiddorails has joined #ruby-lang
rohit has joined #ruby-lang
gokul has joined #ruby-lang
dous has joined #ruby-lang
mattyoho has joined #ruby-lang
rohit has joined #ruby-lang
burgestrand has joined #ruby-lang
thrcka has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
mattyoho has joined #ruby-lang
mattyoho has joined #ruby-lang
elalande has joined #ruby-lang
bjensen has joined #ruby-lang
benanne has joined #ruby-lang
tbuehlmann has joined #ruby-lang
tbuehlmann has joined #ruby-lang
seanstickle has joined #ruby-lang
AlHafoudh has joined #ruby-lang
<AlHafoudh> hi all
<AlHafoudh> is there any mechanize CLI ?
<AlHafoudh> shell...
RORgasm has joined #ruby-lang
webguynow has joined #ruby-lang
m3nd3s has joined #ruby-lang
<andrewvos> AlHafoudh: What are you trying to achieve?
<dragonkh> yo yo - Easter Feaster in da House - what!
retro|cz has joined #ruby-lang
m3nd3s_ has joined #ruby-lang
imperator has joined #ruby-lang
toretore has joined #ruby-lang
kiddorails has joined #ruby-lang
m3nd3s has joined #ruby-lang
m3nd3s has joined #ruby-lang
robgleeson|mba has joined #ruby-lang
<AlHafoudh> andrewvos: neverming, I need to do it other way
<AlHafoudh> is there any XML API consuming gem (no oauth) which preserves and carries cookies?
m3nd3s has joined #ruby-lang
Indian has joined #ruby-lang
esad has joined #ruby-lang
S1kx has joined #ruby-lang
arooni-mobile has joined #ruby-lang
yalue has joined #ruby-lang
malev has joined #ruby-lang
enebo has joined #ruby-lang
morozovm has joined #ruby-lang
vesan has joined #ruby-lang
kiddorails has joined #ruby-lang
bglusman has joined #ruby-lang
bglusman_ has joined #ruby-lang
<robgleeson|mba> andrewvos: did you fix your vim mapping problem?
<andrewvos> robgleeson|mba: I didn't
<robgleeson|mba> andrewvos: maybe you missed it, but did you try map <leader>X <C-s> ?
<andrewvos> robgleeson|mba: Mapping to C-s didn't work :/
Sailias has joined #ruby-lang
<robgleeson|mba> hrm.
<andrewvos> robgleeson|mba: It's only when Command-T is open, which means I can't map to leader key anyway
<robgleeson|mba> what did it do, if anything?
<andrewvos> But I did try mapping C-x
<andrewvos> C-x to C-s even
<andrewvos> .
<robgleeson|mba> that's annoying. :(
<andrewvos> yeap
_inc has joined #ruby-lang
malev has joined #ruby-lang
bgfbghnbgh has joined #ruby-lang
<bgfbghnbgh> hi
<imperator> good morning
tomzx has joined #ruby-lang
<bgfbghnbgh> GOOD morning
justinxreese has joined #ruby-lang
vereteran-x has joined #ruby-lang
codewrangler has joined #ruby-lang
kiddorails has joined #ruby-lang
Yu\2 has joined #ruby-lang
seanstickle has joined #ruby-lang
mstratman has joined #ruby-lang
tjadc has joined #ruby-lang
vereteran has joined #ruby-lang
Jade has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
Sailias has joined #ruby-lang
scampbell has joined #ruby-lang
JEG2 has joined #ruby-lang
bgfbghnbgh has quit [#ruby-lang]
RORgasm has joined #ruby-lang
jtoy has joined #ruby-lang
DEac- has joined #ruby-lang
outoftime has joined #ruby-lang
mistym has joined #ruby-lang
dv310p3r has joined #ruby-lang
RORgasm has joined #ruby-lang
dejongge has joined #ruby-lang
<andrewvos> robgleeson|mba: Looking at the source, I can't see how it even maps horizontal or vertical splits :/
<andrewvos> robgleeson|mba: https://github.com/wincent/Command-T.git
<andrewvos> wtf
thone has joined #ruby-lang
<andrewvos> Wait.
<andrewvos> What the fuck. Apparently I'm using this one: https://github.com/thesamet/Command-T
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
<robgleeson|mba> oh, hah, I'm using the official one.
<andrewvos> robgleeson|mba: Ok the official one works. FML
<robgleeson|mba> at least it is solved. :p
<andrewvos> Stupid google showing forks as the first result.
<andrewvos> Yeah, until next time :)
<andrewvos> robgleeson|mba: Thanks though.
<andrewvos> What does C-s do by the way?
<robgleeson|mba> for me, nothing.
<robgleeson|mba> I'm on OSX though.
<robgleeson|mba> I think on Linux/Windows it saves.
msisk has joined #ruby-lang
<andrewvos> robgleeson|mba: It has some usage inthe terminal though right?
<robgleeson|mba> ah yeah.
<robgleeson|mba> it sends SIGINT.
<andrewvos> Oh right
nif has joined #ruby-lang
<Mon_Ouie> Oh, *that* is why sometimes my terminal seems to freeze when I try to hit C-r!
<Mon_Ouie> (with r next to s on my keyboard layout)
<andrewvos> yeah
jtoy has joined #ruby-lang
futurechimp has joined #ruby-lang
headius has joined #ruby-lang
andrewhl has joined #ruby-lang
apeiros_ has joined #ruby-lang
kvirani has joined #ruby-lang
florentg2 has joined #ruby-lang
gsav has joined #ruby-lang
rippa has joined #ruby-lang
chimkan has joined #ruby-lang
kiddorails1 has joined #ruby-lang
crackity_jones has joined #ruby-lang
loh has joined #ruby-lang
headius has joined #ruby-lang
mssola has joined #ruby-lang
takaokouji has joined #ruby-lang
erics has joined #ruby-lang
m3nd3s has joined #ruby-lang
esad has joined #ruby-lang
workmad3_ has joined #ruby-lang
nif has joined #ruby-lang
workmad3_ has joined #ruby-lang
solars has joined #ruby-lang
crackity_jones_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
nif has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
io_syl has joined #ruby-lang
andrewhl has joined #ruby-lang
bawer has joined #ruby-lang
savage- has joined #ruby-lang
rdavila has joined #ruby-lang
datanoise has joined #ruby-lang
butchanton has joined #ruby-lang
jxie has joined #ruby-lang
workmad3 has joined #ruby-lang
H2H has joined #ruby-lang
fayimora_ has joined #ruby-lang
Kero_ has joined #ruby-lang
butchanton has joined #ruby-lang
spuk has joined #ruby-lang
rking has joined #ruby-lang
rking has joined #ruby-lang
wmoxam has joined #ruby-lang
cirwin has joined #ruby-lang
Austin__ has joined #ruby-lang
Teddy2steper has joined #ruby-lang
malev_ has joined #ruby-lang
Fullmoon has joined #ruby-lang
Skif has joined #ruby-lang
lsegal has joined #ruby-lang
malev has joined #ruby-lang
gnufied has joined #ruby-lang
dustacio has joined #ruby-lang
l0st1 has joined #ruby-lang
<ridders24> hi guys
<ridders24> mistym: i noticed what that problem is with the script. It only giving the last file in the last folder: http://pastie.org/3750114
<mistym> ridders24: Oh, of course! I see the problem now.
<mistym> Sorry it didn't occur to me last time.
<mistym> Did you figure out what was causing it?
dustacio has joined #ruby-lang
<shevy> random kobolds in his computer
<ridders24> mistym: I didnt work out what was causing it, I just noticed the problem this morning.
<mistym> ridders24: Take a look at your File.open arguments. Notice the file mode you selected?
<ridders24> mistym: but least its not becuase of the expression as such
My_Hearing has joined #ruby-lang
<ridders24> mistym: as in "w" write?
<mistym> ridders24: Yes.
<mistym> shevy: Kobolds are a constant worry, of course. I have stonefall traps set up to prevent thieving from my stockpiles.
<shevy> very clever!
<ridders24> mistym: i need to write to the file though?
<mistym> ridders24: Yes, but there's more than one way to do that!
<mistym> "w" isn't just a write mode. It *replaces* the file with what you're writing.
<ridders24> mistym: oh ok
<mistym> So every time you run that File.open... block, you're replacing the file, so you're losing what you wrote to it before.
wyhaines has joined #ruby-lang
<ridders24> oh i see
<mistym> "a" is append mode - it adds what you're writing to the end of the file, without touching what's already there.
z3r00ld has joined #ruby-lang
<ridders24> mistym: trying it now. I also have another question which i thought about today
<mistym> Shoot!
chimkan_ has joined #ruby-lang
crudson has joined #ruby-lang
* shevy shoots at ...
<ridders24> mistym: the script works btw. many thanks :). Back to my question so up until now ive been testing the script on a test enviroment, so the input isnt the one i will be using, it then crossed my mind that in the real input file the filenames will be for example ABC/1/2 but the actual file name would be ABC-1-2
<mistym> Sounds like a job for gsub!
<mistym> 'foo/bar'.gsub! '/', '-' ==> 'foo-bar'
<ridders24> so it replaces the symbol
<mistym> It replaces whatever pattern you feed it in the first argument with the pattern in the second argument.
<ridders24> awesome, let me see if i can add this
<mistym> So out of curiosity, what's this script doing? I remember something about floppies earlier. You have a bunch of data you're checking?
mattyoho has joined #ruby-lang
<ridders24> I have a bunch of servers that have computer images on, and the input is a list of images that can be deleted. But i need a way of indentifing what images have already been deleted and what ones still exist
Radium has joined #ruby-lang
gregmoreno has joined #ruby-lang
<mistym> Aha.
gregmoreno has joined #ruby-lang
nif has joined #ruby-lang
chimkan has joined #ruby-lang
havenn has joined #ruby-lang
sodani has joined #ruby-lang
<sodani> if I want to follow 301/302 redirects until I get a 200 and then just get the http header (not the body), what gem would be recommended?
headius has joined #ruby-lang
<ridders24> mistym: i think i put it in the wrong place :( http://pastie.org/3750114
<mistym> ridders24: There's a typo in the gsub line.
<mistym> See if you can figure out what you did!
<ridders24> i see it
<ridders24> or maybe i dont.... I removed the !
<mistym> Nope, that's not it.
<mistym> It's not the method name or its arguments.
<ridders24> i'll put the ! back
<havenn> ridders24: Just an aside, but you can shorten split(" ") to just split (splitting on " " is default behavior).
<havenn> ridder24: Hint: first char of line 6 is an error =P
<ridders24> ohhh
<ridders24> no need for ' '
z3r00ld2 has joined #ruby-lang
<mistym> Yes! You weren't gsubbing the contents of column2, you were gsubbing from a string containing the text "column2"
<ridders24> my bad
<ridders24> awesome works like a charm
Andorbal has joined #ruby-lang
<ridders24> many thanks once again for putting up with me and my many questions
<mistym> No problem, glad to help :D
savage- has joined #ruby-lang
<Andorbal> Is there any mechanism when using 'require' to handle different files with the same name?
Carnage\ has joined #ruby-lang
<shevy> Andorbal what
<shevy> different files, with same name??
<Andorbal> I'm using Albacore and the Logging gems in my rake file, and Albacore has a file named logging.rb.
rolfb has joined #ruby-lang
<shevy> I dont think they can exist at the same location on the hdd. if you omit the file ending... it may try .rb first then .so
<mistym> Albacore should probably have put its libs in lib/albacore/whatever so you can require 'albacore/logging'
<My_Hearing> It uses the first directory of $LOAD_PATH that contains the file you required
<Andorbal> Albacore looks to have that structure, but when I require 'albacore', the lib/albacore/support path (where logging.rb lives) is put into the load path
<Andorbal> My_Hearing: that's actually the problem I'm having...
mrsolo has joined #ruby-lang
RubyRedGirl has joined #ruby-lang
<Mon_Ouie> I would report this as a bug
<Mon_Ouie> The library shouldn't modify the LOAD_PATH, that's what rubygems is for
<Andorbal> I don't think the library is modifying the load path directly...
<Mon_Ouie> It is
RomyRomy has joined #ruby-lang
<Andorbal> After I require a gem, that gem's lib folder shows up when you do "puts $:" which makes sense
<Mon_Ouie> The 5 first lines do not belong there
RubyRedGirl has joined #ruby-lang
cirwin has joined #ruby-lang
<Andorbal> That would be the problem then ;)
<Mon_Ouie> The second one is what rubygems will do as needed, the others just shouldn't pollute the load path
<Andorbal> So is that something that used to be done manually? I've talked with Derrick a bit and it sounds like some of this was written when he was still starting out with gems
<Mon_Ouie> Well, it's something you'd do if you were not using rubygems
<Andorbal> Well, I think he designed it to work with IronRuby, so I may just wrap that code with the check he's got in there for IronRuby
<Andorbal> Of course, I don't know if rubygems works with IronRuby or not since I've never used IR.
mikeric has joined #ruby-lang
z3r00ld has joined #ruby-lang
crudson has quit [#ruby-lang]
<sodani> drbrain: with mechanize, is there a way for me to get response headers only (and not the body)?
rking has joined #ruby-lang
z3r00ld has joined #ruby-lang
rking_ has joined #ruby-lang
rking has joined #ruby-lang
<z3r00ld> hi, I want to write a program which runs as a process (goal is not to put individual code into crontab which end up lots of log files redirection/checks) and executes/checks keep tracks of other code/process. some link or gem i can start with
dhruvasagar has joined #ruby-lang
<canton7> z3r00ld, maybe look at god, foreman, bluepill, upstart?
<shevy> anyone using http://rio.rubyforge.org/ and can recommend it ?
<z3r00ld> canton7: thanks, checking ..
nif has joined #ruby-lang
bensw has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
florentg2 has joined #ruby-lang
Tref has joined #ruby-lang
Tref has joined #ruby-lang
Zolrath has joined #ruby-lang
<lake> is there a built in ruby method for asking for yes/no/y/n confirmation?
<lake> i hate rolling my own each time
<lake> via gets.chomp == 'yes', etc
<canton7> lake, maybe the highlien gem?
<canton7> *highline
<rolfb> tpope: 140 chars is hard
<bensw> Suppose I have a module "Library" with a class "Book", in a new file I require the file with the Module "Library". I now want to in this new file create a new instance of "Book"
<bensw> but when I do "book = Library.Book.new(params)
<bensw> "
<bensw> I get an error
<bensw> Any insight? this is my first time using ruby...
RORgasm has joined #ruby-lang
<canton7> bensw, Library::Book.new ?
florentg2_ has joined #ruby-lang
<lake> canton7: i see. i am using thor, actually, so that has built in methods for that. thanks.
florentg2_ has joined #ruby-lang
havenn has joined #ruby-lang
Sailias_ has joined #ruby-lang
BenSw has joined #ruby-lang
linless has joined #ruby-lang
vpamulap has joined #ruby-lang
z3r00ld3 has joined #ruby-lang
headius has joined #ruby-lang
tonesfrommars has joined #ruby-lang
kiddorails1 has quit [#ruby-lang]
bensw has joined #ruby-lang
<bensw> Hi, I was wondering if something can help me with a simple Ruby question
<mistym> bensw: Shoot!
<bensw> I have one file Library.rb that includes a module "Library" with class "Book"
<bensw> "Book" includes the function initialize(params)
<bensw> I want to use this in another file
<any-key> require_relative "Library.rb"
<canton7> bensw, did you try my suggestion from the first time you asked that?
<any-key> include "Library"
BenSw_ has joined #ruby-lang
<BenSw_> (if my internet ever decides to work)
<BenSw_> but anyways,
<BenSw_> if I try to do book = Library.Book.new(params)
<BenSw_> that also gives an error
<canton7> what error?
<kyrylo> BenSw_, as canton7 said, try Library::Book.new
<BenSw_> ok
<BenSw_> one second
<BenSw_> thank you!
<BenSw_> works
krz has joined #ruby-lang
Brainix has joined #ruby-lang
mikeric has joined #ruby-lang
chimkan_ has joined #ruby-lang
z3r00ld has joined #ruby-lang
postmodern has joined #ruby-lang
Sailias_ has joined #ruby-lang
macmartine has joined #ruby-lang
ironcamel has joined #ruby-lang
mattyoho has joined #ruby-lang
mattyoho has joined #ruby-lang
BenSw has joined #ruby-lang
cirwin has joined #ruby-lang
andrewhl has joined #ruby-lang
mikeric has joined #ruby-lang
Jake232 has joined #ruby-lang
<Jake232> Does anyone know which part of activerecord I need to include, to get the 1.day, and 1.month etc?
wallerdev has joined #ruby-lang
<apeiros_> active_support/core_ext
<apeiros_> probably even only a part of core_ext
<Jake232> That'll do anyway
<Jake232> thanks
<apeiros_> and it comes from activesupport, not activerecord
hagabaka has joined #ruby-lang
z3r00ld1 has joined #ruby-lang
spuk has joined #ruby-lang
cirwin has joined #ruby-lang
outoftime has joined #ruby-lang
wyhaines has joined #ruby-lang
Radium has joined #ruby-lang
<mistym> Anyone willing to lend a little code critique?
<any-key> surewhynot
<mistym> Tossed together something quick to learn Curses, figure feedback always helps.
<mistym> (Lesson learned, btw: don't use the builtin Curses.)
<shevy> ewwwww curses
<shevy> you brave person!
<any-key> bleehhh
<any-key> oh hey, a do while loop
<shevy> loop
<shevy> somebody rescue me
<shevy> :(
<any-key> mistym: seems fairly straightforward, I can't see anything that'd need changing
<shevy> mistym, that code works only on 1.9.x ?
<mistym> any-key: Thanks! Figured as much, but it's always good to hear that from someone else so I know I didn't make a dumb decision I didn't realize ;)
<any-key> I didn't go very indepth, just a cursory glance at style
<mistym> shevy: Possibly? I didn't test on 1.8.x. Did it barf on anything?
<shevy> oh yeah
<shevy> but that's the past, we have to concentrate on the future!
<mistym> 1.8 doesn't have sample? Wow. I had no idea.
<shevy> hehe
<mistym> messages.rb randomizes a hazard based on a random array entry:
<mistym> "The #{["in","suc"].sample}cubus seems ecstatic!\nEverything goes dark..."
<mistym> (Or, for less hardy adventurers, "The #{["in","suc"].sample}cubus seems disappointed.")
Radium has joined #ruby-lang
Radium has joined #ruby-lang
<drbrain> mistym: in two months, 1.8 won't have official support, either!-
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
Radium has joined #ruby-lang
<shevy> hmm
y3llow has joined #ruby-lang
s0ber has joined #ruby-lang
<shevy> that's like a countdown
wyhaines_ has joined #ruby-lang
bjensen has joined #ruby-lang
<mistym> drbrain: So I'm totally not going to work around it for 1.8.x :D
msisk has joined #ruby-lang
andrewhl has joined #ruby-lang
y3llow has joined #ruby-lang
Radium has joined #ruby-lang
Radium has joined #ruby-lang
H2H has joined #ruby-lang
Radium has joined #ruby-lang
y3llow has joined #ruby-lang
<Mon_Ouie> I think 1.8 had a method that allows to take a random element from an array, but not n random elements
Radium has joined #ruby-lang
BenSw has joined #ruby-lang
<mistym> Oh, you're right. #choice
<mistym> Which doesn't exist in 1.9. Hooray.
<any-key> whaaat
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
<shevy> good old 1.8
<shevy> I demand an official farewell party when the day has come
<ddfreyne> that is weird
<ddfreyne> There is #sample
<ddfreyne> Array#sample
<shevy> folks, you are digging in a dead patient here!
y3llow has joined #ruby-lang
<ddfreyne> Let’s hope OSes start bundling Ruby 1.9 soon
<shevy> rule of thumb says
<shevy> on debian, new version + 3 years delay
<ddfreyne> heh
<mistym> ddfreyne: In 1.9, which is what my code is written for. Not going to fix it for 1.8 though.
msisk has joined #ruby-lang
<any-key> and that is why debian pisses me off
<any-key> although I use it a lot
Radium has joined #ruby-lang
Radium has joined #ruby-lang
<mistym> shevy: Apparently my use of rand in the Creature class also doesn't work in 1.8, so not fixing it with an alias ;)
Radium has joined #ruby-lang
Radium has joined #ruby-lang
Radium has joined #ruby-lang
<mistym> 1.9 lets you rand from a range (which is great when I have a range of acceptable ASCII characters!), 1.8 doesn't.
Radium has joined #ruby-lang
<shevy> well
<shevy> my goal is to be the last person on #ruby-lang using 1.8.x
Radium has joined #ruby-lang
<mistym> shevy: You are well on your way, padawan
<shevy> yeah!
Radium has joined #ruby-lang
<Mon_Ouie> 1.9.3 is the one that added rand(x..y)
Radium has joined #ruby-lang
<mistym> Mon_Ouie: Didn't realize it wasn't around before!
bglusman has joined #ruby-lang
<Mon_Ouie> You can do rand(max - min) + min just fine though
nif has quit ["Initiating backup..."]
Sailias has joined #ruby-lang
<sodani> hello, how can I execute a code block a certain number of times or until a condition is met?
<andrewvos> sodani: 5.times { code goes here }
<andrewvos> sodani: If you want to exit out of that use break.
<sodani> andrewvos: ah awesome. thanks
echoprinter has joined #ruby-lang
<amerine> drbrain: Congrats on the new corporate overlords!
<amerine> zenspider: ^^ you too.
<drbrain> amerine: 53% new!
<amerine> hehe
Radium has joined #ruby-lang
Radium has joined #ruby-lang
malev_ has joined #ruby-lang
Radium has joined #ruby-lang
Radium has joined #ruby-lang
Radium has joined #ruby-lang
robbyoconnor has joined #ruby-lang
esad has joined #ruby-lang
<mistym> drbrain: New corporate overlords?
<drbrain> mistym: 53% new!
<drbrain> mistym: AT&T Interactive was (mostly) sold
<apeiros_> drbrain: oh, you work at ATTI too? do you work together with tenderlove?
<andrewvos> This is quite fun: http://exploit-exercises.com/
<drbrain> apeiros_: yes and yes
<apeiros_> nice
* apeiros_ slightly jealous :)
<drbrain> normally he'd be sitting next to me, but he's going to emerge some enterprise technologies in Philadelphia, or something
_inc has joined #ruby-lang
_inc has joined #ruby-lang
havenn has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
hackingoff has joined #ruby-lang
petercooper has joined #ruby-lang
canton7 has joined #ruby-lang
toertore has joined #ruby-lang
kvirani has joined #ruby-lang
Fullmoon has joined #ruby-lang
headius has joined #ruby-lang
esad has joined #ruby-lang
Radium has joined #ruby-lang
Kero has joined #ruby-lang
werwolf has joined #ruby-lang
slyphon has joined #ruby-lang
io_syl has joined #ruby-lang
<sodani> if I'm in a class method, how do I call another class method that's within the same class? just with Class.other_class_method?
<apeiros_> just `other_class_method`
z3r00ld1 has quit [#ruby-lang]
slyphon has joined #ruby-lang
_inc has joined #ruby-lang
Kero has joined #ruby-lang
<sodani> apeiros_: thanks
mattyoho has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
H2H has joined #ruby-lang
robbyoconnor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
ConstantineXVI has joined #ruby-lang
bru has joined #ruby-lang
bru has quit [#ruby-lang]
Boohbah has joined #ruby-lang
r0bby has joined #ruby-lang
<ged> Anyone know (under 1.9.3p125) how to get non-named matches out of the middle of a named capture group? E.g., for the regexp: /(?<whole>(\w+)(\S+))/, I want what would be $2 and $3 if the outside capture group weren't named.
r0bby_ has joined #ruby-lang
<petercooper> without using a MatchData object, etc?
<ged> With or without is fine.
<ged> I can't get MatchData to show positional captures either.
<petercooper> Think I might be misunderstanding the question :)
<ged> One sec.
<hackingoff> Have you tested your regex to make sure that it's correct?
<petercooper> e.g. x = "xyz".match(/(\w)(\w)(\w)/) x[1] x[2] x[3] etc..
<ged> hackingoff: Yes.
<hackingoff> When is a capture group unnamed?
imperator has quit ["Leaving"]
<shevy> ged!
<ged> hackingoff: /(.)/ is an unnamed capture group.
<shevy> how is faeriemud doing!
<andrewvos> /(.)(.)/
dcorbin has joined #ruby-lang
<andrewvos> \(.)(.)/
<shevy> boobs!
<ged> shevy: somewhat lonely and neglected these days.
<Boohbah> yes?
bglusman has joined #ruby-lang
<andrewvos> hahah
<shevy> no not Boohbah
<Boohbah> :D
<drbrain> ged: "Note: A regexp can't use named backreferences and numbered backreferences simultaneously."
r0bby_ has joined #ruby-lang
<drbrain> ged: this may be why ^^
<andrewvos> Wow this looks awesome http://mosh.mit.edu/? ... oh it won't install on my ec2 box. Fuck it then. /forgets forever
<ged> drbrain: Argggh... where is that?
<drbrain> ged: ri Regexp
<rue> For bonus points, do a grep on that
<rue> Meta!
<andrewvos> man grep |grep grep
<ged> drbrain: Damn. I could have sworn that worked at some point. Thanks for the edumacation.
<drbrain> ged: maybe it did?
<andrewvos> Seriously though. All I want to know from this page is what window manager is that in the screenshot? http://mosh.mit.edu/?
<whitequark> edumacation?
<Boohbah> andrewvos: isn't that some type of OS X?
brushbox has joined #ruby-lang
r0bby_ has joined #ruby-lang
<drbrain> Boohbah: not that I've seen
<andrewvos> Boohbah: In the first screenshot? Doubt it.
* Boohbah does not know then
<andrewvos> Oh wait
<andrewvos> In the screenshots below it says "Gnome Terminal"
<andrewvos> It does look quite nice. Not sure about trying Gnome/Unity lately though since they started making their design decisions in a crack den.
<hackingoff> You can try Cinnamon, though it's not all that mature yet.
<hackingoff> Or just use Gnome 2, since it's not broken.
<ged> whitequark: an intentional misspelling.
wyhaines has joined #ruby-lang
<ged> whitequark: intended to imply that I feel undereducated when drbrain answers my questions.
<mahlon> ged: So how I feel when you answer mine.
<ged> But that's likely a failure to gauge how esoteric the joke was.
<ged> mahlon: Bah.
r0bby_ has joined #ruby-lang
<kyrylo> Boohbah, it looks like Elementary theme for me: http://goo.gl/eDiuX
<kyrylo> *to me
<kyrylo> Boohbah, whoops, sorry.
<kyrylo> andrewvos, ^
<andrewvos> kyrylo: Thanks
<andrewvos> Wish I had the energy to switch to linux again.
woollyams has joined #ruby-lang
<shevy> the terminal seems to be plain xterm
dv310p3r has joined #ruby-lang
andrewhl has joined #ruby-lang
r0bby_ has joined #ruby-lang
<andrewvos> shevy: You talking to me?
bglusman has joined #ruby-lang
<shevy> andrewvos never
jtoy has joined #ruby-lang
<andrewvos> :(
qpingu has joined #ruby-lang
mistym has joined #ruby-lang
<petercooper> youtube comments, for when yahoo answers is having a slow day
tomzx has joined #ruby-lang
havenn has joined #ruby-lang
<mistym> People who have 300 confirmed kills are definitely the type who are trained so well they post about it on Youtube.
echoprinter has quit [#ruby-lang]
<andrewvos> Indeed.
<petercooper> people have a lot of time to kill while waiting for their post traumatic stress lawsuits to go through
bryancp has joined #ruby-lang
WillMarshall has joined #ruby-lang
<WillMarshall> Hey! I've got a crazy load-order problem. I have two classes - State and HealthQuote::State (in Australia, the canonical list of states actually changes in different industries)
<WillMarshall> For some reason, when I access HealthQuote::State it actually returns ::State with a warning
<WillMarshall> But not consistently
rdavila has joined #ruby-lang
<WillMarshall> Any ideas how I might tackle this?
<drbrain> sounds more like a constant resolution problem
<drbrain> do you do class HealthQuote; class State, or class HealthQuote::State
<drbrain> do you always fully-qualify your class names?
<drbrain> i.e. always use HealthQuote::State ?