adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.2, 2.7.4, 2.6.8: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
JSharp has quit [*.net *.split]
mahlon has quit [*.net *.split]
ferr_ has quit [*.net *.split]
AEtherC0r3 has quit [*.net *.split]
Artea has quit [*.net *.split]
dviola has quit [*.net *.split]
AndrewYu has quit [*.net *.split]
danjo has quit [*.net *.split]
ollysmith_ has quit [*.net *.split]
nolesswrong has quit [*.net *.split]
smp has quit [*.net *.split]
unmanbearpig has quit [*.net *.split]
Liothen has quit [*.net *.split]
hwrd has quit [*.net *.split]
cuppajoeman has quit [*.net *.split]
FetidToot has quit [*.net *.split]
eam_ has quit [*.net *.split]
Exa has quit [*.net *.split]
Bish has quit [*.net *.split]
cognemo has quit [*.net *.split]
Furai has quit [*.net *.split]
Bish has joined #ruby
eam has joined #ruby
Artea has joined #ruby
nolesswrong has joined #ruby
Furai has joined #ruby
mahlon has joined #ruby
AndrewYu has joined #ruby
cuppajoeman has joined #ruby
JSharp has joined #ruby
unmanbearpig has joined #ruby
hwrd has joined #ruby
Liothen has joined #ruby
AndrewYu has quit [Changing host]
AndrewYu has joined #ruby
dviola has joined #ruby
markong has quit [Ping timeout: 268 seconds]
cognemo has joined #ruby
smp has joined #ruby
fercell has joined #ruby
Exa has joined #ruby
danjo has joined #ruby
ollysmith has joined #ruby
AEtherC0r3 has joined #ruby
Leon__ has quit [Changing host]
Leon__ has joined #ruby
Leon__ is now known as leonthemisfit
jetchisel has quit [Ping timeout: 260 seconds]
jetchisel has joined #ruby
shuvarek has quit [Ping timeout: 265 seconds]
<havenwood> neshpion: array.map { _1.dig(:foo, :bar) }
dviola has joined #ruby
dviola has quit [Changing host]
<havenwood> neshpion: That'd be similar to: array[:foo][:bar]
<havenwood> neshpion: But array[:foo] could not exist and it'd return `nil` rather than raising an error.
<nakilon> .values_at(*properties)
<havenwood> nakilon: oh, spread rather than buried?
<havenwood> I may have missed that.
<havenwood> neshpion: give us concrete examples and we can show a nice way.
neshpion has quit [Ping timeout: 276 seconds]
jetchisel has quit [Ping timeout: 264 seconds]
neshpion has joined #ruby
jetchisel has joined #ruby
<neshpion> actually my array elements are Hashes
neshpion has quit [Remote host closed the connection]
neshpion has joined #ruby
<havenwood> neshpion: #dig can go between Array, Hash, and more.
jetchisel has quit [Read error: Connection reset by peer]
<havenwood> >> [{meaning: 42}].dig(0, :meaning)
<havenwood> => 42
<havenwood> You can dig multiple Arrays or Hashes deep.
<havenwood> Give an example of the data and what you want and we can show how.
<neshpion> this is my data and i just want the `num` and `focused` fields: https://termbin.com/eycy
<neshpion> i already do `map{|e| { :num => e["num"], :focused => e["focused"] } }` but was wondering if there was a fancier way
swaggboi has quit [Read error: Connection reset by peer]
postmodern has joined #ruby
<nakilon> > {"num"=>5, "focused"=>true, "foo"=>"bar"}.slice("num", "focused").transform_keys(&:to_sym)
<nakilon> => {:num=>5, :focused=>true}
<neshpion> :O
<neshpion> slice!!!
<neshpion> thanks
<postmodern> just noticed something weird with `` in ruby and wanted to know what's going on. `man true` in ruby claims there's no man page for the true command (which is incorrect), but running system("man true"), or system("man", "true"), or even doing man_page=$(man true) in Bash all work. Why?
swaggboi has joined #ruby
<neshpion> i get a man output
shuvarek has joined #ruby
<postmodern> neshpion, weird, what OS/shell are you using?
<neshpion> artix linux, bash 5.1.8(1)-release
<nakilon> I get man too on macos
<postmodern> weeeeird. only happens when in bundle console in this project on Fedora with bash. Outside of bundler it works. Spooky...
<postmodern> narrowed it down to something in the kramdown-2.3.1 gem
\{o} has joined #ruby
<\{o}> hello
neshpion has quit [Ping timeout: 276 seconds]
neshpion has joined #ruby
niv has quit [Quit: Powered by LunarBNC: https://LunarBNC.net]
postmodern has quit [Remote host closed the connection]
goepsilongo has joined #ruby
jetchisel has joined #ruby
ur5us has joined #ruby
neshpion has quit [Ping timeout: 276 seconds]
neshpion has joined #ruby
gr33n7007h has quit [Ping timeout: 245 seconds]
niv has joined #ruby
gr33n7007h has joined #ruby
ur5us has quit [Quit: Leaving]
shuvarek has quit [Ping timeout: 264 seconds]
shuvarek has joined #ruby
Rounin has quit [Ping timeout: 264 seconds]
ur5us has joined #ruby
neshpion has quit [Ping timeout: 276 seconds]
ur5us has quit [Quit: Leaving]
fredlinhares has quit [Quit: WeeChat 2.8]
ur5us has joined #ruby
<\{o}> /quit
\{o} has quit [Quit: ERC (IRC client for Emacs 27.2)]
Liexei has quit [Ping timeout: 240 seconds]
johnnyt has joined #ruby
Skyfire has quit [Quit: WeeChat 3.3]
hammdist has joined #ruby
jpw has joined #ruby
<hammdist> `./configure --disable-jit-support --without-valgrind && make && make install` but when I include `ruby.h` I get `#include "ruby/config.h"` not found and indeed the file is not there in /usr/local/include/ruby-3.0.0
ur5us has quit [Quit: Leaving]
reset has quit [Quit: reset]
vit has joined #ruby
m3ow1606 has joined #ruby
nullheroes has joined #ruby
Starfoxxes has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
Starfoxxes has joined #ruby
Furai has quit [Quit: WeeChat 3.3]
Furai has joined #ruby
teclator has quit [Ping timeout: 245 seconds]
teclator has joined #ruby
___nick___ has joined #ruby
goepsilongo has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
goepsilongo has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
m3ow1606 has quit [Quit: m3ow1606]
shuvarek has quit [Ping timeout: 264 seconds]
markong has joined #ruby
ferr_ has joined #ruby
fercell has quit [Ping timeout: 260 seconds]
Leon_ has joined #ruby
leonthemisfit has quit [Ping timeout: 246 seconds]
ferr_ has quit [Ping timeout: 245 seconds]
<nakilon> I have a huge json and to not flood the terminal I explore it like this https://i.imgur.com/ZfK6Og2.png
<nakilon> maybe some tool like jq can solve the same problem but I also wonder if there is a pure ruby way to explore this safely
Liexei has joined #ruby
Leon_ has quit [Changing host]
Leon_ has joined #ruby
Leon_ is now known as leonthemisfit
<nakilon> (the tool is called jid and it hangs)
Rounin has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
fredlinhares has joined #ruby
Inline has joined #ruby
reset has joined #ruby
fredlinhares has quit [Quit: WeeChat 2.8]
___nick___ has quit [Ping timeout: 264 seconds]
___nick___ has joined #ruby
goepsilongo has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
goepsilongo has joined #ruby
pull has joined #ruby
<hammdist> got a few undefined references when trying to link with ruby: https://paste.ee/p/d0kXr
<hammdist> if I try to manually add `-lruby` I get cannot find -lruby
<hammdist> in /usr/local/lib there is only libruby-static.a and some directories
gr33n7007h has quit [Ping timeout: 264 seconds]
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
<nakilon> may I ask why you compile ruby at all instead of installing a package
<nakilon> I mean an existing package that compiles it for you
Inline has quit [Ping timeout: 268 seconds]
Skyfire has joined #ruby
<adam12> hammdist: I'd try linking to an older version of Ruby, like 2.3 or 2.4, and see if it works. I feel like in the 2.7 or 3.x lineage, they moved some header files around.
<hammdist> got it to compile: `gcc -O2 -o ./main ./main.cpp $(pkg-config --cflags --libs ruby-3.0) -lruby-static -lm -ldl -lrt -lpthread -lcrypt` thanks all
<hammdist> I need to compile ruby because I want to disable pthreads if possible
<hammdist> well it seems it's not possible anymore at any rate. but I'm disabling the JIT which may be problematic for my use case also
Inline has joined #ruby
<hammdist> what causes SIGWINCH in stracing a bone-basic program that embeds ruby? https://paste.ee/p/gvx1k
pull has quit [Quit: Czesc]
taupiqueur has joined #ruby
vit has quit [Quit: Konversation terminated!]
sagax has quit [Ping timeout: 264 seconds]
<hammdist> is mruby on topic here? is there a way to embed only the bytecode interpreter in a program? (e.g., and compile to bytecode ahead of time)
teclator has joined #ruby
sagax has joined #ruby
goepsilongo has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
goepsilongo has joined #ruby
dstein64 has quit [Ping timeout: 252 seconds]
menace has quit [Quit: menace]
dstein64 has joined #ruby
<adam12> hammdist: It's on topic here.
markong has quit [Ping timeout: 268 seconds]
Inline has quit [Ping timeout: 245 seconds]
Inline has joined #ruby
KOTP has quit [Read error: Connection reset by peer]
KOTP has joined #ruby
___nick___ has quit [Ping timeout: 252 seconds]
goldfish has joined #ruby
taupiqueur has quit [Quit: taupiqueur]
Skyfire has quit [Quit: br]
Skyfire has joined #ruby
jpw has quit [Remote host closed the connection]
dohtem has quit [Quit: Connection closed for inactivity]
aesthetikx has joined #ruby
whysthatso1 has quit [Quit: The Lounge - https://thelounge.chat]
whysthatso1 has joined #ruby
rhe3 has joined #ruby
rhe has quit [Read error: Connection reset by peer]
rhe3 is now known as rhe
markong has joined #ruby
gr33n7007h has joined #ruby
BinaryVixen899 has joined #ruby
BinaryVixen899 has quit [Client Quit]
BinaryVixen899 has joined #ruby
skali has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ur5us_ has joined #ruby
ur5us_ has quit [Remote host closed the connection]
skali has quit [Quit: Textual IRC Client: www.textualapp.com]
pull has joined #ruby
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
kaleido has quit [Remote host closed the connection]
kaleido has joined #ruby
kaleido has quit [Changing host]
kaleido has joined #ruby