yamlscript 0.2.25 → 0.2.26

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
  SHA256:
3
- metadata.gz: 8a9181d76a6e913d293c669046b1062f94bdf2c9d76b53dbc8f85d88f09e4dec
4
- data.tar.gz: 766ab61fcada93ef0dbc21b5e648885799c04d71489a7dc3ea38858a0b64a7d6
3
+ metadata.gz: '0368fa633ed6d9e28583a2c3aa7c9c999d4fd7216d21fb59b50470ca4c5e9c68'
4
+ data.tar.gz: 85212dd0822e4546996287ea0464ab34ed8e15629ed1e77b965d67be984670eb
5
5
  SHA512:
6
- metadata.gz: 4f8438753aecd53bf8a5794bdbf4bdc059eaaa3fbb025ed21295cba2d74a570d1038986c8a0adb2578ffc7c14c8d35904b63c0f15e42b44f8cbbdf1e3551bbfe
7
- data.tar.gz: bffd6527ec3e502e025120b781496d561f1dff579bc548895d575ecc3b66651656f4ea91912ac3ea890d4bcfe4fbfffd652c4daffce2996c58fb2804565e8c15
6
+ metadata.gz: a552d4c845d43335da7e3a6d00b2579d67dd6da47889a08ef97f6769d12f5ce20b8510522bd53f789f9a4666dc15a91d28cefa9dd94006db54b5bf60e83de676
7
+ data.tar.gz: d609b27b8824bafc5715e134dd03590b05e37850739101b62f96d2bfb7183cce57eae93347bf67d28fff55fd2d6fa781cc399e1ff240aaf196e74eb85b244be2
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.2.26] - 2026-07-04
2
+
3
+ - libys 0.2.26
4
+
1
5
  ## [0.2.25] - 2026-07-04
2
6
 
3
7
  - libys 0.2.25
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class YAMLScript
4
- VERSION = "0.2.25"
4
+ VERSION = "0.2.26"
5
5
  end
data/lib/yamlscript.rb CHANGED
@@ -16,36 +16,49 @@ class YAMLScript
16
16
  # This value is automatically updated by 'make bump'.
17
17
  # The version number is used to find the correct shared library file.
18
18
  # We currently only support binding to an exact version of libys.
19
- YAMLSCRIPT_VERSION = '0.2.25'
19
+ YAMLSCRIPT_VERSION = '0.2.26'
20
20
 
21
21
  # A low-level interface to the native library
22
22
  module LibYS
23
23
  extend Fiddle::Importer
24
24
 
25
+ def self.windows?
26
+ RUBY_PLATFORM.match?(/mingw|mswin/)
27
+ end
28
+
25
29
  def self.extension
26
30
  case RUBY_PLATFORM
27
31
  when /darwin/
28
32
  'dylib'
29
33
  when /linux/
30
34
  'so'
35
+ when /mingw|mswin/
36
+ 'dll'
31
37
  else
32
38
  raise Error, "Unsupported platform #{RUBY_PLATFORM} for yamlscript."
33
39
  end
34
40
  end
35
41
 
36
42
  def self.libys_name
43
+ return 'libys.dll' if windows?
44
+
37
45
  "libys.#{extension}.#{YAMLSCRIPT_VERSION}"
38
46
  end
39
47
 
40
48
  # Returns an array of library paths extracted from the LD_LIBRARY_PATH
41
- # environment variable.
49
+ # environment variable (PATH on Windows).
42
50
  # If the environment variable is not set will return an array with
43
51
  # `/usr/local/lib` only.
44
52
  def self.ld_library_paths
45
- env_value = ENV.fetch('LD_LIBRARY_PATH', '')
46
- paths = env_value.split(':')
47
- paths << '/usr/local/lib'
48
- paths << ENV.fetch('HOME', '') + '/.local/lib'
53
+ if windows?
54
+ paths = ENV.fetch('PATH', '').split(File::PATH_SEPARATOR)
55
+ home = ENV.fetch('USERPROFILE', ENV.fetch('HOME', ''))
56
+ else
57
+ paths = ENV.fetch('LD_LIBRARY_PATH', '').split(':')
58
+ paths << '/usr/local/lib'
59
+ home = ENV.fetch('HOME', '')
60
+ end
61
+ paths << home + '/.local/lib'
49
62
  end
50
63
 
51
64
  # Find the libys shared library file path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamlscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.25
4
+ version: 0.2.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ingy döt Net