heroku_postgis 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +25 -0
- data/Rakefile +1 -0
- data/heroku_postgis.gemspec +18 -0
- data/lib/heroku_postgis.rb +2 -0
- data/lib/heroku_postgis/railtie.rb +23 -0
- data/lib/heroku_postgis/version.rb +3 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 069ceae86560227f39bb801cff508d1781a0411d
|
4
|
+
data.tar.gz: 9fb522725eeae2959b18e88de29042618b0d1b4b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ccf9a777cae0f8f052b81de9aa930090e642adcb535a6a3ed97963d809a6c866caaa909c6ccea8a6637c6919317df7f377d8949f7635dbebc3684707a54a6770
|
7
|
+
data.tar.gz: 0d27d512555eafedf4060bc83242bab4dacde3e4d21cf1bdf59de8bd93f11fd291ec99f3d11731504dcce6407207b8d5d33a4d84976a21a5e705612a3a2c4505
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Ben Woodall
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Heroku Postgis Railtie
|
2
|
+
|
3
|
+
This Railtie updates your database config to work with Postgis and Heroku. On
|
4
|
+
launch, Heroku updates your database.yml file to work with their database
|
5
|
+
instances. This overrides those updates to make sure the database adapter
|
6
|
+
type is set to 'postgis'.
|
7
|
+
|
8
|
+
The idea for this Railtie is from the Heroku article at:
|
9
|
+
|
10
|
+
https://devcenter.heroku.com/articles/postgis#setting-up-postgis-with-rails
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'heroku_postgis'
|
16
|
+
|
17
|
+
And that's it! There is no need to require this anywhere in your Rails app.
|
18
|
+
|
19
|
+
## Contributing
|
20
|
+
|
21
|
+
1. Fork it
|
22
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
23
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
24
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
25
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'heroku_postgis/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "heroku_postgis"
|
8
|
+
spec.version = HerokuPostgis::VERSION
|
9
|
+
spec.authors = ["Ben Woodall"]
|
10
|
+
spec.email = ["mail@benwoodall.com"]
|
11
|
+
spec.description = "Railtie to facilitate PostGis integration with Heroku."
|
12
|
+
spec.summary = "Heroku/PostGis Railtie"
|
13
|
+
spec.homepage = "http://github.com/benwoody/heroku_postgis"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.require_paths = ["lib"]
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module HerokuPostgis
|
2
|
+
class Railtie < Rails::Railtie
|
3
|
+
initializer "active_record.initialize_database.heroku_postgis" do
|
4
|
+
ActiveSupport.on_load(:active_record) do
|
5
|
+
if url = ENV['DATABASE_URL']
|
6
|
+
ActiveRecord::Base.connection_pool.disconnect!
|
7
|
+
parsed_url = URI.parse(url)
|
8
|
+
config = {
|
9
|
+
adapter: 'postgis',
|
10
|
+
host: parsed_url.host,
|
11
|
+
encoding: 'unicode',
|
12
|
+
database: parsed_url.path.split("/")[-1],
|
13
|
+
port: parsed_url.port,
|
14
|
+
username: parsed_url.user,
|
15
|
+
password: parsed_url.password
|
16
|
+
}
|
17
|
+
establish_connection(config)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: heroku_postgis
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Woodall
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Railtie to facilitate PostGis integration with Heroku.
|
14
|
+
email:
|
15
|
+
- mail@benwoodall.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- .gitignore
|
21
|
+
- Gemfile
|
22
|
+
- LICENSE.txt
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- heroku_postgis.gemspec
|
26
|
+
- lib/heroku_postgis.rb
|
27
|
+
- lib/heroku_postgis/railtie.rb
|
28
|
+
- lib/heroku_postgis/version.rb
|
29
|
+
homepage: http://github.com/benwoody/heroku_postgis
|
30
|
+
licenses:
|
31
|
+
- MIT
|
32
|
+
metadata: {}
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
requirements: []
|
48
|
+
rubyforge_project:
|
49
|
+
rubygems_version: 2.1.10
|
50
|
+
signing_key:
|
51
|
+
specification_version: 4
|
52
|
+
summary: Heroku/PostGis Railtie
|
53
|
+
test_files: []
|