iodine 0.7.39 → 0.7.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,6 @@
8
8
  #include <fio.h>
9
9
 
10
10
  static ID call_func_id;
11
- static ID to_s_func_id;
12
11
  static VALUE filename_id;
13
12
  static VALUE data_id;
14
13
  static VALUE template_id;
@@ -169,7 +168,7 @@ static int mustache_on_arg(mustache_section_s *section, const char *name,
169
168
  if (rb_respond_to(o, call_func_id))
170
169
  o = IodineCaller.call(o, call_func_id);
171
170
  if (!RB_TYPE_P(o, T_STRING))
172
- o = IodineCaller.call(o, to_s_func_id);
171
+ o = IodineCaller.call(o, iodine_to_s_id);
173
172
  }
174
173
  if (!RB_TYPE_P(o, T_STRING) || !RSTRING_LEN(o))
175
174
  return 0;
@@ -220,7 +219,7 @@ static int32_t mustache_on_section_test(mustache_section_s *section,
220
219
  }
221
220
  o = IodineCaller.call2(o, call_func_id, 1, &str);
222
221
  if (!RB_TYPE_P(o, T_STRING))
223
- o = rb_funcall2(o, to_s_func_id, 0, NULL);
222
+ o = rb_funcall2(o, iodine_to_s_id, 0, NULL);
224
223
  if (RB_TYPE_P(o, T_STRING) && RSTRING_LEN(o))
225
224
  mustache_write_text(section, RSTRING_PTR(o), RSTRING_LEN(o), 0);
226
225
  return 0;
@@ -553,7 +552,6 @@ Initialize Iodine::Mustache
553
552
 
554
553
  void iodine_init_mustache(void) {
555
554
  call_func_id = rb_intern2("call", 4);
556
- to_s_func_id = rb_intern2("to_s", 4);
557
555
  filename_id = rb_id2sym(rb_intern2("filename", 8));
558
556
  data_id = rb_id2sym(rb_intern2("data", 4));
559
557
  template_id = rb_id2sym(rb_intern2("template", 8));
@@ -208,22 +208,8 @@ static VALUE iodine_tls_alpn(VALUE self, VALUE protocol_name) {
208
208
  }
209
209
 
210
210
  /**
211
- Loads the mustache template found in `:filename`. If `:template` is provided
212
- it will be used instead of reading the file's content.
213
-
214
- Iodine::Mustache.new(filename, template = nil)
215
-
216
- When template data is provided, filename (if any) will only be used for
217
- partial template path resolution and the template data will be used for the
218
- template's content. This allows, for example, for front matter to be extracted
219
- before parsing the template.
220
-
221
- Once a template was loaded, it could be rendered using {render}.
222
-
223
- Accepts named arguments as well:
224
-
225
- Iodine::Mustache.new(filename: "foo.mustache", template: "{{ bar }}")
226
-
211
+ Creates a new {Iodine::TLS} object and calles the {#use_certificate} method with
212
+ the supplied arguments.
227
213
  */
228
214
  static VALUE iodine_tls_new(int argc, VALUE *argv, VALUE self) {
229
215
  if (argc) {
data/lib/iodine.rb CHANGED
@@ -178,7 +178,7 @@ Iodine.on_state(:after_fork) do
178
178
  end
179
179
 
180
180
  ### Parse CLI for default HTTP settings
181
- Iodine::Base::CLI.parse
181
+ Iodine::Base::CLI.parse if defined?(IODINE_PARSE_CLI) && IODINE_PARSE_CLI
182
182
 
183
183
  ### Set default port (if missing)
184
184
  Iodine::DEFAULT_SETTINGS[:port] ||= (ENV["PORT"] || "3000")
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '0.7.39'.freeze
2
+ VERSION = '0.7.44'.freeze
3
3
  end
@@ -14,6 +14,12 @@ module Iodine
14
14
 
15
15
  true
16
16
  end
17
+
18
+ # patches an assumption by Rack, issue #98 code donated by @Shelvak (Néstor Coppi)
19
+ def self.shutdown
20
+ Iodine.stop
21
+ end
22
+
17
23
  IODINE_RACK_LOADED = true
18
24
  end
19
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iodine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.39
4
+ version: 0.7.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-18 00:00:00.000000000 Z
11
+ date: 2021-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -142,6 +142,7 @@ files:
142
142
  - bin/poc/config.ru
143
143
  - bin/poc/gemfile
144
144
  - bin/poc/www/index.html
145
+ - examples/async_task.ru
145
146
  - examples/config.ru
146
147
  - examples/echo.ru
147
148
  - examples/hello.ru
@@ -243,7 +244,7 @@ licenses:
243
244
  metadata:
244
245
  allowed_push_host: https://rubygems.org
245
246
  post_install_message: |-
246
- Thank you for installing Iodine 0.7.39.
247
+ Thank you for installing Iodine 0.7.44.
247
248
  Remember: if iodine supports your business, it's only fair to give value back (code contributions / donations).
248
249
  rdoc_options: []
249
250
  require_paths:
@@ -265,8 +266,8 @@ requirements:
265
266
  - Ruby >= 2.3.8 (Ruby EOL).
266
267
  - Ruby >= 2.5.0 recommended.
267
268
  - TLS requires OpenSSL >= 1.1.0
268
- rubygems_version: 3.1.2
269
- signing_key:
269
+ rubygems_version: 3.2.3
270
+ signing_key:
270
271
  specification_version: 4
271
272
  summary: iodine - a fast HTTP / Websocket Server with Pub/Sub support, optimized for
272
273
  Ruby MRI on Linux / BSD