geogov 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,15 +1,25 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'bundler'
1
+ # -*- encoding: utf-8 -*-
4
2
 
5
- Bundler::GemHelper.install_tasks
3
+ require "bundler/gem_tasks"
4
+ require "rdoc/task"
5
+ require 'rake/testtask'
6
6
 
7
- task :default => [:test_units]
7
+ RDoc::Task.new do |rd|
8
+ rd.rdoc_files.include("lib/**/*.rb")
9
+ rd.rdoc_dir = "rdoc"
10
+ end
8
11
 
9
- desc "Run basic tests"
10
- Rake::TestTask.new("test_units") { |t|
12
+ Rake::TestTask.new("test") do |t|
13
+ t.ruby_opts << "-rubygems"
11
14
  t.libs << "test"
12
- t.pattern = 'test/*_test.rb'
15
+ t.test_files = FileList["test/**/*_test.rb"]
13
16
  t.verbose = true
14
- t.warning = true
15
- }
17
+ end
18
+
19
+ require "gem_publisher"
20
+ task :publish_gem do |t|
21
+ gem = GemPublisher.publish_if_updated("geogov.gemspec", :rubygems)
22
+ puts "Published #{gem}" if gem
23
+ end
24
+
25
+ task :default => :test
@@ -82,6 +82,7 @@ module Geogov
82
82
 
83
83
  def formatted_authority_name(type)
84
84
  authority = get_authority(type) or return type
85
+
85
86
  authority["name"].gsub(%r{
86
87
  \s*((((District|Borough|County|City)\s|)Council|Community)\s?)+ |
87
88
  \s(North|East|South|West|Central)$ |
@@ -65,7 +65,8 @@ module Geogov
65
65
  results = {:point => {'lat' => lat, 'lon' => lon}}
66
66
  councils = { }
67
67
 
68
- query.each do |id, area_info|
68
+ areas = Hash[query.select {|key, value| key =~ /^\d+$/}]
69
+ areas.each do |id, area_info|
69
70
  type = area_info['type'].upcase.to_sym
70
71
  level = translate_area_type_to_shortcut(area_info['type'])
71
72
 
@@ -0,0 +1,3 @@
1
+ module Geogov
2
+ VERSION = '0.0.12'
3
+ end
metadata CHANGED
@@ -1,86 +1,110 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: geogov
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.11
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.0.12
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Ben Griffiths
9
9
  - James Stewart
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-04 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
13
+
14
+ date: 2012-10-10 00:00:00 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
16
17
  name: rake
17
- requirement: &15045680 !ruby/object:Gem::Requirement
18
+ requirement: &id001 !ruby/object:Gem::Requirement
18
19
  none: false
19
- requirements:
20
+ requirements:
20
21
  - - ~>
21
- - !ruby/object:Gem::Version
22
+ - !ruby/object:Gem::Version
22
23
  version: 0.9.0
23
24
  type: :development
24
25
  prerelease: false
25
- version_requirements: *15045680
26
- - !ruby/object:Gem::Dependency
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
27
28
  name: mocha
28
- requirement: &15045200 !ruby/object:Gem::Requirement
29
+ requirement: &id002 !ruby/object:Gem::Requirement
29
30
  none: false
30
- requirements:
31
+ requirements:
31
32
  - - ~>
32
- - !ruby/object:Gem::Version
33
+ - !ruby/object:Gem::Version
33
34
  version: 0.9.0
34
35
  type: :development
35
36
  prerelease: false
36
- version_requirements: *15045200
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: gem_publisher
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 1.1.1
46
+ type: :development
47
+ prerelease: false
48
+ version_requirements: *id003
37
49
  description: Geolocation and utilities for UK Government single domain
38
- email:
50
+ email:
39
51
  - ben@alphagov.co.uk
40
52
  - jystewart@gmail.com
41
53
  executables: []
54
+
42
55
  extensions: []
56
+
43
57
  extra_rdoc_files: []
44
- files:
45
- - lib/geogov.rb
58
+
59
+ files:
46
60
  - lib/geogov/utils.rb
47
- - lib/geogov/fuzzy_point.rb
48
- - lib/geogov/providers/hostip.rb
49
- - lib/geogov/providers/dracos_gazetteer.rb
50
- - lib/geogov/providers/mapit.rb
51
- - lib/geogov/providers/google.rb
61
+ - lib/geogov/version.rb
52
62
  - lib/geogov/providers/geonames.rb
63
+ - lib/geogov/providers/google.rb
64
+ - lib/geogov/providers/mapit.rb
53
65
  - lib/geogov/providers/open_street_map.rb
66
+ - lib/geogov/providers/dracos_gazetteer.rb
67
+ - lib/geogov/providers/hostip.rb
54
68
  - lib/geogov/geo_stack.rb
69
+ - lib/geogov/fuzzy_point.rb
70
+ - lib/geogov.rb
55
71
  - Gemfile
56
72
  - Rakefile
57
- - test/test_helper.rb
58
73
  - test/geogov_test.rb
74
+ - test/test_helper.rb
59
75
  homepage: http://github.com/alphagov/geogov
60
76
  licenses: []
77
+
61
78
  post_install_message:
62
79
  rdoc_options: []
63
- require_paths:
80
+
81
+ require_paths:
64
82
  - lib
65
- required_ruby_version: !ruby/object:Gem::Requirement
83
+ required_ruby_version: !ruby/object:Gem::Requirement
66
84
  none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: -229329892177929289
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
93
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: -229329892177929289
98
+ segments:
99
+ - 0
100
+ version: "0"
77
101
  requirements: []
102
+
78
103
  rubyforge_project:
79
- rubygems_version: 1.8.11
104
+ rubygems_version: 1.8.24
80
105
  signing_key:
81
106
  specification_version: 3
82
107
  summary: Geolocation and utilities for UK Government single domain
83
- test_files:
84
- - test/test_helper.rb
108
+ test_files:
85
109
  - test/geogov_test.rb
86
- has_rdoc:
110
+ - test/test_helper.rb