havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
Rounin has quit [Ping timeout: 272 seconds]
eddof13 has joined #ruby
RougeR has quit [Remote host closed the connection]
victori has joined #ruby
Starfoxxes has quit [Ping timeout: 240 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mdemo has quit [Quit: The Lounge - https://thelounge.github.io]
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
havenwood has quit [Quit: Ping timeout (120 seconds)]
havenwood has joined #ruby
con3 has quit [Quit: ZNC 1.8.2 - https://znc.in]
con3_ has joined #ruby
axsuul has quit [Quit: 👋]
axsuul has joined #ruby
wand has quit [Ping timeout: 240 seconds]
wand has joined #ruby
duds- has quit [Remote host closed the connection]
duds- has joined #ruby
Guest95 has joined #ruby
Guest95 has left #ruby [#ruby]
mahlon has quit [Ping timeout: 250 seconds]
mahlon has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
ged has joined #ruby
goepsilongo has quit [Quit: Textual IRC Client: www.textualapp.com]
RedNifre has quit [Ping timeout: 272 seconds]
ur5us has quit [Ping timeout: 240 seconds]
RedNifre has joined #ruby
lightbulbjim has joined #ruby
ur5us has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 240 seconds]
lightbulbjim has quit [Quit: Leaving...]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
roadie has joined #ruby
Guest7375 has joined #ruby
roadie has quit [Client Quit]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
_ht has joined #ruby
teclator has joined #ruby
Jonopoly has joined #ruby
Starfoxxes has joined #ruby
infinityfye has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
ur5us has joined #ruby
_ht has quit [Remote host closed the connection]
Rounin has joined #ruby
Guest7375 has quit [Ping timeout: 256 seconds]
perrierjouet has quit [Quit: WeeChat 3.4]
ur5us has quit [Ping timeout: 240 seconds]
perrierjouet has joined #ruby
Guest7375 has joined #ruby
roadie has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
Aylat has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 252 seconds]
szkl has quit [Quit: Connection closed for inactivity]
oxfuxxx has joined #ruby
roadie has joined #ruby
oxfuxxx has quit [Ping timeout: 252 seconds]
roadie has quit [Ping timeout: 268 seconds]
ollysmith_ has joined #ruby
<perrierjouet> sudo gem install sqlint ERROR: Failed to build gem native extension
ollysmith has quit [Ping timeout: 272 seconds]
roadie has joined #ruby
<nakilon> perrierjouet that's not all uotput
<perrierjouet> nakilon: https://pastebin.com/yTJdjhLr
<perrierjouet> am on voidlinux
roadie has quit [Ping timeout: 256 seconds]
<leah2> perrierjouet: install ruby-devel
gproto23 has joined #ruby
<perrierjouet> thanks
ysionneau has joined #ruby
<ysionneau> hello
<ysionneau> is it possible to "cross compile" a gem? afaik extensions are compiled at "gem install" time. Can we say to gem install to cross compile?
<ysionneau> I'm trying to install a gem to work on a buildroot embedded firmware. but the extension needs to be cross compiled for the embedded target
TomyWork has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
roadie has joined #ruby
Jonopoly has quit [Quit: WeeChat 3.0]
roadie has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
Thanzex9 has joined #ruby
Thanzex has quit [Ping timeout: 256 seconds]
Thanzex9 is now known as Thanzex
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
<ysionneau> ah no, so far the only match I found was https://github.com/rubygems/rubygems/issues/1840
<ysionneau> thanks mooff
Guest7375 has quit [Ping timeout: 256 seconds]
Tempesta has quit [Quit: See ya!]
Guest7375 has joined #ruby
Tempesta has joined #ruby
<cxl_> Hey all, I'm a bit confused with require vs include... I have a short example here: https://dpaste.org/6Qgu, can you tell me which of the two examples I need?
<cxl_> I think what I don't get is how to next a module within another when they're in different files.
<havenwood> cxl_: Neither of those work, but include is closer. A require is simply loading Ruby code from another file, just it loads once.
<havenwood> cxl_: While include is closer, it's for mixing in methods not changing namespace.
<havenwood> cxl_: I'd suggest reading more about Ruby namespaces. Generally don't change `Bar::Baz` to be `Foo::Bar::Baz`, we'd define it under `Foo` to start with.
<cxl_> havenwood: so I should do this instead? https://dpaste.org/X1b5
<cxl_> My issue with this is that when I'm testing Foo::Bar::Baz, I require the file, and then everywhere in my test I have to call it Foo::Bar::Baz instead of more simply Bar::Baz or just Baz.
Jonopoly has joined #ruby
<adam12> cxl_: That's natural in Ruby, but perhaps a bit different if you're used to Python
Aylat has quit [Quit: Leaving]
<cxl_> adam12: Alright so it's not particularly frowned upon to use the full module "path" (Foo::Bar::Baz instead of Bar::Baz or Bas)?
<cxl_> s/Bas/Baz
<adam12> cxl_: No, and you won't always need to use it. If you're inside `Foo::Bar` already, you can just call `Baz`. Likewise, if you're in `Foo` already, you can call `Bar::Baz`.
<adam12> cxl_: Ruby checks it's current namespace before looking outside. It does other things too for constant lookup (and I think there are some good Youtube videos about it if you want to deep dive), but in general, if you're inside something `X:Y`, you can access other things in `X:Y`, and you can leave off `X` if you're looking for something similar
<adam12> to `X:Y` but maybe `X:Z`.
<adam12> Not sure if that helps or is confusing :P
<adam12> One thing to note, is that the _defining_ of X:Y:Z matters. If you just go class X:Y:Z, then you're not actually inside X:Y. You're still at the top level.
<cxl_> adam12: Yes I get it. Always do `module A\n module B\n class C` rather than `class A::B::C`
<adam12> cxl_: Yes. I'd say, at least until you're familiar with constant lookup. But I still do explicit namespaces 99% of the time.
bit4bit has joined #ruby
oxfuxxx has joined #ruby
roadie has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
bit4bit has quit [Ping timeout: 240 seconds]
ollysmith_ has quit [Ping timeout: 268 seconds]
ollysmith has joined #ruby
ollysmith_ has joined #ruby
ollysmith has quit [Ping timeout: 240 seconds]
<ysionneau> mooff: any idea? https://pastebin.com/eDNnyxXA
eddof13 has joined #ruby
<ysionneau> as a first step, before cross compiling, I am trying to just replace the "gem build" using mkmf with the rake compile for native build. Then i'll try to cross compile using rake
gproto23 has quit [Remote host closed the connection]
oxfuxxx has quit [Ping timeout: 240 seconds]
<ysionneau> hmm maybe I should just be doing "rake gem"
<nakilon> pastebin is a cancer
oxfuxxx has joined #ruby
<rapha> hi all
<rapha> how are you all
<rapha> is there something pre-made from extracting something like a schema from a deep hash? like, let's say, the hash is {book: {name: "weird stories"}, pages: [{number: 1, contents: "peter ate a leg"}, {number: 2, contents: "mary wasn't happy with that at all"}]}, then the "schema" would be {book: {name: String}, pages: [{number: Integer. contents: String}]} ...
<rapha> s/from/for/
oxfuxxx has quit [Ping timeout: 256 seconds]
<adam12> rapha: Maybe pattern matching on Ruby 3 (technically 2.7)
<rapha> Oh some new Ruby for me to learn? Sign me up!
<ccooke> You can use pattern matching to extract things *using* a schema
<ccooke> but you can't use it to derive a schema from existing data, if I'm understanding what you want
<rapha> oh dang
<rapha> yes you do understand correctly, ccooke
<rapha> so i guess i'll ... write a recursive method and just go step by step
<rapha> hmm perhaps YAML or JSON have something pre-existing for this
<adam12> Ahh. I misunderstood.
<rapha> https://github.com/maxlinc/json-schema-generator does look like it might be the ticket
oxfuxxx has joined #ruby
<rapha> especially since that's _exactly_ what i'm doing right now
oxfuxxx has quit [Ping timeout: 250 seconds]
Jonopoly has quit [Quit: WeeChat 3.0]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
szkl has joined #ruby
Tasi has joined #ruby
oxfuxxx has joined #ruby
<nakilon> rapha if you wanna just check if it fits the schema you make by hand, then you can try https://github.com/Nakilon/nakischema/
<nakilon> or if you are into shaving huge cows ..D https://www.youtube.com/watch?v=gAx3wD_rv_U
m_antis_ has quit [Quit: ZNC - https://znc.in]
m_antis has joined #ruby
roadie` has joined #ruby
nullheroes has quit [Ping timeout: 272 seconds]
<rapha> nakilon: nah, i really needed to derive a schema from (a very large amount of) input data. the above linked json-schema-generator did an awesome job, just don't count on it being very fast :)
roadie has quit [Ping timeout: 268 seconds]
<rapha> also very nice video there :-D
<rapha> man if that "cow" decided it didn't like the guy ... that'd be insta blood and gore
nullheroes has joined #ruby
<rapha> and bookmarking your nakischema, that seems useful
<nakilon> those cows are very kind )
ur5us has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie` has quit [Ping timeout: 268 seconds]
roadie` has joined #ruby
infinityfye has quit [Quit: Leaving]
Tasi has quit [Quit: Leaving]
<rapha> don't tell me you own a couple of 'em :)
<rapha> wow, SFI is still at 115
ur5us has quit [Ping timeout: 240 seconds]
___nick___ has joined #ruby
gcd has joined #ruby
howdoi has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
roadie` has quit [Ping timeout: 245 seconds]
roadie` has joined #ruby
ur5us has joined #ruby
oxfuxxx has joined #ruby
hololeap has quit [Remote host closed the connection]
hololeap has joined #ruby
roadie` has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
oxfuxxx has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
Spitfire_ is now known as Spitfire
___nick___ has quit [Ping timeout: 252 seconds]
<leah2> is there a nicer way than case x in [:foo, *args] if !args.empty?; ...; end
<leah2> irb 3.1 broke Ctrl-u -.-
<leah2> and the completion is completely unreadable
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
szkl has joined #ruby
roadie has quit [Remote host closed the connection]
TomyWork has quit [Remote host closed the connection]
<mooff> case x in [] if cond; ...; end is allowed? :-O
<mooff> :: case "hello" if true; when "hello"; "hi"; end
<ruby-eval> ERROR: (eval):1: syntax error, unexpected `if' modifier, expecting `when'
<ruby-eval> case "hello" if true; when "hello"; "hi"; end
<ruby-eval> ^~
<ruby-eval> (eval):1: syntax error, unexpected `when', expecting end-of-input
<ruby-eval> case "hello" if true; when "hello"; "hi"; end
<ruby-eval> ^~~~
<leah2> yeah mixing in and when isnt allowed
<mooff> i haven't tried the pattern matching stuff yet
<mooff> does it work like 'case x in ([:foo, *args] if !args.empty?)' ?
<mooff> maybe the 'if !args.empty?' wants to be a guard statement before the case
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
<leah2> it's a guard yes
<leah2> that works, i just wondered if there's a nicer way to match a nonempty array
<leah2> [a,*b] => c
<leah2> not really :p
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
Guest7375 has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 240 seconds]
peer has quit [Quit: whoops]
peer has joined #ruby
roadie has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
roadie has quit [Ping timeout: 245 seconds]
peer has quit [Quit: whoops]
peer has joined #ruby
hd1 has joined #ruby
hd1 has left #ruby [#ruby]