geopolitical 0.9.5 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +1 -3
- data/Gemfile +1 -0
- data/README.md +10 -2
- data/app/models/city.rb +4 -4
- data/app/models/nation.rb +2 -1
- data/app/models/region.rb +2 -1
- data/lib/geopolitical/version.rb +1 -1
- data/spec/dummy/log/test.log +8 -0
- data/spec/spec_helper.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3174509562c44b4d8c7c554f0f488640792801ee
|
4
|
+
data.tar.gz: f2bddb266028d674ee0f5d429466550199fcc96f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f87b112c29ceb2155591bc0af21c58190d95cc9b33a1ae5e8c5449ea2f68fadeb97ea6791b8b15ce7d863e2a3965f149abc489110f9e16079fc2b0ac9dcbd6be
|
7
|
+
data.tar.gz: a8c82935bef65f1127d240eb8e7fdd802e8a02b84490ab661feacc45882cd6983c8e9cc534f1becadb479a25ff4063f6909a35b44ef5ad365660a4123fb85e95
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
language: ruby
|
2
2
|
bundler_args: --without development
|
3
3
|
rvm:
|
4
|
-
- 1.9.3
|
5
4
|
- 2.2.2
|
6
5
|
- ruby-head
|
7
6
|
- jruby
|
@@ -12,11 +11,10 @@ rvm:
|
|
12
11
|
# - oraclejdk7
|
13
12
|
# - openjdk7
|
14
13
|
|
15
|
-
env: CI="travis"
|
14
|
+
env: CI="travis"
|
16
15
|
|
17
16
|
matrix:
|
18
17
|
allow_failures:
|
19
|
-
- rvm: 1.9.3
|
20
18
|
- rvm: jruby
|
21
19
|
- rvm: ruby-head
|
22
20
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
Geopolitical
|
2
2
|
============
|
3
3
|
|
4
|
-
[![
|
5
|
-
[![
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/geopolitical.svg)](http://badge.fury.io/rb/geopolitical)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/fireho/geopolitical.svg)](https://codeclimate.com/github/fireho/geopolitical)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/fireho/geopolitical/badge.svg?branch=&service=github)](https://coveralls.io/github/fireho/geopolitical?branch=)
|
7
|
+
[![Dependency Status](https://gemnasium.com/fireho/geopolitical.svg)](https://gemnasium.com/fireho/geopolitical)
|
8
|
+
[![Build Status](https://travis-ci.org/fireho/geopolitical.svg)](https://travis-ci.org/fireho/geopolitical)
|
6
9
|
|
7
10
|
Geopolitical models ready to use!
|
8
11
|
|
@@ -79,5 +82,10 @@ Populate
|
|
79
82
|
Use Geonames_local to populate data easily!
|
80
83
|
"geonames_local"(https://github.com/fireho/geonames_local)
|
81
84
|
|
85
|
+
Links
|
86
|
+
-----
|
87
|
+
|
88
|
+
http://download.geonames.org/export/dump/
|
89
|
+
http://www.statoids.com/ubr.html
|
82
90
|
|
83
91
|
This project rocks and uses MIT-LICENSE.
|
data/app/models/city.rb
CHANGED
@@ -14,12 +14,12 @@ class City
|
|
14
14
|
|
15
15
|
attr_writer :x, :y, :z
|
16
16
|
|
17
|
-
belongs_to :region
|
18
|
-
belongs_to :nation
|
17
|
+
belongs_to :region, inverse_of: :cities
|
18
|
+
belongs_to :nation, inverse_of: :cities
|
19
19
|
has_many :hoods
|
20
20
|
|
21
|
-
has_one :
|
22
|
-
has_one :
|
21
|
+
has_one :nation_governancy, as: :nation_capital
|
22
|
+
has_one :region_governancy, as: :region_capital
|
23
23
|
|
24
24
|
before_validation :set_defaults, on: [:create]
|
25
25
|
|
data/app/models/nation.rb
CHANGED
@@ -18,7 +18,8 @@ class Nation
|
|
18
18
|
alias_method :iso_3166_3, :code3
|
19
19
|
|
20
20
|
validates :abbr, uniqueness: true, presence: true
|
21
|
-
|
21
|
+
|
22
|
+
belongs_to :capital, inverse_of: :nation_capital, class_name: 'City'
|
22
23
|
|
23
24
|
has_many :regions, dependent: :destroy
|
24
25
|
has_many :cities, dependent: :destroy
|
data/app/models/region.rb
CHANGED
@@ -10,7 +10,8 @@ class Region
|
|
10
10
|
belongs_to :nation
|
11
11
|
|
12
12
|
has_many :cities, dependent: :destroy
|
13
|
-
|
13
|
+
|
14
|
+
belongs_to :capital, inverse_of: :region_capital, class_name: 'City'
|
14
15
|
|
15
16
|
validates :nation, presence: true
|
16
17
|
validates :name, uniqueness: { scope: :nation_id }
|
data/lib/geopolitical/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -19324,3 +19324,11 @@ Overwriting existing field _id in class Nation.
|
|
19324
19324
|
Overwriting existing field _id in class Nation.
|
19325
19325
|
Overwriting existing field _id in class Nation.
|
19326
19326
|
Overwriting existing field _id in class Nation.
|
19327
|
+
Overwriting existing field _id in class Nation.
|
19328
|
+
Overwriting existing field _id in class Nation.
|
19329
|
+
Overwriting existing field _id in class Nation.
|
19330
|
+
Overwriting existing field _id in class Nation.
|
19331
|
+
Overwriting existing field _id in class Nation.
|
19332
|
+
Overwriting existing field _id in class Nation.
|
19333
|
+
Overwriting existing field _id in class Nation.
|
19334
|
+
Overwriting existing field _id in class Nation.
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geopolitical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|