unit/docs
Zhidao HONG dc9f592d6e Ruby: added support for rack V3.
Ruby applications would fail to start if they were using rack v3

  2022/09/28 15:48:46 [alert] 0#80912 [unit] Ruby: Failed to parse rack script
  2022/09/28 15:48:46 [notice] 80911#80911 app process 80912 exited with code 1

This was due to a change in the rack API

Rack V2

  def self.load_file(path, opts = Server::Options.new)
    ...
    cfgfile.sub!(/^__END__\n.*\Z/m, '')
    app = new_from_string cfgfile, path

    return app, options
  end

Rack V3

  def self.load_file(path)
    ...

    return new_from_string(config, path)
  end

This patch handles _both_ the above APIs by correctly handling the cases
where we do and don't get an array returned from
nxt_ruby_rack_parse_script().

Closes: <https://github.com/nginx/unit/issues/755>
Tested-by: Andrew Clayton <a.clayton@nginx.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
[ Andrew: Patch by Zhidao, commit message by me with input from Zhidao ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2022-10-04 19:33:11 +01:00
..
man Added a missing .El directive in man page source. 2021-03-24 16:49:59 +00:00
change_log_conf.dtd Added changelogs generation tools. 2017-10-19 17:48:58 +03:00
change_log_conf.xml Added changelogs generation tools. 2017-10-19 17:48:58 +03:00
changes.dtd Added changelogs generation tools. 2017-10-19 17:48:58 +03:00
changes.xml Ruby: added support for rack V3. 2022-10-04 19:33:11 +01:00
changes.xsls Docs: special handling for empty "date" and "time" XML attributes. 2020-12-08 13:17:21 +03:00
changes.xslt Docs: special handling for empty "date" and "time" XML attributes. 2020-12-08 13:17:21 +03:00
Makefile Packages: added Ubuntu 21.04 "hirsute" support. 2021-05-27 13:12:52 +03:00
unitlogo.svg Updated the GitHub page banner. 2022-09-05 10:42:18 +01:00