ffi-geos 0.0.1.beta3 → 0.0.1

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.
@@ -1,5 +1,5 @@
1
1
 
2
- = GEOS Ruby Bindings in FFI
2
+ = GEOS Ruby Bindings via FFI
3
3
 
4
4
  == Requirements
5
5
 
@@ -12,8 +12,12 @@ Ruby versions known to work:
12
12
  * Ruby MRI 1.8.7 and 1.9.2, x86_64, OSX 10.6.5+
13
13
  * Ruby MRI 1.8.7 and 1.9.2, i386, linux
14
14
  * Ruby MRI 1.8.7, x86_64, linux
15
- * JRuby 1.5 and 1.6 using JRE 1.6.0_22, x86_64, OSX 10.6.5+
16
- * JRuby 1.5 and 1.6 using JRE 1.6.0_18, i386, linux
15
+
16
+ Note that versions of JRuby prior to the as-of-yet (25 June 2011) unreleased
17
+ version 1.6.3 have problems in their ffi implementation when dealing with
18
+ AutoPointers that can lead to segfaults during garbage collection. Upcoming
19
+ versions of JRuby should have the problem licked. For details, check out
20
+ http://jira.codehaus.org/browse/JRUBY-5813.
17
21
 
18
22
  == Features
19
23
 
@@ -135,3 +139,11 @@ Ruby bindings along with the following enhancements and additions:
135
139
  === Geos::Utils
136
140
 
137
141
  * Geos::Utils.orientation_index
142
+
143
+ == Thanks
144
+
145
+ * Thanks to Daniel Azuma for the testing and JRuby help.
146
+
147
+ * Christopher Meiklejohn for the bug reporting and PreparedGeometry fix.
148
+
149
+ * Wayne Meissner for some help with some ffi issues.
data/Rakefile CHANGED
@@ -2,9 +2,9 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'rubygems'
5
- require 'rake/gempackagetask'
5
+ require 'rubygems/package_task'
6
6
  require 'rake/testtask'
7
- require 'rake/rdoctask'
7
+ require 'rdoc/task'
8
8
 
9
9
  $:.push 'lib'
10
10
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1.beta3
1
+ 0.0.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ffi-geos}
8
- s.version = "0.0.1.beta3"
8
+ s.version = "0.0.1"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["J Smith"]
12
- s.date = %q{2011-05-20}
12
+ s.date = %q{2011-06-25}
13
13
  s.description = %q{An ffi wrapper for GEOS, a C++ port of the Java Topology Suite (JTS).}
14
14
  s.email = %q{dark.panda@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -466,7 +466,7 @@ module Geos
466
466
  end
467
467
 
468
468
  def to_prepared
469
- Geos::PreparedGeometry.new(FFIGeos.GEOSPrepare_r(Geos.current_handle, self.ptr))
469
+ Geos::PreparedGeometry.new(self)
470
470
  end
471
471
 
472
472
  def to_s
@@ -3,15 +3,18 @@ module Geos
3
3
  class PreparedGeometry
4
4
  include Geos::Tools
5
5
 
6
- attr_reader :ptr
6
+ attr_reader :ptr, :geometry
7
7
 
8
8
  undef :clone, :dup
9
9
 
10
- def initialize(ptr, auto_free = true)
10
+ def initialize(geom, auto_free = true)
11
+ check_geometry(geom)
12
+
11
13
  @ptr = FFI::AutoPointer.new(
12
- ptr,
14
+ FFIGeos.GEOSPrepare_r(Geos.current_handle, geom.ptr),
13
15
  auto_free ? self.class.method(:release) : self.class.method(:no_release)
14
16
  )
17
+ @geometry = geom
15
18
 
16
19
  if !auto_free
17
20
  @ptr.autorelease = false
@@ -82,5 +82,11 @@ if defined?(Geos::PreparedGeometry)
82
82
  read(POINT_A).to_prepared.dup
83
83
  end
84
84
  end
85
+
86
+ def test_initializer_type_exception
87
+ assert_raise(TypeError) do
88
+ Geos::PreparedGeometry.new('hello world')
89
+ end
90
+ end
85
91
  end
86
92
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-geos
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196397
5
- prerelease: 6
4
+ hash: 29
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 1
10
- - beta
11
- - 3
12
- version: 0.0.1.beta3
10
+ version: 0.0.1
13
11
  platform: ruby
14
12
  authors:
15
13
  - J Smith
@@ -17,7 +15,7 @@ autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2011-05-20 00:00:00 Z
18
+ date: 2011-06-25 00:00:00 Z
21
19
  dependencies: []
22
20
 
23
21
  description: An ffi wrapper for GEOS, a C++ port of the Java Topology Suite (JTS).
@@ -86,14 +84,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
84
  required_rubygems_version: !ruby/object:Gem::Requirement
87
85
  none: false
88
86
  requirements:
89
- - - ">"
87
+ - - ">="
90
88
  - !ruby/object:Gem::Version
91
- hash: 25
89
+ hash: 3
92
90
  segments:
93
- - 1
94
- - 3
95
- - 1
96
- version: 1.3.1
91
+ - 0
92
+ version: "0"
97
93
  requirements: []
98
94
 
99
95
  rubyforge_project: