activerecord-postgres-earthdistance 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/.gitignore +21 -0
  2. data/.rspec +2 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile +4 -10
  5. data/Gemfile.lock +92 -69
  6. data/README.md +124 -0
  7. data/Rakefile +12 -40
  8. data/activerecord-postgres-earthdistance.gemspec +24 -117
  9. data/lib/activerecord-postgres-earthdistance.rb +5 -46
  10. data/lib/activerecord-postgres-earthdistance/activerecord.rb +9 -10
  11. data/lib/activerecord-postgres-earthdistance/acts_as_geolocated.rb +24 -0
  12. data/lib/activerecord-postgres-earthdistance/railties.rb +40 -0
  13. data/lib/templates/setup_earthdistance.rb +4 -427
  14. data/spec/act_as_geolocated_spec.rb +29 -0
  15. data/{test/app/app/models → spec/fixtures}/place.rb +0 -0
  16. data/spec/spec_helper.rb +46 -0
  17. metadata +67 -109
  18. data/README.rdoc +0 -17
  19. data/VERSION +0 -1
  20. data/test/app/.gitignore +0 -4
  21. data/test/app/Gemfile +0 -5
  22. data/test/app/Gemfile.lock +0 -83
  23. data/test/app/README +0 -256
  24. data/test/app/Rakefile +0 -7
  25. data/test/app/app/controllers/application_controller.rb +0 -3
  26. data/test/app/app/helpers/application_helper.rb +0 -2
  27. data/test/app/app/views/layouts/application.html.erb +0 -14
  28. data/test/app/config.ru +0 -4
  29. data/test/app/config/application.rb +0 -42
  30. data/test/app/config/boot.rb +0 -13
  31. data/test/app/config/database.yml +0 -25
  32. data/test/app/config/environment.rb +0 -5
  33. data/test/app/config/environments/development.rb +0 -26
  34. data/test/app/config/environments/production.rb +0 -49
  35. data/test/app/config/environments/test.rb +0 -35
  36. data/test/app/config/initializers/backtrace_silencers.rb +0 -7
  37. data/test/app/config/initializers/inflections.rb +0 -10
  38. data/test/app/config/initializers/mime_types.rb +0 -5
  39. data/test/app/config/initializers/secret_token.rb +0 -7
  40. data/test/app/config/initializers/session_store.rb +0 -8
  41. data/test/app/config/initializers/use_sql_schema.rb +0 -3
  42. data/test/app/config/locales/en.yml +0 -5
  43. data/test/app/config/routes.rb +0 -58
  44. data/test/app/db/development_structure.sql +0 -807
  45. data/test/app/db/migrate/20110225205046_setup_earthdistance.rb +0 -434
  46. data/test/app/db/migrate/20110225205131_create_places.rb +0 -15
  47. data/test/app/db/schema.rb +0 -24
  48. data/test/app/db/seeds.rb +0 -7
  49. data/test/app/doc/README_FOR_APP +0 -2
  50. data/test/app/lib/tasks/.gitkeep +0 -0
  51. data/test/app/public/404.html +0 -26
  52. data/test/app/public/422.html +0 -26
  53. data/test/app/public/500.html +0 -26
  54. data/test/app/public/favicon.ico +0 -0
  55. data/test/app/public/images/rails.png +0 -0
  56. data/test/app/public/index.html +0 -239
  57. data/test/app/public/javascripts/application.js +0 -2
  58. data/test/app/public/javascripts/controls.js +0 -965
  59. data/test/app/public/javascripts/dragdrop.js +0 -974
  60. data/test/app/public/javascripts/effects.js +0 -1123
  61. data/test/app/public/javascripts/prototype.js +0 -6001
  62. data/test/app/public/javascripts/rails.js +0 -175
  63. data/test/app/public/robots.txt +0 -5
  64. data/test/app/public/stylesheets/.gitkeep +0 -0
  65. data/test/app/script/rails +0 -6
  66. data/test/app/test/performance/browsing_test.rb +0 -9
  67. data/test/app/test/test_helper.rb +0 -13
  68. data/test/app/test/unit/place_test.rb +0 -27
  69. data/test/app/vendor/plugins/.gitkeep +0 -0
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --colour
2
+ --format d
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+
5
+ branches:
6
+ only:
7
+ - master
data/Gemfile CHANGED
@@ -1,11 +1,5 @@
1
- source :gemcutter
1
+ source "http://rubygems.org"
2
2
 
3
- gem 'rails', '>= 3.0.0'
4
- gem 'pg', '>= 0.11'
5
-
6
- group :development do
7
- gem "shoulda", ">= 0"
8
- gem "bundler", "~> 1.0.0"
9
- gem "jeweler", "~> 1.6.2"
10
- gem "rcov", ">= 0"
11
- end
3
+ # specify gem dependencies in activerecord-postgres-earthdistance.gemspec
4
+ # except the platform-specific dependencies below
5
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,84 +1,107 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ activerecord-postgres-earthdistance (0.2.0)
5
+ pg
6
+ rails (>= 3.1)
7
+ rake
8
+
1
9
  GEM
2
10
  remote: http://rubygems.org/
3
11
  specs:
4
- abstract (1.0.0)
5
- actionmailer (3.0.7)
6
- actionpack (= 3.0.7)
7
- mail (~> 2.2.15)
8
- actionpack (3.0.7)
9
- activemodel (= 3.0.7)
10
- activesupport (= 3.0.7)
11
- builder (~> 2.1.2)
12
- erubis (~> 2.6.6)
13
- i18n (~> 0.5.0)
14
- rack (~> 1.2.1)
15
- rack-mount (~> 0.6.14)
16
- rack-test (~> 0.5.7)
17
- tzinfo (~> 0.3.23)
18
- activemodel (3.0.7)
19
- activesupport (= 3.0.7)
20
- builder (~> 2.1.2)
21
- i18n (~> 0.5.0)
22
- activerecord (3.0.7)
23
- activemodel (= 3.0.7)
24
- activesupport (= 3.0.7)
25
- arel (~> 2.0.2)
26
- tzinfo (~> 0.3.23)
27
- activeresource (3.0.7)
28
- activemodel (= 3.0.7)
29
- activesupport (= 3.0.7)
30
- activesupport (3.0.7)
31
- arel (2.0.10)
32
- builder (2.1.2)
33
- erubis (2.6.6)
34
- abstract (>= 1.0.0)
35
- git (1.2.5)
36
- i18n (0.5.0)
37
- jeweler (1.6.2)
38
- bundler (~> 1.0)
39
- git (>= 1.2.5)
40
- rake
41
- mail (2.2.19)
42
- activesupport (>= 2.3.6)
12
+ actionmailer (3.2.11)
13
+ actionpack (= 3.2.11)
14
+ mail (~> 2.4.4)
15
+ actionpack (3.2.11)
16
+ activemodel (= 3.2.11)
17
+ activesupport (= 3.2.11)
18
+ builder (~> 3.0.0)
19
+ erubis (~> 2.7.0)
20
+ journey (~> 1.0.4)
21
+ rack (~> 1.4.0)
22
+ rack-cache (~> 1.2)
23
+ rack-test (~> 0.6.1)
24
+ sprockets (~> 2.2.1)
25
+ activemodel (3.2.11)
26
+ activesupport (= 3.2.11)
27
+ builder (~> 3.0.0)
28
+ activerecord (3.2.11)
29
+ activemodel (= 3.2.11)
30
+ activesupport (= 3.2.11)
31
+ arel (~> 3.0.2)
32
+ tzinfo (~> 0.3.29)
33
+ activeresource (3.2.11)
34
+ activemodel (= 3.2.11)
35
+ activesupport (= 3.2.11)
36
+ activesupport (3.2.11)
37
+ i18n (~> 0.6)
38
+ multi_json (~> 1.0)
39
+ arel (3.0.2)
40
+ builder (3.0.4)
41
+ diff-lcs (1.1.3)
42
+ erubis (2.7.0)
43
+ hike (1.2.1)
44
+ i18n (0.6.1)
45
+ journey (1.0.4)
46
+ json (1.7.6)
47
+ mail (2.4.4)
43
48
  i18n (>= 0.4.0)
44
49
  mime-types (~> 1.16)
45
50
  treetop (~> 1.4.8)
46
- mime-types (1.16)
47
- pg (0.11.0)
48
- polyglot (0.3.1)
49
- rack (1.2.3)
50
- rack-mount (0.6.14)
51
- rack (>= 1.0.0)
52
- rack-test (0.5.7)
51
+ mime-types (1.20.1)
52
+ multi_json (1.5.0)
53
+ pg (0.14.1)
54
+ polyglot (0.3.3)
55
+ rack (1.4.4)
56
+ rack-cache (1.2)
57
+ rack (>= 0.4)
58
+ rack-ssl (1.3.3)
59
+ rack
60
+ rack-test (0.6.2)
53
61
  rack (>= 1.0)
54
- rails (3.0.7)
55
- actionmailer (= 3.0.7)
56
- actionpack (= 3.0.7)
57
- activerecord (= 3.0.7)
58
- activeresource (= 3.0.7)
59
- activesupport (= 3.0.7)
62
+ rails (3.2.11)
63
+ actionmailer (= 3.2.11)
64
+ actionpack (= 3.2.11)
65
+ activerecord (= 3.2.11)
66
+ activeresource (= 3.2.11)
67
+ activesupport (= 3.2.11)
60
68
  bundler (~> 1.0)
61
- railties (= 3.0.7)
62
- railties (3.0.7)
63
- actionpack (= 3.0.7)
64
- activesupport (= 3.0.7)
69
+ railties (= 3.2.11)
70
+ railties (3.2.11)
71
+ actionpack (= 3.2.11)
72
+ activesupport (= 3.2.11)
73
+ rack-ssl (~> 1.3.2)
65
74
  rake (>= 0.8.7)
66
- thor (~> 0.14.4)
67
- rake (0.9.2)
68
- rcov (0.9.9)
69
- shoulda (2.11.3)
70
- thor (0.14.6)
71
- treetop (1.4.9)
75
+ rdoc (~> 3.4)
76
+ thor (>= 0.14.6, < 2.0)
77
+ rake (10.0.3)
78
+ rdoc (3.12)
79
+ json (~> 1.4)
80
+ rspec (2.12.0)
81
+ rspec-core (~> 2.12.0)
82
+ rspec-expectations (~> 2.12.0)
83
+ rspec-mocks (~> 2.12.0)
84
+ rspec-core (2.12.2)
85
+ rspec-expectations (2.12.1)
86
+ diff-lcs (~> 1.1.3)
87
+ rspec-mocks (2.12.2)
88
+ sprockets (2.2.2)
89
+ hike (~> 1.2)
90
+ multi_json (~> 1.0)
91
+ rack (~> 1.0)
92
+ tilt (~> 1.1, != 1.3.0)
93
+ thor (0.17.0)
94
+ tilt (1.3.3)
95
+ treetop (1.4.12)
96
+ polyglot
72
97
  polyglot (>= 0.3.1)
73
- tzinfo (0.3.27)
98
+ tzinfo (0.3.35)
74
99
 
75
100
  PLATFORMS
76
101
  ruby
77
102
 
78
103
  DEPENDENCIES
79
- bundler (~> 1.0.0)
80
- jeweler (~> 1.6.2)
81
- pg (>= 0.11)
82
- rails (>= 3.0.0)
83
- rcov
84
- shoulda
104
+ activerecord-postgres-earthdistance!
105
+ bundler
106
+ rdoc
107
+ rspec (~> 2.11)
data/README.md ADDED
@@ -0,0 +1,124 @@
1
+ #ActiveRecord + PostgreSQL Earthdistance [![Build Status](https://secure.travis-ci.org/softa/activerecord-postgres-earthdistance.png?branch=master)](http://travis-ci.org/softa/activerecord-postgres-earthdistance)
2
+
3
+ Check distances with latitude and longitude using PostgreSQL special indexes.
4
+ This gem enables your model to query the database using the earthdistance extension. This should be much faster than using trigonometry functions over standart indexs.
5
+
6
+ ##Requirements
7
+
8
+ Postgresql 9.1+ with contrib and Rails 3.1+
9
+ On Ubuntu, this is easy: `sudo apt-get install postgresql-contrib-9.1`
10
+
11
+ On Mac you have a couple of options:
12
+
13
+ * [the binary package kindly provided by EnterpriseDB](http://www.enterprisedb.com/products-services-training/pgdownload#osx)
14
+ * [Homebrew’s](https://github.com/mxcl/homebrew) Postgres installation also includes the contrib packages: `brew install postgres`
15
+ * [Postgres.app](http://postgresapp.com/)
16
+
17
+ ##Install
18
+
19
+
20
+ Earthdistance is a PostgreSQL contrib module, [check it out first](http://www.postgresql.org/docs/9.2/static/earthdistance.html).
21
+
22
+ Then, just add this to your Gemfile:
23
+
24
+ `gem 'activerecord-postgres-earthdistance'`
25
+
26
+ And run your bundler:
27
+
28
+ `bundle install`
29
+
30
+ Now you need to create a migration that adds earthdistance support for your
31
+ PostgreSQL database:
32
+
33
+ `rails g earthdistance:setup`
34
+
35
+ Run it:
36
+
37
+ `rake db:migrate`
38
+
39
+ Now let's add some gist indexes to make queries ultra-fast.
40
+ For the model Place we could create an index over the lat and lng fields:
41
+
42
+ `rails g migration add_index_to_places`
43
+
44
+ Edit the created migration:
45
+
46
+ ```ruby
47
+ class AddIndexToPlaces < ActiveRecord::Migration
48
+ def change
49
+ add_earthdistance_index :places
50
+ end
51
+ end
52
+ ```
53
+
54
+ This will create the index with a SQL like this:
55
+ ```sql
56
+ CREATE INDEX places_earthdistance_ix ON places USING GIST (ll_to_earth(lat, lng));
57
+ ```
58
+
59
+ ##Usage
60
+
61
+ This gem only provides a custom serialization coder.
62
+ If you want to use it just put in your Gemfile:
63
+
64
+ gem 'activerecord-postgres-earthdistance'
65
+
66
+ Now add a line (for each earthdistance column) on the model you have your earthdistance columns.
67
+ Assuming a model called **Person**, with a **data** field on it, the
68
+ code should look like:
69
+
70
+ ```ruby
71
+ class Place < ActiveRecord::Base
72
+ acts_as_geolocated
73
+ end
74
+ ```
75
+
76
+ This way, you will automatically look for columns with names such as lat/latitude and lng/longitude.
77
+ But you can use alternative names passing them as:
78
+
79
+ ```ruby
80
+ class Place < ActiveRecord::Base
81
+ acts_as_geolocated lat: 'latitude_column_name', lng: 'longitude_column_name'
82
+ end
83
+ ```
84
+
85
+ ###Querying the database
86
+
87
+ To query for all places within a given radius of 100 meters from the origin 30,50 just use:
88
+ ```ruby
89
+ Place.within_radius(500, 30, 50).all
90
+ ```
91
+
92
+ ##Test Database
93
+
94
+ To have earthdistance enabled when you load your database schema (as happens in rake db:test:prepare), you
95
+ have two options.
96
+
97
+ The first option is creating a template database with earthdistance installed and set the template option
98
+ in database.yml to that database.
99
+
100
+ The second option is to uncomment or add the following line in config/application.rb
101
+
102
+ config.active_record.schema_format = :sql
103
+
104
+ This will change your schema dumps from Ruby to SQL. If you're
105
+ unsure about the implications of this change, we suggest reading this
106
+ [Rails Guide](http://guides.rubyonrails.org/migrations.html#schema-dumping-and-you).
107
+
108
+ ##Help
109
+
110
+ You can use issues in github for that. Or else you can reach us at
111
+ twitter: [@dbiazus](https://twitter.com/#!/dbiazus)
112
+
113
+ ##Note on Patches/Pull Requests
114
+
115
+
116
+ * Fork the project.
117
+ * Make your feature addition or bug fix.
118
+ * Add tests for it. This is important so I don’t break it in a future version unintentionally.
119
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
120
+ * Send me a pull request. Bonus points for topic branches.
121
+
122
+ ##Copyright
123
+
124
+ Copyright © 2010 Diogo Biazus. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,7 +1,12 @@
1
- # encoding: utf-8
2
-
1
+ # -*- encoding: utf-8 -*-
2
+ $:.unshift File.expand_path("../lib", __FILE__)
3
+ require 'bundler/gem_tasks'
3
4
  require 'rubygems'
4
- require 'bundler'
5
+ require 'rspec/core/rake_task'
6
+ require 'rdoc/task'
7
+
8
+ task :default => :spec
9
+
5
10
  begin
6
11
  Bundler.setup(:default, :development)
7
12
  rescue Bundler::BundlerError => e
@@ -9,47 +14,14 @@ rescue Bundler::BundlerError => e
9
14
  $stderr.puts "Run `bundle install` to install missing gems"
10
15
  exit e.status_code
11
16
  end
12
- require 'rake'
13
17
 
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- gem.name = "activerecord-postgres-earthdistance"
17
- gem.license = "MIT"
18
- gem.name = "activerecord-postgres-earthdistance"
19
- gem.summary = %Q{Now you can filter records within a radius}
20
- gem.description = %Q{I'll write it tomorrow}
21
- gem.email = "diogob@gmail.com"
22
- gem.homepage = "http://github.com/softa/activerecord-postgres-earthdistance"
23
- gem.authors = ["Juan Maiz", "Diogo Biazus"]
24
- gem.add_dependency "pg"
25
- gem.add_dependency "rails"
26
- # dependencies defined in Gemfile
27
- end
28
- Jeweler::RubygemsDotOrgTasks.new
29
-
30
- require 'rake/testtask'
31
- Rake::TestTask.new(:test) do |test|
32
- test.libs << 'lib' << 'test'
33
- test.pattern = 'test/**/test_*.rb'
34
- test.verbose = true
35
- end
18
+ RSpec::Core::RakeTask.new(:spec)
36
19
 
37
- require 'rcov/rcovtask'
38
- Rcov::RcovTask.new do |test|
39
- test.libs << 'test'
40
- test.pattern = 'test/**/test_*.rb'
41
- test.verbose = true
42
- test.rcov_opts << '--exclude "gems/*"'
43
- end
44
-
45
- task :default => :test
46
-
47
- require 'rake/rdoctask'
48
- Rake::RDocTask.new do |rdoc|
20
+ RDoc::Task.new do |rdoc|
49
21
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
50
-
51
22
  rdoc.rdoc_dir = 'rdoc'
52
- rdoc.title = "activerecord-postgres-earthdistance #{version}"
23
+ rdoc.title = "activerecord-postgres-hstore #{version}"
53
24
  rdoc.rdoc_files.include('README*')
54
25
  rdoc.rdoc_files.include('lib/**/*.rb')
55
26
  end
27
+
@@ -1,124 +1,31 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib/', __FILE__)
3
+ $:.unshift lib unless $:.include?(lib)
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{activerecord-postgres-earthdistance}
8
- s.version = "0.1.0"
6
+ s.name = "activerecord-postgres-earthdistance"
7
+ s.version = "0.2.0"
9
8
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Juan Maiz", "Diogo Biazus"]
12
- s.date = %q{2011-06-23}
13
- s.description = %q{I'll write it tomorrow}
14
- s.email = %q{diogob@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- "Gemfile",
22
- "Gemfile.lock",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "activerecord-postgres-earthdistance.gemspec",
28
- "lib/activerecord-postgres-earthdistance.rb",
29
- "lib/activerecord-postgres-earthdistance/activerecord.rb",
30
- "lib/templates/cube.sql",
31
- "lib/templates/earthdistance.sql",
32
- "lib/templates/setup_earthdistance.rb",
33
- "test/app/.gitignore",
34
- "test/app/Gemfile",
35
- "test/app/Gemfile.lock",
36
- "test/app/README",
37
- "test/app/Rakefile",
38
- "test/app/app/controllers/application_controller.rb",
39
- "test/app/app/helpers/application_helper.rb",
40
- "test/app/app/models/place.rb",
41
- "test/app/app/views/layouts/application.html.erb",
42
- "test/app/config.ru",
43
- "test/app/config/application.rb",
44
- "test/app/config/boot.rb",
45
- "test/app/config/database.yml",
46
- "test/app/config/environment.rb",
47
- "test/app/config/environments/development.rb",
48
- "test/app/config/environments/production.rb",
49
- "test/app/config/environments/test.rb",
50
- "test/app/config/initializers/backtrace_silencers.rb",
51
- "test/app/config/initializers/inflections.rb",
52
- "test/app/config/initializers/mime_types.rb",
53
- "test/app/config/initializers/secret_token.rb",
54
- "test/app/config/initializers/session_store.rb",
55
- "test/app/config/initializers/use_sql_schema.rb",
56
- "test/app/config/locales/en.yml",
57
- "test/app/config/routes.rb",
58
- "test/app/db/development_structure.sql",
59
- "test/app/db/migrate/20110225205046_setup_earthdistance.rb",
60
- "test/app/db/migrate/20110225205131_create_places.rb",
61
- "test/app/db/schema.rb",
62
- "test/app/db/seeds.rb",
63
- "test/app/doc/README_FOR_APP",
64
- "test/app/lib/tasks/.gitkeep",
65
- "test/app/public/404.html",
66
- "test/app/public/422.html",
67
- "test/app/public/500.html",
68
- "test/app/public/favicon.ico",
69
- "test/app/public/images/rails.png",
70
- "test/app/public/index.html",
71
- "test/app/public/javascripts/application.js",
72
- "test/app/public/javascripts/controls.js",
73
- "test/app/public/javascripts/dragdrop.js",
74
- "test/app/public/javascripts/effects.js",
75
- "test/app/public/javascripts/prototype.js",
76
- "test/app/public/javascripts/rails.js",
77
- "test/app/public/robots.txt",
78
- "test/app/public/stylesheets/.gitkeep",
79
- "test/app/script/rails",
80
- "test/app/test/performance/browsing_test.rb",
81
- "test/app/test/test_helper.rb",
82
- "test/app/test/unit/place_test.rb",
83
- "test/app/vendor/plugins/.gitkeep"
84
- ]
85
- s.homepage = %q{http://github.com/softa/activerecord-postgres-earthdistance}
86
- s.licenses = ["MIT"]
87
- s.require_paths = ["lib"]
88
- s.rubygems_version = %q{1.6.2}
89
- s.summary = %q{Now you can filter records within a radius}
9
+ s.platform = Gem::Platform::RUBY
10
+ s.license = "MIT"
11
+ s.authors = ["Diogo Biazus"]
12
+ s.email = "diogo@biazus.me"
13
+ s.homepage = "http://github.com/diogob/activerecord-postgres-earthdistance"
14
+ s.summary = "Check distances with latitude and longitude using PostgreSQL special indexes"
15
+ s.description = "This gem enables your model to query the database using the earthdistance extension. This should be much faster than using trigonometry functions over standart indexs."
16
+ s.required_ruby_version = ">= 1.8.7"
17
+ s.required_rubygems_version = ">= 1.3.6"
90
18
 
91
- if s.respond_to? :specification_version then
92
- s.specification_version = 3
19
+ s.add_dependency "rails", ">= 3.1"
20
+ s.add_dependency "rake"
21
+ s.add_dependency "pg"
22
+ s.add_development_dependency "bundler"
23
+ s.add_development_dependency "rdoc"
24
+ s.add_development_dependency "rspec", "~> 2.11"
93
25
 
94
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
95
- s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
96
- s.add_runtime_dependency(%q<pg>, [">= 0.11"])
97
- s.add_development_dependency(%q<shoulda>, [">= 0"])
98
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
99
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
100
- s.add_development_dependency(%q<rcov>, [">= 0"])
101
- s.add_runtime_dependency(%q<pg>, [">= 0"])
102
- s.add_runtime_dependency(%q<rails>, [">= 0"])
103
- else
104
- s.add_dependency(%q<rails>, [">= 3.0.0"])
105
- s.add_dependency(%q<pg>, [">= 0.11"])
106
- s.add_dependency(%q<shoulda>, [">= 0"])
107
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
108
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
109
- s.add_dependency(%q<rcov>, [">= 0"])
110
- s.add_dependency(%q<pg>, [">= 0"])
111
- s.add_dependency(%q<rails>, [">= 0"])
112
- end
113
- else
114
- s.add_dependency(%q<rails>, [">= 3.0.0"])
115
- s.add_dependency(%q<pg>, [">= 0.11"])
116
- s.add_dependency(%q<shoulda>, [">= 0"])
117
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
118
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
119
- s.add_dependency(%q<rcov>, [">= 0"])
120
- s.add_dependency(%q<pg>, [">= 0"])
121
- s.add_dependency(%q<rails>, [">= 0"])
122
- end
26
+ git_files = `git ls-files`.split("\n") rescue ''
27
+ s.files = git_files
28
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
29
+ s.executables = []
30
+ s.require_paths = %w(lib)
123
31
  end
124
-