havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
leitz has quit [Quit: Leaving]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 240 seconds]
rmnull has quit [Ping timeout: 240 seconds]
buckworst has joined #ruby
rmnull has joined #ruby
drincruz has joined #ruby
ur5us has joined #ruby
TCZ has joined #ruby
ChmEarl has quit [Quit: Leaving]
reyfi9e has left #ruby ["Konversation term"]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
meinside has quit [Quit: Connection closed for inactivity]
Tuor has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
OverClocked has joined #ruby
Tuor has joined #ruby
zlogan has quit [Ping timeout: 246 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
<brool> in this section of the rails guides https://guides.rubyonrails.org/active_record_validations.html#message i see syntax like `message: ->(object, data) do` -- what is the -> syntax? i've never seen this before
<adam12> brool: It's called a stabby lambda.
zlogan has joined #ruby
<brool> oic. seems an odd thing in ruby, being not very english-like
<brool> lol
<adam12> brool: I'm not sure of the backstory but it's been around since 1.9
<adam12> Maybe it was stolen from Coffeescript :P
arahael2 has quit [Ping timeout: 264 seconds]
cliluw has quit [Quit: Leaving]
roadie has joined #ruby
<havenwood> En garde! ->
roadie has quit [Ping timeout: 256 seconds]
trif has quit [Ping timeout: 268 seconds]
trif has joined #ruby
arahael2 has joined #ruby
greypack has quit [Ping timeout: 246 seconds]
rmnull has quit [Ping timeout: 256 seconds]
rmnull has joined #ruby
drincruz has quit [Ping timeout: 258 seconds]
Pascal is now known as r3m
alfiemax has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
cschneid has joined #ruby
TCZ has quit [Quit: Leaving]
rmnull has quit [Quit: WeeChat 2.7.1]
x0n- has joined #ruby
x0n has quit [Ping timeout: 268 seconds]
Eiam has quit [Ping timeout: 246 seconds]
Fridtjof has quit [Quit: ZNC - http://znc.in]
alfiemax has quit [Ping timeout: 256 seconds]
brool has quit [Ping timeout: 246 seconds]
caterfxo has joined #ruby
renich has quit [Quit: renich]
caterfxo has left #ruby [#ruby]
brool has joined #ruby
meinside has joined #ruby
polishdub has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
alfiemax has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
d3bug has joined #ruby
ur5us has joined #ruby
Intelo has quit [Ping timeout: 256 seconds]
Fridtjof has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
mozzarella has quit [Remote host closed the connection]
mozzarella has joined #ruby
Arkantos has joined #ruby
drincruz has joined #ruby
<apotheon> I had the misfortune of stumbling across a "jumpstar labs" tutorial about the Sequel gem.
<apotheon> It's . . . stupid.
<apotheon> It seems maliciously stupid.
braincrash has quit [Quit: bye bye]
<havenwood> apotheon: No HTTPS, check.
drincruz has quit [Ping timeout: 260 seconds]
<apotheon> s/jumpstar/jumpstart/
<apotheon> havenwood: Oh, that too.
<apotheon> I meant the tutorial itself.
<havenwood> apotheon: I doubt it's in bad faith.
<apotheon> There's this facile "here's your require" and "this is how you use raw SQL with a couple of methods", then there's the facile "here are some more Rubyish methods that essentially map one-to-one to SQL" . . .
<apotheon> . . . then there's this:
<apotheon> heading: Full ActiveRecord-style ORM
<apotheon> the entire section: If you’re going to use the ActiveRecord-style mappers, maybe you should just use ActiveRecord.
<apotheon> end of tutorial
<apotheon> I thought "It might be nice to look at someone's example code. I haven't touched Sequel in four years or so."
<apotheon> nope, not there
<apotheon> I mean . . .
<apotheon> That's just miserable.
<apotheon> I guess it's probably not in bad faith, per se, but . . . wow.
braincrash has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 264 seconds]
<apotheon> havenwood: I *just now* realized that Sequel and Roda were evidently created by the same person.
<apotheon> I saw the name "Jeremy Evans" on some Roda-related stuff and thought "Wait. I know that name."
<havenwood> apotheon: Sequel is maintained by Jeremy Evans and Roda was created and is maintained by him. He's also a Ruby core committer.
<apotheon> Yep. I've seen his name around a bit, for those reasons (and others, I think). I just hadn't noticed Jeremy Evans was responsible for Roda until now.
<havenwood> apotheon: Ah, nice.
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apotheon> Given my warm fuzzies about Sequel in the past, it (perhaps a little irrationally) makes me feel a tiny big more inclined to use Roda for a project I'm contemplating.
<apotheon> I'm now officially on the horns of a dilemma.
<apotheon> I was thinking "I mean, Roda seems cool and all, but really I expect I'll just use Rails."
greypack has joined #ruby
caterfxo has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
aphprentice__ has quit [Quit: Connection closed for inactivity]
jingjinghack has joined #ruby
mozzarella has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 256 seconds]
mozzarella has joined #ruby
mozzarella has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 265 seconds]
gix has quit [Disconnected by services]
mozzarella has joined #ruby
dinfuehr has joined #ruby
caterfxo has quit [Ping timeout: 240 seconds]
buckworst has quit [Quit: WeeChat 2.7.1]
xco has joined #ruby
ritalinona has quit [Max SendQ exceeded]
ritalinona has joined #ruby
polishdub has quit [Quit: leaving]
caterfxo has joined #ruby
caterfxo has quit [Client Quit]
caterfxo has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
Sauvin has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brool has quit [Ping timeout: 240 seconds]
markopasha has joined #ruby
<pyrmont> apotheon: I still like Sinatra if all you want is a lightweight framework that sits on top of Rack.
alfiemax has quit [Remote host closed the connection]
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 264 seconds]
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
Emmanuel_Chanel has quit [Ping timeout: 250 seconds]
postmodern has quit [Read error: Connection reset by peer]
postmodern has joined #ruby
pandakekok9 has joined #ruby
xco has joined #ruby
Emmanuel_Chanel has joined #ruby
cthu| has quit [Ping timeout: 260 seconds]
noodle has quit [Ping timeout: 240 seconds]
d3bug has quit [Quit: Connection closed for inactivity]
noodle has joined #ruby
conta has joined #ruby
jingjing1 has joined #ruby
jingjinghack has quit [Ping timeout: 256 seconds]
jingjinghack has joined #ruby
sergioro has quit [Quit: leaving]
jingjing1 has quit [Ping timeout: 264 seconds]
alfiemax has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
pwnd_nsfw` has joined #ruby
pwnd_nsfw` has quit [Remote host closed the connection]
_whitelogger has joined #ruby
xyhuvud has joined #ruby
kent\n has joined #ruby
alnk has joined #ruby
NODE has quit [Excess Flood]
ryzokuken has joined #ruby
vqrs has joined #ruby
robotmay has joined #ruby
darkphnx4805 has joined #ruby
timeless has joined #ruby
graphicsv has joined #ruby
NODE has joined #ruby
TomyLobo has joined #ruby
evdubs has joined #ruby
creat has joined #ruby
DarthGandalf has joined #ruby
kashike has joined #ruby
TzilTzal has joined #ruby
arooni has joined #ruby
yokel has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ldepandis has joined #ruby
jingjing1 has joined #ruby
jingjinghack has quit [Ping timeout: 250 seconds]
schne1der has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 256 seconds]
TomyWork has joined #ruby
jingjinghack has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
jingjing1 has quit [Ping timeout: 264 seconds]
chalkmonster has joined #ruby
mozzarella has quit [Remote host closed the connection]
TomyLobo has quit [Read error: Connection reset by peer]
mozzarella has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
cschneid_ has quit [Quit: ZNC 1.7.5 - https://znc.in]
yelloB has joined #ruby
yelloB has quit [Remote host closed the connection]
Arkantos has quit [Quit: Textual IRC Client: www.textualapp.com]
mozzarella has quit [Remote host closed the connection]
jingjing1 has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mozzarella has joined #ruby
jingjinghack has quit [Ping timeout: 250 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
cschneid has joined #ruby
yokel has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
MuffinPimp has quit [Quit: Goodbye.]
MuffinPimp has joined #ruby
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
tbisker8 has quit [Ping timeout: 260 seconds]
chalkmon1 has joined #ruby
titanbiscuit has joined #ruby
chalkmonster has quit [Ping timeout: 260 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
Vashy has joined #ruby
ellcs has joined #ruby
ellcs has quit [Client Quit]
postmodern has quit [Quit: Leaving]
chalkmon1 has quit [Quit: WeeChat 2.7.1]
dviola has quit [Quit: WeeChat 2.7.1]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
jingjing1 has quit [Quit: WeeChat 2.1]
ldepandis has joined #ruby
ritalinona has quit [Remote host closed the connection]
lineus has quit [Remote host closed the connection]
iNs_ has quit [Remote host closed the connection]
galaxie has quit [Write error: Connection reset by peer]
cnsvc has quit [Write error: Connection reset by peer]
lineus has joined #ruby
galaxie has joined #ruby
cnsvc has joined #ruby
sylario has joined #ruby
stryek has joined #ruby
chalkmonster has joined #ruby
cschneid_ has joined #ruby
iNs has joined #ruby
ritalinona has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
conta has quit [Quit: conta]
iNs has quit [Ping timeout: 240 seconds]
iNs has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.7.1]
al2o3-cr has joined #ruby
burningserenity has joined #ruby
Technodrome has joined #ruby
burningserenity has quit [Client Quit]
burningserenity has joined #ruby
buckworst has joined #ruby
rmnull has joined #ruby
drincruz has joined #ruby
Liothen has joined #ruby
galaxie has quit [Remote host closed the connection]
galaxie has joined #ruby
chalkmonster has quit [Remote host closed the connection]
chalkmonster has joined #ruby
burningserenity has quit [Ping timeout: 260 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
burningserenity has joined #ruby
<Cork> anyone know if there is a cleaner way to parse subjectAltName? https://paste.debian.net/1136753/
buckworst has quit [Quit: WeeChat 2.7.1]
lineus has quit [Ping timeout: 240 seconds]
lineus has joined #ruby
<ytti> i'm not familiar how this objectl ooks like, so i can't say anything specific to it
<ytti> but the code looks good to me, it is idiomatic
<ytti> knowing the object well i might know something domain specific and say it's easier to dig by xyz
<Cork> ya its the OpenSSL::ASN1.decode(OpenSSL::ASN1.decode().value.second.value).value that feels stupid
<ytti> i'd perhaps use safe navigation and #select instead of #detect
<ytti> but not a big deal
<Cork> my problem is that the certificate has a comma separated string with "DNS:<name>, DNS:<name>, ..."
<Cork> i could do a split(", DNS:") but that feels even more like a hack
<ytti> i agree, i like current code more
<Cork> ytti: ok, thx for your time!
<ytti> only question i have, which i guess is what you're looking answer for, is the object really constructed in such an awkward way
alfiemax has joined #ruby
<ytti> that this is the best way to dig that information
<Cork> ya, that is exactly my questio
<Cork> +n
<Cork> it feels like you should be able to get some form of a list without double parsing it
<ytti> might take some time in pry/irb
<ytti> to poke around it, look at public methods etc
<Cork> ya, that's what i've done
<Cork> googling has given me absolute zero for subjectAltName in certificate
<Cork> for csr there are a few examples but nothing for certificates
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
<ytti> entirely possible the object just has, well, let's be honest, shitty api
<ytti> and that's the best code there is for it
<Cork> heh ya possible, the api for csr is quite shitty too
burningserenity has quit [Ping timeout: 258 seconds]
conta has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
burningserenity has joined #ruby
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
pandakekok9 has quit [Quit: leaving]
jmcgnh has quit [Read error: Connection reset by peer]
consti has joined #ruby
conta has quit [Quit: conta]
banisterfiend has joined #ruby
lucasb has joined #ruby
jmcgnh has joined #ruby
duderonomy has joined #ruby
bvdw has quit [Quit: bvdw]
bvdw has joined #ruby
pupsikov has joined #ruby
chalkmonster has joined #ruby
consti has quit [Quit: consti]
impermanence has joined #ruby
ExoUNX has joined #ruby
ua has quit [Ping timeout: 246 seconds]
ExoUNX has quit [Ping timeout: 240 seconds]
impermanence has quit [Remote host closed the connection]
nofxx_ has joined #ruby
nofxx has quit [Ping timeout: 256 seconds]
akem_ has joined #ruby
ua has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Junaos has quit [Ping timeout: 264 seconds]
nchamber- has joined #ruby
nchambers has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
Junaos has joined #ruby
cranq has quit [Ping timeout: 264 seconds]
shansen has quit [Ping timeout: 264 seconds]
<apotheon> pyrmont: I like Sinatra, too. I've written several web applications using it.
shansen_ has joined #ruby
jetchisel has quit [Ping timeout: 264 seconds]
akem has quit [Ping timeout: 264 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
cranq has joined #ruby
jetchisel has joined #ruby
<apotheon> pyrmont: I'm looking at creating an ecommerce web application that integrates with a POD API to create kind of a collection of sub-shops, basically. On one hand, I like simpler frameworks (I know, Sinatra's not exactly a "framework", but what's the parent set for "framework" and "web application DSL" subsets?). On the other hand, I just wanna build the thing and not reinvent any wheels in this
<apotheon> case.
cockadopolous has quit [Quit: leaving]
<apotheon> pyrmont: Perhaps amusingly, I feel like I might take the opposite of the usual route -- start by building it in Rails, then eventually rewrite it using something like Roda or Sinatra (that is, move from "big, Enterprise thing" to "small, somewhat bespoke thing").
<adam12> Rails is obviously a super complete package. If Sequel was more of a first-class citizen on it I might say it would be the better option.
<adam12> I've been using Roda full time for ~ 3 years now. It's great but there's definitely rough edges. And tbh, I miss having a global list of routes.
dhollinger has quit [Ping timeout: 260 seconds]
<pyrmont> apotheon: Yeah, that app sounds complex enough that something like Sinatra might be 'too simple' as it were.
chalkmonster has quit [Quit: WeeChat 2.7.1]
<apotheon> too simple to feel like I want to put in the extra work in this case, anyway
NODE has quit [Quit: changing servers]
NODE has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
conta has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
dhollinger has joined #ruby
OverClocked has quit [Ping timeout: 250 seconds]
titanbiscuit has quit [Ping timeout: 250 seconds]
titanbiscuit has joined #ruby
ldepandis has quit [Read error: Connection reset by peer]
meinside has quit [Quit: Connection closed for inactivity]
roadie has joined #ruby
cschneid has quit [Ping timeout: 258 seconds]
cschneid has joined #ruby
Arkantos has joined #ruby
vdl has quit [Quit: WeeChat 2.3]
vdl has joined #ruby
TorpedoSkyline has joined #ruby
TorpedoSkyline has quit [Client Quit]
burningserenity has quit [Ping timeout: 240 seconds]
cthu| has joined #ruby
TCZ has joined #ruby
DTZUZU2 has quit [Ping timeout: 250 seconds]
DTZUZU2 has joined #ruby
brool has joined #ruby
burningserenity has joined #ruby
ChmEarl has joined #ruby
banisterfiend has joined #ruby
dylanf has joined #ruby
<dylanf> Hi all :waves:
<dylanf> I'm trying to do Something Clever that I'm convinced is within the realm of Ruby's possibilities, but can't quite figure it out. Is there a way to get the parent class of a calling method?
<dylanf> Eg. right now I've got a method in one class that calls a method in another class. From the inside of that latter method, I can get the _name_ of the calling method pretty easily with `caller` or `caller_locations`.
<dylanf> But I can't for the life of me figure out how to get that calling method's parent, except maybe by just inferring it from the filename.
postmodern has joined #ruby
<adam12> dylanf: Maybe through binding_of_caller
Emmanuel_Chanel has joined #ruby
conta has quit [Quit: conta]
<adam12> dylanf: Tho it might be a slow path so I'd be wary about where you put it.
<dylanf> Hmm. Yeah, I'd rather avoid pulling in dependencies for this. Might just not bother.
sergioro has joined #ruby
yelloB has joined #ruby
yelloB has quit [Remote host closed the connection]
wildtrees has joined #ruby
wildtrees has quit [Remote host closed the connection]
wildtrees has joined #ruby
conta has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
wildtrees has quit [Remote host closed the connection]
wildtrees has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
<havenwood> dylanf: By parent do you mean its class?
wildtrees has quit [Remote host closed the connection]
conta1 has joined #ruby
conta has quit [Ping timeout: 264 seconds]
conta1 is now known as conta
<havenwood> dylanf: How about?: method(__callee__).owner
<havenwood> Ah, parent class as in ancestry. Gotcha.
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> method(__callee__).owner.ancestors
<havenwood> Maybe I'm misunderstanding the question. I should just not check IRC until *after* first cup of coffee. :P
conta has quit [Ping timeout: 256 seconds]
troulouliou_div2 has joined #ruby
caterfxo has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
TCZ has quit [Quit: Leaving]
troulouliou_div2 has quit [Ping timeout: 240 seconds]
chalkmonster has joined #ruby
Arkantos has quit [Quit: Textual IRC Client: www.textualapp.com]
Arkantos has joined #ruby
caterfxo has joined #ruby
troulouliou_div2 has joined #ruby
alfiemax has joined #ruby
markopasha has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 256 seconds]
t0th_- has joined #ruby
<t0th_-> hi
<havenwood> t0th_-: hi
<t0th_-> how i can solve this? An error occurred while installing sassc (2.2.1), and Bundler cannot continue.
<t0th_-> Make sure that `gem install sassc -v '2.2.1' --source 'https://rubygems.org/'` succeeds before bundling.
<t0th_-> jekyll was resolved to 4.0.0, which depends on
<t0th_-> In Gemfile:
<t0th_-> jekyll-multiple-languages-plugin was resolved to 1.6.1, which depends on
<t0th_-> jekyll-sass-converter was resolved to 2.1.0, which depends on
<t0th_-> sassc
<t0th_-> sorry
<havenwood> t0th_-: What error do you get with?: gem install sassc -v '2.2.1'
burningserenity has quit [Ping timeout: 260 seconds]
<t0th_-> testing
<ruby[bot]> t0th_-: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<havenwood> t0th_-: make: g++: Command not found
<havenwood> t0th_-: What distro are you on?
<havenwood> t0th_-: You need to install build tools.
<havenwood> t0th_-: E.g.: sudo apt-get install g++
<t0th_-> installing
<havenwood> t0th_-: sudo apt-get install build-essential
<t0th_-> yes
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
ChmEarl has quit [Quit: Leaving]
Azure has quit [Ping timeout: 240 seconds]
Azure has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 265 seconds]
<t0th_-> thanks, havenwood
<havenwood> t0th_-: no prob, you're welcome
rmnull has quit [Ping timeout: 256 seconds]
rmnull has joined #ruby
alfiemax has joined #ruby
cd has quit [Quit: cd]
Azure has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 256 seconds]
<adam12> Ruby on CentOS 8 has been a pleasant surprise. `yum module enable ruby:2.6 && yum install ruby`
jinie has quit [Ping timeout: 240 seconds]
jinie has joined #ruby
ExoUNX has joined #ruby
t0th_- has quit [Remote host closed the connection]
TomyWork has quit [Quit: Leaving]
xco has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
Azure has joined #ruby
consti has joined #ruby
<dylanf> havenwood: no worries :) I ended up just changing the calling method signature to pass in `binding`.
consti has quit [Client Quit]
<dylanf> havenwood: thanks though :D
chalkmonster has quit [Quit: WeeChat 2.7.1]
ExoUNX has quit [Ping timeout: 256 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
Sauvin has quit [Read error: Connection reset by peer]
kevinburke has joined #ruby
chalkmonster has joined #ruby
sagax has quit [Read error: Connection reset by peer]
wildtrees has joined #ruby
cliluw has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
alfiemax has joined #ruby
wildtrees has quit [Remote host closed the connection]
cliluw has quit [Quit: Leaving]
rmnull has quit [Quit: WeeChat 2.7.1]
cliluw has joined #ruby
duderonomy has quit [Remote host closed the connection]
duderonomy has joined #ruby
alfiemax has quit [Remote host closed the connection]
sergioro has quit [Quit: leaving]
sergioro has joined #ruby
d3bug has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
TzilTzal has quit [Quit: Leaving.]
ChmEarl has joined #ruby
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
rippa has joined #ruby
GodFather has joined #ruby
dasher00 has joined #ruby
vondruch has quit [Ping timeout: 250 seconds]
chalkmonster has joined #ruby
wildtrees has joined #ruby
<sergioro> Hi, i'm using "ENV['EUID']==0" to check if a ruby script is run by root. This only works if export EUID in bash session. How to check if a script is run by root, without using environment variables?
Scriptonaut has joined #ruby
wildtrees has quit [Remote host closed the connection]
<dylanf> sergioro: it's not a _great_ way but you could `system("whoami")` or something. I suspect env vars are the right way to go, but that you don't want EUID. Try USER instead.
<xco> havenwood will you help me fix the emoji issue with the terminal-table gem?
<xco> :D
<havenwood> sergioro: See Etc: https://docs.ruby-lang.org/en/2.7.0/Etc.html
chalkmonster has quit [Quit: WeeChat 2.7.1]
<dylanf> ^^ that is a better answer; TIL
<havenwood> sergioro: Or: Process.euid
<havenwood> sergioro: From the command line, you can: ri euid
<havenwood> xco: Yeah, sure!
<xco> yes!!
<xco> so first this is my plan
<xco> i need to have a way for my gem to work with a forked version of the original
<xco> because i don't think the maintainers would want to spend time on this
<xco> how can i get that gem somehow locally ?
<xco> that's my idea to firs test that but i think you might have a smarter idea
<havenwood> xco: They might consider a patch. You can fork it or I think a zero-width character might work as a hack.
<xco> i thought of forking it but then tried adding it to my gem and it wasn't picking it
<xco> unless my change was wrong
<xco> i can show you
<xco> looks silly i know
<havenwood> I'd vote for changing it to understand Emoji size or using an invisible character to pad.
rubydoc has quit [Ping timeout: 246 seconds]
chalkmonster has joined #ruby
rubydoc has joined #ruby
<havenwood> xco: It looks like it's nearing a 2.0 release. Does it work in 2.0? Maybe a good time for a patch.
chalkmonster has quit [Client Quit]
<xco> oh you meant for the change to actually be done on unicode-display_width?
<havenwood> xco: Yeah, as upstream as possible.
<havenwood> xco: That'll fix it in the most places.
<xco> hmmm but what if terminal-table have their version of unicode-display_width locked?
<havenwood> xco: They don't implement it themselves.
<sergioro> dylanf and havenwood: thanks, Process.euid worked for me.
<havenwood> sergioro: you're welcome
jmcgnh has quit [Ping timeout: 250 seconds]
chalkmonster has joined #ruby
<havenwood> xco: I'd first check if it works in the 2.0 release candidate.
<xco> havenwood but how would i do that?
jmcgnh has joined #ruby
<havenwood> xco: You can either git clone, git branch, gem build, gem install or use the specific_install plugin for RubyGems: https://github.com/rdp/specific_install
cschneid has joined #ruby
<xco> oh so using specific_install i can redirect my gem to use a modified version of terminal-table?
cschneid_ has quit [Ping timeout: 250 seconds]
brendan- has quit [Ping timeout: 240 seconds]
<xco> i thought i should be directing my gem to use a specific version of unicode-display_width
<havenwood> xco: I meant to use it to check if the problem is resolved in 2.0.0-rc2.
<havenwood> xco: gem specific_install https://github.com/janlelis/unicode-display_width.git
<havenwood> xco: That'll ^ install the master branch.
<havenwood> xco: Then you can check if it's resolved.
bvdw has quit [Read error: Connection reset by peer]
<havenwood> xco: You can use a forked gem in many ways easy enough. The specific_install gem isn't necessary for that though.
<havenwood> xco: First I'd check if the problem is fixed, since that'll inform what to do next.
<xco> i'm confused
bvdw has joined #ruby
<xco> but i'nnot use unicode-display_width directly
chalkmonster has quit [Quit: WeeChat 2.7.1]
<xco> terminal table uses it
<xco> i'm not using*
<havenwood> xco: Right, it's "upstream" from terminal-table.
<havenwood> xco: When fixing a bug like this, go to the source rather than hacking it downstream.
<xco> that i get
<xco> what i don't get is
<havenwood> xco: So threshold question is "Is this already fixed."
<havenwood> If so, you can make a PR to terminal-table to bump the gem version and use your fork until they merge it.
<xco> i depende on terminal-table(TT) which depends on the unicode gem
<havenwood> Right.
<xco> so
<xco> in my gemspec
<xco> how do i tell TT to use the master of unicode gem?
<xco> that's what i don't understand :)
<havenwood> I'm suggesting just quickly checking IF it's fixed.
<xco> yes i know
brendan- has joined #ruby
<xco> how do i tell terminal table which is in MY gemspec to use the laster branch of unicode gem?
<havenwood> xco: You'd fork the gem, make the gemspec change, then point to your fork.
<xco> so i can do the test
troulouliou_dev has joined #ruby
<havenwood> Just test it in IRB.
<havenwood> We could have checked it multiple times whilst talking about it. :P
<havenwood> xco: gem specific_install https://github.com/janlelis/unicode-display_width.git && irb -runicode-display_width
<havenwood> Oh, it requires by another name.
<xco> havenwood yeah i know
<havenwood> unicode/display_width
<xco> but i've never been this confused in my life
<havenwood> xco: Do you know if the issue is fixed in the 2.0.0-rc2??
<havenwood> xco: If you don't know, quickly check!
<xco> havenwood i have no idea
<havenwood> xco: Literally just run this line: gem specific_install https://github.com/janlelis/unicode-display_width.git && irb -runicode/display_width
<havenwood> xco: Then try the command.
<havenwood> xco: (Install the latest master version of the gem, require it in IRB, and try the line.)
<havenwood> xco: Unicode::DisplayWidth.of(...)
<havenwood> xco: It may be fixed before 2.0 too.
Xeago has quit [Read error: Connection reset by peer]
<havenwood> xco: 1.1 is pretty old.
<havenwood> xco: Or may not be fixed at all.
markopasha has joined #ruby
<havenwood> xco: Unicode::DisplayWidth.of('🇫🇷') #=> 2
<havenwood> xco: Just checked.
<xco> Unicode::DisplayWidth.of("🇺🇸")
<xco> 2
<xco> yeah just did too
<xco> is that the expected width?
<havenwood> xco: Really good question.
<xco> in their readme they have
<xco> Unicode::DisplayWidth.of "🤾🏽‍♀️" # => 5
<havenwood> xco: That seems strange, huh?
<xco> but in my terminal Unicode::DisplayWidth.of "🤾🏽‍♀️" give me 5 as well
<havenwood> xco: It's size is 5.
<havenwood> xco: 5 codepoints.
<xco> right
<havenwood> xco: But... display width shouldn't be five unless I'm not understanding what they mean.
<xco> then they have this too Unicode::DisplayWidth.of "🤾🏽‍♀️", 1, {}, emoji: true # => 2
<havenwood> xco: Maybe it was a limitation at the time.
<havenwood> xco: Ah, nice.
<havenwood> xco: So they have an emoji option.
<xco> yes
<havenwood> xco: I do think emoij generally are 2 display width. I'd have thought you'd luck into it working for flags.
<havenwood> xco: Why is it displaying as 1 not 2 then?
<havenwood> Hmm.
<xco> 🤷🏾‍♂️
<havenwood> Unicode::DisplayWidth.of('🇫🇷', emoji: true) #=> 2
<havenwood> So the emoji feature is meant for single-codepoint or greater-than-two-codepoint emojis.
<xco> that makes sense because you can't have an emoji of less than 2 codepoints can you
<xco> so 2 is like the min
<xco> unless it's this "⚀".display_width
<xco> :D
<xco> Unicode::DisplayWidth.of "⚀" = 1
<havenwood> xco: There are single codepoint emoji.
<xco> :P
<havenwood> &>> '🤣'.codepoints
<xco> yeah just noticed
<rubydoc> # => [129315] (https://carc.in/#/r/8rvj)
<havenwood> &>> '🤣'.codepoints.size
<rubydoc> # => 1 (https://carc.in/#/r/8rvk)
<havenwood> xco: This gem's `emoji: true` option makes them all size 2.
<havenwood> xco: Which I'd have expected to work, so unclear why it's not offsetting. Seems like a terminal issue. I've seen odd spacing with emoji in terminals before.
<havenwood> xco: We should check if it's broken on all terminals or just yours.
<xco> should i prepare code for you to check on your machine?
<havenwood> xco: Perfect.
<xco> sec
<havenwood> We can try in a few terminals with a few fonts and sanity check.
<havenwood> xco: I suspect it's displaying two wide but only indenting one wide.
seydar has joined #ruby
<seydar> is there a community consensus on an alternative to (n)curses?
<havenwood> xco: Confirmed broken on this machine.
cliluw has quit [Ping timeout: 240 seconds]
<xco> so it's not just me
cliluw has joined #ruby
<havenwood> xco: Nope, not just you.
<havenwood> xco: Gotta run for a minute but I'll ponder.
<xco> havenwood sure!!! :D thanks for today though <3
ur5us has joined #ruby
<havenwood> xco: Replied to your gist.
caterfxo has quit [Ping timeout: 264 seconds]
<havenwood> xco: Zero-width font works.
<xco> mind blown
<havenwood> xco: Since it seems like a pain to fix upstream, I'd suggest just adding a zero-width character after the flag.
<xco> yeah
<xco> sad this is not being fixed for everyone else
<xco> yay now we can have emoji flags in kovid :D :D
<havenwood> xco: There's a subtle terminal-specific indentation issue.
<xco> hmmm
<havenwood> xco: Woot!
<xco> so this won't work for all terminals you mean?
<havenwood> xco: Terminals seem to consistently not indent emoji properly. I don't actually know why.
jetchisel has quit [Ping timeout: 260 seconds]
<havenwood> xco: I *think* the fix is fine.
<xco> ok cool
Jonopoly has joined #ruby
Jonopoly has quit [Client Quit]
<xco> i'll ask around how the tables with emojis appears for others with other systems
<havenwood> xco: `[8203].pack('U')` is the same as `8203.chr(Encoding::UTF_8)`.
<havenwood> &>> [8203].pack('U') == 8203.chr(Encoding::UTF_8) # xco
<rubydoc> # => true (https://carc.in/#/r/8rw5)
vondruch has joined #ruby
jetchisel has joined #ruby
<havenwood> xco: I think the latter is more readable.
<havenwood> xco: And it avoid instanciating that Array.
caterfxo has joined #ruby
<xco> havenwood think how i'm going to use that
<xco> will i add that to the emoji?
<xco> that's my guess
<xco> interpolate the emoji with it
carbone5 has joined #ruby
<havenwood> xco: Yup, just append it along with any emoji.
<havenwood> xco: It should work before or after the emoji for your case.
<xco> sweeeeet!!!!
<xco> it's amazing how much i learn from you everyday
<xco> Thank you really!! havenwood
<havenwood> xco: You're welcome!
arahael2 has quit [Ping timeout: 256 seconds]
howdoi has joined #ruby
william1 has joined #ruby
william1 has quit [Client Quit]
sagax has joined #ruby
eDaky has joined #ruby
<eDaky> hi guys
<eDaky> i'm going in curcle for some time now
<eDaky> i have this part of code
<eDaky> servers.select {|x| x["name"] =~ /group/}.map {|x| x["ip"]}.reject(&:nil?).join(' ')
<eDaky> i'm getting server ip address "1.2.3.4 4.3.2.1 1.2.3.4" but i need to join somehow port :* so it should be "1.2.3.4:* 4.3.2.1:*"
<eDaky> anybody willing to help me with this ?
<xco> :D
<xco> hahhaha
<xco> this is fun :D
<eDaky> if i add .join(':* ') but last address deos not get this part of string
<eDaky> 1
caterfxo has quit [Ping timeout: 264 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<eDaky> Anybody with some speer time ? :)
caterfxo has joined #ruby
<eDaky> ping
<ccooke> eDaky: join will only add the string between items, so the item at the end doesn't get them. what you want is to use .map
<eDaky> yea i'm using map to make ip list
<ccooke> &>> %w{ 1.2.3.4 4.3.2.1 1.2.3.4 }.map { |i| "#{i}:*" }
<rubydoc> # => ["1.2.3.4:*", "4.3.2.1:*", "1.2.3.4:*"] (https://carc.in/#/r/8rwt)
<eDaky> omg
<eDaky> totally blind
<eDaky> this worked
<eDaky> ccooke tnx so much for help
arahael2 has joined #ruby
seydar has quit [Quit: leaving]
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #ruby
_whitelogger has joined #ruby
_whitelogger has joined #ruby
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
russt has quit [Quit: That's all, folks!]
russt has joined #ruby
arcaos has joined #ruby
russt has quit [Client Quit]
russt has joined #ruby
<howdoi> When was the last you checked if two arrays were equal in your production code?
brendan- has quit [Ping timeout: 240 seconds]
brendan- has joined #ruby
cschneid has quit [Ping timeout: 264 seconds]
cschneid_ has joined #ruby
<leftylink> ah, it's too bad adventofcode.com doesn't count as production code, because that was a time when I clearly checked whether two arrays were equsl
<leftylink> I will not be enumerating all the days in which I did that, but at the very least, in day 22, I did.
<phaul> what are the pitfalls of comparing arrays for equality?
<phaul> &>> [] == []
<rubydoc> # => true (https://carc.in/#/r/8ry4)
<phaul> seems to work fine
<leftylink> well, at least we've moved on from the spaceship operator.
<havenwood> howdoi: I'm on parental leave so I have no production code, but it's common to compare Arrays.
<leftylink> 2020-01-14 19:43:33 < howdoi> when was the last time you used the space ship operator in production code?
<leftylink> (referring to that)
<phaul> rings a bell :)
<leftylink> one of the things you learn about leftylink after being in the same channel for a while: leftylink holds grudges
<howdoi> leftylink: no, I haven't :D
<havenwood> howdoi: Twoquals is properly in common useage.
<howdoi> I am build a case
<howdoi> from equals, to compare to spaceship
<howdoi> leftylink: never forgets me :D [happy to have such a friend]
* leftylink nods
<havenwood> howdoi: The spaceship operator is used much less frequently than twoquals. The former is used when you're defining your own class that's comparable. The latter is used frequently and not just when defining your own class.
<howdoi> DataViz, Memoization check, Schema validator
<havenwood> howdoi: Why do you ask?
<howdoi> I feel a need that JS needs spaceship, but I need a solid problem statement
<havenwood> xco: Nice, that looks good.
<xco> :)
schne1der has quit [Ping timeout: 260 seconds]
<howdoi> There is no well defined way to check if two arrays are equal in JS
<howdoi> But normally in production code we don't compare arrays either
<howdoi> <=> is a lovely operator in ruby, was curious to know the production use cases for it
<howdoi> also, == and compare and stuff
<howdoi> in the ruby world
Arkantos has quit [Quit: Textual IRC Client: www.textualapp.com]
caterfxo has quit [Ping timeout: 250 seconds]
<havenwood> &>> [0, 1] == [1, 0]
<rubydoc> # => false (https://carc.in/#/r/8ryn)
<havenwood> &>> require 'set'; Set.new([0, 1]) == Set.new([1, 0])
<rubydoc> # => true (https://carc.in/#/r/8ryo)
caterfxo has joined #ruby
<kaleido> &>> 1 ==1
<rubydoc> # => true (https://carc.in/#/r/8ryt)
<kaleido> truly advanced code there, kal :D
dasher00 has quit [Ping timeout: 240 seconds]
sylario has quit [Quit: Connection closed for inactivity]
<brool> &>> true
<rubydoc> # => true (https://carc.in/#/r/8ryv)
ellcs has quit [Ping timeout: 256 seconds]
dasher00 has joined #ruby
dasher00 has quit [Max SendQ exceeded]
dasher00 has joined #ruby
dasher00 has quit [Max SendQ exceeded]
<howdoi> :D
dasher00 has joined #ruby
dasher00 has quit [Max SendQ exceeded]
<havenwood> howdoi: It's not terribly common to see Array#== in particular, but you do. Here's an example in Rails: https://github.com/rails/rails/blob/v6.0.2.2/actionpack/lib/action_dispatch/journey/gtg/builder.rb#L35
dasher00 has joined #ruby
<howdoi> havenwood: how is it diff from u.include?(DUMMY)?
<havenwood> howdoi: The latter might include other things.
<havenwood> howdoi: The former does not.
<howdoi> nods
<havenwood> howdoi: That's actually checked in the next else statement here: https://github.com/rails/rails/blob/v6.0.2.2/actionpack/lib/action_dispatch/journey/gtg/builder.rb#L45
<howdoi> hah hah okies
<howdoi> havenwood: nice, thanks for helping, even when on paternity level!
<havenwood> howdoi: This channel doesn't offer paternity leave, so I'm stuck here...
<howdoi> havenwood: lolz
carbone5 has quit [Quit: carbone5]
KramerC has quit [Quit: Leaving]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
KramerC has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
evdubs has quit [Quit: Leaving]
evdubs has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
<adam12> lol
kristian_on_linu has joined #ruby
cliluw has quit [Ping timeout: 256 seconds]
cliluw has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
TCZ is now known as ekspert_programi
Tempesta has quit [Read error: Connection reset by peer]
Arkantos has joined #ruby
Tempesta has joined #ruby
ekspert_programi has quit [Quit: Leaving]
_phaul has joined #ruby
phaul has quit [Ping timeout: 256 seconds]
arcaos has quit [Ping timeout: 240 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
buckworst has joined #ruby
markopasha has quit [Ping timeout: 250 seconds]
phaul has joined #ruby
_phaul has quit [Ping timeout: 258 seconds]
ccooke has quit [Remote host closed the connection]