rwanda 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9eb49bda9660b07247da012084427c95db096c59
4
- data.tar.gz: ced4996fa49ade4d65d45c2ca2c683aa0bef0122
3
+ metadata.gz: ad2a723bd51dd539d89fab152fcd8bfd99535c27
4
+ data.tar.gz: a162f3eed7b7cece0dcbdaa23fe17de9caf3d194
5
5
  SHA512:
6
- metadata.gz: 3a6f6fae7b405baa87d56a8f1d23c5c152264033f32c9e9be0cb59ef3c1e98e4a66b57d90fd070d736f764eda9234ef610e3e6806e2d2074cbda4234cbb54187
7
- data.tar.gz: 1ae1caed1a6ed98f1ae502cd3ed727ceb3b05f2b2397b0334ffcf51a2181f4a97781d3d7d3d7574c98a98f0dc988473f4cf107620e0bd4e83f3b653e5bfbcea9
6
+ metadata.gz: f25d6fc529b581faf237b8ff7ef9c0930bc2d9d19d98c8d14546e60159e7bec96d098ffa05c06e5e6fb614982d0702f1253299ab109ff93e357afc356e2dbebe
7
+ data.tar.gz: efde3156ec4edc27a73beaec6eabbc3aa1881b0f0512c3c7260100173557b6f4c41ad93cc2f0c2c76d0bc4be1c87ad650dfc173492c53b4371470edb4561619a
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.2
4
+
5
+ * adding .select_first to Array seems to cause freeze problems with newer versions of Ruby (2+?) so they've been removed
6
+
3
7
  ## 0.8.1
4
8
 
5
9
  * Make pry a runtime dependency
data/README.md CHANGED
@@ -57,9 +57,8 @@ pry(main)> rw.district_of 'Giheke'
57
57
  => "Rusizi"
58
58
  pry(main)> rw.district_of 'Busasamana' # returns array if multiple
59
59
  => ["Nyanza", "Rubavu"]
60
- pry(main)> rw.sector_like 'Rukuma'
61
- RuntimeError: can't modify frozen #<Class:#<Rwanda:0x007f00ea48cf28>>
62
- from /home/slack/vendor/bundle/gems/rwanda-0.7.1/lib/rwanda.rb:87:in `sectors'
60
+ pry(main)> r.sector_like 'Rukuma'
61
+ => "Rukumberi"
63
62
  pry(main)> rw.is_district? 'Karongi'
64
63
  => true
65
64
  pry(main)> rw.is_sector? 'Gashari'
@@ -102,6 +101,12 @@ If you are not familiar with this data set, it's worth noting the following feat
102
101
  * at the cell or village level, there may be multiple villages with the same name, differentiated by a number (in roman numerals) e.g. Matimba cell has seven "Umudugudu Wa"s
103
102
  * you might find where_is? helpful for inspecting ambiguity: it lists all divisions at all levels that share the name you give it (try `rw.where_is? 'Gatsibo'`)
104
103
 
104
+ ## Other Sources
105
+
106
+ To my knowledge, this dataset has not been published by MINALOC.
107
+
108
+ [NISR](http://www.statistics.gov.rw/) do, however, publish this information in CSV format down to cell level (2148 cells), as part of their [geolocation datasets](http://statistics.gov.rw/geodata).
109
+
105
110
  ## Contributing
106
111
 
107
112
  1. Fork it ( https://github.com/repent/rwanda/fork )
@@ -34,7 +34,8 @@ class Rwanda
34
34
 
35
35
  # Singular Ofs ((
36
36
  def province_of(district, rw=false)
37
- village = @villages.select_first {|v| v.district.downcase == district.downcase}
37
+ #village = @villages.select_first {|v| v.district.downcase == district.downcase}
38
+ village = @villages.select {|v| v.district.downcase == district.downcase}.first
38
39
  if village
39
40
  if rw then RW[village.province] else village.province end
40
41
  else
@@ -1,8 +1,8 @@
1
- class Array
2
- def select_first
3
- self.each do |el|
4
- return el if yield(el)
5
- end
6
- nil
7
- end
8
- end
1
+ #class Array
2
+ # def select_first
3
+ # self.each do |el|
4
+ # return el if yield(el)
5
+ # end
6
+ # nil
7
+ # end
8
+ #end
@@ -1,3 +1,3 @@
1
1
  class Rwanda
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rwanda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Hetherington
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler