u/postmodern
-
32points
postmodern
postmodern
"Testing" under "Advanced Topics" should be "Documentation" since it lists RDoc and YARD below it. It might also be worth mentioning RSpec after Minitest. While Rails uses Minitest by default, many people still prefer and use RSpec. Might also want to mention the new technologies that Rails adopted (ex: import maps, Hotwire, Stimulus, Turbo, Propshaft, Solid Cache, Solid Queue, Kamal 2, Thruster, etc).
postmodern
Looks good! Just curious if you've seen rubydoc.info (source) which provides auto-generated YARD docs for stdlib and all of the gems? YARD supports RDoc as well as Markdown and supports using a custom template for generating the HTML. Also while API documentation websites are important, the name of the website made me think there would be a literal manual with chapters to read.
postmodern
Still using rubydoc.info which can render YARD tags.
postmodern
I hadn't heard of Tebako or DwarFS. While shipping one static compiled binary is probably the safest way to distribute a Ruby app, it has the same problem as Electron apps, where each app ends up containing it's own version of Chromium which you cannot update.
I wish every platform had an integrated app store, where apps could specify a dependency on Ruby, etc, and the app store would magically also install the Ruby package in addition to your app. Snapcraft tried to do this, except they disabled macOS support and their Ruby "plugin" for packaging Ruby apps is basically abandoned (it also seems to assume app means a bundled web app, and not a CLI app), and I still haven't figured out how to properly overlay globally installed Ruby gems with the official Ruby snap.
postmodern
Bundler is trying to install it's gems globally, which you probably don't want; I also have no clue why Bundler does this by default. Try bundle install --path vendor/bundle instead. This will install everything into your app's vendor/bundle directory.
postmodern
Just curious why your gem also has a Rails app directory structure at the top-level?
postmodern
Also note that interpolating a Regexp within a String will result in -e /regex-stuff-here/, which might not be what the -e option is expecting.
postmodern
In both bash/zsh and within the backtick quotes that executes the command which since it runs that command via $SHELL -c "...".
postmodern
You have to put single quotes around regexs to prevent special characters (*, $, [, ]) from being interpreted by the shell.
postmodern
Also some ruby to integrate my stuff into metasploit. I hate ruby.
Don't blame Ruby for Metasploit's aweful code quality and bugginess. Checkout Ronin which is better maintained.
postmodern
Ruby is definitely (still) used in Cyber Security. There are a few major security tools written in Ruby: Metasploit, BeFF, Ronin, CeWL, dnscat2, etc. Ruby is a general purpose programming language, with an ecosystem of libraries (rubygems), with lots of libraries for web related tasks. You can also use Ruby's built-in TCPSocket or Net::HTTP for doing networking. There's even a discord library for writing bots.
postmodern
While ROM breaks apart and exposes all of the aspects of an ORM (schema definition, repository, query logic, mappings, etc), there's a great deal of "magic" happening behind the scenes to connect all of these pieces and make them work together. Also, while the dry-rb ecosystem seeks to be DRY, some of the code in dry-types, dry-schema, dry-validations is not exactly simple or clean. This shouldn't be a problem of course, until you run into a bug or confusing behavior in ROM/dry-rb and have to dig into it's code base. YMMV
postmodern
This is not exactly true. Mike is probably thinking in terms of ActiveRecord and how easy it is to implicitly trigger additional queries when accessing other associations on records. With ROM you define the record classes (aka Entity) separate from the class which contains your query logic (aka Repository). However, even with ROM you can query a collection of records (entities), enumerate over them, then do additional queries for each record (entity); but maybe you could argue that explicit N+1 queries in code would be easier to catch than ActiveRecord's implicit lazy loaded queries.
postmodern
Even though I have mixed feelings about Hanami, I fully support people contributing and supporting Open Source projects, especially Ruby projects.
postmodern
Once you wrap your head around Async's tasks and other Async primitives, it's quite nice. ronin-recon also uses Async Ruby for it's custom recursive recon engine that's capable of massively concurrent recon of domains.
postmodern
This is because Python and JavaScript have become the defacto go-to beginner programming languages which everyone recommends and every new programmer is now encouraged to learn. The vast majority of articles online discussing which programming language you should learn are geared towards beginners. Also, when you hear other programmers say "X is dead", what they really mean is "X is no longer trendy". Ruby is definitely not dead, is still broadly used by large successful tech companies (ex: Shopify, GitHub, LinkedIn, AirBnB, etc) thanks to Rails, and has multiple other popular frameworks other than Rails (ex: DragonRuby).
postmodern
Great to see a GitHub Action in Ruby! Always thought it was odd that GitHub Actions were written in TypeScript, instead of Python, Ruby, or even a compiled language to maximum performance.
postmodern
Ractors are still very experimental and not in wide use.
postmodern
I'm curious if anyone has tried to tackle the problem with types by religiously documenting their codebase using YARD? VS Code and JetBrain's RubyMine both have YARD integration which feeds into their Intellisense suggestions. There's even sord which can generate RBS/RBI type definition files from your YARD documentation tags.
postmodern
Finally a non-tiling WM for Wayland! I've been a long time fluxbox user and was waiting for a *box WM for Wayland.
postmodern
ruby-install only installs the rubies. You will need to either use chruby to switch to the installed ruby to make it temporarily the main ruby, or explicitly execute the ruby binary (ex: ~/.rubies/ruby-3.3.x/bin/gem install sqlite3 and ~/.rubies/ruby-3.3.X/bin/ruby myscript.rb). You will also need to install the sqlite3 gem under both truffleruby and ruby-3.3.x, since they are different Ruby implementations and support C extensions in different ways.
postmodern
I would like something like pipes but for representing deeply nested yielding methods:
ruby
foo do |a|
bar(a) do |b|
baz(b) do |c|
...
end
end
end
could be represented with special syntax:
foo |> bar |> baz do |c|
...
end
or perhaps using method_missing and chaining:
ruby
foo.pipe.bar.baz do |c|
...
end
Looks nice! I wish this existed a few years ago when I wanted GitBook-style documentation for a project, didn't like the existing tools, so rolled my own using vanilla Jekyll. One question, how do you integrate this into an existing Jekyll website with it's own CSS and header/foot? Must the docs be hosted on a
docs.subdomain? Or can you somehow add them into a traditional Jekyll website? Also how might this handle other documentation files such as markdown man pages?