Skip to content

Commit

Permalink
check cpu architecture and OS for gnparser binary (close #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimus committed Oct 28, 2024
1 parent 7ea77a1 commit 5bb9a32
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 3 deletions.
Binary file added ext/gnparser-arm-linux
Binary file not shown.
Binary file renamed ext/gnparser-linux → ext/gnparser-arm-mac
Binary file not shown.
Binary file renamed ext/gnparser-win.exe → ext/gnparser-x86-linux
Binary file not shown.
Binary file added ext/gnparser-x86-mac
Binary file not shown.
Binary file renamed ext/gnparser-mac → ext/gnparser-x86-win.exe
Binary file not shown.
14 changes: 13 additions & 1 deletion lib/biodiversity/parser/gnparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,20 @@ def start_gnparser
else
raise "Unsupported platform: #{Gem.platforms[1].os}"
end

target_cpu = RbConfig::CONFIG['target_cpu']
cpu_arch =
case target_cpu
when /x86/
'x86'
when /arch|arm/
'arm'
else
raise "Unsupported CPU Architecture: #{target_cpu}"
end

path = File.join(__dir__, '..', '..', '..',
'ext', "gnparser-#{platform_suffix}")
'ext', "gnparser-#{cpu_arch}-#{platform_suffix}")

@stdin, @stdout = Open3.popen2(
"#{path} --format #{format} --details --quiet --stream --jobs 1 #{@extra_settings}"
Expand Down
4 changes: 2 additions & 2 deletions lib/biodiversity/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# Biodiversity module provides a namespace for scientific name parser.
module Biodiversity
VERSION = '6.0.0'
GNPARSER_VERSION = 'GNparser 1.10.1'
VERSION = '6.0.1'
GNPARSER_VERSION = 'GNparser 1.10.3'

def self.version
VERSION
Expand Down

0 comments on commit 5bb9a32

Please sign in to comment.