<apeiros>
terens: it's generally bad to have long lines
<apeiros>
it makes reading more difficult
emilford has quit [Ping timeout: 256 seconds]
<apeiros>
but as ccooke says - "it depends". Sometimes the long line may be better than the alternatives.
<dminuoso>
Long lines usually denote far too long naming of things and/or deeply complex code.
<dminuoso>
If its the first: fix the naming to use short but descriptive names.
<dminuoso>
If its the second: Write smaller/more composable code.
<dminuoso>
The second lets you reason about code earlier, and it makes testing easier.
emilford has joined #ruby
amar has joined #ruby
lypsis is now known as lypsis|awy
amar_ has joined #ruby
amar has quit [Ping timeout: 252 seconds]
emilford has quit [Remote host closed the connection]
graingert has quit []
graingert has joined #ruby
emilford has joined #ruby
arquebus has quit [Quit: Konversation terminated!]
amelliaa has joined #ruby
kies^ has joined #ruby
kies^ has quit [Remote host closed the connection]
emilford has quit [Ping timeout: 264 seconds]
TvL2386_ is now known as TvL2386
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ShekharReddy has quit [Quit: Connection closed for inactivity]
dr3w__ has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
venmx has joined #ruby
jameser has quit [Remote host closed the connection]
jameser has joined #ruby
Guest44354 is now known as ged
ged is now known as Guest83710
paul_ has quit [Ping timeout: 260 seconds]
paul_ has joined #ruby
aufi has quit [Read error: Connection reset by peer]
aufi_ has joined #ruby
dstrunk has joined #ruby
saTchymoto has quit []
RougeR has joined #ruby
emilford has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sanscoeur has joined #ruby
roshanavand has joined #ruby
roamingdog has quit [Remote host closed the connection]
ur5us has joined #ruby
roshanavand has quit [Client Quit]
Charliebr73 has joined #ruby
roamingdog has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
emilford has quit [Ping timeout: 276 seconds]
sanscoeur has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
tomaw_ is now known as tomaw
x71e6fd52 has joined #ruby
jameser has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
x71e6fd52 has quit [Quit: WeeChat 2.1]
x71e6fd52 has joined #ruby
amar_ has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
emilford has joined #ruby
conta has quit [Ping timeout: 264 seconds]
emilford has quit [Ping timeout: 240 seconds]
dmathieu has joined #ruby
dmathieu has quit [Quit: leaving]
conta has joined #ruby
shinnya has quit [Ping timeout: 265 seconds]
emilford has joined #ruby
conta has quit [Ping timeout: 240 seconds]
conta has joined #ruby
KeyJoo has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weird_error has quit [Quit: weird_error]
conta has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
alex`` has quit [Ping timeout: 245 seconds]
conta has joined #ruby
ellcs has joined #ruby
lxsameer has joined #ruby
yaewa has joined #ruby
lxsameer has joined #ruby
Flonk has quit [Ping timeout: 240 seconds]
moei has quit [Ping timeout: 255 seconds]
Flonk has joined #ruby
jsaak has joined #ruby
ur5us has quit [Remote host closed the connection]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
apparition47 has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
emilford has quit [Ping timeout: 252 seconds]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
ropeney has quit [Ping timeout: 248 seconds]
emilford has joined #ruby
alfiemax has quit [Remote host closed the connection]
Guest83710 is now known as ged
ged is now known as Guest57472
x71e6fd52 has quit [Quit: WeeChat 2.1]
sanscoeur has joined #ruby
x71e6fd52 has joined #ruby
alfiemax has joined #ruby
emilford has quit [Ping timeout: 260 seconds]
sanscoeur has quit [Ping timeout: 256 seconds]
emilford has joined #ruby
lypsis|awy is now known as lypsis
victorfigol has joined #ruby
emilford has quit [Ping timeout: 264 seconds]
emilford has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
emilford has quit [Ping timeout: 240 seconds]
Axy has joined #ruby
emilford has joined #ruby
Mia has quit [Ping timeout: 248 seconds]
karapetyan has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Axy has quit [Ping timeout: 248 seconds]
paul_ has quit [Ping timeout: 248 seconds]
GodFather has joined #ruby
victorfigol has quit [Quit: leaving]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
emilford has quit [Ping timeout: 260 seconds]
terens has quit [Read error: Connection reset by peer]
guille-moe has quit [Ping timeout: 248 seconds]
emilford has joined #ruby
sphenxes has joined #ruby
jamesaxl has joined #ruby
roshanavand has joined #ruby
ferr has joined #ruby
Cybergeek has quit [Quit: ZNC 1.6.1+deb1 - http://znc.in]
<kke>
class Foo < BasicObject; def Kernel(*_); nil; end; end; Foo.new.instance_exec { Kernel.puts(Kernel.send(:`, "ls")) } i wonder why this doesn't work as expected. (just thinking if i could make a somewhat secure variable container to be sent to template rendering)
Cybergeek has joined #ruby
<apeiros>
"doesn't work as expected" is bad. show what it does and what you expect.
<kke>
i would expect it to say NoMethodError no method `puts` for NilClass but it puts the output of `ls`.
<apeiros>
note that instance_exec does NOT change constant lookup scope.
emilford has quit [Ping timeout: 276 seconds]
<kke>
oh. is there something that does?
guille-moe has joined #ruby
<apeiros>
afaik no
nowhere_man has quit [Ping timeout: 245 seconds]
<apeiros>
additional note: Kernel.puts does NOT call Kernel(). Kernel() is a method. Kernel is a constant. they are not the same.
<kke>
i also tried const_set :Kernel, nil
<apeiros>
so even if you run your code in the scope of Foo, what you should expect is a NameError, uninitialized constant Kernel
<kke>
but of course even then you could do ::Kernel
emilford has joined #ruby
<apeiros>
you can have it easier than const_set. you can just do Kernel = nil
<lupine>
whyyyyyyyyyyyy
<kke>
for the lulz mostly
<apeiros>
re your question: I think the only thing which you can execute in an arbitrary context is code as string.
Charliebr73 has quit []
ellcs has quit [Ping timeout: 255 seconds]
<kke>
i would be using it for a cli thing that processes ERB locally, it would be nice if i could sandbox it
<kke>
because the erb can come from somewhere online
emilford has quit [Ping timeout: 256 seconds]
bogdan has joined #ruby
Cybergeek has quit [Quit: ZNC 1.6.1+deb1 - http://znc.in]
Cybergeek has joined #ruby
x71e6fd52 has quit [Quit: WeeChat 2.1]
guille-moe has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
plexigras has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
lxsameer has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
emilford has joined #ruby
bogdan has quit [Quit: bogdan]
roshanavand1 has joined #ruby
roshanavand has quit [Quit: Leaving.]
roshanavand1 has quit [Client Quit]
roshanavand has joined #ruby
Guest57472 is now known as ged
ged is now known as Guest41945
jottr has joined #ruby
paul_ has joined #ruby
shinnya has joined #ruby
Cavallari has joined #ruby
redondos has joined #ruby
redondos has joined #ruby
redondos has quit [Changing host]
emilford has quit [Ping timeout: 240 seconds]
ldnunes has joined #ruby
ellcs has joined #ruby
rfoust has joined #ruby
ferr has quit [Quit: WeeChat 2.1]
alfiemax has quit [Remote host closed the connection]
ferr has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
emilford has joined #ruby
amar has joined #ruby
banisterfiend has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
AJA4350 has joined #ruby
amar has quit [Ping timeout: 252 seconds]
suukim has joined #ruby
amelliaa has quit [Quit: -]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
ferr has quit [Quit: WeeChat 2.1]
ferr has joined #ruby
paul_ has quit [Ping timeout: 240 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
mostlybadfly has joined #ruby
vondruch has quit [Client Quit]
vondruch has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
agent_white has quit [Quit: leaving]
lxsameer has joined #ruby
alex`` has joined #ruby
banisterfiend has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
sanscoeur has joined #ruby
lxsameer has joined #ruby
cyberg has joined #ruby
bmurt has joined #ruby
sanscoeur has quit [Ping timeout: 260 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goatish has joined #ruby
Bounga has joined #ruby
<darix>
kke: maybe stick to templating languages which limit what the user can do. like liquid
thapakazi has quit [Ping timeout: 240 seconds]
snood1205 has joined #ruby
Cavallari1 has joined #ruby
Cavallari has quit [Ping timeout: 256 seconds]
Cavallari1 is now known as Cavallari
snood1205 is now known as eelster
Guest41945 is now known as ged
ged is now known as Guest54904
jenrzzz has quit [Ping timeout: 260 seconds]
Zefoy has quit [Quit: Leaving]
banisterfiend has joined #ruby
Zaab1t has joined #ruby
BTRE has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
kmurphy4 has joined #ruby
ellcs has joined #ruby
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cadillac_ has quit [Ping timeout: 240 seconds]
gray_-_wolf has joined #ruby
<gray_-_wolf>
Hi :) I need a bit of help with ffi, I'm trying to iterate directory using FindFile{First,Next}, however I'm not sure how to use GetLastError using FFI. I'm always getting back 0. Is there some trick I'm missing?
lypsis is now known as lypsis|awy
darkhanb has quit [Read error: Connection reset by peer]
jcalla has joined #ruby
Dabo has quit [Remote host closed the connection]
nowhere_man has joined #ruby
weaksauce has quit [Ping timeout: 252 seconds]
k0mpa has joined #ruby
<canton7>
gray_-_wolf, look at FFI::LastError ?
<gray_-_wolf>
oh... missed that. I've just tried attaching GetLastError, will try this, thank you
mr_wooh has joined #ruby
<canton7>
gray_-_wolf, it's often the case that either the ffi machinery, or stuff that wraps it, calls other functions internally, which messes up GetLastError. Ruby methods can also call into stuff which sets the last error
<canton7>
(I assume -- that's how it is in other languages)
roshanavand has quit [Ping timeout: 265 seconds]
<canton7>
so it's common that the ffi lib will record the LastError itself after calling a native function, and save it for you
<gray_-_wolf>
I think I understand, now just figure out why rest of the code is not working :D
<gray_-_wolf>
\quit
gray_-_wolf has quit [Quit: WeeChat 2.1]
beefjoe has joined #ruby
guille-moe has joined #ruby
jamiejackson has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
lxsameer has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
banisterfiend has joined #ruby
sanscoeur has joined #ruby
lypsis|awy is now known as lypsis
roshanavand has joined #ruby
jenrzzz has joined #ruby
wontruefree has joined #ruby
sanscoeur has quit [Ping timeout: 252 seconds]
wontruefree has quit [Client Quit]
hinbody has joined #ruby
hinbody has left #ruby [#ruby]
wontruefree has joined #ruby
ellcs has left #ruby [#ruby]
Guest91942 is now known as sirecote
nowz has quit [Ping timeout: 248 seconds]
wontruefree has quit [Quit: bye]
cadillac_ has joined #ruby
gray_-_wolf has joined #ruby
<gray_-_wolf>
to follow up on my previous question, any idea how to get FFI::LastError.error to work under cygwin?
<gray_-_wolf>
based on quick look at the source code does not seem possible without patching ffi itself :/ ... but I find hard to believe I'm first one to encounter this
lypsis is now known as lypsis|awy
lxsameer has joined #ruby
wontruefree has joined #ruby
ta_ has quit [Remote host closed the connection]
Guest54904 is now known as ged
Rapture has joined #ruby
ged is now known as Guest79918
krawchyk has joined #ruby
alfiemax has joined #ruby
grilix_ has joined #ruby
nowz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
t0xik has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
ccjdockjj123 has joined #ruby
lxsameer has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
eelster has quit [Quit: #hockey]
snood1205 has joined #ruby
snood1205 has quit [Client Quit]
gix has joined #ruby
gix- has quit [Ping timeout: 260 seconds]
eelster has joined #ruby
krawchyk has quit [Quit: krawchyk]
lxsameer has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
cadillac_ has joined #ruby
thapakazi has joined #ruby
thapakazi has quit [Remote host closed the connection]
<thapakazi_>
Hello again, back with crypto question, does ECDSA OpenSSL::PKey::EC lacking the encrypt(public_key, msg) and decrypt_with_priavate_key(encrypted_string), I only see the dsa_sign_ans1 and dsa_verfy_asn1
<thapakazi_>
I am trying implement public key based auth, that reuses artificats {public_key, private_key} generated with ECDSA
<thapakazi_>
want to encrypt a text on server with public key and have it unlocked on client who holds public key
sytherax has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
cyberg has joined #ruby
Guest95603 is now known as ged
ged is now known as Guest44521
CuriousMind has quit [Quit: Page closed]
lxsameer has quit [Ping timeout: 265 seconds]
<havenwood>
banisterfiend: o/
cschneid has joined #ruby
_phaul has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
lxsameer has joined #ruby
<dminuoso>
banisterfiend: pry broken. fix please?
<banisterfiend>
dminuoso how is it broken
<dminuoso>
Things regularly segfault while experimenting with Fiddle in pry ¯\_(ツ)_/¯
* havenwood
plays a tiny fiddle
sytherax has quit [Ping timeout: 252 seconds]
_phaul is now known as phaul
karapetyan has quit [Remote host closed the connection]
<banisterfiend>
dminuoso i've played with fiddle a lot in pry too and never experienced that :) Maybe your libraries are busted?
<dminuoso>
banisterfiend: Your troll detector must be broken. :S
cschneid has quit [Ping timeout: 252 seconds]
<banisterfiend>
heh i guess
<dminuoso>
banisterfiend: On a more serious note, I still regularly run into the issue where the entire visualization is completely messed up when I run the pager through too much output
yaewa has quit [Quit: Leaving...]
cschneid has joined #ruby
moei has joined #ruby
<dminuoso>
(Mainly happens when I accidentally inspect output from large AR stuff)
<apeiros>
yeah, I experience that at times too
lxsameer has quit [Ping timeout: 256 seconds]
lytol has joined #ruby
<dminuoso>
It might be that there's some weird control sequence being flung around though, I dont know
<dminuoso>
Afaict that shouldnt be the case though *shrugs*
sytherax has joined #ruby
sanscoeur has joined #ruby
jottr has joined #ruby
<dminuoso>
apeiros: Is it reproducable for you? Because it certainly is not for me.
<apeiros>
no. else I'd have filed an issue :)
<dminuoso>
Heh same.
<apeiros>
and it hasn't happened often recently
<dminuoso>
It hasnt happened often recently for me because I quit dicking around with pry to solve problems.
<apeiros>
using a haskell repl instead?
<eelster>
Pry is kinda great sometimes though especially if you use it with the extensions that let you step into methods and go line by line.
<banisterfiend>
havde't written much ruby in a good while
cschneid has quit [Ping timeout: 248 seconds]
lxsameer has joined #ruby
<dminuoso>
banisterfiend: That's okay. We have a veteran program to get you back into the war.
jottr has quit [Ping timeout: 240 seconds]
cyberg has quit [Ping timeout: 256 seconds]
<banisterfiend>
ruby gave me ptsd
<apeiros>
oy, that bad?
<apeiros>
you sure it wasn't the pills? :D
<banisterfiend>
i like it but there's whole swathes of programming that you can't do in it, and the more interesting things are difficult to do in ruby
<banisterfiend>
or at least the things i'm interested in recently
<apeiros>
lack of libraries?
orbyt_ has joined #ruby
<banisterfiend>
yeah i'd have to write the binding/libraries myself to get started using ruby and i kind of enjoy using C atm anyway. Very refreshing compared to the mindnumbing tedium of webdev imo
<eelster>
I like C and I like Ruby. I hate writing C extensions for Ruby.
lxsameer has quit [Ping timeout: 252 seconds]
<dminuoso>
banisterfiend: webdev can actually be fun.
karapetyan has joined #ruby
<dminuoso>
banisterfiend: It's just that the hipster generation has a huge stack of idiotic tools and things that make you want to claw your eyes out.
<banisterfiend>
dminuoso i did it for 4 years, i can't stand it. Not for me but i can see how other people could enjoy it
memo1 has quit [Ping timeout: 265 seconds]
sphenxes has quit [Ping timeout: 256 seconds]
<phaul>
banisterfiend: I was a C programmer for a decade. I felt exactly like how you are feeling. For me ruby was what C is for you :)
cadillac_ has quit [Ping timeout: 260 seconds]
<phaul>
it's less about a language, more about what you have done for a long time
<thapakazi_>
rephrasing :)anyone doing OpenSSL ECDSA, i am able to get signature verification working, but hogged with "Encrypt/Decrypt a message decryptable by the private key corresponding to pubKey"
<thapakazi_>
can't find proper docs on OpenSSL::PKey::EC lib :(
lxsameer has joined #ruby
biberu has joined #ruby
dionysus69 has joined #ruby
sphenxes has joined #ruby
shinnya has joined #ruby
sytherax has quit [Read error: No route to host]
cschneid has joined #ruby
Cavallari has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
beefjoe has quit [Ping timeout: 248 seconds]
sytherax has joined #ruby
grilix_ has quit [Read error: Connection reset by peer]
grilix_ has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
<cagomez>
what is the difference between `comparison of NilClass with String failed` and `comparison of String with nil failed`? I seem to be getting these 2 errors when sorting 2 arrays and comparing the results. But I'm not sure why I'm getting 2 different error messages
dinfuehr_ has quit [Ping timeout: 252 seconds]
<apeiros>
>> NilClass > "string"
cyberg has joined #ruby
<apeiros>
>> nil > "string"
<apeiros>
cagomez: ^
SeepingN has joined #ruby
<apeiros>
hm
dinfuehr has joined #ruby
<eelster>
Wait, how can you get `comparison of NilClass with String failed`
<apeiros>
oh, that's not actually it
<baweaver>
Order
<apeiros>
seems to be depending on the order of the operands
<baweaver>
which one's on the left
mrx has joined #ruby
<baweaver>
the error message tells you based on which type is on the left of the message
<apeiros>
[nil, "x"].sort # !> ArgumentError: comparison of NilClass with String failed
<apeiros>
["x", nil].sort # !> ArgumentError: comparison of String with nil failed
<eelster>
Ohh ok with sort that makes more sense. I wasn't able to get it just using > or <.
<baweaver>
Operators are all left-biased once they get desugared because aforementioned operators are really methods on classes
<baweaver>
>> 1.>(5)
alfiemax has quit [Remote host closed the connection]
<eelster>
Yeah which is why if you have nil on the left it will give you a NoMethodError instead of an ArgumentError because > and < aren't defined for nil:NilClass.
sytherax has quit [Ping timeout: 240 seconds]
thapakazi has quit [Quit: thapakazi]
mrx has quit [Remote host closed the connection]
<cagomez>
I have 2 arrays: arr1 and arr2. I do `arr1.sort != arr2.sort` . does this mean that the error is happening on during 1 individual sort? ie during `arr1.sort`?
mrx has joined #ruby
<cagomez>
and furthermore, the position of the `nil` within `arr1` will dictate which error message I get?
alfiemax has joined #ruby
<apeiros>
since ruby uses qsort, which usually is randomized quicksort, it should be random which message you get
<eelster>
If you don't mind my asking, why does the error message matter? They're both ArgumentError in terms of handling.
<apeiros>
but why does that matter?
lxsameer has joined #ruby
thapakazi_ has quit [Ping timeout: 240 seconds]
<apeiros>
meh, I should read
<apeiros>
cagomez: could be either
sytherax has joined #ruby
<cagomez>
just checking to see if by fixing 1 error message, I'll also be fixing the other. I need to find out where how these nil's are getting into the collection
<eelster>
So you can use #compact to remove the nils from the array if you'd like to, but if it's a problem that nils are there than it's worthwhile investigating that.
sytherax has quit [Remote host closed the connection]
<eelster>
Like `[2, nil, 3].compact` because `[2, 3]`
* apeiros
thinks #compact is a bad "solution" if nils shouldn't be in those arrays
sytherax has joined #ruby
mrx has left #ruby [#ruby]
beefjoe has joined #ruby
mrx has joined #ruby
<dminuoso>
There's perfectly valid reasons for #compact
mrx has left #ruby [#ruby]
mrx has joined #ruby
<eelster>
Like I said, it depends upon if it's ok that the nils are coming in or not. It's too vague to know either way.
<apeiros>
there are. as said, it's a bad solution *if the nils shouldn't be in there*
jottr has joined #ruby
<apeiros>
IME valid reasons for compact are rather rare, though
lxsameer has quit [Ping timeout: 260 seconds]
<eelster>
I use it with DBs a fair amount if I'm looking for an optional field in a table.
<eelster>
But that's my main use-case for it.
<apeiros>
if you get an array then you probably only select one column, in that case letting the db filter beforehand would make more sense, no?
mrx has quit [Quit: mrx]
<baweaver>
In general I make a habit of avoiding nil wherever possible.
<eelster>
Normally it's from a collection that I've already gathered of all the data then I have to sometimes iterate through a specific column. It's not a super common use, but I definitely have it. It'll be like if I have something like this, but probably with a much better example: https://hastebin.com/oxilevumiy.rb
sauvin has quit [Read error: Connection reset by peer]
jottr has quit [Ping timeout: 248 seconds]
<apeiros>
baweaver: same
<apeiros>
and I'm looking forward to have syntax to disallow nil args.
lxsameer has joined #ruby
<eelster>
And with more behavior between the first query and the if statement so I actually end up doing something with all_people
alfiemax has quit [Remote host closed the connection]
<eelster>
But I rarely even do that.
<baweaver>
Speaking of, guess what Koichi confirmed
nitric_ has joined #ruby
<apeiros>
eelster: yeah, I guess that makes sense
<eelster>
apeiros: But it's a rather specific use-case.
<apeiros>
or in that case, if all you do is delete, a subquery would probably be best
<eelster>
Oh certainly yeah. This was just a rudimentary example.
csk157 has joined #ruby
heftig has quit [Quit: heftig]
nitric has quit [Ping timeout: 256 seconds]
<apeiros>
baweaver: oy, nice :D
heftig has joined #ruby
<baweaver>
I have so so many ideas for that
<baweaver>
zenspider: you see that one yet?
<apeiros>
me too, but at the same time I know perfectly well that I won't have the time to even try a single one of them :<
<baweaver>
MRI is getting a live AST, Koichi confirmed it. s-expressions are about to get real danged handy
<eelster>
I always just get sad looking at the new features knowing that we're probably only going to keep using Ruby 2.3 probaby next january where we'll finally upgrade a bit.
<eelster>
At least I can use them in personal projects.
<dminuoso>
baweaver: *shrugs*
<dminuoso>
baweaver: so what happened to your Qo shenanigans
lxsameer has quit [Ping timeout: 240 seconds]
<dminuoso>
been a few weeks since you spammed this channel
<baweaver>
Working on something bigger
<baweaver>
much much bigger
<dminuoso>
how much bigger?
<baweaver>
It'll take me until January to be done probably.
eb0t has quit [Quit: WeeChat 2.0.1]
<dminuoso>
what field is your project in?
<apeiros>
ze book?
<baweaver>
ze book
<apeiros>
:D
<apeiros>
\o/
csk157 has quit [Ping timeout: 268 seconds]
<baweaver>
Meanwhile I do daily Ruby tips on Twitter
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
lxsameer has joined #ruby
banisterfiend has joined #ruby
alfiemax has joined #ruby
ellcs has left #ruby [#ruby]
orbyt_ has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
alfiemax has quit [Ping timeout: 260 seconds]
eelster has joined #ruby
amar has joined #ruby
<eelster>
Is there a flag for irb to skip my irbrc?
ta_ has joined #ruby
lxsameer has joined #ruby
\void has joined #ruby
<Zarthus>
`man irb` suggests -f
<Zarthus>
in case you're unaware, `pry` is a cool irb replacement.
<eelster>
Oh wow that's weird I must've messed up when I used / to search the man irb for irbrc.
<eelster>
Yeah, pry is great and I actually load it in my irbrc, but I'm using jruby just to test one thing and I don't really want to install the gems loaded in my irbrc into jruby.
<eelster>
Thanks Zarthus
<Zarthus>
:)
Trevoke` has joined #ruby
wontruefree has joined #ruby
lxsameer has quit [Ping timeout: 255 seconds]
<Trevoke`>
I expect the sub-files to be loaded automatically, especially because I require them in the main required file...)
<Trevoke`>
Hey all, I've forgotten almost all my ruby. I'm working on a small gem and I moved the errors it would fail/raise out in a separate file (namespaced properly, of course). I reference the constants as ::Namespace::Error in my code, but when I run the specs I get "NameError: uninitialized constant Namespace::Error", which I did not expect. I created the gem boilerplate with bundler, so I expect things to work (among other things, it means
cagomez has joined #ruby
desperek has joined #ruby
synthroid has quit []
<Trevoke`>
So, long story short, why might constants be uninitialized in a boilerplaty gem directory structure in rspec tests?
lxsameer has joined #ruby
<dminuoso>
Trevoke`: gist your spec, spec_helper (and related files) and show the commend you use to invoke rspec with
<dminuoso>
Trevoke`: Edit the gist and include the full error including stack trace.
<Trevoke`>
Oh my bad, one sec
ur5us has joined #ruby
<Trevoke`>
Done. Completely forgot you could ask for a bigger backtrace...
sytherax has joined #ruby
lxsameer has joined #ruby
venmx has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
csk157 has joined #ruby
cschneid has quit [Ping timeout: 256 seconds]
<Trevoke`>
Oh, I'm a complete idiot. I'm here looking for what information I could _possibly_ not have included in the gist, and it turns out I had started and never finished a refactor where I had an extra namespace of Errors
inoperable has joined #ruby
<Trevoke`>
So, ten out of ten for style, minus several million for good thinking
<Trevoke`>
dminuoso: sorry I wasted your time :/
<dminuoso>
Trevoke`: Hey I just spend 10 seconds making you look at your code.
<dminuoso>
Sounds like a job well done to me.
sytherax has quit [Ping timeout: 260 seconds]
<Trevoke`>
dminuoso: hah, well, it's fair, but I was hoping I'd be able to do that without having someone else tell me about it.. :p Now I need to figure out why my code didn't tell me what I had done (subdirectories / namespace assumption) and what I want to do about it.
<Trevoke`>
Thanks
bmurt has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 256 seconds]
cschneid has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
csk157 has quit [Ping timeout: 276 seconds]
lxsameer has joined #ruby
redlegion has quit [Remote host closed the connection]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
redlegion has joined #ruby
ghormoon has quit [Ping timeout: 256 seconds]
CcjDoK has joined #ruby
banisterfiend has joined #ruby
nahra has joined #ruby
CcjDoK has quit [Client Quit]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ghormoon has joined #ruby
Cavallari has quit [Quit: Cavallari]
lxsameer has quit [Ping timeout: 268 seconds]
cschneid has quit [Ping timeout: 256 seconds]
guille-moe has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
cschneid has joined #ruby
arquebus has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
<arquebus>
are comprhensions ever going to be added to Ruby? Thats the only thing that keeps holding me to Python
roamingdog has quit [Remote host closed the connection]
lxsameer has joined #ruby
sphenxes has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
eelster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
guille-moe has quit [Remote host closed the connection]
roamingdog has joined #ruby
guille-moe has joined #ruby
roamingdog has quit [Remote host closed the connection]
ramfjord has joined #ruby
amelliaa has quit [Quit: -]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 256 seconds]
cschneid has quit [Ping timeout: 256 seconds]
samort7 has joined #ruby
Trevoke` has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<arquebus>
dont tell me you all actually prefer attaching blocks to methods rather than having a uniform comprehension syntax
guille-moe has quit [Remote host closed the connection]
beefjoe has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 268 seconds]
guille-moe has joined #ruby
Trevoke` has joined #ruby
lxsameer has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
Trevoke` has quit [Ping timeout: 256 seconds]
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
drim has joined #ruby
lxsameer has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
cschneid has quit [Ping timeout: 256 seconds]
Trevoke` has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
k0mpa has quit [Ping timeout: 250 seconds]
wontruefree has quit [Quit: this is not the client you are looking for]
ur5us has quit [Read error: Connection reset by peer]
cschneid has joined #ruby
ruby[bot] has joined #ruby
ur5us has joined #ruby
<Radar>
arquebus: we actually prefer attaching blocks to methods rather than having a uniform comprehension syntax
<Radar>
oh just read your second message sorry
<arquebus>
ok, well, just so you know you are missing out on millions of users by not having comprehensions, it would be easy to add to Ruby and wouldnt change the block syntax thats already there
Guest9984 is now known as ged
ged is now known as Guest68676
beauby_ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
<apeiros>
I'm sure you meant to say billions
Trevoke` has quit [Ping timeout: 265 seconds]
<arquebus>
apeiros: yes! I did!
<apeiros>
good thing I made you aware of your mistake then!
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
dionysus69 has quit [Ping timeout: 264 seconds]
<dminuoso>
arquebus: What kind of comprehensions are you looking for?
<arquebus>
like the ones in Python are perfect, you can use guards in them, and whatever kind of brackets you surround the comprehension with thats what kind of container it returns. I really hate Python but it has the cleanest comprehension sytnax around
<dminuoso>
arquebus: Are you talking about list comprehensions?
<ramfjord>
sounds a lot like list comprehensions
<dminuoso>
arquebus: they are nice, but really pale in comparison to comprehensions from Haskell.
<arquebus>
dminuoso: the comprehensions in Python are not limited to lists, they can iterate over any container type and even mulitple containers and return any container type
<eelster>
dminuoso: I have never found a language that treats lists as well as Haskell.
<arquebus>
eelster: lists in Haskell are actual linked lists and so to access an element means iterating through all the elements from the start till you reach the element. Which is why lists in Haskell require heads/tails syntax (yuck)
<eelster>
arquebus: But normally you program with that in consideration so it's fine.
roshanavand has quit [Ping timeout: 255 seconds]
<dminuoso>
arquebus: We have other types of containers too. That form has, for various reasons, tons of elegance.
amar has quit [Remote host closed the connection]
<arquebus>
dminuoso: Thats why I think comprehension would work well in Ruby, because Ruby (I believe) implements its array and hash under the hood with a single sequence type, so a comprehension will work for any container type in Ruby very easily
<dminuoso>
arquebus: well hash is a wildly different beast from array
<Radar>
" missing out on millions of users" delicious hyperbole. Part of a healthy, balanced breakfast.
<Radar>
I'm sure that there's more pulling people to Ruby than just list comprehensions.
<Radar>
And if people really did want Ruby flavoured syntax and "proper" list comprehensions, then there's Elixir, surely? ;)
<dminuoso>
arquebus: and also..
<lupine>
comprehensions are awful
<arquebus>
dminuoso: I think that Ruby is moving hashes to be more like arrays by having a set order of elements
<lupine>
"yo dawg, I heard you like languages, so I put a language in your language, so you can language while you're languaging"
* Eiam
opens, sees method_missing, closes again immediately
<apeiros>
dminuoso: don't worry, I'm firmly asleep and won't see it before tomorrow!
lxsameer has quit [Ping timeout: 256 seconds]
<arquebus>
dminuoso: I just googled it and I dont see any list comprehensions for Ruby
<dminuoso>
arquebus: Check my link!
<Eiam>
no, please don't
lxsameer has joined #ruby
<apeiros>
never underestimate a motivated dminuoso 😂
<dminuoso>
apeiros: In all fairness that code is not by myself.
<apeiros>
I'm sure I've seen something like this in this channel, though
<Radar>
dminuoso is the new 0xdea?
<dminuoso>
I miss him :<
<Eiam>
a lost disciple
* Radar
deletes a line of code in memoriam
* Radar
rewrites it using only procs, in memoriam
moei has quit [Quit: Leaving...]
<arquebus>
dminuoso: I just did, that code looks awful and is exactly why Ruby needs comprehensions
<dminuoso>
Radar: Screw procs.
<dminuoso>
Radar: Write a substitution proc and a a const proc, and then write all your programs entirely in SK calculus.
sameerynho has quit [Ping timeout: 260 seconds]
<dminuoso>
arquebus: That code is the implementation.
<dminuoso>
Who cares about the implemnetation
<Radar>
dminuoso: galaxybrain.jpg
<dminuoso>
foo =+ [x * y | x <- [1..3], y <- [4..6]]
<dminuoso>
bar =+ [a + b | a <- ['n','p'..'t'], b <- %w[a i u e o]]
<dminuoso>
You wanted list comprehensions. You got them.
<lupine>
nobody wants list comprehensions
<Radar>
lupine: arquebus does.
<Eiam>
uh, correction, millions want them.
<arquebus>
dminuoso: ok, well that looks good, I'll look into it
sytherax has quit [Remote host closed the connection]
<lupine>
nah, they just think they do
<lupine>
I know better
<dminuoso>
list comprehensions are nice and a cool thing, but overrated.
sytherax has joined #ruby
<Eiam>
arquebus: look forward to your debugging sessions
<lupine>
they are bad and wrong, but certainly cool
<dminuoso>
lupine: they are quite great for one particular reason
<lupine>
although to be fair, rubyists are also unhealthily obsessed with oneliners
<dminuoso>
lupine: if you roll them right, they act like set builder notation in mathematics.
<dminuoso>
Which is an incredibly precise way to describe a set.
<dminuoso>
(which is in fact where the syntax originated from)
<dminuoso>
<- is an ascii approximation of ∈ for example
<lupine>
sadface
<dminuoso>
[x * y | x ∈ A, y ∈ B]
<Eiam>
lupine: its true, I really do enjoy good one liners, as long as they are easy to understand
<dminuoso>
This is nice.
<lupine>
Eiam: those two goals are directly in conflict with each other
arquebus has quit [Quit: Konversation terminated!]
<dminuoso>
lupine: absolute bullshit.
<dminuoso>
sorry
<lupine>
fite me irl
<Eiam>
nah, think of one liners where how it works is through several layers of indirection, vs a one liner that is just a well encapsulated usage of existing functionality
<dminuoso>
If the tooling is right, then short concise one-liners can be easier to understand.
<lupine>
some one-liners are certainly worse than others
<Eiam>
i.e. method missing one liners == my least favorite kind of one liner
<Eiam>
if its not a part of ruby core
<dminuoso>
lupine: No question. But the question is not about smashing it all in one line with poor abstractions
<dminuoso>
but with the right abstractions.
<lupine>
but if you spend a lot of time squeezing n lines into 1, it's invariably going to be a hot mess
<Eiam>
its some home brewed bullshit in a local code base that I have to figure out
<lupine>
and this includes list comprehensions
alfiemax has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 256 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
memo1 has quit [Ping timeout: 260 seconds]
<dminuoso>
lupine: The point is not to squeeze it into one line.
<lupine>
if only
<dminuoso>
Its to write it in short and concise code.
<dminuoso>
If that happens to be one line, so be it.
guacamole has quit [Client Quit]
roamingdog has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 240 seconds]
roamingdog has joined #ruby
lxsameer has joined #ruby
roamingdog has quit [Client Quit]
cschneid has quit [Ping timeout: 248 seconds]
tvw has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
brechbohne92 has joined #ruby
<havenwood>
lupine: I got caught talking too loudly in a taqueria about how I wanted to try killing *all* of the unicorns to make sure God would still restart them. My coworker responded that we could try Blue Pill if God didn't like our unicorn killing. Got some weird looks.
<havenwood>
Rainbows!
jenrzzz_ has joined #ruby
<havenwood>
Oops, wrong channel.
<havenwood>
Right person though, at least.
<dminuoso>
havenwood: You're a daemon.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
"There are two major projects that came out of Berkeley: LSD and UNIX. We do not believe this to be a coincidence."
<dminuoso>
havenwood: Im not exactly sure what this is doing.
<havenwood>
dminuoso: Yeah, me neither.
guacamole has quit [Client Quit]
desperek has quit [Quit: xoxo]
<dminuoso>
havenwood: I mean from what I can tell it's somehow a mechanism to reuse threads without going through the cost of having the kernel make one for you
alfiemax has joined #ruby
<dminuoso>
But Im not sure how the caching works
cadillac_ has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
<dminuoso>
Especially the commit message..
quobo has joined #ruby
<Radar>
Just came across this: .each_with_object({}) { |(k, v), h| v.map { |f| h[f] = k } }
<Radar>
Probably would've been better with list comprehensions, no?
<Radar>
I don't know why employee_id and locale are special-cased like that.
zapata has quit [Ping timeout: 256 seconds]
<Radar>
Seems like it provides mappings from the things on the right to the things on the left.
<apeiros>
the .map there should be an each
<Radar>
apeiros: good point
ramfjord has quit [Ping timeout: 256 seconds]
<Radar>
.each_with_object({}) { |(destination, sources), mappings| sources.each { |field| mappings[field] = destination } } <- changing it to this because k, v, h and f was too much of an "alphabet soup"