From 83776676e54b387fc52081ff31cfd7710bae9e03 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Fri, 28 Oct 2016 20:44:58 +0200 Subject: Hide commands from API site. They're just barren on the site and confure more than guide, instead rely on the built in --help to guide users. --- railties/lib/rails/commands/runner/runner_command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/commands/runner') diff --git a/railties/lib/rails/commands/runner/runner_command.rb b/railties/lib/rails/commands/runner/runner_command.rb index 8db6da8759..27666c76b7 100644 --- a/railties/lib/rails/commands/runner/runner_command.rb +++ b/railties/lib/rails/commands/runner/runner_command.rb @@ -1,6 +1,6 @@ module Rails module Command - class RunnerCommand < Base + class RunnerCommand < Base # :nodoc: class_option :environment, aliases: "-e", type: :string, default: Rails::Command.environment.dup, desc: "The environment for the runner to operate under (test/development/production)" -- cgit v1.2.3 From 5aea0952e7cb445e614652e3cd9aba71a836eed0 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 20 Nov 2016 16:02:39 +0100 Subject: Pass `rails runner` args onto file again. When making the new command insfrastructure I had missed that `bin/rails runner some_file.rb some args` would pass the extra args onto the file in `ARGV`. Now fixed by allowing the command to take extra args again, and make sure to remove the file name from `ARGV`. --- railties/lib/rails/commands/runner/runner_command.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails/commands/runner') diff --git a/railties/lib/rails/commands/runner/runner_command.rb b/railties/lib/rails/commands/runner/runner_command.rb index 27666c76b7..4989a7837d 100644 --- a/railties/lib/rails/commands/runner/runner_command.rb +++ b/railties/lib/rails/commands/runner/runner_command.rb @@ -14,7 +14,7 @@ module Rails "#{super} [<'Some.ruby(code)'> | ]" end - def perform(code_or_file = nil) + def perform(code_or_file = nil, *file_argv) unless code_or_file help exit 1 @@ -27,6 +27,7 @@ module Rails if File.exist?(code_or_file) $0 = code_or_file + ARGV.replace(file_argv) Kernel.load code_or_file else begin -- cgit v1.2.3 From 75607a67b4f5e3fb5acf9c49353f102a4ecd9319 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Wed, 30 Nov 2016 20:57:50 +0900 Subject: use `Gem.win_platform?` to check windows Ruby platforms `Gem.win_platform?` check if it is Windows more accurately. Ref: https://github.com/ruby/ruby/blob/ruby_2_2/lib/rubygems.rb#L945..L952 --- railties/lib/rails/commands/runner/USAGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/commands/runner') diff --git a/railties/lib/rails/commands/runner/USAGE b/railties/lib/rails/commands/runner/USAGE index dc47a35ff3..b2a6e8493d 100644 --- a/railties/lib/rails/commands/runner/USAGE +++ b/railties/lib/rails/commands/runner/USAGE @@ -8,7 +8,7 @@ Run the Ruby file located at `path/to/filename.rb` after loading the app: <%= executable %> path/to/filename.rb -<% if RbConfig::CONFIG['host_os'] !~ /mswin|mingw/ %> +<% unless Gem.win_platform? %> You can also use the runner command as a shebang line for your executables: #!/usr/bin/env <%= File.expand_path(executable) %> -- cgit v1.2.3