summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorksss <co000ri@gmail.com>2016-01-21 11:22:52 +0900
committerksss <co000ri@gmail.com>2016-01-21 11:22:52 +0900
commit6839f4249552370dd3c0057f942879e89dd971a6 (patch)
tree636bec619fdd174a616ea95c5ac041817a2b5c9d
parent6d107564a3d46a4f0413ff7e3812ae5e2a95f81d (diff)
downloadffi-6839f4249552370dd3c0057f942879e89dd971a6.tar.gz
Support ruby 2.1.8
-rw-r--r--lib/ffi/struct.rb2
-rw-r--r--spec/ffi/struct_spec.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/ffi/struct.rb b/lib/ffi/struct.rb
index 89231ba..0896d35 100644
--- a/lib/ffi/struct.rb
+++ b/lib/ffi/struct.rb
@@ -341,7 +341,7 @@ module FFI
# @raise if Ruby 1.8
# Add hash +spec+ to +builder+.
def hash_layout(builder, spec)
- raise "Ruby version not supported" if RUBY_VERSION =~ /1\.8\.*/
+ raise "Ruby version not supported" if RUBY_VERSION =~ /^1\.8\..*/
spec[0].each do |name, type|
builder.add name, find_field_type(type), nil
end
diff --git a/spec/ffi/struct_spec.rb b/spec/ffi/struct_spec.rb
index 1728758..9110d92 100644
--- a/spec/ffi/struct_spec.rb
+++ b/spec/ffi/struct_spec.rb
@@ -7,7 +7,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
describe "Struct aligns fields correctly" do
it "char, followed by an int" do
- pending("not supported in 1.8") if RUBY_VERSION =~ /1.8.*/
+ pending("not supported in 1.8") if RUBY_VERSION =~ /^1\.8\..*/
class CIStruct < FFI::Struct
layout :c => :char, :i => :int
end
@@ -15,7 +15,7 @@ describe "Struct aligns fields correctly" do
end
it "short, followed by an int" do
- pending("not supported in 1.8") if RUBY_VERSION =~ /1.8.*/
+ pending("not supported in 1.8") if RUBY_VERSION =~ /^1\.8\..*/
class SIStruct < FFI::Struct
layout :s => :short, :i => :int
end
@@ -23,7 +23,7 @@ describe "Struct aligns fields correctly" do
end
it "int, followed by an int" do
- pending("not supported in 1.8") if RUBY_VERSION =~ /1.8.*/
+ pending("not supported in 1.8") if RUBY_VERSION =~ /^1\.8\..*/
class IIStruct < FFI::Struct
layout :i1 => :int, :i => :int
end
@@ -31,7 +31,7 @@ describe "Struct aligns fields correctly" do
end
it "long long, followed by an int" do
- pending("not supported in 1.8") if RUBY_VERSION =~ /1.8.*/
+ pending("not supported in 1.8") if RUBY_VERSION =~ /^1\.8\..*/
class LLIStruct < FFI::Struct
layout :l => :long_long, :i => :int
end