nokolexbor 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23409daec8c9cbe801afef6c39e6507fc938eb35cad2458ef80fc99e6bf5bece
4
- data.tar.gz: 06e83318711ac6e6c2582d78fcd87f5a0efeaceff7421a1880cd8e698637d803
3
+ metadata.gz: 29411076a95eae20060101aa8a270bfe53a48eda3b6e58cfad6ebe22b184049c
4
+ data.tar.gz: 920536ad4f69a635cfec9a6dea4d8bbe746c7c97d74c1b1daa6b22c41856d201
5
5
  SHA512:
6
- metadata.gz: d77bb45c508edba84043156149ff1dfce0249b7f4d52d871c0552b4f590c01e0879c77b0bf039a46ee019be4e445b072a658fbb9fc3872c8b1d6f48e4801b0dd
7
- data.tar.gz: 8ec494323f66188fbd39455c05a63e6be0fa5f8979fcb43310dc80a429a3d77355b8875988fa800041a04f1746254b0d88d9522780c085469efe18308a3d4576
6
+ metadata.gz: d6ca49aa873ee254caf034600fbbb9384a2a4efaa86422e992a7fbb7970107af20541c4309e582c6f8863353209d36cd6e5d56fdb19b52fd54a233a4419202ea
7
+ data.tar.gz: f4c9413c2cd8683e6cf111d1c966a8511d4d605ec30008f595d2c05b402b028dc8f889c9480d3ff43b0f380e84861b2384c915f9f9cca68b6ad8f510a58a0b0a
@@ -5,6 +5,10 @@ if ENV["CC"]
5
5
  RbConfig::CONFIG["CC"] = RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"]
6
6
  end
7
7
 
8
+ def windows?
9
+ RbConfig::CONFIG["target_os"].match?(/mingw|mswin/)
10
+ end
11
+
8
12
  # From: https://stackoverflow.com/questions/2108727
9
13
  # Cross-platform way of finding an executable in the $PATH.
10
14
  #
@@ -23,9 +27,9 @@ end
23
27
  cmake_flags = [ ENV["CMAKE_FLAGS"] ]
24
28
  cmake_flags << "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
25
29
  # Set system name explicitly when cross-compiling
26
- cmake_flags << "-DCMAKE_SYSTEM_NAME=Windows -DWIN32=1" if Gem.win_platform?
30
+ cmake_flags << "-DCMAKE_SYSTEM_NAME=Windows -DWIN32=1" if windows?
27
31
  # On Windows, Ruby-DevKit is MSYS-based, so ensure to use MSYS Makefiles.
28
- cmake_flags << "-G \"MSYS Makefiles\"" if Gem.win_platform? && !ENV['NOKOLEXBOR_CROSS_COMPILE']
32
+ cmake_flags << "-G \"MSYS Makefiles\"" if windows? && !ENV['NOKOLEXBOR_CROSS_COMPILE']
29
33
 
30
34
  if ENV['NOKOLEXBOR_CROSS_COMPILE']
31
35
  # use the same toolchain for cross-compiling lexbor
@@ -74,7 +78,7 @@ end
74
78
 
75
79
  def self.run_cmake(timeout, args)
76
80
  # Set to process group so we can kill it and its children
77
- pgroup = (Gem.win_platform? && !ENV['NOKOLEXBOR_CROSS_COMPILE']) ? :new_pgroup : :pgroup
81
+ pgroup = (windows? && !ENV['NOKOLEXBOR_CROSS_COMPILE']) ? :new_pgroup : :pgroup
78
82
  pid = Process.spawn("cmake #{args}", pgroup => true)
79
83
 
80
84
  Timeout.timeout(timeout) do
@@ -104,7 +108,7 @@ def apply_patch(patch_file, chdir)
104
108
  end
105
109
 
106
110
 
107
- MAKE = if Gem.win_platform?
111
+ MAKE = if windows?
108
112
  # On Windows, Ruby-DevKit only has 'make'.
109
113
  find_executable('make')
110
114
  else
@@ -143,7 +147,7 @@ Dir.chdir(EXT_DIR) do
143
147
  Dir.mkdir("build") if !Dir.exist?("build")
144
148
 
145
149
  Dir.chdir("build") do
146
- run_cmake(10 * 60, ".. #{cmake_flags.join(' ')} #{Gem.win_platform? ? "-DLIBXML2_WITH_THREADS=OFF" : ""}")
150
+ run_cmake(10 * 60, ".. #{cmake_flags.join(' ')} #{windows? ? "-DLIBXML2_WITH_THREADS=OFF" : ""}")
147
151
  end
148
152
  end
149
153
 
@@ -383,7 +383,6 @@ nl_node_find(VALUE self, VALUE selector, lxb_selectors_cb_f cb, void *ctx)
383
383
  }
384
384
 
385
385
  /* Parse and get the log. */
386
- // TODO: Cache the list for reuse, improves performance
387
386
  list = lxb_css_selectors_parse_relative_list(parser, (const lxb_char_t *)selector_c, selector_len);
388
387
  if (parser->status != LXB_STATUS_OK) {
389
388
  status = parser->status;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nokolexbor
4
- VERSION = '0.3.5'
4
+ VERSION = '0.3.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokolexbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yicheng Zhou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-25 00:00:00.000000000 Z
11
+ date: 2023-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler