<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.
<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
<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?
<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...
<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?
<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.)
<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!
<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..
<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?