Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions lib/locale/driver/win32.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,35 @@
require "locale/driver/env"
require "locale/driver/win32_table"

require "dl/import"
if RUBY_VERSION < "2.1"
require "dl/import"
else
require 'fiddle'
require 'fiddle/import'

# For now map DL to Fiddler versus updating all the code below
# net-ssh did it first
module DL
CPtr ||= Fiddle::Pointer
if RUBY_PLATFORM != "java"
RUBY_FREE ||= Fiddle::RUBY_FREE
end
end
end

module Locale
# Locale::Driver::Win32 module for win32.
# Detect the user locales and the charset.
# This is a low-level class. Application shouldn't use this directly.
module Driver
module Win32

module Kernel32
extend DL::Importer
if RUBY_VERSION < "2.1"
extend DL::Importer
else
extend Fiddle::Importer
end
dlload "kernel32.dll"
extern "int GetThreadLocale()"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/locale/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
license terms as Ruby.
=end
module Locale
VERSION = "2.0.9"
VERSION = "2.0.10"
end

2 changes: 2 additions & 0 deletions locale.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Ruby-Locale is the pure ruby library which provides basic APIs for localization.
s.test_files = Dir.glob("test/test_*.rb")
end

s.required_ruby_version = "< 2.3.0"

s.add_development_dependency("rake")
s.add_development_dependency("bundler")
s.add_development_dependency("yard")
Expand Down