From ed44b145bd6d621cd19a4a3c94eff1311e9c3755 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Wed, 31 Aug 2016 09:28:44 -0600 Subject: support `-` as an argument to `rails runner` in Rails 4.0, you could use `/dev/stdin` on both Linux and Mac, but with the switch to Kernel.load in Rails 4.1, this broke on Linux (you get a LoadError). Instead, explicitly detect `-` as meaning stdin, then read from stdin explicitly, instead of performing file gymnastics. This should now work on any platform uniformly. Passing a script via stdin is useful when you're sshing to a server, and the script you want to run is stored locally. You could theoretically pass the entire script on the command line, but in reality you'll run into problems with the command being too long. --- railties/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'railties/CHANGELOG.md') diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index f720b7caab..45e1f5f3ea 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,8 @@ +* Support `-` as a platform-agnostic way to run a script from stdin with + `rails runner` + + *Cody Cutrer* + * Add `bootsnap` to default `Gemfile`. *Burke Libbey* -- cgit v1.2.3