havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: 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!
roadie has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
quazimodo has joined #ruby
chris____ has joined #ruby
Garb0_ has joined #ruby
Garb0 has quit [Ping timeout: 246 seconds]
roshanavand has quit [Ping timeout: 256 seconds]
gell5 has joined #ruby
gell5 has quit [Ping timeout: 256 seconds]
gdonald has quit [Remote host closed the connection]
braj has joined #ruby
entel has joined #ruby
TCZ has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
r29v has joined #ruby
chris____ has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 272 seconds]
ChmEarl has quit [Quit: Leaving]
TCZ has quit [Quit: Leaving]
chri_____ has joined #ruby
chri_____ has quit [Ping timeout: 264 seconds]
Besnik_b has quit [Remote host closed the connection]
Besnik_b has joined #ruby
roadie has joined #ruby
akem has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicholaslyang has joined #ruby
Fusl has quit [Max SendQ exceeded]
<dualfade> super newbie question. How do you assign a hex address to int ?
Fusl has joined #ruby
<dualfade> nm
<dualfade> found it
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
roadie has quit [Ping timeout: 260 seconds]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
gell5 has joined #ruby
Besnik_b has quit [Remote host closed the connection]
Chris__ has joined #ruby
gell5 has quit [Ping timeout: 264 seconds]
Besnik_b has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
greypack has quit [Ping timeout: 256 seconds]
entel has quit [Quit: Connection closed for inactivity]
roadie has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
gavlee has quit [Ping timeout: 260 seconds]
greypack has joined #ruby
greypack has quit [Ping timeout: 246 seconds]
roadie has quit [Ping timeout: 272 seconds]
greypack has joined #ruby
Chris__ has quit [Remote host closed the connection]
gix- has joined #ruby
gix has quit [Disconnected by services]
nicholaslyang has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r3m has quit [Quit: was testing my buflist against utf-8 characters in channel name]
r3m has joined #ruby
nicholaslyang has joined #ruby
roadie has joined #ruby
Chris__ has joined #ruby
roadie has quit [Ping timeout: 272 seconds]
Chris__ has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
gell5 has joined #ruby
ho0po3 has joined #ruby
gell5 has quit [Ping timeout: 260 seconds]
Chris__ has joined #ruby
ho0po3 has quit [Client Quit]
ho0po3 has joined #ruby
edwardly has quit [Ping timeout: 260 seconds]
Omnilord has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
gavlee has joined #ruby
roadie has joined #ruby
ho0po3 has quit [Quit: Leaving]
roadie has quit [Ping timeout: 272 seconds]
stnly has quit [Quit: goodbye]
stnly has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
r29v has quit [Quit: r29v]
sauvin has joined #ruby
SuperL4g has joined #ruby
roadie has joined #ruby
sauvin has quit [Max SendQ exceeded]
sauvin has joined #ruby
SuperLag has quit [Ping timeout: 260 seconds]
Garb0_ has quit [Ping timeout: 264 seconds]
xco has joined #ruby
renich has joined #ruby
timwis has quit [Read error: Connection reset by peer]
d0liver has quit [Read error: Connection reset by peer]
ryzokuken has quit [Read error: Connection reset by peer]
d0liver has joined #ruby
leah2 has quit [Ping timeout: 246 seconds]
timwis has joined #ruby
ryzokuken has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
leah2 has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 256 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
cxl has quit [Quit: bye]
_whitelogger has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Omnilord has quit [Quit: Leaving]
xco has joined #ruby
roadie has quit [Ping timeout: 272 seconds]
entel has joined #ruby
cxl has joined #ruby
nicholaslyang has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
chris__ has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
gell5 has joined #ruby
jenrzzz has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
gell5 has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
vondruch has joined #ruby
conta has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich has quit [Quit: renich]
renich has joined #ruby
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
r3m has quit [Quit: WeeChat 2.9-dev]
imode has quit [Ping timeout: 256 seconds]
MrCrackPot has joined #ruby
r3m has joined #ruby
roadie has joined #ruby
renich has quit [Quit: renich]
cd has quit [Quit: cd]
r3m has quit [Quit: WeeChat 2.9-dev]
ur5us has quit [Ping timeout: 256 seconds]
r3m has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
infinityfye has joined #ruby
roadie has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
roadie has quit [Ping timeout: 272 seconds]
Vashy has quit [Ping timeout: 252 seconds]
Vashy has joined #ruby
mikecmpbll has joined #ruby
donofrio has quit [Remote host closed the connection]
ur5us has joined #ruby
schne1der has joined #ruby
impermanence has quit [Ping timeout: 256 seconds]
infinityfye has quit [Ping timeout: 258 seconds]
infinityfye has joined #ruby
quazimodo has quit [Ping timeout: 246 seconds]
jetchisel has quit [Ping timeout: 264 seconds]
entel has quit [Quit: Connection closed for inactivity]
jetchisel has joined #ruby
jetchisel has quit [Client Quit]
gell5 has joined #ruby
leftylink has quit [Ping timeout: 256 seconds]
tris has quit [Ping timeout: 256 seconds]
leftylink has joined #ruby
tris has joined #ruby
gell5 has quit [Ping timeout: 258 seconds]
<IsoLinCHiP> Any suggestions for a job queueing library that supports status and retaining results? Preferably with a SQL DB Backend. I would like to async issue jobs to queues, which other workers can pickup and register their completion/failure back with the system and return some abritrary result data. Delayed_job came close, but doesnt seem to support keeping a record of completed jobs with results.
roadie has joined #ruby
Besnik_b has quit [Quit: Leaving]
lmat has joined #ruby
<lmat> rubocop made the following change to my code: https://imgur.com/cAcFkrJ.png This is a drastic change, right?
<lmat> As in, my code will act differently now?
chris__ has joined #ruby
<IsoLinCHiP> lmat: The delimiters used in %w should not make a difference
<jennis> lmat, no. They both produce an array of strings
<leftylink> &>> %w(a b c) == %w[a b c]
<rubydoc> # => true (https://carc.in/#/r/9908)
<jennis> &>> %w(string1, string2, stirng3).class
<rubydoc> # => Array (https://carc.in/#/r/9909)
<jennis> whoops
<jennis> &>> %w(string1 string2 string3).class
<rubydoc> # => Array (https://carc.in/#/r/990a)
<jennis> &>> %w[string1 string2 string3].class
<rubydoc> # => Array (https://carc.in/#/r/990b)
<lmat> Okay, thanks!
dionysus69 has joined #ruby
chris__ has quit [Ping timeout: 256 seconds]
iNs_ has joined #ruby
iNs has quit [Ping timeout: 240 seconds]
<havenwood> IsoLinCHiP: I think folk typically use logging for that, but you could write a little plugin.
ur5us has quit [Ping timeout: 256 seconds]
<havenwood> IsoLinCHiP: If you want to store a record in your DB, you could write a plugin along the lines of this one: https://github.com/salsify/delayed_job_heartbeat_plugin
<havenwood> (But instead of timing out, store the record of the transaction.)
ncakerlist has joined #ruby
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
xco has joined #ruby
<xco> in Ruby when a thread with keys is dead, you can still access the keys, why's that? :/
<havenwood> xco: a key with cobwebs
<havenwood> xco: You can still set thread variable keys as well.
<CommunistWolf> it's data, and it's still around. I can see it being useful for accessing calculations or debugging info prior to disposing of the thread
<xco> yeah, but for a dead thread this shouldn't be the case no?
<havenwood> xco: Folk often also confuse fiber variables with thread variables.
<CommunistWolf> why not?
<havenwood> xco: The #[] and #[]= are Fiber-local variables.
<xco> CommunistWolf cause it's uh... dead!
<CommunistWolf> but it's still allocated
<CommunistWolf> the runstate is orthogonal to the data
<havenwood> it's... living dead
<xco> CommunistWolf interesting
<xco> havenwood ha!
sagax has joined #ruby
<CommunistWolf> to put it another way: why would you want to forbid something that would be possible if only you hadn't put the restriction in?
<xco> this is confusing the sh*t out of me
<CommunistWolf> should access be forbidden while the thread is paused or sleeping too? it's such a weird thing to link the data to
TomyWork has joined #ruby
<xco> CommunistWolf havenwood look what i discovered today https://twitter.com/siaw23/status/1270975717174583298?s=20
<xco> CommunistWolf havenwood i'm not sure if it's entirely correct though, what do you think
<CommunistWolf> yeah, a whole bunch of them are thread-local (fiber-local?)
<xco> also are they any other global vars that behave like that?
<CommunistWolf> big long list
CrazyEddy has quit [Ping timeout: 246 seconds]
<xco> CommunistWolf you can add fiber-local cause i understand it as a thread with spin on it
<CommunistWolf> https://docs.ruby-lang.org/en/2.6.0/globals_rdoc.html mentions something for each of the affected variables
<CommunistWolf> like "th read-local" or "current scope"
<CommunistWolf> $? ? really? *sigh*
<havenwood> xco: Like CommunistWolf hints, those magic RegExp globals are actually Fiber-local, not Thread-local.
<xco> CommunistWolf you never get to see these globals around everyday, i've seen ONLY one person use such globals in ruby
<havenwood> xco: It just happens a new Thread gets a new Fibber.
<CommunistWolf> xco: I use $? quite a lot
<xco> havenwood aren't Fibers a spin on threads?
<CommunistWolf> 12 years of professional ruby, and I didn't know it was actually thread-local
<CommunistWolf> life=suffer
<xco> havenwood hm!
CrazyEddy has joined #ruby
<havenwood> xco: A Thread is backed by a real system thread. A Fiber isn't. A thread is self scheduling. A Fiber isn't.
<IsoLinCHiP> havenwood: Thanks, I did considder logging, but since I would like to orchestrate dependancies between jobs, parsing the logs to get the results for the next stage would be inconvenient. Ill look into the plugin you mentioned, I still havent given up hooking into DJ somehow to add status and result support, but its trickey to dig through all that code
<havenwood> xco: Fibers are much lighter weight than Threads. I can spin up a few thousand Threads on this laptop but a millions of Fibers until I run out of RAM.
<xco> havenwood this i didn't know
<havenwood> xco: A Fiber by default has a 4k stack. You can actually fairly easily set the size to something else though.
<xco> in all honestly i've never got to write any code that requires a Thread/Fiber :D i'm just learning about these out of boredom, do you have an gem on your repo where you use Threads? i'll like to check it out
<xco> havenwood ^
<havenwood> xco: Enumerators are backed by a Fiber under the hood, so `1.upto(3)` spins up a Fiber.
<xco> yeah that i know
<havenwood> They're super quick to spin up, thanks in large part to ioquatix's work.
<xco> i can even implement my own enumerator with fibers
<havenwood> :)
<IsoLinCHiP> havenwood: Thanks for the hint, I just came across a blob post about writing plugins for DJ. In case you are interested: https://www.salsify.com/blog/engineering/delayed-jobs-callbacks-and-hooks-in-rails
<havenwood> xco: Looks like I do in this example with your name on it from a while back, haha: https://gist.github.com/havenwood/060d4b3cdf671080262a096933d6d640
<havenwood> IsoLinCHiP: Ah, nice.
<xco> havenwood 8months ago hahahah wow
<havenwood> xco: For more practical uses of Fibers, see many of the Socketry repos: https://github.com/socketry
<havenwood> xco: Async is the core lib.
<xco> havenwood yeah looking into these for a real practical usage
<lmat> When I run bundle exec rails test; in a docker container, I get the following output: https://paste.rs/QJ5
<lmat> I think it's looking for /config/boot.rb rather than ./config/boot.rb. It works outside the container, so I'm not sure why that would be wrong.
<lmat> When I run rails test; in the container, the error is:
<lmat> oh... that seems to work now. Maybe I'll try that way.
<havenwood> xco: Or the Concurrent Ruby gem is interesting to explore: https://github.com/havenwood/elixir.rb/blob/master/lib/elixir/task.rb
<havenwood> xco: Keep in mind that Matz regrets adding Threads to Ruby too.
<xco> havenwood too late
<xco> havenwood i find this very interesting https://gist.github.com/havenwood/113c61b9540728d4932f
<havenwood> xco: Back to the Future.
jingjinghack has joined #ruby
<xco> havenwood oh this is practical hahhaaaa
<xco> it's nicer if you have a practical context to work around like the snippets you've shared havenwood
<xco> havenwood this one is funny https://gist.github.com/havenwood/113c61b9540728d4932f#file-fiber_fizzbuzz-rb i get it but WHY would you do that?
<ncakerlist> matsumoto yukihiro said C++ supports both default parameter values for functions and overloading of function names based on parameters.
<xco> was it like a POC?
<ncakerlist> what is function overloading with some ruby examples
<havenwood> xco: I'm just trying to show how it works in a fun way.
<ncakerlist> operator overloading is the only thing i know
<xco> havenwood got it! yeah those snippets are good
<xco> starred
<havenwood> xco: Interestingly, with Isolates/Guilds, you might "undef" Threads when enabling the Isolate.
<havenwood> xco: So it oddly might be more valuable to focus study on Fibers.
<havenwood> Isolate.new(bare: true) do |isolate| # Goodbye Threads
<xco> havenwood wait, is this something coming to Ruby 3? i can't keep up
<xco> haha
<havenwood> xco: Yeah, Isolates (Guilds) are Ruby 3.
<havenwood> xco: Isolates will handle parallel computation and then an Async Fiber Selector for I/O.
<xco> ok got it...
<xco> so Threads will vanish completely? havenwood
<havenwood> xco: Yup, no place for Threads other than backward compatibility. Matz deeply dislikes them, so I recon they'll be gone by Ruby 4.
<xco> or they plan to keep it for backward compat?
<xco> ah
<xco> you read my mind
<havenwood> xco: Maybe Ruby 5, so more than a decade.
<havenwood> Perhaps
<xco> now my i'm thinking what will happen if you dont' do undef Thread
<xco> :D
<xco> when using Isolates
<havenwood> that's just pseudo-code for what "bare" triggers
<xco> oh
<havenwood> iir
<havenwood> xco: So you can just have as many Isolates as you have cores, and Fiber-backed I/O is super if you can suspend the Fiber while you wait like Falcon does with an Async adapter for I/O like DB, disk, network call, etc.
<havenwood> xco: Falcon can have tons of Fibers, each for a connection and they just suspend while they wait for I/O.
<havenwood> xco: Great for web servers in general and also for things like WebSockets.
<havenwood> xco: Going from thousands to millions is awesome.
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> xco: And using all cores without multiple processes is... well, standard these days. :P
<havenwood> But Isolates are fairly novel.
<havenwood> At least the particular flavor.
<havenwood> xco: This ^ is a practical, foundational use of Fibers.
<havenwood> xco: That's ^ something more typical for practical use of Threads.
<havenwood> xco: I'd suggest trying out the Async gem. It's a good block to build with too.
roadie has quit [Ping timeout: 256 seconds]
<ncakerlist> havenwood: hi
<havenwood> ncakerlist: hey!
<ncakerlist> i have to ask some questions about ruby lang....
<ncakerlist> (2..9) how can i print it with minimum effort
<ncakerlist> range not the literal !
<havenwood> ncakerlist: What do you want the output to be?
<ncakerlist> range of course
<havenwood> Like 2 through 9 with newlines between them?
<ncakerlist> yes
Garb0 has joined #ruby
<havenwood> ncakerlist: There are many ways! One is: puts (2..9).to_a
<ncakerlist> to_a is array
<havenwood> ncakerlist: Yup.
<havenwood> ncakerlist: Or: (2..9).each { |n| puts n }
<havenwood> ncakerlist: puts [*2..9]
gell5 has joined #ruby
Garb0_ has joined #ruby
<ncakerlist> that's exploding range
<xco> That's ^ something more typical for practical use of Threads. << haha, been looking to contribute to Puma you keep reading my thoughts havenwood
<al2o3-cr> ncakerlist: splatting
<havenwood> *
Garb0 has quit [Ping timeout: 246 seconds]
<ncakerlist> hmm and using while can i print that
<ncakerlist> and also using for , just wrapping my head around the loops as .each {} is most natural for me
gell5 has quit [Ping timeout: 260 seconds]
<leftylink> one could use while, but it seems wasteful to write that code when it is possible to do it with a single line
Garb0__ has joined #ruby
<leftylink> I am lazy person and want to save myself the effort
<leftylink> I can't help it!
<ncakerlist> leftylink: i too like that style
conta has quit [Quit: conta]
Garb0_ has quit [Ping timeout: 246 seconds]
Garb0_ has joined #ruby
<ncakerlist> for i in 0..5 puts end
Garb0_ has quit [Remote host closed the connection]
roadie has joined #ruby
<al2o3-cr> a = [*2..9]; while n = a.shift; puts n end
<al2o3-cr> that's the while version
Garb0__ has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Quit: WeeChat 2.8]
<ncakerlist> with [*2..9] what's the syntax to use .step(3)
<leftylink> since step is a method on Range, act accordingly
<leftylink> to the knowledge that step is a method on Ragen
<leftylink> s/Ragen/Range
<xco> if you don' have a compelling reason to use "for x in .." you might want to forget it exists ncakerlist
<ncakerlist> i frequently get trapped in the irb irb(main):041:2> for i in (2..10) do
<ncakerlist> irb(main):042:3* puts i
<ncakerlist> irb(main):043:3> end
mikecmpbll has joined #ruby
al2o3-cr has joined #ruby
<ncakerlist> for i in (2..19) do puts i end ; then i see i is 19 and they said do end puts local variables but in this case they are global
<ncakerlist> the same with for i in obj { ... }
<ncakerlist> irb(main):062:0> for i in (2..19) { puts i }
<ncakerlist> irb(main):063:1>y
<ncakerlist> the code is not executing
<xco> ncakerlist try replacing {} with do...end
<ncakerlist> i know that
<xco> ncakerlist it's excuting for me
<al2o3-cr> ncakerlist: the reason for that is that for is a keyword and don't create a new scope. blocks on the other hand create a new local scope.
<ncakerlist> ya i was looking for a way for/while loops to make local scopes
<al2o3-cr> unfortunetly you can't :(
<xco> right
<ncakerlist> "The for loop is rarely used in modern ruby programs." i assume the same is true for while loops.
<ncakerlist> so finally i got rid of for loop
<leftylink> the clear reason why `for` is rarely used is that #each does the same. sometimes, you cannot replace `while` with an equivalent. sometimes you can.
<leftylink> if one would like to create a scope for reasons such as "I don't want a temporary to escape", I am reminded of a conversation I once had in this channel
<leftylink> 2019-10-25 22:45:07 < leftylink> I guess if I wanted temporaries not to escape I could use a function or something
<leftylink> those interested in such a concept could perhaps look at that conversation for inspiration.
Garb0 has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
Garb0 has quit [Ping timeout: 240 seconds]
CrazyEddy has joined #ruby
Tempesta has quit [Quit: See ya!]
Tempesta has joined #ruby
drincruz has joined #ruby
jingjinghack has quit [Quit: WeeChat 2.1]
bsdbandit-01 has quit [Ping timeout: 246 seconds]
bsdband79 has joined #ruby
drincruz has quit [Ping timeout: 264 seconds]
AndreYuhai has joined #ruby
<AndreYuhai> Hey there, can I pass parameters to a proc like: Foo.new.tap(&:set_name('some name')) ?
postmodern has quit [Quit: Leaving]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has quit [Remote host closed the connection]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
drincruz has joined #ruby
bsdband79 has quit [Ping timeout: 272 seconds]
teyas has joined #ruby
Benett has quit [Remote host closed the connection]
<al2o3-cr> ncakerlist: most people use Kernel#loop instead of a while loop.
gdonald has joined #ruby
bsdbandit-01 has joined #ruby
<teyas> hello family, I am looking for a gem that would help generate UML/Class Diagrams from my ruby source code. I am running Ruby 2.6 on Windows 10. PLEASE HELP.. Tried following ways. 1. Umlify gem - generates 1KB sized PNG which doesn't open. 2. ruby2uml gem - I am not able to understand how to use it (no clear info under "Usage" on rubydoc<dot>info/gems/ruby2uml/0.1.3) 3. ruby-uml gem - it was written and tested with Ruby1.8, so didn't work
<teyas> 4.os6sense/
<teyas> xumlidot (this is NOT a gem or rubygems<dot>org, its a github repo) - I am again not able to understand whether its a gem, needs installation or not. or whether it will work on Linux with a chmod +x
<ncakerlist> &ri Kernel#loop
<ncakerlist> &ri Kernel#p
<ncakerlist> i have a doubt
jetpack_joe has quit [Ping timeout: 240 seconds]
siasmj has quit [Read error: Connection reset by peer]
siasmj has joined #ruby
alnk has quit [Read error: Connection reset by peer]
<ncakerlist> a='word <i give a new line> one' ; b='word\none' ; p a b ; a and b are different
alnk has joined #ruby
jetpack_joe has joined #ruby
<ncakerlist> "word\none" "word\\none"
<ncakerlist> so can I just type some magic thing that can make it "word\none" without manually giving new lines
<ncakerlist> al2o3-cr: was up
<ncakerlist> why is there \\n instead of \n
<ncakerlist> i always thought me pressing enter key is the same as \n
<jhass> ncakerlist: https://carc.in/#/r/991n more clear?
<al2o3-cr> ncakerlist: in the latter you're escaping the `\n` making a literal \n
<al2o3-cr> bk in 10 marinating tandoori chicken :P
yCrazyEdd has joined #ruby
<xco> ok
CrazyEddy has quit [Ping timeout: 246 seconds]
yCrazyEdd is now known as CrazyEddy
gell5 has joined #ruby
teyas_ has joined #ruby
<teyas_> any suggestions?? :(
teyas has quit [Ping timeout: 260 seconds]
gell5 has quit [Ping timeout: 246 seconds]
teyas has joined #ruby
teyas_ has quit [Remote host closed the connection]
teyas has quit [Client Quit]
teyas has joined #ruby
<teyas> posting the question again
<teyas> hello family, I am looking for a gem that would help generate UML/Class Diagrams from my ruby source code. I am running Ruby 2.6 on Windows 10. PLEASE HELP.. Tried following ways. 1. Umlify gem - generates 1KB sized PNG which doesn't open. 2. ruby2uml gem - I am not able to understand how to use it (no clear info under "Usage" on rubydoc<dot>info/gems/ruby2uml/0.1.3) 3. ruby-uml gem - it was written and tested with Ruby1.8, so didn't work
<teyas> 4.os6sense/<teyas> xumlidot (this is NOT a gem or rubygems<dot>org, its a github repo) - I am again not able to understand whether its a gem, needs installation or not. or whether it will work on Linux with a chmod +x
<teyas> os6sense/xumlidot
drincruz has quit [Quit: WeeChat 2.8]
AndreYuhai has quit [Quit: Leaving]
Ishido has joined #ruby
<phaul> it looks like it's a gem it just wasn't uploaded to rubygems
akem has quit [Ping timeout: 258 seconds]
Ishido has quit [Client Quit]
<phaul> clone it locally enter it and then gem build to get a gem file. that you can install with gem install
donofrio has joined #ruby
CrazyEddy has quit [Ping timeout: 246 seconds]
chris____ has joined #ruby
troulouliou_div2 has quit [Ping timeout: 256 seconds]
CrazyEddy has joined #ruby
<phaul> teyas: I just installed it myself and it blows up on it's own source code. so there is that
chris____ has quit [Ping timeout: 256 seconds]
<xco> phaul really appreciate how you go extra miles to help out!!
troulouliou_dev has joined #ruby
troulouliou_div2 has joined #ruby
ldepandis has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
gitter1234 has joined #ruby
troulouliou_div2 has quit [Excess Flood]
troulouliou_div2 has joined #ruby
conta has joined #ruby
akem has joined #ruby
Benett has joined #ruby
troulouliou_div2 has quit [Ping timeout: 246 seconds]
entel has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gell5 has joined #ruby
<teyas> which one ?
<teyas> phaul: xumlidot ?
codefriar has joined #ruby
troulouliou_div2 has joined #ruby
mikecmpbll has quit [Ping timeout: 265 seconds]
<phaul> teyas: yes , that's the one I tried
mikecmpbll has joined #ruby
roadie has quit [Remote host closed the connection]
teyas has quit [Read error: Connection reset by peer]
roadie has joined #ruby
akem has quit [Remote host closed the connection]
akem has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
teyas has joined #ruby
ChmEarl has joined #ruby
<teyas> phaul: woww... so there is no solution
<teyas> phaul: xumlidot gave nice example outputs in that directory
evert has quit [Quit: ZNC - https://znc.in]
evert_ has joined #ruby
evert_ is now known as evert
spiette has quit [Quit: ZNC 1.8.0 - https://znc.in]
leah2 has quit [Ping timeout: 272 seconds]
gell5 has quit [Ping timeout: 256 seconds]
spiette has joined #ruby
nicholaslyang has joined #ruby
troulouliou_div2 has quit [Ping timeout: 260 seconds]
nicholaslyang has quit [Client Quit]
troulouliou_dev has joined #ruby
ncakerlist has quit [Ping timeout: 265 seconds]
leah2 has joined #ruby
troulouliou_div2 has joined #ruby
troulouliou_div2 has joined #ruby
troulouliou_div2 has quit [Changing host]
troulouliou_dev has quit [Max SendQ exceeded]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
troulouliou_dev has joined #ruby
codefriar has quit [Quit: Textual IRC Client: www.textualapp.com]
lxsameer has left #ruby ["WeeChat 2.8"]
roadie has quit [Ping timeout: 256 seconds]
teyas has quit [Read error: Connection reset by peer]
conta has quit [Ping timeout: 240 seconds]
teyas has joined #ruby
xco has joined #ruby
orbyt_ has joined #ruby
Jenny9234 has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Jenny9234> I've been programming in Ruby for years, but still not found any good resource on how to properly structure a project (lib directory, tests, what goes where, etc)
<Jenny9234> Does anyone have any blog, video or other suggestions on the topic?
<apotheon> Jenny9234: The book Eloquent Ruby has some gem structure stuff in it, too.
<Jenny9234> Thanks apotheon
nychtel has quit [Ping timeout: 260 seconds]
<apotheon> Jenny9234: I'm guessing you know about the standard relationship of names to file hierarchies, too, but in case you don't check out this as well . . .
<phaul> teyas: you can try installing it yourself, it might work for you. follow the steps I described
<Jenny9234> I didn't actually. That's really useful to know!
<phaul> teyas: if it doesn't work just do gem uninstall not much to lose
<apotheon> Jenny9234: I'm glad I could help.
leitz has joined #ruby
<Jenny9234> Thank you, I appreciate it
teyas has quit [Read error: Connection reset by peer]
nychtel has joined #ruby
nychtel has quit [Ping timeout: 246 seconds]
nychtel has joined #ruby
chris__ has joined #ruby
braj has quit []
dionysus69 has quit [Ping timeout: 256 seconds]
teyas has joined #ruby
mikecmpbll has quit [Ping timeout: 246 seconds]
leah2 has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
rtyler has joined #ruby
<rtyler> greetings, I was hoping somebody might be able to help me understand some behavior with SSLSocket that I am seeing.
<rtyler> basically when I pipe 100 lines of data to openssl s_client, it ensures that all 100 lines are received by the server before disconnecting
<rtyler> when I use the following ruby script: https://gist.github.com/rtyler/32968c568369b9376ec602855273d191 it seems to not be flushing and waiting for the connection to properly terminate, such that the receiving server will receive some number of messages between 1-100 and then a "Connection reset by peer" error.
<jhass> rtyler: did you try close instead of sysclose?
<rtyler> I did just now, it exhibits the behavior unfortunately
<jhass> mmh
<jhass> I see nothing wrong unfortunately
<jhass> net/http wraps the whole afair into BufferedIO, but I can't really imagine that to make a difference
<jhass> otherwise it does pretty much exactly what you do
<rtyler> yeah, I'm quite perplexed, I have no idea what openssl s_client is doing differently, and I'm loathe to dive into that mess of C
r29v has joined #ruby
imode has joined #ruby
cyrus_mc_ has joined #ruby
gell5 has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
<rtyler> preplexion continues >_<
gell5 has quit [Ping timeout: 260 seconds]
<teyas> phaul: I dont see the steps, could u please paste them again ?
SeepingN has joined #ruby
rainmanjam has quit []
fercell has joined #ruby
chris__ has quit [Ping timeout: 256 seconds]
leitz has quit [Quit: Leaving]
leah2 has joined #ruby
<phaul> teyas: (1) git clone https://github.com/os6sense/xumlidot.git
<phaul> teyas: (2) cd xumlidot
<phaul> teyas: (3) gem build
<phaul> teyas: (4) gem install ./*.gem
cyrus_mc_ has quit [Quit: Connection closed]
nychtel_ has joined #ruby
r3m has quit [Quit: WeeChat 2.9-dev]
r3m has joined #ruby
teyas has quit [Read error: Connection reset by peer]
gitter1234 has quit [Quit: Connection closed for inactivity]
dionysus69 has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
Jenny9234 has quit [Remote host closed the connection]
fmccann has joined #ruby
dviola has quit [Quit: WeeChat 2.8]
SuperLag has joined #ruby
gitter1234 has joined #ruby
SuperL4g has quit [Ping timeout: 256 seconds]
cd has joined #ruby
nicholaslyang has joined #ruby
ScottFrancis has joined #ruby
acacio has joined #ruby
ryanar has joined #ruby
acacio has quit [Client Quit]
<ryanar> How can I parse JSON as a hash and make it available in a module? https://gist.github.com/audiolion/bdf23201b45273459b9b252dabee8a06
acacio has joined #ruby
sauvin has quit [Ping timeout: 265 seconds]
<jhass> def self.events; @events ||= ...; end
<ryanar> I just did class << self attr_accessor but that way seems even leaner
<jhass> it's pretty much the same
<havenwood> ryanar: How about a constant?
gell5 has joined #ruby
<havenwood> ryanar: You can drop the `./` with #expand_path.
<ryanar> I basically want this to be const, read the file into memory once
ScottFrancis has quit [Quit: Leaving]
<havenwood> ryanar: How about `__dir__` in place of `File.dirname(__FILE__)`?
<havenwood> ryanar: EVENTS = JSON.parse File.read File.expand_path('events.json', __dir__)
<havenwood> private_constant :EVENTS
ScottFrancis has joined #ruby
<ryanar> yeah that works great, thanks @jhass @havenwood
gell5 has quit [Ping timeout: 260 seconds]
Jonopoly has joined #ruby
bsdband26 has joined #ruby
Jonopoly has quit [Client Quit]
drincruz has joined #ruby
bsdbandit-01 has quit [Ping timeout: 265 seconds]
infinityfye has quit [Ping timeout: 246 seconds]
infinityfye has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicholaslyang has joined #ruby
ScottFrancis has quit [Remote host closed the connection]
ScottFrancis has joined #ruby
<gitter1234> Hey! Adding /home/user/.gem/bin to $PATH should be all Bundler needs to know right? Having some slight problems getting things to work on OpenBSD. Any chance anybody here knows? https://gist.github.com/anon987654321/99becb9e75d235ce10b3490317eaff9e
bsdband26 has quit [Read error: Connection reset by peer]
<jhass> well it also needs GEM_HOME maybe? Or just sidestep all of that with bundle install --path
ScottFrancis has quit [Ping timeout: 260 seconds]
ncakerlist has joined #ruby
<gitter1234> jhass: Great idea, thanks!
impermanence has joined #ruby
Jonopoly has joined #ruby
<gitter1234> jhass: Seems to be working! Woohoo!
<gitter1234> (the --path thing)
r29v has quit [Ping timeout: 256 seconds]
<ncakerlist> eval removes the quote to get source code excluding quote, so we need second eval to execute the code?
wickedbloodfart has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gitter1234> jhass: it just finished compiling and its all good - thanks again!
<jhass> ncakerlist: what are you doing? Why do you need eval?
<ncakerlist> i am finding the reason why eval needs extra quotes, internal representation always has excess quotes using p command
<ncakerlist> no it doesn't p "ok" => "ok" only one quote
<jhass> I don't follow...
<ncakerlist> eval "'a'" => 'a'
dviola has joined #ruby
<leftylink> so, what do you think would happen without the quotes?
davispuh has joined #ruby
<ncakerlist> eval 'a'; NameError (undefined local variable or method `a' for main:Object)
<leftylink> great
<leftylink> now you see
<ncakerlist> eval "1+3" ; 4 no double quotes needed
acacio has quit [Quit: Konversation terminated!]
<leftylink> well... duh?
<ncakerlist> 1.inspect => 1 ; '1'.inspect => => "\"1\""
<jhass> &>> p 1.inspect
<rubydoc> # => "1"... check link for more (https://carc.in/#/r/9956)
<leftylink> in both cases, it is as if you evaluate the expression inside the quotes. of course `a` evaluates differently from `'a'`
<ncakerlist> however i thought p object shows the internal represenetation but it's different than obj.inspect
<leftylink> &ri Kernel#p
<leftylink> as you can see, p writes `#inspect` of its args
<jhass> p(x) is the same as (puts(x); x)
<jhass> er, sorry
<jhass> p(x) is the same as (puts(x.inspect); x)
<ncakerlist> that is not p 's documentation it's not in english unlike https://www.rubyguides.com/2018/10/puts-vs-print/
<leftylink> mmm I see. good luck then.
<ncakerlist> ok i understood p now, jhass as you said p(x) is puts(x.inspect)
<jhass> I wouldn't think of the return value f inspect to be a "raw" value or so. It's just a string that wants to help you understand what the object is
<jhass> puts 1; and puts "1"; look the same, but p(1) and p("1") help you to understand what's the number and what's the string
<jhass> that's all it's trying to do
mikecmpbll has quit [Quit: inabit.]
<gitter1234> Hey
<gitter1234> What happened to www.puma.io?!
nicholaslyang has joined #ruby
<gitter1234> ah, their www. doesn't work
<havenwood> gitter1234: https://puma.io/
<gitter1234> Yup!
bsdbandit-01 has joined #ruby
<ncakerlist> i searched about ruby on duckduckgo , i got youtube recommendations of ruby on mobile wtf
xco has joined #ruby
<ncakerlist> you can't escape google even if you don't use google.com
Fusl has quit [Max SendQ exceeded]
Fusl has joined #ruby
ncakerlist has quit [Read error: Connection reset by peer]
ellcs1 has joined #ruby
ncakerlist has joined #ruby
infinityfye has quit [Quit: Leaving]
<ncakerlist> can i use ruby as a shell
<jhass> sure
<jhass> irb
<jhass> or
<jhass> ?pry
<jhass> mmh, bot is borked
<jhass> !pry
<leftylink> sounds fun!
<jhass> well, or pry after gem install pry :)
<ncakerlist> in python i need to import sys,os and then if sys.os i just can't mkdir folder to make a directory and closing and opening files too is a pain... i just gave up on python
<ncakerlist> how is ruby different in terms of system control than python then.
<leftylink> ahhhhh so the goal is to make things like that easy...! thta is very interesting. since a naive way one might think of doing it is "if I can't do it in pure ruby, then I'll just use backticks, that only two extra characters"
<leftylink> BUT
<leftylink> BUT
<leftylink> what if I then decided "what if I want to not have to type the backticks"
<leftylink> then maybe one would craft a particular method_missing that automatically backticks it
<leftylink> :0 :0 :0 :0 :0
<leftylink> WHOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
<jhass> mmh, where did the Shell stdlib go?
<jhass> anyways, include FileUtils should get you pretty far
postmodern has joined #ruby
<leftylink> NOTE that I have NOT attempted to make such a method_missing myself since I need to figure out how it is to handle things like a b c where I think method_missing will be invoked for each of a, b, c... and I think the result for a will need to be substantially different than that for b and c
<leftylink> I will give it a try now!
<leftylink> very exciting task!
<leftylink> I thank you for giving me the idea
entel has joined #ruby
<leftylink> mmm yes, it is a little difficult. for "a b c" for example, first you get the method_missing for c (of course), then for b, then for a (of course)
<leftylink> so the method_missing needs to have an understanding of this fact
<ncakerlist> `ls` the output is not pretty?
<ncakerlist> `ls -l` is even worse
<jhass> ruby is not meant to be used as a shell :) Neither is python
<jhass> I mean it's not optimized for this usecase at all
<ncakerlist> i don't want optimization just basic ability to read the output of ls
<ncakerlist> is `ls` calling /usr/bin/ls , then why is it scrambled
<jhass> you see that's already a trade off. Make it easy to read and make it easy to use programmatically are quite different goals. That's why writing shell scripts has so many corner cases to consider
mozzarella has quit [Ping timeout: 246 seconds]
<jhass> puts `ls`
<jhass> irb calls inspect just like p
garyserj has joined #ruby
<ncakerlist> but ls does output newlines so irb does what to swallow them and morph them
<jhass> nothing
<jhass> backticks returns the command output as a string
<jhass> irb calls inspect on that string to show it
barg has quit [Ping timeout: 264 seconds]
SeepingN has left #ruby ["The system is going down for reboot NOW!"]
<ncakerlist> i also can't changet the directory `cd ..`
<ncakerlist> Errno::ENOENT (No such file or directory - cd)
<jhass> yes, cd is a shell builtin, not a comman in /bin or /usr/bin
<ncakerlist> hmm i new you would say that
<jhass> FileUtils.cd
<leftylink> ah adds an interesting twist
<leftylink> so `cd` will have to be understood
<leftylink> oh nooooooooooooo
<leftylink> trouble with "cd .." because .. also indicates a range
<ncakerlist> can you show me the exmaple with FileUtils
schne1der has joined #ruby
<jhass> FileUtils.cd("my_directory")
<ncakerlist> ok can i from FileUtils import cd and then cd 'mydir'
<ncakerlist> LoadError (cannot load such file -- FileUtils)
<ncakerlist> require 'FileUtils'
<leftylink> hey so http://sprunge.us/4BG5Hq is kinda close (require it in irb and good sh*************************t happens
<leftylink> but
<leftylink> still can't deal with cd ..
<jhass> require "file_utils"; include FileUtils
<leftylink> might need to make my own repl........................... too much work
<leftylink> ................................
<ncakerlist> sorry i am digressing maybe i should just take light before leaerning basics first...
<ncakerlist> i have noted it down though.
vondruch has quit [Ping timeout: 260 seconds]
<ncakerlist> i yet managed to learn the basics given in 20 minute ruby tutorials, i could have never imagined such a feat with python - it tooks me months
reyfi9e has quit [Quit: Konversation term]
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
<jhass> :)
<ncakerlist> or maybe i am developing brain muscles after programming python- which was my first langage
reyfi9e has joined #ruby
<jhass> tbf they're in the same ballpark of languages and learning programming and learning a programming language are two different things that you just happen to do at the same time in the beginning
<jhass> yeah :)
<leftylink> now that I look at it, I am pretty sure this donesn't know how to deal with / either
<leftylink> I could define a particular ArgOrCmd#/ that does the right thing
<leftylink> but I don't feel like it right now
<jhass> or maybe recognize the fact that Ruby doesn't want to be a shell :)
<jhass> alias r='ruby -pe' and live with it
schne1der has quit [Ping timeout: 240 seconds]
gell5 has joined #ruby
bsdbandit-01 has joined #ruby
codefriar has joined #ruby
TCZ has joined #ruby
<leftylink> hmm
ncakerlist has quit [Read error: Connection reset by peer]
<leftylink> there are things I can vs cannot do
<leftylink> &>> Range.new(1, nil) == (1..)
<rubydoc> # => true (https://carc.in/#/r/995p)
gell5 has quit [Ping timeout: 264 seconds]
<leftylink> &>> Range.new(nil, 1) == (..1)
<rubydoc> # => true (https://carc.in/#/r/995q)
<leftylink> &>> Range.new(nil, nil) == (..)
<rubydoc> stderr: -e:4: syntax error, unexpected ')'... check link for more (https://carc.in/#/r/995r)
<leftylink> NOPE
<leftylink> but I guess nobody would have a use for such a range anyway
<leftylink> so why bother allowing it to be craeted with a literal
ncakerlist has joined #ruby
<leftylink> coolear heads prevail once again.
bodqhrohro_ has joined #ruby
<leftylink> we have ot use logic and reason to understand why things are the way they are
bodqhrohro has quit [Ping timeout: 256 seconds]
<leftylink> and practical considerations
<leftylink> there can be many complex decisions that go on without our nkowing
<ncakerlist> how do we make a language that we made make syscalls like shells
<ncakerlist> making language is easy but i don't know what procedure is used dto make them interace with linux
<jhass> uh, that question could be answered on many many levels
<jhass> it kinda depends on what the runtime or backend of your language is
<ncakerlist> the asiest way is what i prefer
<ncakerlist> let's say i made scheme then making it is easy but interfacing it with OS
poro has joined #ruby
<ncakerlist> it takes only one page of code to make a programming language
<jhass> how did you make your language?
<jhass> what tools?
<ncakerlist> you mean lexers/parsers ?
<jhass> mh, no that's the less interesting part to answer this question
<ncakerlist> i didn't currently but i think i can make it
<ncakerlist> what tools are you talking then jhass
<jhass> the parser and lexer just gives you the AST, you need something that interpretes that AST (an interpreter) or transforms it into some other code (a transpiler)
<jhass> so whatcha doing with the AST?
<jhass> how do you run the code of your language?
<ncakerlist> scheme interpreter what else
<jhass> so, an interpreter in scheme, cool
inradius has joined #ruby
<ncakerlist> it takes barely a page of code to make a programming language
<jhass> what you need to do is have the interpreter know predefined functions
<poro> do you just map stuff to C stuff?
<jhass> and call the appropriate scheme functions for these functions
<ncakerlist> like open/close file
ur5us has joined #ruby
<jhass> yeah
<jhass> for example
<jhass> this line in the Ruby C code
<jhass> it hooks calling Dir.chdir to the C function
<jhass> called dir_s_chdir
<jhass> which in turn calls the syscall chdir
<jhass> from glibc
<apotheon> Ruby's great for defining DSLs.
<apotheon> I just noticed something about writing programming languages. I'm probably somewhat off the topic.
AndreYuhai has joined #ruby
wickedbloodfart has quit [Quit: wickedbloodfart]
<ncakerlist> can i "freeze" the source code of an interpreter to get machine code ? without needing to make a compiler
<jhass> no :)
<ncakerlist> the interpreter too is ultimately giving out machine code so can't we "steal " that from low level underhand yes we can but i would like to
<jhass> no, what you're describing is called a just in time compiler or JIT for short
<jhass> an interpreter is exactly not doing that, it's at runtime interpreting the operations
<ncakerlist> JIT doesn't freeze the script
<jhass> some languages cheat a bit by generating a binary which embeds the user code and an interpreter for it
<apotheon> "at runtime" as in "some parts of it don't get jitted until it receives user input"
<jhass> Ruby doesn't JIT at all (well, until 2.7 where they added some experimental stuff that you need to explicitly enable)
<jhass> it uses a VM, which is just an internal transformation step to make interpreting a little bit faster
<jhass> so it doesn't directly interpret user code but an internal bytecode generated from it
<jhass> but never (outside the experimental JIT) it generates machine code and then points the program counter to it
<ncakerlist> i used to think every interpreter had a VM
BH23 has quit [Ping timeout: 264 seconds]
<jhass> no, ruby didn't until Ruby 2.0 :)
inradius has quit [Remote host closed the connection]
<jhass> it operated directly on the parsed AST (afaik)
<ncakerlist> which year was ruby 2.0 released
<jhass> uh, 2013
<ncakerlist> i am wondering did the performance improve after that due to the VM ?
<jhass> I mean you'll almost always will have some interpreter state, like a stack and whithin what's the local variables and some heap like place to store objects and stuff, so that's maybe a bit like a VM, but I think most people distinguish it by having it run on some kind of bytecode which is more lowlevel than the user code
<jhass> I think so, yeah
<jhass> I mean Ruby's stdlib is majorily C, so maybe not as much as you would think
<jhass> since most time you spend in stdlib functions really, map this array, add these two numbers, write this to some IO
dionysus69 has quit [Ping timeout: 240 seconds]
inradius has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
TCZ has quit [Quit: Leaving]
ncakerlist has quit [Ping timeout: 256 seconds]
jottr has joined #ruby
gell5 has joined #ruby
fercell has quit [Quit: WeeChat 2.8]
AndreYuhai has quit [Quit: Leaving]
Jonopoly has quit [Quit: WeeChat 2.8]
<inradius> learning a bit about module_function (inspired by looking at Ruby's open-uri lib). What's the reasoning behind using module_function to monkey patch Kernel#open? Is it related to Kernel methods are mixins with the top level 'main' object? (wild guess)
<jhass> module_function is not used to "monkey patch Kernel#open", Kernel#open, like all methods on Kernel, is defined as a module_function, so an overide needs to preserve that
nychtel has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
nychtel_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<jhass> module_function is used in Kernel so the methods are available as both, instance methods by the include Kernel into Object and singleton methods so you can call them as Kernel.open too
<jhass> the latter being useful in scenarios where you have something shadowing the Kernel#open method or you have a BasicObject subclass for example
jetchisel has joined #ruby
<jhass> recalling module_function is necessaty because module_function actually makes a copy to the singleton class, not a delegator or so
poro has quit [Quit: Leaving]
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
<inradius> Is including Kernel into Object what makes calling open() possible?
<jhass> yeah
<jhass> because main (the toplevel scope) is just an instance of it
<jhass> eh, an instance of Object
<jhass> that makes it work for the toplevel. And then your classes inherit Object of course
<inradius> makes a lot of sense, but I don't quite understand the wording. This is still a monkey-patch correct? It's modifying the original Kernel#open method to open uri's, is the right way to describe module_function usage here to override the open methods?
ellcs1 has quit [Ping timeout: 260 seconds]
<jhass> module_function is part of the monkey patch, it's not a way of implementing a monkey patch
<inradius> got it
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Garb0 has joined #ruby
Garb0 has quit [Max SendQ exceeded]
Garb0 has joined #ruby
<inradius> btw, where's the source code for how Kernel methods are defined as module_functions?
cloaked1 has joined #ruby
<jhass> good question! I can't immediately spot it below https://github.com/ruby/ruby/blob/master/object.c#L4591
BH23 has joined #ruby
<jhass> maybe they make sure this one https://github.com/ruby/ruby/blob/master/kernel.rb#L30 happens before those definitions?
nicholaslyang has joined #ruby
sphex has quit [Ping timeout: 256 seconds]
chalkmonster has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chris____ has joined #ruby
mozzarella has joined #ruby
ryanar has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
drincruz has quit [Ping timeout: 240 seconds]
<inradius> Yeah I saw that too. Perhaps it has something to do with this too? https://github.com/ruby/ruby/blob/master/class.c#L1931 Seems like lots of other files calls this function
<jhass> ah yeah, sounds like you're on the right path
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troulouliou_dev has quit [Quit: Leaving]
sphex has joined #ruby
gell5 has quit []
ScottFrancis has joined #ruby
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
chris____ has quit [Remote host closed the connection]
Garb0 has quit [Ping timeout: 256 seconds]
nicholaslyang has joined #ruby
ScottFrancis has quit [Quit: Leaving]
ScottFrancis has joined #ruby
akem has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quazimodo has joined #ruby
bodqhrohro_ has quit [Remote host closed the connection]
ScottFrancis has quit [Ping timeout: 256 seconds]
bodqhrohro has joined #ruby
jottr_ has joined #ruby
codefriar has quit [Ping timeout: 246 seconds]
jottr has quit [Ping timeout: 246 seconds]
codefriar has joined #ruby
ScottFrancis has joined #ruby