libuv 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4c95c239b58b3429b67cfc328e7a2adefe488b0
4
- data.tar.gz: 236dcd09f67bf2a3363417c20faea0975a2663ba
3
+ metadata.gz: 14a437923d19e87327fe1bdfd95c3a1d06df76db
4
+ data.tar.gz: 6e4376bcc668ec20234d0c02cca5b6f1b31c218f
5
5
  SHA512:
6
- metadata.gz: 446d248cfd4fc340a4ef1f16da7c1bf46f3f5100af439108cc35813ce0e4e16ae39deda00106a3d7d47b05c8ec239f41a98ce390096c972b29ce894b44fb37a7
7
- data.tar.gz: 744f091cf46e94c5213150e3ec6e4d51465a6760be368ec26b86a80071d8fb7f18f8a289a69f2569044991b46ad826b6d745666c8b776879c082e2b4f499ece9
6
+ metadata.gz: 332ce9963f872229ef383807fd6376e1101d854bd934d313d908811b93c3723e3f8af703ff39b81734029c3811d7877652ca80a3a89a77bb83f84b96a9187ba1
7
+ data.tar.gz: 9984c187e9017144b7f93dc68945fe2d94ef92eee46e23e863ef4545b96c25b47c003938235aeab61121e392fce0ffdc70924b5b02cac3ce3c521a5cf90dd6cb
@@ -8,6 +8,7 @@ libuv is currently managed by the following individuals:
8
8
  * **Bert Belder** ([@piscisaureus](https://github.com/piscisaureus))
9
9
  * **Colin Ihrig** ([@cjihrig](https://github.com/cjihrig))
10
10
  - GPG key: 94AE 3667 5C46 4D64 BAFA 68DD 7434 390B DBE9 B9C5 (pubkey-cjihrig)
11
+ - GPG key: 5735 3E0D BDAA A7E8 39B6 6A1A FF47 D5E4 AD8B 4FDC (pubkey-cjihrig-kb)
11
12
  * **Fedor Indutny** ([@indutny](https://github.com/indutny))
12
13
  - GPG key: AF2E EA41 EC34 47BF DD86 FED9 D706 3CCE 19B7 E890 (pubkey-indutny)
13
14
  * **Imran Iqbal** ([@iWuzHere](https://github.com/iWuzHere))
@@ -57,9 +57,6 @@
57
57
 
58
58
  #define MAX_INPUT_BUFFER_LENGTH 8192
59
59
 
60
- #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
61
- #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
62
- #endif
63
60
 
64
61
  static void uv_tty_capture_initial_style(CONSOLE_SCREEN_BUFFER_INFO* info);
65
62
  static void uv_tty_update_virtual_window(CONSOLE_SCREEN_BUFFER_INFO* info);
@@ -128,14 +125,6 @@ static char uv_tty_default_fg_bright = 0;
128
125
  static char uv_tty_default_bg_bright = 0;
129
126
  static char uv_tty_default_inverse = 0;
130
127
 
131
- typedef enum {
132
- UV_SUPPORTED,
133
- UV_UNCHECKED,
134
- UV_UNSUPPORTED
135
- } uv_vtermstate_t;
136
- /* Determine whether or not ANSI support is enabled. */
137
- static uv_vtermstate_t uv__vterm_state = UV_UNCHECKED;
138
- static void uv__determine_vterm_state(HANDLE handle);
139
128
 
140
129
  void uv_console_init() {
141
130
  if (uv_sem_init(&uv_tty_output_lock, 1))
@@ -179,9 +168,6 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) {
179
168
  /* shared between all uv_tty_t handles. */
180
169
  uv_sem_wait(&uv_tty_output_lock);
181
170
 
182
- if (uv__vterm_state == UV_UNCHECKED)
183
- uv__determine_vterm_state(handle);
184
-
185
171
  /* Store the global tty output handle. This handle is used by TTY read */
186
172
  /* streams to update the virtual window when a CONSOLE_BUFFER_SIZE_EVENT */
187
173
  /* is received. */
@@ -1650,33 +1636,6 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
1650
1636
  uv_buf_t buf = bufs[i];
1651
1637
  unsigned int j;
1652
1638
 
1653
- if (uv__vterm_state == UV_SUPPORTED) {
1654
- utf16_buf_used = MultiByteToWideChar(CP_UTF8,
1655
- 0,
1656
- buf.base,
1657
- buf.len,
1658
- NULL,
1659
- 0);
1660
-
1661
- if (utf16_buf_used == 0) {
1662
- *error = GetLastError();
1663
- break;
1664
- }
1665
-
1666
- if (!MultiByteToWideChar(CP_UTF8,
1667
- 0,
1668
- buf.base,
1669
- buf.len,
1670
- utf16_buf,
1671
- utf16_buf_used)) {
1672
- *error = GetLastError();
1673
- break;
1674
- }
1675
-
1676
- FLUSH_TEXT();
1677
- continue;
1678
- }
1679
-
1680
1639
  for (j = 0; j < buf.len; j++) {
1681
1640
  unsigned char c = buf.base[j];
1682
1641
 
@@ -2234,24 +2193,3 @@ int uv_tty_reset_mode(void) {
2234
2193
  /* Not necessary to do anything. */
2235
2194
  return 0;
2236
2195
  }
2237
-
2238
- /* Determine whether or not this version of windows supports
2239
- * proper ANSI color codes. Should be supported as of windows
2240
- * 10 version 1511, build number 10.0.10586.
2241
- */
2242
- static void uv__determine_vterm_state(HANDLE handle) {
2243
- DWORD dwMode = 0;
2244
-
2245
- if (!GetConsoleMode(handle, &dwMode)) {
2246
- uv__vterm_state = UV_UNSUPPORTED;
2247
- return;
2248
- }
2249
-
2250
- dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
2251
- if (!SetConsoleMode(handle, dwMode)) {
2252
- uv__vterm_state = UV_UNSUPPORTED;
2253
- return;
2254
- }
2255
-
2256
- uv__vterm_state = UV_SUPPORTED;
2257
- }
data/lib/libuv/reactor.rb CHANGED
@@ -308,6 +308,15 @@ module Libuv
308
308
  e
309
309
  end
310
310
 
311
+ def sleep(msecs)
312
+ fiber = Fiber.current
313
+ time = timer {
314
+ time.close
315
+ fiber.resume
316
+ }.start(msecs)
317
+ Fiber.yield
318
+ end
319
+
311
320
  # Get a new TCP instance
312
321
  #
313
322
  # @return [::Libuv::TCP]
data/lib/libuv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Libuv
4
- VERSION = '3.1.0'
4
+ VERSION = '3.1.1'
5
5
  end
@@ -105,6 +105,18 @@ if RUBY_PLATFORM != 'java'
105
105
  expect(@log).to eq(['in timer', 'after timer'])
106
106
  expect(@general_failure).to eq([])
107
107
  end
108
+
109
+ it "should provide a sleep function that doesn't block the reactor" do
110
+ @reactor.run { |reactor|
111
+ @log << 'before sleep'
112
+ reactor.sleep 200
113
+ @log << 'after sleep'
114
+ @timeout.close
115
+ }
116
+
117
+ expect(@log).to eq(['before sleep', 'after sleep'])
118
+ expect(@general_failure).to eq([])
119
+ end
108
120
  end
109
121
  end
110
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libuv
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-14 00:00:00.000000000 Z
11
+ date: 2016-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi