Skip to content

Commit 1dd4b26

Browse files
author
David Troy
committed
Moving stuff around to get ext to build properly
1 parent ea3a834 commit 1dd4b26

File tree

6 files changed

+18
-24
lines changed

6 files changed

+18
-24
lines changed

Makefile renamed to ext/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,8 @@ install-rb: pre-install-rb install-rb-default
116116
install-rb-default: pre-install-rb-default
117117
pre-install-rb: Makefile
118118
pre-install-rb-default: Makefile
119-
pre-install-rb-default: $(RUBYLIBDIR)
120-
install-rb-default: $(RUBYLIBDIR)/geohash.rb
121-
$(RUBYLIBDIR)/geohash.rb: $(srcdir)/lib/geohash.rb
122-
$(INSTALL_DATA) $(srcdir)/lib/geohash.rb $(@D)
123119
$(RUBYARCHDIR):
124120
$(MAKEDIRS) $@
125-
$(RUBYLIBDIR):
126-
$(MAKEDIRS) $@
127121

128122
site-install: site-install-so site-install-rb
129123
site-install-so: install-so

ext/extconf.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require 'mkmf'
2+
dir_config("geohash_native")
3+
create_makefile("geohash_native")
File renamed without changes.

extconf.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

geohash.gemspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Gem::Specification.new do |s|
1010
s.description = "Geohash provides support for manipulating GeoHash strings in Ruby. See http://geohash.org."
1111
s.has_rdoc = true
1212
s.authors = ["David Troy"]
13-
s.files = ["extconf.rb",
14-
"geohash_native.c",
15-
"lib/geohash.rb",
16-
"Makefile"]
13+
s.files = ["ext/extconf.rb",
14+
"ext/geohash_native.c",
15+
"ext/Makefile",
16+
"lib/geohash.rb"]
1717
s.test_files = ["test/test_geohash.rb"]
1818
s.rdoc_options = ["--main", "README"]
19-
s.extensions = 'extconf.rb'
20-
s.require_paths = 'lib'
19+
s.extensions = 'ext/extconf.rb'
20+
s.require_paths = ['lib', 'ext']
2121
s.extra_rdoc_files = ["Manifest.txt", "README"]
2222
end

test/test_geohash.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env ruby
2-
$LOAD_PATH << "#{File.dirname(__FILE__)}/.."
2+
$LOAD_PATH << "#{File.dirname(__FILE__)}/../ext"
33
require "#{File.dirname(__FILE__)}/../lib/geohash"
44
require 'test/unit'
55

@@ -65,13 +65,13 @@ def test_neighbors
6565
assert_equal 8, (["dqcw7", "dqctg", "dqcw4", "dqcwh", "dqcw6", "dqcwk", "dqctf", "dqctu"] & GeoHash.new("dqcw5").neighbors).size
6666
end
6767

68-
require 'benchmark'
69-
def test_multiple
70-
Benchmark.bmbm(30) do |bm|
71-
bm.report("encoding") {30000.times { test_encoding }}
72-
bm.report("decoding") {30000.times { test_decoding }}
73-
#bm.report("neighbors") {30000.times { test_neighbors }}
74-
end
75-
end
68+
# require 'benchmark'
69+
# def test_multiple
70+
# Benchmark.bmbm(30) do |bm|
71+
# bm.report("encoding") {30000.times { test_encoding }}
72+
# bm.report("decoding") {30000.times { test_decoding }}
73+
# #bm.report("neighbors") {30000.times { test_neighbors }}
74+
# end
75+
# end
7676
end
7777

0 commit comments

Comments
 (0)