havenwood changed the topic of #ruby to: Ruby 3.2.2, 3.1.4, 3.3.0-preview3: https://www.ruby-lang.org | Rules: https://ruby-community.com | Logs: https://libera.irclog.whitequark.org/ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
graywolf has quit [Quit: WeeChat 4.0.4]
smp has quit [Ping timeout: 264 seconds]
smp has joined #ruby
peterbecich has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Vonter has quit [Ping timeout: 276 seconds]
Vonter has joined #ruby
joto has quit [Quit: Ping timeout (120 seconds)]
joto has joined #ruby
mx has quit [Quit: ZNC 1.8.2 - https://znc.in]
mx has joined #ruby
slurpyb has quit [Remote host closed the connection]
bambanxx has joined #ruby
peterbecich has quit [Ping timeout: 276 seconds]
peterbecich has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
CrazyEddy has quit [Remote host closed the connection]
CrazyEddy has joined #ruby
constxqt_ has quit [Ping timeout: 255 seconds]
bambanxx has joined #ruby
edr has quit [Quit: Leaving]
caedmon has quit [Quit: caedmon]
caedmon has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
constxqt_ has joined #ruby
hightower4 has joined #ruby
peterbecich has quit [Ping timeout: 256 seconds]
hightower3 has quit [Ping timeout: 255 seconds]
olus has quit [Quit: No Ping reply in 120 seconds.]
olus has joined #ruby
fercell has quit [Read error: Connection reset by peer]
rvalue has quit [Quit: ZNC - https://znc.in]
constxqt_ has quit [Ping timeout: 255 seconds]
rvalue has joined #ruby
fercell has joined #ruby
caedmon has quit [Ping timeout: 264 seconds]
caedmon has joined #ruby
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 276 seconds]
caedmon has quit [Ping timeout: 252 seconds]
caedmon has joined #ruby
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 252 seconds]
caedmon has quit [Ping timeout: 252 seconds]
caedmon has joined #ruby
constxqt_ has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
caedmon has quit [Ping timeout: 255 seconds]
CrazyEddy has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
constxqt_ has quit [Ping timeout: 268 seconds]
constxqt_ has joined #ruby
peterbecich has joined #ruby
constxqt_ has quit [Ping timeout: 264 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 268 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 268 seconds]
constellati0n has quit [Ping timeout: 256 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 264 seconds]
white_magic has joined #ruby
_ht has joined #ruby
peterbecich has quit [Ping timeout: 256 seconds]
white_magic has quit [Quit: Client closed]
mange has quit [Ping timeout: 268 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 256 seconds]
grenierm has joined #ruby
teclator has joined #ruby
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 264 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 260 seconds]
Starfoxxes has quit [Ping timeout: 245 seconds]
constxqt_ has joined #ruby
Starfoxxes has joined #ruby
constxqt_ has quit [Ping timeout: 264 seconds]
schne1der has joined #ruby
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 255 seconds]
TomyWork has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
desnudopenguino1 is now known as desnudopenguino
grenierm has quit [Quit: Client closed]
grenierm has joined #ruby
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 255 seconds]
constellati0n has joined #ruby
<ox1eef_> You can also use \ for multiline strings:
<ox1eef_> "hello " \
<ox1eef_> "world " \
<ox1eef_> "and everything in between"
constellati0n has quit [Ping timeout: 259 seconds]
Paris has joined #ruby
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 264 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 256 seconds]
Aminda has quit [Quit: Default quit message is difficult to set. If you don't see me returning, ask me? You will find me, if you want to]
Aminda has joined #ruby
Tempesta has quit [Ping timeout: 244 seconds]
constxqt_ has joined #ruby
Tempesta has joined #ruby
constxqt_ has quit [Ping timeout: 252 seconds]
Linux_Kerio has joined #ruby
grenierm has quit [Quit: Client closed]
bambanxx has joined #ruby
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 264 seconds]
infinityfye has joined #ruby
infinity_fye has joined #ruby
infinityfye has quit [Remote host closed the connection]
infinity_fye has quit [Remote host closed the connection]
infinityfye has joined #ruby
Vonter has quit [Ping timeout: 276 seconds]
Vonter has joined #ruby
mkoncek has joined #ruby
<mkoncek> what is the C API function for getting the length of an array? or to just iterate over it?
<mkoncek> nwm, i found it
hightower4 has quit [Remote host closed the connection]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 276 seconds]
vigumnov has joined #ruby
victori has quit [Ping timeout: 276 seconds]
constxqt_ has joined #ruby
TrillionEuroNote has quit [Ping timeout: 246 seconds]
constxqt_ has quit [Ping timeout: 240 seconds]
yziquel has joined #ruby
TrillionEuroNote has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
ua_ has quit [Ping timeout: 252 seconds]
ua_ has joined #ruby
bambanxx has joined #ruby
constxqt_ has joined #ruby
u0_a115 has joined #ruby
u0_a115 is now known as misper
constxqt_ has quit [Ping timeout: 246 seconds]
mkoncek has quit [Quit: mkoncek]
misper has quit [Ping timeout: 252 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 264 seconds]
constxqt_ has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
constellati0n has joined #ruby
bambanxx has joined #ruby
constellati0n has quit [Ping timeout: 268 seconds]
Paris has quit [Quit: quit]
constxqt_ has quit [Ping timeout: 255 seconds]
constxqt_ has joined #ruby
rvalue has quit [Remote host closed the connection]
rvalue has joined #ruby
constxqt_ has quit [Ping timeout: 255 seconds]
constxqt_ has joined #ruby
constxqt_ has quit [Ping timeout: 268 seconds]
constxqt_ has joined #ruby
<leah2> i'm confused
<leah2> >> "foobaroo"[/oo|oob/]
<ruby[bot]> leah2: # => "oo" (https://carc.in/#/r/g5pw)
<leah2> => "oo"
<leah2> >> "foobaroo"[/oob|oo/]
<ruby[bot]> leah2: # => "oob" (https://carc.in/#/r/g5px)
<leah2> => "oob"
<leah2> shouldnt it match longest always?
constellati0n has joined #ruby
szkl has joined #ruby
constellati0n has quit [Ping timeout: 276 seconds]
<wnd> I don't know Ruby's pecularities, but in general /repetition/ is greedy
_whitelogger has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
constxqt_ has quit [Ping timeout: 264 seconds]
bambanxx has joined #ruby
edr has joined #ruby
constxqt_ has joined #ruby
constellati0n has joined #ruby
_whitelogger has joined #ruby
<xkoncek> https://docs.ruby-lang.org/en/master/Module.html#method-i-private_constant does the C function `rb_mod_private_constant` actually exist?
<leah2> wnd: true
<leah2> egrep prefers longest match tho
<leah2> pcre doesnt
otisolsen70 has joined #ruby
otisolsen70 has quit [Remote host closed the connection]
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Paris has joined #ruby
Paris has quit [Remote host closed the connection]
Paris has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
desnudopenguino has joined #ruby
schne1der has quit [Ping timeout: 255 seconds]
yziquel has quit [Quit: Client closed]
bambanxx has joined #ruby
bambanxx has quit [Client Quit]
bambanxx has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
Paris has quit [Remote host closed the connection]
desnudopenguino has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino1 has quit [Read error: Connection reset by peer]
desnudopenguino has quit [Ping timeout: 256 seconds]
desnudopenguino has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
desnudopenguino has joined #ruby
constellati0n has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
desnudopenguino has joined #ruby
graywolf has joined #ruby
brokkoli_origin has quit [Ping timeout: 256 seconds]
Vonter has quit [Ping timeout: 256 seconds]
Vonter has joined #ruby
brokkoli_origin has joined #ruby
desnudopenguino1 has joined #ruby
<xkoncek> how do i write a module's content so that it is reachable both using scope resolution syntax (::) as well as being include-able in the main files?
constellati0n has quit [Ping timeout: 245 seconds]
<xkoncek> writing def method vs def self.method enables one but disables the other option of accessing them
desnudopenguino has quit [Ping timeout: 268 seconds]
desnudopenguino1 is now known as desnudopenguino
___nick___ has joined #ruby
TomyWork has quit [Remote host closed the connection]
flowersandsharks has joined #ruby
flowersandsharks has quit [Client Quit]
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
desnudopenguino1 is now known as desnudopenguino
xkoncek has quit [Ping timeout: 245 seconds]
constellati0n has joined #ruby
constellati0n has quit [Ping timeout: 260 seconds]
wand has joined #ruby
constellati0n has joined #ruby
constellati0n has quit [Ping timeout: 252 seconds]
___nick___ has quit [Ping timeout: 276 seconds]
peterbecich has joined #ruby
infinityfye has quit [Quit: Leaving]
<rapha> like this? that's the only way i know, xkoncek: https://gist.github.com/sixtyfive/e8baf1c1cf93e91e091eb876f0e621dd
<rapha> oh, they left...
peterbecich has quit [Ping timeout: 256 seconds]
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
tomtmym has quit [Quit: Gone.]
bambanxx has joined #ruby
Rounin has quit [Remote host closed the connection]
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
_ht has quit [Remote host closed the connection]
Guest94 has joined #ruby
Guest94 has quit [Client Quit]
polishdub has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
constellati0n has joined #ruby
peterbecich has joined #ruby
xkoncek has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Rounin has quit [Remote host closed the connection]
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
peterbecich has quit [Ping timeout: 260 seconds]
ua_ has quit [Ping timeout: 246 seconds]
ua_ has joined #ruby
<rapha> that's surprisingly funny :)
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<ox1eef_> xkoncek: I don't see rb_mod_private_constant in ruby.h - but, 'private_constant :Foo' is a method. You can call it as a method from C.
<xkoncek> ahh
szkl has quit [Quit: Connection closed for inactivity]
<ox1eef_> With C extensions in the past I try to implement an interface I can expose to Ruby, and then write Ruby methods that use that C interface. It is not always required to call private_constant from C with that appproach, often easier to do it from Ruby.
<xkoncek> i am new to Ruby, i chose it mainly because of its neat syntax, however i still haven't managed to find an answer to my question regarding importing symbols
Linux_Kerio has quit [Ping timeout: 255 seconds]
<xkoncek> it seems in Ruby there is simply no way to import individual symbols into current scope
<ox1eef_> It sounds like you want one of two features. 'extend self', or 'module_function'.
<ox1eef_> module Foo; extend self; def bar; 42; end; end; Foo.bar
<ox1eef_> You could also swap 'extend self' for 'module_function' in that example, and it'd be almost the same. The primary difference is that when Foo is included, 'bar' will be private by default.
<xkoncek> hmm... right, seems to work
<dorian> random question: why can't you `include` a class (TypeError, not a module), even if Class.is_a? Module
<ox1eef_> On a conceptual level, you could think of it as a behavior that a class overrides.
<dorian> hm
<xkoncek> ox1eef_: i want to create a DSL of sorts, seems like the most popular approach is widely using blocks, however i noticed that when i use blocks on a struct which defines its methods, those methods will inevitably shadow whatever global object the block may have wanted to reference
<xkoncek> instance_exec
<ox1eef_> Do you mean that the methods of the struct you define with 'def' do not have access to the block's scope?
<ox1eef_> You can use define_method to work around that if that's the case... Struct.new(:foobar) { a = 42; define_method(:bar) { a } }
<xkoncek> as a library writer i am to make sure there are no unavoidable name collisions
<ox1eef_> The second definition of foo, within bar, redefines the 'global' foo. It appears you might want to use a lambda, or Proc, in place of that second definition.
<xkoncek> in the end i chose to use @foo = lambda ...
<ox1eef_> That seems reasonable based on the example, but I might be missing a bigger context.
<xkoncek> i am writing something similar to Rake, but majority of the code is native
<xkoncek> i just want the scripts to look nice
<xkoncek> i switched from Lua because even tho it is easily embeddable, the Lua code does not look nice
<ox1eef_> I don't think it is common to define a method inside a method, and there's patterns that can be used to deal with name collision and the nature of being able to monkey patch. Are you using mruby?
<xkoncek> i no longer define methods inside the method, instead i instantiate a private struct and instance_exec the block on it
<xkoncek> Ruby - binary /usr/bin/ruby-mri - Installed
<ox1eef_> https://github.com/mruby/mruby - this sounds more in line with what you might want, especially since you're using C and mentioned being able to embed.
<xkoncek> hmmm... Fedora doesn't package it :(
<ox1eef_> It can work standalone from the git repository. I think that's more common with mruby than MRI.
<xkoncek> will take a look at it
<xkoncek> does mruby use the same C headers?
peterbecich has joined #ruby
Rounin has quit [Remote host closed the connection]
peterbecich has quit [Ping timeout: 264 seconds]