proj4rb 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/ChangeLog +46 -0
  3. data/Gemfile +4 -0
  4. data/README.rdoc +158 -148
  5. data/Rakefile +26 -41
  6. data/lib/area.rb +32 -0
  7. data/lib/config.rb +70 -0
  8. data/lib/context.rb +103 -0
  9. data/lib/coordinate.rb +197 -0
  10. data/lib/crs.rb +206 -0
  11. data/lib/ellipsoid.rb +42 -0
  12. data/lib/error.rb +18 -0
  13. data/lib/operation.rb +43 -0
  14. data/lib/pj_object.rb +82 -0
  15. data/lib/point.rb +72 -0
  16. data/lib/prime_meridian.rb +40 -0
  17. data/lib/proj.rb +31 -0
  18. data/lib/proj4.rb +3 -469
  19. data/lib/projection.rb +207 -0
  20. data/lib/transformation.rb +61 -0
  21. data/lib/unit.rb +54 -0
  22. data/proj4rb.gemspec +31 -0
  23. data/test/abstract_test.rb +7 -0
  24. data/test/context_test.rb +82 -0
  25. data/test/coordinate_test.rb +35 -0
  26. data/test/crs_test.rb +373 -0
  27. data/test/ellipsoid_test.rb +34 -0
  28. data/test/operation_test.rb +29 -0
  29. data/test/prime_meridians_test.rb +33 -0
  30. data/test/proj_test.rb +17 -0
  31. data/test/projection_test.rb +224 -0
  32. data/test/transformation_test.rb +68 -0
  33. data/test/unit_test.rb +47 -0
  34. metadata +82 -77
  35. data/data/GL27 +0 -22
  36. data/data/MD +0 -0
  37. data/data/TN +0 -0
  38. data/data/WI +0 -0
  39. data/data/WO +0 -0
  40. data/data/conus +0 -0
  41. data/data/epsg +0 -5443
  42. data/data/epsg-deprecated +0 -2
  43. data/data/esri +0 -5937
  44. data/data/esri.extra +0 -948
  45. data/data/hawaii +0 -0
  46. data/data/nad.lst +0 -142
  47. data/data/nad27 +0 -809
  48. data/data/nad83 +0 -744
  49. data/data/ntv1_can.dat +0 -0
  50. data/data/null +0 -0
  51. data/data/other.extra +0 -49
  52. data/data/proj_def.dat +0 -17
  53. data/data/prvi +0 -0
  54. data/data/stgeorge +0 -0
  55. data/data/stlrnc +0 -0
  56. data/data/stpaul +0 -0
  57. data/data/world +0 -212
  58. data/example/basic.rb +0 -18
  59. data/example/list-datums.rb +0 -17
  60. data/example/list-ellipsoids.rb +0 -17
  61. data/example/list-errors.rb +0 -11
  62. data/example/list-prime-meridians.rb +0 -17
  63. data/example/list-projection-types.rb +0 -17
  64. data/example/list-units.rb +0 -17
  65. data/example/version.rb +0 -8
  66. data/ext/Makefile +0 -238
  67. data/ext/extconf.rb +0 -16
  68. data/ext/mkmf.log +0 -103
  69. data/ext/out.log +0 -0
  70. data/ext/proj4_ruby-x64-mingw32.def +0 -2
  71. data/ext/proj4_ruby.so +0 -0
  72. data/ext/projrb.c +0 -566
  73. data/ext/projrb.o +0 -0
  74. data/ext/vc/proj4_ruby.sln +0 -19
  75. data/ext/vc/proj4_ruby.vcproj +0 -208
  76. data/test/test_constants.rb +0 -18
  77. data/test/test_create_projection.rb +0 -63
  78. data/test/test_datums.rb +0 -45
  79. data/test/test_ellipsoids.rb +0 -46
  80. data/test/test_errors.rb +0 -66
  81. data/test/test_init_projection.rb +0 -109
  82. data/test/test_prime_meridians.rb +0 -45
  83. data/test/test_projection_type.rb +0 -44
  84. data/test/test_simple_projection.rb +0 -58
  85. data/test/test_suite.rb +0 -14
  86. data/test/test_transform.rb +0 -115
  87. data/test/test_units.rb +0 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 99cd1a356cd839962a71f2c48333e7441cbec03d
4
- data.tar.gz: 65f2ba67386c2daea17fe2e22d5f8b50de1bb697
2
+ SHA256:
3
+ metadata.gz: bdd77e892a3126bb4c0b4c984356e9ba6a32e73811813c2d5dcc5a2eb36a02ae
4
+ data.tar.gz: 0217052b386be354cd4b48c5bc0536c179336c5c73026a3cb544e9630ad66810
5
5
  SHA512:
6
- metadata.gz: 334bc98a7beb383a5fe66435a258c72985859f8bbd0ac4cff59e106b6bcfc383b447d50c346f1a000adccee1460747b5513904a9e785c3f08dee23fe3d0b21cb
7
- data.tar.gz: f4e8df9f338f337bfb784bfb7388e22213ed29fe4d01e5d73478146032b1a36c5e5f8158bd1889f653b4964b351e1afef9f9267f663099f6385127db4949d0cd
6
+ metadata.gz: 9d0e577ede5260d24da9b474e10c52700f9179fe9a42e61728fba85f051be1b152af847c6c45c8df9ef9ad9f5b5ea71ca82ecbef977056b2361dfb2de3be7dac
7
+ data.tar.gz: 050366cf1ce478ee809a4d82af9a9ed0a9e54e3fd28d4fd58d4fac4b22c0ddbb431969a61581c8a5e3990525e567f2fb7f03b1f9a010b734867c67c9795f7369
@@ -0,0 +1,46 @@
1
+ 2.0.0 (December 30, 2019)
2
+ =========================
3
+ - Full rewrite to support API changes in Proj versions 5 and 6
4
+ - As part of rewrite switch bindings to use FFI versus a C extension
5
+ - Split Ruby code into multiple files based on classes
6
+ - Add in a bunch of new classes including Context, Crs, Coordinate, Ellipsoid, Prime Meridian and Transform
7
+ - Deprecate Projection and Point - these will stop working with Proj 7 since the use an older deprecated API
8
+
9
+ - Calling this 1.0.0 since its a very stable gem
10
+
11
+ 1.0.0 (December 14, 2014)
12
+ =========================
13
+ - Calling this 1.0.0 since its a very stable gem
14
+
15
+ 0.4.3 (August 30, 2011)
16
+ =========================
17
+ - Remove reference to now private projects.h header
18
+
19
+ 0.4.2 (August 15, 2011)
20
+ =========================
21
+ - Minor build tweak to support MSVC++
22
+
23
+ 0.4.1 (July 30, 2011)
24
+ =========================
25
+ - Search first for binaries when using windows gems
26
+ - Add # encoding to test files
27
+ - Reformat tests files to use standard ruby 2 space indenting
28
+
29
+ 0.4.0 (July 30, 2011)
30
+ =========================
31
+ - Update to compile on Ruby 1.9.* (Fabio Renzo Panettieri)
32
+ - Add in gemspec file (Charlie Savage)
33
+ - Add rake-compiler as development dependency, remove older MinGW build system (Charlie Savage)
34
+ - Move to GitHub (Charlie Savage)
35
+
36
+ 0.3.1 (December 23, 2009)
37
+ =========================
38
+ - Update extconf.conf file to be more flexible to make it easier to build
39
+ on OS X when using MacPorts
40
+ - Updated windows binary to link against proj4.7
41
+
42
+ 0.3.0 (August 14, 2008)
43
+ =========================
44
+ - Removed Proj4::UV class which was previously deprecated
45
+ - New build infrastructure for Windows (Charlie Savage)
46
+ - Fixed memory leaks in forward() and inverse() methods (Charlie Savage)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in tensorflow-ruby.gemspec
4
+ gemspec
@@ -1,160 +1,170 @@
1
1
  =Proj4rb
2
+ This gem provides Ruby bindings for the Proj Library (https://proj.org). The Proj Library supports converting coordinates
3
+ between a number of different coordinate systems and projections.
2
4
 
3
- This is a Ruby binding for the Proj.4 Carthographic Projection library
4
- (http://trac.osgeo.org/proj/), that supports conversions between a large
5
- number of geographic coordinate systems and datums.
5
+ == Installation
6
+ First install the gem in the usual manner:
6
7
 
7
- Most functions of the C library are exposed to Ruby. In cases where
8
- there is a direct equivalent between C and Ruby, identifiers (such as names of
9
- functions and constants) are the same. But the usage has been changed to
10
- take advantage of Ruby's object-oriented features.
8
+ gem install proj4rb
9
+
10
+ Next install the Proj Library. This of course varies per system, but you want to install the latest version Proj
11
+ possible. Once installed, you'll need to make sure that libproj is installed on your operating system's
12
+ load path.
13
+
14
+ == Usage
15
+ To get started first require the gem:
16
+
17
+ require 'proj'
18
+
19
+ If you are using the old Proj4 namespace, then you can do this:
11
20
 
12
- == Operations
13
- To load the library:
14
21
  require 'proj4'
15
22
 
16
- The classes are in the Proj4 module so you may wish to include it:
17
- include Proj4
18
-
19
- Next, you need to create a projection:
20
- proj = Projection.new( :proj => "utm", :zone => "21", :units => "m" )
21
-
22
- This defines a UTM21 North projection in WGS84. Note that the <tt>proj</tt> /
23
- <tt>proj.exe</tt> initialization arguments equivalent to the one above would
24
- be:
25
- +proj=utm +zone=21 +units=m
26
-
27
- Note there are several alternative ways of specifying the arguments, see
28
- the documentation for Proj4::Projection.new for details.
29
-
30
- Once you've created the projection, you can tranform coordinates using either
31
- the +forward+ or +inverse+ methods. +forward+ transforms the point in WGS84
32
- lon/lat (in radians) to the coordinate system defined during the creation
33
- of the Projection object. +inverse+ does the opposite. For example:
34
-
35
- projected_point = proj.forward(lonlat_point)
36
- lonlat_point = proj.inverse(projected_point)
37
-
38
- There is also a +transform+ function which can transform between any two
39
- projections including datum conversions:
40
-
41
- point_in_projB = projA.transform(projB, point_in_projA)
42
-
43
- The +forward+, +inverse+, and +transform+ methods all have an in-place
44
- equivalent: <tt>forward!</tt>, <tt>inverse!</tt>, and <tt>transform!</tt>
45
- which projects the given point in place. There are also +forwardDeg+
46
- and +inverseDeg+ methods which work with longitudes and latitudes in
47
- degrees rather than radians.
48
-
49
- For the points you can use an object of the Proj4::Point class. It has
50
- properties: +x+, +y+, and +z+, which can be set and retrieved. Aliases
51
- +lon+ and +lat+ for +x+ and +y+, respectively, are also available.
52
- (There used to be a UV class, but this has been removed in version 0.3.0.)
53
-
54
- Instead of using the Proj4::Point object, you may use another class as long
55
- as it responds to the methods +x+ and +y+ (and +z+ for 3D datum transformations
56
- with the +transform+ method).
57
-
58
- The methods +forward_all+, +inverse_all+, and +transform_all+ (and their
59
- in-place versions <tt>forward_all!</tt>, <tt>inverse_all!</tt>, and
60
- <tt>transform_all!</tt> work just like their simple counterparts, but
61
- instead of transforming a single point they transform a collection of points
62
- in a single call. They take an array as an argument or any object that responds
63
- to the +each+ method (for the in-place versions) or +each+, +clear+, and
64
- <tt><<</tt> methods (for the normal version).
65
-
66
- The library also defines two constants to make it easy to convert between
67
- degrees and radians:
68
- +DEG_TO_RAD+ and +RAD_TO_DEG+
69
-
70
- ==Error handling
71
- Projection initialization (Proj4::Projection.new) and transformation functions
72
- (Proj4::Projection#forward/inverse/transform) all throw exceptions when
73
- they encounter an error. This is done by mapping proj4's C error codes to
74
- Ruby specific exception classes. See Proj4::Error for more information or
75
- use the <tt>list-errors.rb</tt> program from the examples for a list.
76
-
77
- ==Definition lists
78
- Proj.4 supports many different datums, ellipsoids, prime meridians,
79
- projection types and length units. Use the Proj4::Datum, Proj4::Ellipsoid,
80
- Proj4::PrimeMeridian, Proj4::ProjectionType, and Proj4::Unit classes
81
- to access this information and get detailed information about each definition.
82
- See the <i>list-*</i> files in the <i>example</i> directory for code
83
- examples.
84
-
85
- Note that these lists rquire version 449 or later of the Proj.4 C library.
86
-
87
- ==Installation
88
- To install the gem simply type:
89
- gem install proj4rb
23
+ === Crs
24
+ If you are using Proj 6 create a coordinate system. To create a coordinate system, you can use CRS codes, well-known text (WKT) strings
25
+ or old-style Proj4 strings (which are deprecated).
90
26
 
91
- ==Compiling
92
- ===Linux
93
- To compile the proj4rb Ruby bindings from source you'll need the
94
- Proj.4 C library installed. Then simply call:
95
- rake build
96
-
97
- If there is a problem, you can perform this step manually:
98
- Enter the <i>ext</i> directory and create
99
- a Makefile:
100
- cd ext
101
- ruby extconf.rb
102
- If there are any problems consult the <i>mkmf.log</i> log file.
103
- Then compile with
104
- make
105
- The result is the file <i>proj4_ruby.so</i>.
106
-
107
- If you want to run the tests call
108
- rake test
109
-
110
- If you want to, you can now create a gem with
111
- rake gem
112
-
113
- This will create a file <tt>proj4rb-<i>version</i>-i486-linux.gem</tt>
114
- or similar in the <i>pkg</i> directory.
115
-
116
- ===Mac OS X
117
- To compile the proj4rb Ruby bindings from source you'll need the
118
- Proj.4 C library installed. Enter the <i>ext</i> directory and create
119
- a Makefile:
120
- cd ext
121
- ruby extconf.rb
122
- If there are any problems consult the <i>mkmf.log</i> log file.
123
- Then compile with
124
- make
125
- The result is the file <i>projrb.bundle</i> which you need to copy into
126
- the <i>lib</i> directory:
127
- cp projrb.bundle ../lib/
128
-
129
- If you want to, you can now create a gem with
130
- rake gem
131
-
132
- This will create a file <tt>proj4rb-<i>version</i>-universal-darwin8.0.gem</tt>
133
- or similar in the <i>pkg</i> directory.
134
-
135
- ===Windows
136
- To build the library on Windows requires a working installation of Visual
137
- Studio or MingW/msys. You of course also need to have proj4 installed.
138
-
139
- If you are using Visual Studio, you'll find a Visual Studio 2008 project
140
- file in ext/vc. You'll have to edit the various include and library paths
141
- to fit your specific environment.
142
-
143
- If you are using MingW/msys, then:
144
-
145
- 1. Open a msys prompt (a DOS prompt may also work)
146
- 2. Change diretories to ext/MingW
147
- 3. Type in rake
148
-
149
- The result is a proj4_ruby.so file which can be package into a GEM or
150
- copied to the ruby/site-lib directory.
151
-
152
- ==License
153
- Proj4rb is released under the MIT license.
27
+ crs1 = Proj::Crs.new('EPSG:4326')
28
+
29
+ crs2 = Proj::Crs.new('urn:ogc:def:crs:EPSG::4326')
30
+
31
+ crs3 = Proj::Crs.new('+proj=longlat +datum=WGS84 +no_defs +type=crs')
32
+
33
+ crs4 = Proj::Crs.new(<<~EOS)
34
+ GEOGCRS["WGS 84",
35
+ DATUM["World Geodetic System 1984",
36
+ ELLIPSOID["WGS 84",6378137,298.257223563,
37
+ LENGTHUNIT["metre",1]]],
38
+ PRIMEM["Greenwich",0,
39
+ ANGLEUNIT["degree",0.0174532925199433]],
40
+ CS[ellipsoidal,2],
41
+ AXIS["geodetic latitude (Lat)",north,
42
+ ORDER[1],
43
+ ANGLEUNIT["degree",0.0174532925199433]],
44
+ AXIS["geodetic longitude (Lon)",east,
45
+ ORDER[2],
46
+ ANGLEUNIT["degree",0.0174532925199433]],
47
+ USAGE[
48
+ SCOPE["unknown"],
49
+ AREA["World"],
50
+ BBOX[-90,-180,90,180]],
51
+ ID["EPSG",4326]]
52
+ EOS
53
+
54
+ Notice when using the old-style Proj4 string, the addition of the "+type=crs" value.
55
+
56
+ If you are using Proj 5, then you should create a transformation using epsg strings (see below). If you are using Proj 4,
57
+ you need to use the deprecated Projection class (see documentation).
58
+
59
+ === Transformation
60
+ After you have created two coordinate systems, you can then create a transformation. For example, if you want to
61
+ convert coordinates from the "3-degree Gauss-Kruger zone 3" coordinate system to WGS84 (one version of lat-long)
62
+ first create a transformation:
63
+
64
+ crs_gk = Proj::Crs.new('epsg:31467')
65
+ crs_wgs84 = Proj::Crs.new('epsg:4326')
66
+ transform = Proj::Transformation.new(crs_gk, crs_wgs84)
67
+
68
+ Alternatively, or if you are using Proj 5, you can create a transformation without first
69
+ creating Crs instances. Instead, pass the EPSG information directly to the transformation:
70
+
71
+ transform = Proj::Transformation.new('epsg:31467', 'epsg:4326')
72
+
73
+ Once you've created the transformation, you can tranform coordinates using either
74
+ the +forward+ or +inverse+ methods. The forward transformation looks like this:
75
+
76
+ from = Proj::Coordinate.new(x: 5428192.0, y: 3458305.0, z: -5.1790915237)
77
+ to = transform.forward(from)
78
+
79
+ assert_in_delta(48.98963932450735, to.x, PRECISION)
80
+ assert_in_delta(8.429263044355544, to.y, PRECISION)
81
+ assert_in_delta(-5.1790915237, to.z, PRECISION)
82
+ assert_in_delta(0, to.t, PRECISION)
83
+
84
+ While the inverse transformation looks like this:
154
85
 
86
+ from = Proj::Coordinate.new(lam: 48.9906726079, phi: 8.4302123334)
87
+ to = transform.inverse(from)
88
+
89
+ assert_in_delta(5428306.389495558, to.x, PRECISION)
90
+ assert_in_delta(3458375.3367194114, to.y, PRECISION)
91
+ assert_in_delta(0, to.z, PRECISION)
92
+ assert_in_delta(0, to.t, PRECISION)
93
+
94
+ Transformation objects can also be created directly like this:
95
+
96
+ transform = Proj::Transformation.new('epsg:31467', 'epsg:4326')
97
+
98
+ === Coordinate
99
+ Notice the examples above transform Coordinate objects. A Coordinate consists
100
+ of up to four double values to represent three directions plus time. In general
101
+ you will need to fill out at least the first two values:
102
+
103
+ from = Proj::Coordinate.new(x: 5428192.0, y: 3458305.0, z: -5.1790915237)
104
+ from = Proj::Coordinate.new(lam: 48.9906726079, phi: 8.4302123334)
105
+
106
+ Lam is longitude and phi is latitude.
107
+
108
+ === Context
109
+ Contexts are used to support multi-threaded programs. The bindings expose this object via Context.current
110
+ and store it using thread local storage. Use the context object to access error codes, set proj4
111
+ compatability settings, set the logging level and to install custom logging code.
112
+
113
+ Both Crs and Transformation objects take a context object in their constructors. If none is passed, they default
114
+ to using Context.current
115
+
116
+ === Projection
117
+ If you are using Proj 4, then instead of using Coordinates, Crses and Tranformations you use Points and Projections. Those
118
+ are deprecated classes but will continue to work until the release of Proj 7. Please refer to the documentation
119
+ for more information.
120
+
121
+ == Error handling
122
+ When an error occurs, a Proj::Error instance will be thrown with the underlying message provided
123
+ from the Proj library.
124
+
125
+ == Finding Proj Files (LIB_PROJ)
126
+ Starting with version 6, Proj stores its information (datums, ellipsoids, prime meridians, coordinate systems,
127
+ units, etc) in a sqlite file called proj.db. If Proj cannot find its database, then the Ruby bindings will
128
+ search for it in some well-known locations. Failing that, the Ruby bindings will raise an exception.
129
+ In this case, set the environmental variable PROJ_LIB to point at the folder that contains the proj.db file.
130
+ Note PROJ_LIB must be set by whatever launches your Ruby program. The Ruby program itself cannot set this
131
+ variable and have it work correctly (at least not on windows).
132
+
133
+ == Backwards Compatibility
134
+ Proj versions 5 and 6 are *very* different than Proj version 4. Changes are documented at
135
+ https://proj.org/development/migration.html. Note that the gem should gracefully degrade
136
+ (as in newer functionality stops working) depending on if you are using Proj 6, Proj 5 or Proj 4.
137
+
138
+ To ensure backwards compatiblity, the Ruby bindings still include the older Point and Projection
139
+ classes. However, these classes are no longer documented in this Readme because they will be
140
+ removed upon the release of Proj 7 which will remove the underlying API's they are dependent upon.
141
+ So please port your code! But take note of the changes in Proj 6 described below.
142
+
143
+ Proj 5 introduced the the Coordinate, Crs and Tranformation apis. However, it wasn't until Proj 6 that additional
144
+ metadata APIs were added, so the amount of information about each object is somewhat limited.
145
+
146
+ Proj 6 makes a big change compared to previous releases that is not well documented (see
147
+ https://github.com/OSGeo/PROJ/pull/1182). When creating tranformations with EPSG values Proj 6
148
+ will assume EPSG axis order and units (typically lat-long degree for geodetic CRS). First,
149
+ this means that lat-long should usually be specified in degrees and not radians (breaking change one).
150
+ Second, the axis order is likely different than what your previous code assumed (breaking change two).
151
+ Note if creating transformations with the deprecated "+init=epsg:XXXX" values, Proj 6 will assume the traditional
152
+ axis order and units (long-lat radians for geodetic CRS).
153
+
154
+ Bottom line - when porting your code to the new Proj 6 APIs generally:
155
+
156
+ * Use degrees, not radians
157
+ * Swap the order of the lat and long values
158
+
159
+ == Tests
160
+ Proj4rb ships with a full test suite designed to work using Proj 6. If you are using an earlier version of Proj,
161
+ then expect *many* test failures.
162
+
163
+ == License
164
+ Proj4rb is released under the MIT license.
155
165
 
156
166
  ==Authors
157
167
  The proj4rb Ruby bindings were started by Guilhem Vellut with most of the code
158
168
  written by Jochen Topf. Charlie Savage ported the code to Windows and added
159
- the Windows build infrastructure.
160
-
169
+ the Windows build infrastructure. Later, he updated the code to support
170
+ Proj version 5 and 6 and ported the code to use FFI.
data/Rakefile CHANGED
@@ -1,42 +1,27 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "rubygems"
4
- require "rake/extensiontask"
5
- require "rake/testtask"
6
- require "rubygems/package_task"
7
- require "rdoc/task"
8
- require "yaml"
9
-
10
- # Read the spec file
11
- GEM_NAME = "proj4rb"
12
- SO_NAME = "proj4_ruby"
13
- spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
14
-
15
- # Setup generic gem
16
- Gem::PackageTask.new(spec) do |pkg|
17
- pkg.package_dir = 'pkg'
18
- pkg.need_tar = false
19
- end
20
-
21
- # RDoc Task
22
- desc "Generate rdoc documentation"
23
- RDoc::Task.new("rdoc") do |rdoc|
24
- rdoc.rdoc_dir = 'doc'
25
- rdoc.title = "Proj4rb"
26
- # Show source inline with line numbers
27
- rdoc.options << "--line-numbers"
28
- # Make the readme file the start page for the generated html
29
- rdoc.main = 'README.rdoc'
30
- rdoc.rdoc_files.include('doc/*.rdoc',
31
- 'ext/projrb.c',
32
- 'README',
33
- 'proj4rb.gemspec',
34
- 'Changelog',
35
- 'MIT-LICENSE')
36
- end
37
-
38
- # Test Task
39
- Rake::TestTask.new do |t|
40
- t.libs << "test"
41
- t.verbose = true
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "rake/testtask"
5
+ require "rubygems/package_task"
6
+ require "yard"
7
+ require "yaml"
8
+
9
+ # Read the spec file
10
+ GEM_NAME = "proj4rb"
11
+ spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
12
+
13
+ # Setup generic gem
14
+ Gem::PackageTask.new(spec) do |pkg|
15
+ pkg.package_dir = 'pkg'
16
+ pkg.need_tar = false
17
+ end
18
+
19
+ # Yard Task
20
+ desc "Generate documentation"
21
+ YARD::Rake::YardocTask.new
22
+
23
+ # Test Task
24
+ Rake::TestTask.new do |t|
25
+ t.libs << "test"
26
+ t.verbose = true
42
27
  end