-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated gemspec, added some instructions to readme, setup dummy app w…
…ith basic models
- Loading branch information
1 parent
5747be1
commit 9d85997
Showing
17 changed files
with
327 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ test/dummy/db/*.sqlite3-* | |
test/dummy/log/*.log | ||
test/dummy/storage/ | ||
test/dummy/tmp/ | ||
test/dummy/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
spatial_stats (0.1.0) | ||
rails (~> 6.0.0) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actioncable (6.0.2.1) | ||
actionpack (= 6.0.2.1) | ||
nio4r (~> 2.0) | ||
websocket-driver (>= 0.6.1) | ||
actionmailbox (6.0.2.1) | ||
actionpack (= 6.0.2.1) | ||
activejob (= 6.0.2.1) | ||
activerecord (= 6.0.2.1) | ||
activestorage (= 6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
mail (>= 2.7.1) | ||
actionmailer (6.0.2.1) | ||
actionpack (= 6.0.2.1) | ||
actionview (= 6.0.2.1) | ||
activejob (= 6.0.2.1) | ||
mail (~> 2.5, >= 2.5.4) | ||
rails-dom-testing (~> 2.0) | ||
actionpack (6.0.2.1) | ||
actionview (= 6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
rack (~> 2.0, >= 2.0.8) | ||
rack-test (>= 0.6.3) | ||
rails-dom-testing (~> 2.0) | ||
rails-html-sanitizer (~> 1.0, >= 1.2.0) | ||
actiontext (6.0.2.1) | ||
actionpack (= 6.0.2.1) | ||
activerecord (= 6.0.2.1) | ||
activestorage (= 6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
nokogiri (>= 1.8.5) | ||
actionview (6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
builder (~> 3.1) | ||
erubi (~> 1.4) | ||
rails-dom-testing (~> 2.0) | ||
rails-html-sanitizer (~> 1.1, >= 1.2.0) | ||
activejob (6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
globalid (>= 0.3.6) | ||
activemodel (6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
activerecord (6.0.2.1) | ||
activemodel (= 6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
activerecord-postgis-adapter (6.0.0) | ||
activerecord (~> 6.0) | ||
rgeo-activerecord (~> 6.0) | ||
activestorage (6.0.2.1) | ||
actionpack (= 6.0.2.1) | ||
activejob (= 6.0.2.1) | ||
activerecord (= 6.0.2.1) | ||
marcel (~> 0.3.1) | ||
activesupport (6.0.2.1) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
i18n (>= 0.7, < 2) | ||
minitest (~> 5.1) | ||
tzinfo (~> 1.1) | ||
zeitwerk (~> 2.2) | ||
builder (3.2.4) | ||
concurrent-ruby (1.1.6) | ||
crass (1.0.6) | ||
erubi (1.9.0) | ||
globalid (0.4.2) | ||
activesupport (>= 4.2.0) | ||
i18n (1.8.2) | ||
concurrent-ruby (~> 1.0) | ||
loofah (2.4.0) | ||
crass (~> 1.0.2) | ||
nokogiri (>= 1.5.9) | ||
mail (2.7.1) | ||
mini_mime (>= 0.1.1) | ||
marcel (0.3.3) | ||
mimemagic (~> 0.3.2) | ||
method_source (0.9.2) | ||
mimemagic (0.3.4) | ||
mini_mime (1.0.2) | ||
mini_portile2 (2.4.0) | ||
minitest (5.14.0) | ||
nio4r (2.5.2) | ||
nokogiri (1.10.8) | ||
mini_portile2 (~> 2.4.0) | ||
pg (1.2.2) | ||
rack (2.2.2) | ||
rack-test (1.1.0) | ||
rack (>= 1.0, < 3) | ||
rails (6.0.2.1) | ||
actioncable (= 6.0.2.1) | ||
actionmailbox (= 6.0.2.1) | ||
actionmailer (= 6.0.2.1) | ||
actionpack (= 6.0.2.1) | ||
actiontext (= 6.0.2.1) | ||
actionview (= 6.0.2.1) | ||
activejob (= 6.0.2.1) | ||
activemodel (= 6.0.2.1) | ||
activerecord (= 6.0.2.1) | ||
activestorage (= 6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
bundler (>= 1.3.0) | ||
railties (= 6.0.2.1) | ||
sprockets-rails (>= 2.0.0) | ||
rails-dom-testing (2.0.3) | ||
activesupport (>= 4.2.0) | ||
nokogiri (>= 1.6) | ||
rails-html-sanitizer (1.3.0) | ||
loofah (~> 2.3) | ||
railties (6.0.2.1) | ||
actionpack (= 6.0.2.1) | ||
activesupport (= 6.0.2.1) | ||
method_source | ||
rake (>= 0.8.7) | ||
thor (>= 0.20.3, < 2.0) | ||
rake (13.0.1) | ||
rgeo (2.1.1) | ||
rgeo-activerecord (6.2.1) | ||
activerecord (>= 5.0) | ||
rgeo (>= 1.0.0) | ||
sprockets (4.0.0) | ||
concurrent-ruby (~> 1.0) | ||
rack (> 1, < 3) | ||
sprockets-rails (3.2.1) | ||
actionpack (>= 4.0) | ||
activesupport (>= 4.0) | ||
sprockets (>= 3.0.0) | ||
thor (1.0.1) | ||
thread_safe (0.3.6) | ||
tzinfo (1.2.6) | ||
thread_safe (~> 0.1) | ||
websocket-driver (0.7.1) | ||
websocket-extensions (>= 0.1.0) | ||
websocket-extensions (0.1.4) | ||
zeitwerk (2.2.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
activerecord-postgis-adapter (~> 6.0.0) | ||
pg (~> 1.0) | ||
spatial_stats! | ||
|
||
BUNDLED WITH | ||
2.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,61 @@ | ||
# SpatialStats | ||
|
||
Short description and motivation. | ||
|
||
## Usage | ||
|
||
How to use my plugin. | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
```ruby | ||
gem 'spatial_stats' | ||
``` | ||
|
||
And then execute: | ||
|
||
```bash | ||
$ bundle | ||
``` | ||
|
||
Or install it yourself as: | ||
|
||
```bash | ||
$ gem install spatial_stats | ||
``` | ||
|
||
## Contributing | ||
Contribution directions go here. | ||
|
||
Once cloned, run the following commands to setup the test database. | ||
|
||
```sh | ||
cd ./spatial_stats | ||
cd test/dummy | ||
rake db:create | ||
rake db:migrate | ||
``` | ||
|
||
If you are getting an error, you may need to set the following environment variables. | ||
|
||
``` | ||
$PGUSER # default "postgres" | ||
$PGPASSWORD # default "" | ||
$PGHOST # default "127.0.0.1" | ||
$PGPORT # default "5432" | ||
$PGDATABASE # default "spatial_stats_test" | ||
``` | ||
|
||
If the dummy app is setup correctly, run the following: | ||
|
||
``` | ||
cd ../.. | ||
rake | ||
``` | ||
|
||
This will run the tests. If they all passed, then your environment is setup correctly. | ||
|
||
## License | ||
|
||
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
$:.push File.expand_path("lib", __dir__) | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.push File.expand_path('lib', __dir__) | ||
|
||
# Maintain your gem's version: | ||
require "spatial_stats/version" | ||
require 'spatial_stats/version' | ||
|
||
# Describe your gem and declare its dependencies: | ||
Gem::Specification.new do |spec| | ||
spec.name = "spatial_stats" | ||
spec.name = 'spatial_stats' | ||
spec.version = SpatialStats::VERSION | ||
spec.authors = ["Keith Doggett"] | ||
spec.email = ["[email protected]"] | ||
spec.homepage = "TODO" | ||
spec.summary = "TODO: Summary of SpatialStats." | ||
spec.description = "TODO: Description of SpatialStats." | ||
spec.license = "MIT" | ||
spec.authors = ['Keith Doggett'] | ||
spec.email = ['[email protected]'] | ||
spec.homepage = 'https://www.github.com/Kdoggett887/spatial_stats' | ||
spec.summary = 'An ActiveRecord/PostGIS extension that provides statistical methods to spatial postgresql databases.' | ||
spec.description = 'An ActiveRecord/PostGIS extension that provides'\ | ||
'statistical methods to spatial postgresql databases.'\ | ||
'It integrates with ActiveRecord to perform spatial weighting'\ | ||
' in PostGIS and performs statistical computations '\ | ||
'inside your rails app. Supports contiguious and distance-based'\ | ||
' calculations.' | ||
spec.license = 'MIT' | ||
|
||
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' | ||
# to allow pushing to a single host or delete this section to allow pushing to any host. | ||
if spec.respond_to?(:metadata) | ||
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" | ||
else | ||
raise "RubyGems 2.0 or newer is required to protect against " \ | ||
"public gem pushes." | ||
end | ||
# if spec.respond_to?(:metadata) | ||
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" | ||
# else | ||
# raise "RubyGems 2.0 or newer is required to protect against " \ | ||
# "public gem pushes." | ||
# end | ||
|
||
spec.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] | ||
spec.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] | ||
|
||
spec.add_dependency "rails", "~> 6.0.2", ">= 6.0.2.1" | ||
spec.add_dependency 'rails', '~> 6.0.0' | ||
|
||
spec.add_development_dependency "sqlite3" | ||
spec.add_development_dependency 'activerecord-postgis-adapter', '~> 6.0.0' | ||
spec.add_development_dependency 'pg', '~> 1.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class GeoPointModel < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class GeoPolygonModel < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class PointModel < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class PolygonModel < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/dummy/db/migrate/20200229235915_create_point_models.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreatePointModels < ActiveRecord::Migration[6.0] | ||
def change | ||
create_table :point_models do |t| | ||
t.st_point :position | ||
t.float :value | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
test/dummy/db/migrate/20200301000228_create_geo_point_models.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreateGeoPointModels < ActiveRecord::Migration[6.0] | ||
def change | ||
create_table :geo_point_models do |t| | ||
t.st_point :latlon, geographic: true | ||
t.float :value | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
test/dummy/db/migrate/20200301000304_create_polygon_models.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreatePolygonModels < ActiveRecord::Migration[6.0] | ||
def change | ||
create_table :polygon_models do |t| | ||
t.st_polygon :geom | ||
t.float :value | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
test/dummy/db/migrate/20200301000554_create_geo_polygon_models.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreateGeoPolygonModels < ActiveRecord::Migration[6.0] | ||
def change | ||
create_table :geo_polygon_models do |t| | ||
t.st_polygon :geom, geographic: true | ||
t.float :value | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
Oops, something went wrong.