Posts by postmodern@ruby.social
 (DIR) Post #AQ7vh9GE4JVfJdRxXU by postmodern@ruby.social
       2022-11-30T03:27:43Z
       
       0 likes, 1 repeats
       
       Fun Programming Challenge: write a function that randomizes the case of the characters in a String, but ensures at least one character has a different case than the input String. (i.e. `random_case("foo")` should never return "foo".)
       
 (DIR) Post #AQ8Jt6iNl2DpnKr596 by postmodern@ruby.social
       2022-11-30T15:17:46Z
       
       0 likes, 0 repeats
       
       @james this is also what I was thinking. You would need to select +1 random (but unique) indexes to flip to ensure that at least one index is always flipped. Doing bitflipping with rand() might still result in no indexes being flipped, because there's still a small probability that rand() might return 0.
       
 (DIR) Post #AQRURbjtbfyjPEtKxU by postmodern@ruby.social
       2022-12-09T21:06:55Z
       
       0 likes, 0 repeats
       
       What would be a good name for a method which renders an erb template then writes the output to another file? `erb_file`? `erb_template`? `erb_write`?
       
 (DIR) Post #AQRVDle84law239tWy by postmodern@ruby.social
       2022-12-09T21:24:22Z
       
       0 likes, 0 repeats
       
       @james just source and dest paths.
       
 (DIR) Post #AQRWVAnDvz1utsHAgq by postmodern@ruby.social
       2022-12-09T21:38:43Z
       
       0 likes, 0 repeats
       
       @james I suppose I could call it `erb` and have an optional second argument for the output, but I don't like adding too much functionality to one method.
       
 (DIR) Post #AQX8IFmMquSyeGwRcm by postmodern@ruby.social
       2022-12-11T17:02:13Z
       
       1 likes, 0 repeats
       
       Maybe part of the reason for Ruby's declining popularity numbers is that we've put all of our eggs in one basket, that is Rails. Come to think of it, there hasn't really been any new big [Open Source] Ruby frameworks with the exception of ROM and Hanami; I'll classify Sinatra and Padrino as micro-frameworks. Eventually users became increasingly disenchanted with Rails, Chef, Puppet, and Metasploit. Maybe what really drives programming language growth is new shiny frameworks/tools?#ruby
       
 (DIR) Post #AQX8IID1okysBXQlSS by postmodern@ruby.social
       2022-12-11T19:07:25Z
       
       0 likes, 0 repeats
       
       Well, jekyll was almost a killer app for Ruby. It became popular really quickly as the go-to solution for static site generation, and GitHub used it for GitHub Pages. Jekyll ruined it's chances by becoming too complex, relying heavily on C extensions (which required a C compiler), adding extra features like SASS, SCSS, CoffeeScript, WebPack, etc, when the majority of people just wanted to make simple markdown+CSS websites. This contributed to Ruby's reputation as being complex and hard to setup.
       
 (DIR) Post #AQX8IJoHriNX9Ns2Ai by postmodern@ruby.social
       2022-12-11T19:15:07Z
       
       0 likes, 0 repeats
       
       If you search for Jekyll, you will find many examples of users complaining about Jekyll and how they perceived it to be too difficult to get installed/setup, and how they eventually switched to Hugo (Go) or Hyde (Python).* https://gohugo.io/* https://hyde.github.io/
       
 (DIR) Post #AQX8ILYlMP9IZocfFg by postmodern@ruby.social
       2022-12-11T19:18:21Z
       
       0 likes, 0 repeats
       
       Also note how Jekyll's installation instructions are far more complex than Hugo or Hyde. Hugo recommends installing from hugo from the package manager for Linux, and Hyde recommends installing it using pip. Meanwhile, Jekyll recommends you install via rubygems, but also mentions you need Ruby >= 2.5.0, GCC, and Make. Why doesn't Jekyll just tell users to install jekyll via `apt-get` or `dnf` like Hugo? Ubuntu and Fedora already have jekyll packaged, with all necessary external deps.
       
 (DIR) Post #AQX8INX41gyih7qKsi by postmodern@ruby.social
       2022-12-11T19:26:39Z
       
       0 likes, 0 repeats
       
       If you're distributing software for non-ruby-developers, your installation instructions should not be ruby-developer-centric where you tell users they need to install homebrew, then rbenv, then ruby-3.2.0, then ohmyzsh, etc. Instead consider these options:1. Create your own packages (PPA, Fedora COPR, Homebrew formula, or even a Snap image).2. Installation bash script which handles downloading, installing dependencies, building, configuring, etc.3. Copy/pasteable OS-specific install commands
       
 (DIR) Post #AVYZfuwHEkjrervnGK by postmodern@ruby.social
       2023-05-11T20:27:12Z
       
       0 likes, 1 repeats
       
       Can someone ping Ruby Central or rubygems.org admins. Somehow rubygems.org got flagged by Google Safe Browsing as malicious. Chrome, Brave, and FireFox are all flagging it. Someone needs to un-flag it.https://transparencyreport.google.com/safe-browsing/search?url=https:%2F%2Frubygems.org%2F&hl=en-UShttps://sucuri.net/guides/how-to-remove-google-blocklist-warning//cc @adarsh
       
 (DIR) Post #AYTZvyC31VJPk7e2iW by postmodern@ruby.social
       2023-08-07T04:23:26Z
       
       0 likes, 0 repeats
       
       @freemo a lot of Ruby classes defines both mutable methods that mutate the object in-place, and define methods that return a copy via `dup.do_mutation`.
       
 (DIR) Post #AYTaj3c9elICkIGMNs by postmodern@ruby.social
       2023-08-07T04:32:19Z
       
       0 likes, 0 repeats
       
       @freemo Ruby's handling of immutability hasn't really changed, besides adding frozen_string_literal. There are several libraries that do recursive-freezing of objects or define immutable Struct-like objects. I've found that being mindful of API boundaries and object ownership prevents a lot of the mutability horror stories.
       
 (DIR) Post #AZ7AkjTlMxQHWzzP60 by postmodern@ruby.social
       2023-08-25T17:20:27Z
       
       0 likes, 1 repeats
       
       There seems to be this repeating pattern of developers dreaming up new Project Management Processes (XP, Agile, Scrum) that shift power away from project managers and towards the developers, and then bureaucratic project management certification organizations co-opting the process and recuperating it back into the traditional project manager vs. developer power structure.
       
 (DIR) Post #AZ7AklVFqNnvoChchM by postmodern@ruby.social
       2023-08-25T17:25:07Z
       
       0 likes, 0 repeats
       
       It reminds me of when companies were forced to embrace remote work and async collaboration during the pandemic, but managers kept scheduling back-to-back zoom meetings in order to appear busy and not obsolete.
       
 (DIR) Post #AZ7AkoDzj0mSFXeNiC by postmodern@ruby.social
       2023-08-25T17:39:54Z
       
       0 likes, 0 repeats
       
       I guess you could think of XP/Agile/Scrum as reforms to the project management system. By not explicitly abolishing the position of project manager, and that we should all just follow the process as intended, it allowed project managers to retain their positions and power, which then causes much of the friction with XP/Agile/Scrum. You probably don't hate XP/Agile/Scrum as they're written, you hate that someone else is dictating the process to you.
       
 (DIR) Post #AZnWzBM6IvY2zFWVua by postmodern@ruby.social
       2023-09-15T17:16:05Z
       
       0 likes, 0 repeats
       
       @changelog @searls a lot of the "DX" friction is due to the fact that our apps and thus tools are designed to run on Linux servers, but [web] developers keep trying to setup a Linux-ish dev environment on macOS, which is a different environment with a different OS, package manager, security subsystem, etc. To get around this, developers have been pushing everything into Docker, which emulates the Linux userspace environment on macOS but for individual processes. tl;dr just use Linux.
       
 (DIR) Post #AaJ3JAlzErcygaSIZU by postmodern@ruby.social
       2023-09-30T22:12:22Z
       
       0 likes, 0 repeats
       
       @simon can you melt an egg? Are there any countries in Africa that start with the letter K?The benefit of LLMs is that instead of searching StackOverflow or Quora and getting a wrong answer, an LLM can rephrase your question and generate the wrong answer for you, because it was trained on the same StackOverflow/Quora answers from 2020.
       
 (DIR) Post #Ahru0umCVdKF2PgJ84 by postmodern@ruby.social
       2024-05-03T03:21:16Z
       
       0 likes, 0 repeats
       
       I'm also curious what Rubyist's opinions are of initializing a Config object from a parsed plain YAML file vs. initializing an empty Config object and populating it as you enumerate the parsed plain YAML?
       
 (DIR) Post #AhtGpe8mVqFEMSnbf6 by postmodern@ruby.social
       2024-05-05T04:30:09Z
       
       0 likes, 0 repeats
       
       If you have a Ruby filename that's hyphenated for some reason (ex: CVE IDs), should the rspec spec files be named "XYZ-1234_spec.rb"? Or should I name them "XYZ_1234_spec.rb"?#rspec