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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ddbbc3d314fc70c0c5d7779788c3a28e9ceb328
4
- data.tar.gz: 10dafe1e76ddeda92f13d939fc79358954e2cd1e
3
+ metadata.gz: 3174509562c44b4d8c7c554f0f488640792801ee
4
+ data.tar.gz: f2bddb266028d674ee0f5d429466550199fcc96f
5
5
  SHA512:
6
- metadata.gz: a68e63ee84e918a9c04aaba54d2279adaee7bbf5a2f7816f1a6d9943793cb0812693c3c247faefd741f8d9107a9a5db9ad3125c184f8e1002fd5aa7b78d0e836
7
- data.tar.gz: d7251098fec828c5022b2a4ac5ec2e85427c720019ecb5d0b93f30199f2c509d6dea76f448f07b23800df04ca5528c1004d3316be71d2d327dd220376bfe00f1
6
+ metadata.gz: f87b112c29ceb2155591bc0af21c58190d95cc9b33a1ae5e8c5449ea2f68fadeb97ea6791b8b15ce7d863e2a3965f149abc489110f9e16079fc2b0ac9dcbd6be
7
+ data.tar.gz: a8c82935bef65f1127d240eb8e7fdd802e8a02b84490ab661feacc45882cd6983c8e9cc534f1becadb479a25ff4063f6909a35b44ef5ad365660a4123fb85e95
data/.gitignore CHANGED
@@ -7,4 +7,5 @@ spec/dummy/log/*.log
7
7
  spec/dummy/tmp/
8
8
  spec/dummy/.sass-cache
9
9
  Gemfile.lock
10
- tmp/*
10
+ tmp/*
11
+ coverage/*
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" JRUBY_OPTS="--server -Xcompile.invokedynamic=false -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify -J-Xms512m -J-Xmx1024m"
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
@@ -13,3 +13,4 @@ gem 'rspec-rails'
13
13
  gem 'guard'
14
14
  gem 'guard-rspec'
15
15
  gem 'guard-rubocop'
16
+ gem 'coveralls', require: false
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  Geopolitical
2
2
  ============
3
3
 
4
- [![Code Climate](https://codeclimate.com/github/fireho/geopolitical.png)](https://codeclimate.com/github/fireho/geopolitical)
5
- [![Build Status](https://travis-ci.org/fireho/geopolitical.png)](https://travis-ci.org/fireho/geopolitical)
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 :nation, as: :capital
22
- has_one :region, as: :capital
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
- belongs_to :capital, class_name: 'City'
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
- belongs_to :capital, class_name: 'City'
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 }
@@ -1,4 +1,4 @@
1
1
  # :nodoc:
2
2
  module Geopolitical
3
- VERSION = '0.9.5'
3
+ VERSION = '0.9.7'
4
4
  end
@@ -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
@@ -5,6 +5,8 @@ require 'rspec/rails'
5
5
  require 'faker'
6
6
  require 'fabrication'
7
7
  require 'fabrication/syntax/make'
8
+ require 'coveralls'
9
+ Coveralls.wear!
8
10
 
9
11
  # Requires supporting ruby files with custom matchers and macros, etc,
10
12
  # in spec/support/ and its subdirectories.
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.5
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-30 00:00:00.000000000 Z
11
+ date: 2015-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid