<Tuor>
Are there any "don't do that!" in it? Or do you have any sugsetion what I should do differently for reason x? I wrote ruby befor like 3 or 4 years ago and learned a lot with this channel. But don't hit me if I can't remember all of what you told me. ;)
stan has quit [Ping timeout: 252 seconds]
<Tuor>
So I'm still a beginner. ;)
stan has joined #ruby
DaRock has joined #ruby
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
sagax has quit [Ping timeout: 272 seconds]
ur5us has joined #ruby
schleppel has joined #ruby
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
themsay has quit [Ping timeout: 246 seconds]
Devalo has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
emilford has quit [Ping timeout: 255 seconds]
emilford has joined #ruby
Devalo has quit [Ping timeout: 246 seconds]
qual has quit [Ping timeout: 252 seconds]
schleppel has quit [Read error: Connection reset by peer]
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
powerbit has quit [Ping timeout: 250 seconds]
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
qual has joined #ruby
schleppel has joined #ruby
alem0lars has quit [Read error: Connection reset by peer]
dhollin3 has joined #ruby
dhollinger has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
emilford has quit [Ping timeout: 252 seconds]
emilford has joined #ruby
mikecmpbll has joined #ruby
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
DaRock has quit [Read error: Connection reset by peer]
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
claudiuinberlin has joined #ruby
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
SegFaultAX has quit [Ping timeout: 258 seconds]
SegFaultAX has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
GodFather has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
tdy has quit [Ping timeout: 252 seconds]
ericboehs has quit [Read error: Connection reset by peer]
alem0lars has quit [Read error: Connection reset by peer]
ericboehs has joined #ruby
alem0lars has joined #ruby
sylario has joined #ruby
emilford has quit [Ping timeout: 246 seconds]
TomyWork has quit [Ping timeout: 246 seconds]
r3m has quit [Remote host closed the connection]
r3m has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
themsay has joined #ruby
DaRock has joined #ruby
<canton7>
Tuor, don't use 'and', use '&&'
emilford has joined #ruby
aupadhye has quit [Ping timeout: 245 seconds]
<canton7>
line 33, you access `params['path']` a *lot*, which means a lot of hash lookups
<canton7>
line 7, I'd make 'default_config_file_path' a constant
<canton7>
personally as a user I'd expect some sort of warning or message if I supplied a path, but the code decides to ignore it for some reason
ur5us has quit [Ping timeout: 245 seconds]
Guest63017 has quit [Quit: WeeChat 2.4]
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
al2o3-cr has joined #ruby
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ruby
aqd has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 245 seconds]
aupadhye has joined #ruby
marmotini_ has joined #ruby
alem0lars has quit [Read error: Connection reset by peer]
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
alem0lars has joined #ruby
TomyWork has joined #ruby
gregf_ has joined #ruby
mangold has joined #ruby
code_zombie has quit [Quit: Leaving]
DaRock has quit [Read error: Connection reset by peer]
<Bish>
isn't eql? a alias of == or the other way around?
<ryouba>
good morning everybody!
<ljarvis>
no
<ljarvis>
eql? is for hashing
<Bish>
well for the object im working on, it is :(
<Tuor>
I have the rescue part in my code, how can I fail in a part of the script and jump to that rescue part. Like `error = 'failure reason; go to rescue`
<Tuor>
(?)
<ljarvis>
well eql? is the same as == for a lot of classes, because that makes sense for hashing
<Bish>
Tuor: wrap it the code inside begin; <code>; rescue ErrorType => e; end;
<Bish>
and lines behind that rescue will work for that errortype
<ljarvis>
Tuor: either use exceptions and rescue, or simplify with multiple methods
<Bish>
ljarvis: yeah and my question is if i can change that :/, i want a hash that uses ===
<ljarvis>
Bish: ok i dont think i can help
<Bish>
ljarvis: background is my ORM, it uses equality(==) if content of rows are the same and === for the database ids
<ljarvis>
that sounds like a bad idea
alem0lars has quit [Read error: Connection reset by peer]
<Bish>
i liked it until now
<Bish>
and why?
<ljarvis>
because [open arms to demonstrate current situation]
emilford has joined #ruby
<ljarvis>
you need to be careful overriding standard operators like that
<Bish>
i don't follow
alem0lars has joined #ruby
<Bish>
last time i checked === can be whatever you like there is no "standard"
<Bish>
and == works correctly
<ljarvis>
my point is that === is a standard operator, and you have to be careful when overriding them. Why do you want == and === to return differently? surely if the DB id refers to the same value then so with the contents?
mangold has quit [Quit: This computer has gone to sleep]
alem0lars has quit [Read error: Connection reset by peer]
<Bish>
why do == and === exists if you want them to be the same, the fuck?
<ljarvis>
ok well i hope someone else can help you
alem0lars has joined #ruby
<Bish>
ljarvis: yes, to the last part
<Bish>
and sure, === is a standard operator.. but NOWHERE used in the codebase of ruby standardlibrary (atleast as i hae seen)
<Bish>
just for "case" and everyone knows that
<Bish>
afaik === is exactly that the "case" equality
<Tuor>
ljarvis: I'm trying to put it into a function. but how can I let the function fail? If I'm not happy with the given path the function should fail.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
memofun has joined #ruby
face has quit [Ping timeout: 250 seconds]
ams__ has joined #ruby
tiogrand_ has joined #ruby
tiogrand_ has quit [Max SendQ exceeded]
tiogrand_ has joined #ruby
tiogrand has quit [Ping timeout: 246 seconds]
<c-c>
Bish: why would you do that?
<Bish>
c-c: puh... i have a call inside my code that gets a Coupon code from a database
<Bish>
it has to be a single code (bad software design)
<Bish>
but it also has to be fast, because it gets called thousand times a second
<Bish>
so i have a thread in background, that manages the cache (gets codes from the database ⇒ ram, when neeeded)
<c-c>
Bish: and the coupon code is so hot it can't wait for a process to be spawned. So much hotter than f.ex. unicorns or similar.
<Bish>
no, it's just i have to start that thread somewhere, and doing it in the "get" call would mean, if i have to check if that thread is already spawned every call
<c-c>
I wouldn't use threads, just an extra complexity layer
<Bish>
so, the get methods manages the cache itself?
<c-c>
So, its sleeping all day but gets called thousand times a second. Ok I think this is beyond my skill, bordering on paradoxical.
Rapture has joined #ruby
<Bish>
why is everyone in this channel in troll mood today? if you got so much better to do, go ahead and do it
<Bish>
jeebus
AJA4350 has joined #ruby
<c-c>
Bish I have zero patience for antisocial comments.
qual_ has joined #ruby
cd has joined #ruby
<c-c>
Bish: if ppl don't understand your question, you need to rephrase your q. Not call channel members "trolls".
* c-c
thats an order
qual has quit [Ping timeout: 246 seconds]
<Bish>
i did an antisocial comment?
<Bish>
"that is beyond my skill"? do you mean that one?
ellcs has quit [Ping timeout: 240 seconds]
<phaul>
Tuor: why don't you raise something that has the info about the error instead of using globals to store the error?
<phaul>
RuntimeError can have a message raise message, just raise it, and when rescue, rescue it into a variable, then you can get your message via #message
<dberger>
hm, i thought [[:word]] was unicode aware? but /[[:word]]/.match("Ἑλλάς123_456") returns nil
<dberger>
whereas /\p{L}/.match("Ἑλλάς123_456") gives me a match
<al2o3-cr>
dberger: never use posix shit
<dberger>
lol, ok
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dberger>
because it doesn't work as advertised? or it's just generally unwise? or ????
<al2o3-cr>
dberger: you want to match unicode?
<dberger>
yes
<al2o3-cr>
use character properties.
lukelukeluke has quit [Remote host closed the connection]
<TomyWork>
I have a certain HTTP server I need to deal with, that sends chunked encoding in an odd way. With chunked encoding, you have a CRLF following each chunk. Unfortunately, this server delays that CRLF until the start of the next chunk, which can be hours later. Do you think there's a ruby library that can deal with that and still timely call handlers, even though that CRLF hasn't arrived yet?
<TomyWork>
and i would like to simultaneously get rid of the python (i'm really not that good at python and i prefer ruby) and get rid of that kludge, if possible
qual_ is now known as qual
clemens3 has quit [Ping timeout: 246 seconds]
orbyt_ has joined #ruby
jaddison has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Remote host closed the connection]
stryek has joined #ruby
crankharder has joined #ruby
orbyt_ has quit [Ping timeout: 272 seconds]
tdy has joined #ruby
xMopx- is now known as xMOpx
xMOpx is now known as xMopx
skyikot has joined #ruby
skyikot has quit [Ping timeout: 256 seconds]
crankharder has quit [Ping timeout: 252 seconds]
<Bish>
if a coniditonvariable#wait times out, does i still hold the mutex lock? i guess so, right?
millerti has joined #ruby
<Bish>
s/i/it
TomyWork has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
crankharder has joined #ruby
mikecmpbll has joined #ruby
shlomif2 has joined #ruby
e has joined #ruby
am0123 has quit [Ping timeout: 245 seconds]
bmurt has joined #ruby
dberger has quit [Quit: Leaving]
griffindy has quit [Read error: Connection reset by peer]
Madper|Unsupport has quit [Ping timeout: 272 seconds]
cnsvc has joined #ruby
Madper|Unsupport has joined #ruby
dustym has joined #ruby
Guest78365 has joined #ruby
dustym has quit [Client Quit]
Celmor has joined #ruby
Guest78365 has quit [Client Quit]
<Celmor>
I'm learning ruby and rails and wondering why I don't need the curly brackets when specifying a hash in a function, e.g. Subject.where(:visible => true)
<Celmor>
is it only allowed to omit them in that case where a hash is expected as a parameter?
cnsvc has quit [Ping timeout: 256 seconds]
cnsvc has joined #ruby
Caeso has joined #ruby
stan has joined #ruby
ldnunes has quit [Quit: Leaving]
yqt has quit [Ping timeout: 245 seconds]
dellavg__ has quit [Ping timeout: 250 seconds]
stan has quit [Quit: No Ping reply in 180 seconds.]
claudiuinberlin has quit [Ping timeout: 252 seconds]
stan has joined #ruby
schleppel has quit [Quit: Konversation terminated!]
mochiyoda has joined #ruby
mniip has joined #ruby
stooj has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
am0123_ has joined #ruby
dar123 has quit [Ping timeout: 250 seconds]
stooj has joined #ruby
am0123 has quit [Ping timeout: 246 seconds]
nowhere_man has joined #ruby
gfawcett has joined #ruby
xco has left #ruby [#ruby]
orbyt_ has joined #ruby
Swyper has quit [Remote host closed the connection]
mozzarella has quit [Ping timeout: 245 seconds]
skyikot has joined #ruby
gfawcett has quit [Read error: Connection reset by peer]
mochiyoda has left #ruby ["Konversation terminated!"]
xrexeon has joined #ruby
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]