3 ms·
Hell yeah! I’ll never forget being fooled by HN that you have to use Perl if you want portable scripts that aren’t bash, writing a whole script with it, and hav
by corytheboyd 2y ago
Hell yeah! I’ll never forget being fooled by HN that you have to use Perl if you want portable scripts that aren’t bash, writing a whole script with it, and having a coworker politely, yet firmly, tell me that I am dumb and it should just be Ruby… and it was a script I was checking into a Rails app! It’s even trivial to include dependencies with bundler inline https://bundler.io/guides/bundler_in_a_single_file_ruby_script.html https://bundler.io/guides/bundler_in_a_single_file_ruby_scri...
- notnmeyer 2y agothis is… somewhat horrific, right? would anyone do this without explicit version pinning? loosely pinned deps installed on execution sounds fucking awful.
- deleted 2y ago[deleted]
- corytheboyd 2y agoWell, don’t use this then. It’s a neat feature for quickly iterating, and you can quite easily go up from here to a proper Gemfile/Gemfile.lock.
- manume 2y agoYou can pin a gem to a specific version, of course. `gem "mygem"` installs the latest version. `gem "mygem", "~> 4.0.0"` installs >= 4.0.0 but < 4.1.0, which is what you probably want when using Semantic Versioning, which most gems adhere to, to get the latest patch version. `gem "mygem", "4.0.10"` installs exactly that version.