Skip to content

Commit

Permalink
proper implentation
Browse files Browse the repository at this point in the history
  • Loading branch information
monkstone committed Sep 13, 2017
1 parent b443c4b commit e0b890e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/jruby_art/native_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
class NativeFolder
attr_reader :os, :bit

WIN_FORMAT = 'windows%d'
LINUX_FORMAT = 'linux%d'
WIN_FORMAT = 'windows%d'.freeze
LINUX_FORMAT = 'linux%d'.freeze
WIN_PATTERNS = [
/bccwin/i,
/cygwin/i,
Expand All @@ -22,13 +22,13 @@ def initialize

def name
return 'macosx' if os =~ /darwin/ || os =~ /mac/
return format(WIN_FORMAT, bit) if WIN_PATTERNS.any? os
return format(WIN_FORMAT, bit) if WIN_PATTERNS.any? { |pat| pat =~ os }
return format(LINUX_FORMAT, bit) if os =~ /linux/
end

def extension
return '*.so' if os =~ /linux/
return '*.dll' if WIN_PATTERNS.any? os
return '*.dll' if WIN_PATTERNS.any? { |pat| pat =~ os }
'*.dylib' # MacOS
end
end

0 comments on commit e0b890e

Please sign in to comment.