Skip to content
Browse files

Changing file permissions; Reworking rake & packaging

  • Loading branch information...
1 parent 704b4c2 commit a333556aa9262c3c40919ffdb2b1abe0a5cd701d @abscondment committed Dec 2, 2008
View
2 .gitignore
@@ -0,0 +1,2 @@
+pkg
+rubyvor-rdoc
View
3 History.txt
@@ -0,0 +1,3 @@
+=== 0.0.1 / 2008-12-02
+
+ * OMG
View
15 Manifest.txt
@@ -0,0 +1,15 @@
+.gitignore
+README.txt
+Rakefile
+ext/.gitignore
+ext/Doc
+ext/edgelist.c
+ext/extconf.rb
+ext/geometry.c
+ext/heap.c
+ext/memory.c
+ext/output.c
+ext/vdefs.h
+ext/voronoi.c
+ext/voronoi_interface.c
+lib/rubyvor.rb
View
0 README
No changes.
View
69 MIT-LICENSE → README.txt
@@ -1,24 +1,45 @@
-Copyright (c) 2008 Brendan Ribera <brendan.ribera+rubyvor@gmail.com>
-
-Original public-domain C code (by Steven Fortune; http://ect.bell-labs.com/who/sjf/) and
-memory-management fixes for said C code (by Derek Bradley; http://www.derekbradley.ca)
-used and released under the MIT-LICENSE with permission.
-
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+= rubyvor
+
+Efficient Voronoi diagrams and Delaunay trianglation for Ruby
+
+== Description
+
+RubyVor provides efficient computation of Voronoi diagrams and
+Delaunay triangulation for a set of Ruby points. It is intended to
+function as a complemenet to GeoRuby.
+
+== Usage:
+
+ require 'rubyvor'
+ vddt = RubyVor::VDDT::Decomposition.from_points(georuby_points)
+
+== LICENSE:
+
+Original public-domain C code (by Steven Fortune; http://ect.bell-labs.com/who/sjf/) and
+memory-management fixes for said C code (by Derek Bradley; http://www.derekbradley.ca)
+used and released under the MIT-LICENSE with permission.
+
+
+(The MIT License)
+
+
+Copyright (c) 2008 Brendan Ribera <brendan.ribera+rubyvor@gmail.com>
+
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
116 Rakefile
@@ -1,17 +1,32 @@
+# -*- ruby -*-
+
+
require 'rubygems'
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
+require 'hoe'
+require './lib/rubyvor.rb'
+
+Hoe.new('rubyvor', RubyVor::VERSION) do |p|
+ #p.rubyforge_name = 'rubyvor'
+ p.developer('Brendan Ribera', 'brendan.ribera@gmail.com')
+end
+
+desc "Copying Phil"
+task :github do
+ system "git ls-files > Manifest.txt"
+ system "rake debug_gem | egrep -v \"^\\(in\" > rubyvor.gemspec"
+end
+task :gem => :github
+
+=begin
task :default => :test
desc "Run the tests"
Rake::TestTask.new do |t|
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
-task :test => :compile
+task :test => :compile_clean
desc "Generate the documentation"
Rake::RDocTask::new do |rdoc|
@@ -35,7 +50,7 @@ end
def make(target = '')
Dir.chdir('ext/') do
- pid = fork { exec "#{MAKECMD} #{ MAKEOPTS} #{ target}" }
+ pid = fork { exec "#{MAKECMD} #{MAKEOPTS} #{target}" }
Process.waitpid pid
end
$?.exitstatus
@@ -44,95 +59,54 @@ end
# Let make handle dependencies between c/o/so - we'll just run it.
file 'ext/voronoi_interface.so' => 'ext/Makefile' do
m = make
- fail "Make failed (status #{ m})" unless m == 0
+ fail "Make failed (status #{m})" unless m == 0
end
desc "Compile the shared object"
task :compile => 'ext/voronoi_interface.so'
+desc "Regenerate Makefile and perform a clean compile of shared object"
+task :compile_clean do
+ Dir.chdir('ext/') do
+ ruby 'extconf.rb' unless File.exists?('Makefile')
+ `make clean`
+ `rm -f Makefile`
+ end
+
+ Rake::Task[:compile].invoke
+end
-=begin
spec = Gem::Specification::new do |s|
s.platform = Gem::Platform::RUBY
- s.name = 'GeoRuby'
- s.version = "1.3.3"
- s.summary = "Ruby data holder for OGC Simple Features"
+ s.name = 'RubyVor'
+ s.version = "0.1"
+ # s.date
+ s.summary = "Efficient Voronoi diagrams and Delaunay trianglation for Ruby"
s.description = <<EOF
-GeoRuby is intended as a holder for data returned from PostGIS and MySQL Spatial queries. The data model roughly follows the OGC "Simple Features for SQL" specification (see www.opengis.org/docs/99-049.pdf), although without any kind of advanced functionalities (such as geometric operators or reprojections)
+Efficient Voronoi diagrams and Delaunay trianglation for Ruby
EOF
- s.author = 'Guilhem Vellut'
- s.email = 'guilhem.vellut@gmail.com'
- s.homepage = "http://thepochisuperstarmegashow.com/projects/"
+ s.author = 'Brendan Ribera'
+ s.email = 'brendan.ribera@gmail.com'
+ s.homepage = "http://github.com/bribera/rubyvor"
+ s.rubyforge_project = nil
s.requirements << 'none'
s.require_path = 'lib'
- s.files = FileList["lib/**/*.rb", "test/**/*.rb", "README","MIT-LICENSE","rakefile.rb","test/data/*.shp","test/data/*.dbf","test/data/*.shx","tools/**/*.yml","tools/**/*.rb","tools/lib/**/*"]
+
+ s.files = FileList["lib/**/*.rb", "test/**/*.rb", "ext/*.rb", "ext/*.c", "ext/*.h", "README","MIT-LICENSE","Rakefile"]
s.test_files = FileList['test/test*.rb']
s.has_rdoc = true
s.extra_rdoc_files = ["README"]
s.rdoc_options.concat ['--main', 'README']
+
+ s.extensions = ['ext/extconf.rb']
end
desc "Package the library as a gem"
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
-
-
-
-
-
-
-
-
-
-
-
-
-ooooooooooooooooooooooor
-
-
-spec = Gem::Specification.new do |s|
- s.name = %q{teius}
- # Note: search both lib, ext for teius.so
- s.version = "0.11"
- s.date = %q{2006-07-27}
- s.summary = %q{Light-weight Ruby API to LibXML.}
- s.email = %q{joshmh@gmail.com}
- s.homepage = %q{http://teius.rubyforge.org}
- s.rubyforge_project = %q{teius}
- s.description = %q{Teius is a very lightweight Ruby API around the LibXML C library. The idea is to use a syntax reminiscent of Ruby On Rails' find method to quickly process information from an XML document.}
- s.require_paths = [ 'lib' ]
- s.autorequire = %q{teius}
- s.has_rdoc = false
- s.authors = ["Joshua Harvey"]
- s.files = FileList[ '{test,xml,doc}/**/*', 'ext/*.rb', 'ext/*.c', 'lib/*.rb',
- 'Rakefile' ].to_a
- s.test_file = 'test/teius_test.rb'
- s.platform = Gem::Platform::RUBY
- s.extensions = [ 'ext/extconf.rb' ]
-# s.rdoc_options = ["--main", "README"]
-# s.extra_rdoc_files = ["README"]
-end
-Rake::GemPackageTask.new(spec) do |pkg|
-pkg.need_zip = false
-pkg.need_tar = true
-end
-
-Rake::GemPackageTask.new(win_spec) do |pkg|
-pkg.need_zip = true
-pkg.need_tar = false
-end
-
-
-
-
-
-
-
-
-
=end
View
0 ext/Doc 100755 → 100644
File mode changed.
View
0 ext/edgelist.c 100755 → 100644
File mode changed.
View
0 ext/geometry.c 100755 → 100644
File mode changed.
View
0 ext/heap.c 100755 → 100644
File mode changed.
View
0 ext/output.c 100755 → 100644
File mode changed.
View
0 ext/voronoi.c 100755 → 100644
File mode changed.
View
28 ext/voronoi_interface.c
@@ -13,7 +13,7 @@ static int repeat;
// Private method definitions
static Site * readone(void), * nextone(void);
static void readsites(void);
-static void print_memory(void);
+//static void print_memory(void);
static VALUE
from_points(VALUE self, VALUE pointsArray)
@@ -27,8 +27,11 @@ from_points(VALUE self, VALUE pointsArray)
xsum = 0;
ysum = 0;
repeat = 0;
+
+ rubyvorState.triangulate = 1;
+ // hi
- print_memory();
+ //print_memory();
// Initialize the Site Freelist
freeinit(&(rubyvorState.sfl), sizeof(Site)) ;
@@ -43,20 +46,19 @@ from_points(VALUE self, VALUE pointsArray)
if (rubyvorState.plot)
- plotinit() ;
+ plotinit();
// Perform the computation
- voronoi(next) ;
-
+ voronoi(next);
- print_memory();
+ //print_memory();
// Free our allocated objects
free_all();
-
- print_memory();
- fprintf(stderr,"FINISHED ITERATION %i\n", repeat + 1);
+ //print_memory();
+
+ //fprintf(stderr,"FINISHED ITERATION %i\n", repeat + 1);
/*
x = rb_intern("x");
@@ -96,7 +98,7 @@ Init_voronoi_interface(void)
-
+/*
static void
print_memory(void)
{
@@ -117,15 +119,15 @@ print_memory(void)
pf = fopen(buf, "r");
if (NULL != pf)
{
- fscanf(pf, "%u" /* %u %u %u %u %u"*/, &size/*, &resident, &share, &text, &lib, &data*/);
+ fscanf(pf, "%u", &size);//, %u, %u ... etc &resident, &share, &text, &lib, &data);
// DOMSGCAT(MSTATS, std::setprecision(4) << size / (1024.0) << "MB mem used");
totalSize = (float)size / 1024.0;
fprintf(stderr, "%f ", totalSize);
}
fclose(pf);
}
-
+*/
/*** sort sites on y, then x, coord ***/
@@ -207,7 +209,7 @@ readsites(void)
}
}
- print_memory();
+ //print_memory();
// Close the file
fclose(inputFile);
View
4 lib/rubyvor.rb
@@ -1 +1,3 @@
-#
+module RubyVor
+ VERSION = '0.0.1'
+end
View
32 rubyvor.gemspec
@@ -0,0 +1,32 @@
+Gem::Specification.new do |s|
+ s.name = %q{rubyvor}
+ s.version = "0.0.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Brendan Ribera"]
+ s.date = %q{2008-12-02}
+ s.description = %q{RubyVor provides efficient computation of Voronoi diagrams and Delaunay triangulation for a set of Ruby points. It is intended to function as a complemenet to GeoRuby.}
+ s.email = ["brendan.ribera@gmail.com"]
+ s.extra_rdoc_files = ["README.txt"]
+ s.files = [".gitignore", "README.txt", "Rakefile", "ext/.gitignore", "ext/Doc", "ext/edgelist.c", "ext/extconf.rb", "ext/geometry.c", "ext/heap.c", "ext/memory.c", "ext/output.c", "ext/vdefs.h", "ext/voronoi.c", "ext/voronoi_interface.c", "lib/rubyvor.rb"]
+ s.has_rdoc = true
+ s.homepage = %q{Efficient Voronoi diagrams and Delaunay trianglation for Ruby}
+ s.rdoc_options = ["--main", "README.txt"]
+ s.require_paths = ["lib", "ext"]
+ s.rubyforge_project = %q{rubyvor}
+ s.rubygems_version = %q{1.2.0}
+ s.summary = %q{RubyVor provides efficient computation of Voronoi diagrams and Delaunay triangulation for a set of Ruby points}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if current_version >= 3 then
+ s.add_development_dependency(%q<hoe>, [">= 1.8.2"])
+ else
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
+ end
+ else
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
+ end
+end

0 comments on commit a333556

Please sign in to comment.
Something went wrong with that request. Please try again.