nxt_ruby.c (1337:2200adad4885) nxt_ruby.c (1488:6976d36be926)
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

--- 14 unchanged lines hidden (view full) ---

23
24typedef struct {
25 nxt_task_t *task;
26 nxt_str_t *script;
27 VALUE builder;
28} nxt_ruby_rack_init_t;
29
30
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

--- 14 unchanged lines hidden (view full) ---

23
24typedef struct {
25 nxt_task_t *task;
26 nxt_str_t *script;
27 VALUE builder;
28} nxt_ruby_rack_init_t;
29
30
31static nxt_int_t nxt_ruby_init(nxt_task_t *task, nxt_common_app_conf_t *conf);
31static nxt_int_t nxt_ruby_start(nxt_task_t *task,
32 nxt_process_data_t *data);
32static VALUE nxt_ruby_init_basic(VALUE arg);
33static nxt_int_t nxt_ruby_init_io(nxt_task_t *task);
34static VALUE nxt_ruby_rack_init(nxt_ruby_rack_init_t *rack_init);
35
36static VALUE nxt_ruby_require_rubygems(VALUE arg);
37static VALUE nxt_ruby_bundler_setup(VALUE arg);
38static VALUE nxt_ruby_require_rack(VALUE arg);
39static VALUE nxt_ruby_rack_parse_script(VALUE ctx);

--- 33 unchanged lines hidden (view full) ---

73static nxt_ruby_run_ctx_t nxt_ruby_run_ctx;
74
75NXT_EXPORT nxt_app_module_t nxt_app_module = {
76 sizeof(compat),
77 compat,
78 nxt_string("ruby"),
79 ruby_version,
80 NULL,
33static VALUE nxt_ruby_init_basic(VALUE arg);
34static nxt_int_t nxt_ruby_init_io(nxt_task_t *task);
35static VALUE nxt_ruby_rack_init(nxt_ruby_rack_init_t *rack_init);
36
37static VALUE nxt_ruby_require_rubygems(VALUE arg);
38static VALUE nxt_ruby_bundler_setup(VALUE arg);
39static VALUE nxt_ruby_require_rack(VALUE arg);
40static VALUE nxt_ruby_rack_parse_script(VALUE ctx);

--- 33 unchanged lines hidden (view full) ---

74static nxt_ruby_run_ctx_t nxt_ruby_run_ctx;
75
76NXT_EXPORT nxt_app_module_t nxt_app_module = {
77 sizeof(compat),
78 compat,
79 nxt_string("ruby"),
80 ruby_version,
81 NULL,
81 nxt_ruby_init,
82 nxt_ruby_start,
82};
83
84
85static nxt_int_t
83};
84
85
86static nxt_int_t
86nxt_ruby_init(nxt_task_t *task, nxt_common_app_conf_t *conf)
87nxt_ruby_start(nxt_task_t *task, nxt_process_data_t *data)
87{
88{
88 int state, rc;
89 VALUE res;
90 nxt_unit_ctx_t *unit_ctx;
91 nxt_unit_init_t ruby_unit_init;
92 nxt_ruby_rack_init_t rack_init;
89 int state, rc;
90 VALUE res;
91 nxt_unit_ctx_t *unit_ctx;
92 nxt_unit_init_t ruby_unit_init;
93 nxt_ruby_rack_init_t rack_init;
94 nxt_common_app_conf_t *conf;
93
94 static char *argv[2] = { (char *) "NGINX_Unit", (char *) "-e0" };
95
95
96 static char *argv[2] = { (char *) "NGINX_Unit", (char *) "-e0" };
97
98 conf = data->app;
99
96 RUBY_INIT_STACK
97 ruby_init();
98 ruby_options(2, argv);
99 ruby_script("NGINX_Unit");
100
101 rack_init.task = task;
102 rack_init.script = &conf->u.ruby.script;
103

--- 794 unchanged lines hidden ---
100 RUBY_INIT_STACK
101 ruby_init();
102 ruby_options(2, argv);
103 ruby_script("NGINX_Unit");
104
105 rack_init.task = task;
106 rack_init.script = &conf->u.ruby.script;
107

--- 794 unchanged lines hidden ---