<adam12>
Consider docs.ruby-lang.org as official canonical. rubyapi.org is a nicer interface. ruby-doc.org is not official. rubydoc.info is not official.
<adam12>
We have a proliferation of ruby doc sites, sadly. I've contributed to it by introducing gemdocs.org...
<johnjaye>
eh. if you say so
<johnjaye>
so it would probably be a bad idea to start a ruby.doc website i guess
<adam12>
Hehe. Is that a legit tld? I want to re-document ruby...
<johnjaye>
no but it could be. the permutations on just a few words are pretty much endless
<adam12>
I want to steal the Rust doc format. Much nicer, imho.
<weaksauce>
anything would be better
<weaksauce>
how is the doc in such a state after what? 30 years or something like that?
<johnjaye>
seems like everybody has their own version of markdown. why not ruby
<adam12>
I think that theme is from 2008 and never updated.
<adam12>
I think we should adopt Asciidoc..
<johnjaye>
why. aren't they all the same
<adam12>
I like writing Markdown but once you stray into abdomations(sp?) and others, then you're into the wild west of markdown dialects.
<adam12>
rdoc maintenance has just been super quiet lately. It does receive bug fixes, and I think v6 shipped with Ripper support, but that feels like it lately.
<weaksauce>
that ruby-doc website would be better if it just went unders
<adam12>
Agreed. I kind of wish it went kabut.
<adam12>
kaput.
<adam12>
It ranks higher than official site.
<weaksauce>
using such an old version of whatever formatter that it's worse
<weaksauce>
oh you know what they updated it
<weaksauce>
almost new now
<adam12>
Ooh you're right.
<adam12>
The ads tho. Eeesh
<adam12>
We had an entire period where everyone was told to `--no-ri --no-rdoc` their gem installs and I think we suffered immensely from it because fuck docs.
FetidToot has joined #ruby
rvalue has quit [Ping timeout: 240 seconds]
jhass has quit [Ping timeout: 256 seconds]
jhass has joined #ruby
caedmon has joined #ruby
rvalue has joined #ruby
caedmon has quit [Remote host closed the connection]
<blackmetal>
yo guys
<blackmetal>
so u ever listened to a song and been like "hmm.. i wish i had that in midi-format"
<leftylink>
uh oh, are my links mostly to ruby-doc... let's see
<cAMP>
(it is self-contained, and should run from prompt from that paste)
<cAMP>
I decided to use it for my OSS game project, Mutonex, so this will be GNU GPL 3.0
<rapha>
no clue about math, cAMP, but this looks cool. how does one write games in Ruby?
<cAMP>
hi rapha, I just write
<cAMP>
but I did also write a game design for it
<rapha>
i mean, like, what library does one use for the graphics?
<cAMP>
rapha: there are many libraries for ruby like the classic SDL, but I was just going to use a browser-client. So its probably canvas-based renderer. Maybe a minimal three.js ripoff.
<cAMP>
rapha: so that Planet module would live in a server, and the engine would request the planet related values from it to calculate game state for game-world sector.
<ox1eef_>
Historically, ruby had quite a few libraries for writing games, at least 2D games. There was Ray from Mon_Ouie, the original Pry author wrote some C bindings for it as well. MacRuby had a successful iPhone app game. I'm not sure what it is like nowadays.
<cAMP>
I'm not looking for info on ruby game libs or frameworks, I'll make all of that myself.
<rapha>
cAMP: i didn't know that if someone wants to do DIY it's forbidden for them to read a book to gain some knowledge from :)
<ox1eef_>
That's my approach to most problems, too
<cAMP>
I'm more interested in idiomatic ruby and any feedback on the module/class/logic-level solutions I put in my pastes 8)
<cAMP>
rapha: its just I don't need any of that
<rapha>
would you be able of writing, say, a Vulkan wrapper yourself?
<rapha>
(not that that book goes into that)
<cAMP>
not interested in writing wrappers
<rapha>
how would you approach 3D in a slow language like Ruby?
<cAMP>
If you scroll above I kinda attempted to tell you earlier.
<ox1eef_>
You can always drop down to C where you need speed.
<cAMP>
But in general, with ruby I leverage the kernel and C libraries where fast stuff is needed.
<rapha>
you said you're going to do it browser based
<rapha>
hmm, that's inaccessible to me then
<rapha>
C, that is
<cAMP>
I'll write these in ruby first, some parts in ecmaland, and then whats needed I'll try to get rust-modules for.
<rapha>
sounds pretty cool
<cAMP>
I'm hoping the code is somewhat idiomatic, and easy to follow. Then maybe others will join the Mutonex project later.
<ox1eef_>
C can be hard sometimes. It is very easy to shoot yourself in the foot with it, but great language to learn all the same.
<rapha>
i had it when i did my 3-year specialized compsci degree thing, and i can do some simple things with it. or some a little more complex ones with C++ and something like the Arduino framework. but for more than that i think i lack both the intelligence as well as the grit.
<ox1eef_>
It is a language that requires paying close atttention, that's for sure.
<rapha>
yeah and then that attention is missing to keep an eye on the bigger picture. i've always admired people who can keep both in mind without their mental workload being through the roof from that.
<cAMP>
C just requires you think the memory management through
<cAMP>
other than that, its somewhat simple IMO
<rapha>
simplicity can still result in enormous complexity.
<ox1eef_>
simple, subtle and sometimes dangerous is how I would describe it.
<cAMP>
Most languages today have all kinds of extensions, extras, bells and whistles. I find the best results come from using the simple. But then, I often want to do things like iterate methods in a module. Introspection. Then most languages fail totally. One can't even iterate the properties of a class or module.
<cAMP>
Ruby is fun like that
<ox1eef_>
I think Rust is a decent candidate to be a C successor. At least when it compiles, you can have reasonable confidence it works as intended. C can compile and then just blow up.
<cAMP>
If you look at Rust, it comes from browser renderers. C++ gets too complex and memory-buggy. Segfault galore.
<cAMP>
So, rust is now posed to be defacto browser lang. Just recently, rust modules for linux kernel became a thing. So linux kernel project supports rust. Something else may surface at any time, but to me looks like rust is the definitive language for the future.
<Shell>
it's /a/ big language for the future, at least.
<cAMP>
heh, "rust modules for linux kernel" is kinda bad english, but maybe you can still get that
<cAMP>
FWIW, I've been learning rust on and off, but the base requirement for understanding coercion with lifecycles, scopes and memory management gets pretty confusing. But then, its better than doing it in your head, as with C.
<cAMP>
Ruby feels so soft compared. Fire irb up, do weird metaprogramming.
hwpplayer1 has quit [Quit: cylater]
sam113101 has joined #ruby
roadie has joined #ruby
<ox1eef_>
Ruby is awesome indeed.
<leftylink>
let's see, was it in this channel where we had the conversation and someone's position was essentially "I am not saying Rust is good. I am not saying Rust is bad. I am saying we can't give a definite statement either way without practical evidence"
<leftylink>
no, we probably would not have that conversation about Rust in #ruby , so it probably wasn't here
sam113101 has quit [Ping timeout: 268 seconds]
<johnjaye>
doesn't ruby occupy a completely different niche though?
<johnjaye>
in my head I file it under "dynamic languages with oo features and also xyz addons". in the case of ruby web related tasks
<johnjaye>
idk if it was on purpose but ruby even shares keywords with python like def
<weaksauce>
doubtful
<weaksauce>
def is just a short way to write define
___nick___ has quit [Ping timeout: 240 seconds]
weyhmueller has quit [Read error: Connection reset by peer]
weyhmueller has joined #ruby
<cAMP>
OK, moved the planet.rb into Mutonex repo, inc
<leftylink>
so you definitely don't want the first splat
<Sampersand>
to solve it I need `.each { |kwargs| foo(**kwargs) }` . It seems related to `ruby2_keywords` but im not sure why `**splat `doesnt work
<Sampersand>
it's also a bit weird since when you use a single argument in a block and are passed multiple positional arguments, that single argument is an array of them. Does this behaviour change with hashes?
<leftylink>
okay in fact I can see this being related to the ruby 3 kwargs thing
<leftylink>
because |**kwargs| says kwargs should be any kwargs the caller of the block passes in
<leftylink>
and each would pass in {a:1, b:2}
<Sampersand>
yeah exactly
<Sampersand>
so maybe those are passed as positional arguments, and since no positional arguments are described it drops them
walez_ has joined #ruby
<Sampersand>
Now for something entirely unrelated: How can I make a `GET` request to an arbitrary host with port? I know you can `Net::HTTP.get(URI("http://#{host}"))` (and also `https://`) but i dont see a way to do it to any arbitrary port. ( `Net::HTTP.get(URI("http://www.example.com:443"))` doesn't work, for example)
<ox1eef_>
On the same thread, sure - no problem. Across threads, you might want to limit it to one instance per thread.
TomyWork has quit [Remote host closed the connection]
<Sampersand>
cool
_ht has quit [Remote host closed the connection]
fercell has joined #ruby
cAMP has left #ruby [ta!]
cek has joined #ruby
walez_ has quit [Quit: Leaving]
mexen has quit []
Sampersand has quit [Quit: Client closed]
roadie` has quit [Ping timeout: 248 seconds]
sam113101 has joined #ruby
tomtmym has quit [Quit: Gone.]
infinityfye has quit [Quit: Leaving]
Sampersand has joined #ruby
cek has quit []
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
grenierm has joined #ruby
crueber_ has joined #ruby
roadie` has joined #ruby
crueber_ has quit [Quit: Leaving]
roadie` has quit [Ping timeout: 248 seconds]
<Sampersand>
Is there a way to have ruby automatically `require` some files whenever it starts? Context: I'm debugging some server code locally, and I want to just have `binding.pry` always defined
roadie` has joined #ruby
plujon has joined #ruby
<plujon>
Can the standard net/http module be used to parse a raw http request?
<plujon>
request = Net::HTTP::read_raw(raw_http_request) # something like this
roadie` has quit [Ping timeout: 248 seconds]
<havenwood>
plujon: With Net::HTTP you can `set_debug_output($stdout)` to get at the raw HTTP request.
<havenwood>
I personally avoid Net::HTTP.
<havenwood>
Or send the debug output elsewhere.
Thanzex3268 has quit [Quit: Ping timeout (120 seconds)]
<havenwood>
I really favor the HTTP clients that support HTTP/2 these days. Particularly, Typhoeus, Async::HTTP, and HTTPX.
Thanzex3268 has joined #ruby
znpy has quit [Quit: Ping timeout (120 seconds)]
znpy has joined #ruby
<plujon>
havenwood: Thanks, but I don't want to see a raw http request; I want to parse a raw http request into a ruby object.
grenierm has quit [Quit: Client closed]
<havenwood>
plujon: What's the result you're looking for? Parsing into objects seems broad. Have an example result you're aiming for?