geokit-nominatim 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ coverage
2
+ rdoc
3
+ doc
4
+ .bundle
5
+ pkg
6
+ .DS_Store
7
+ Gemfile.lock
data/Gemfile CHANGED
@@ -11,6 +11,4 @@ gem 'geokit'
11
11
  group :development do
12
12
  gem "rspec" #, "~> 2.3.0"
13
13
  gem "bundler" #, "~> 1.0.0"
14
- gem "jeweler" #, "~> 1.6.2"
15
- gem "rcov", ">= 0"
16
14
  end
data/HISTORY.txt ADDED
@@ -0,0 +1,9 @@
1
+ v1.0.1 2012/05/24
2
+
3
+ - Merge pull request #2 from ya-jeks/master
4
+ - Merge pull request #1 from inossidabile/master
5
+ - got rid of jeweler, added VERSION constant to NominatimGeocoder class
6
+
7
+ v1.0.0 2011/06/24
8
+
9
+ - initial version
data/Rakefile CHANGED
@@ -2,48 +2,9 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'bundler'
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
10
- exit e.status_code
11
- end
12
- require 'rake'
13
-
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "geokit-nominatim"
18
- gem.homepage = "http://github.com/sobakasu/geokit-nominatim"
19
- gem.license = "MIT"
20
- gem.summary = %Q{Nominatim geocoding provider for geokit}
21
- gem.description = %Q{Nominatim geocoding provider for geokit}
22
- gem.email = "sobakasu@gmail.com"
23
- gem.authors = ["Andrew Williams"]
24
- # dependencies defined in Gemfile
25
- end
26
- Jeweler::RubygemsDotOrgTasks.new
27
-
28
- require 'rspec/core'
5
+ require 'bundler/gem_tasks'
29
6
  require 'rspec/core/rake_task'
30
- RSpec::Core::RakeTask.new(:spec) do |spec|
31
- spec.pattern = FileList['spec/**/*_spec.rb']
32
- end
33
-
34
- RSpec::Core::RakeTask.new(:rcov) do |spec|
35
- spec.pattern = 'spec/**/*_spec.rb'
36
- spec.rcov = true
37
- end
38
-
39
- task :default => :spec
40
-
41
- require 'rake/rdoctask'
42
- Rake::RDocTask.new do |rdoc|
43
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
7
 
45
- rdoc.rdoc_dir = 'rdoc'
46
- rdoc.title = "geokit-nominatim #{version}"
47
- rdoc.rdoc_files.include('README*')
48
- rdoc.rdoc_files.include('lib/**/*.rb')
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ t.pattern = 'spec/*_spec.rb'
49
10
  end
@@ -1,66 +1,24 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require 'geokit-nominatim'
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{geokit-nominatim}
8
- s.version = "1.0.0"
6
+ s.name = "geokit-nominatim"
7
+ s.version = Geokit::Geocoders::NominatimGeocoder::VERSION
8
+ s.authors = ["Andrew Williams"]
9
+ s.email = ["sobakasu@gmail.com"]
10
+ s.homepage = "http://github.com/sobakasu/geokit-nominatim"
11
+ s.summary = %Q{Nominatim geocoding provider for geokit}
12
+ s.description = %Q{Nominatim geocoding provider for geokit}
9
13
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Andrew Williams"]
12
- s.date = %q{2011-06-25}
13
- s.description = %q{Nominatim geocoding provider for geokit}
14
- s.email = %q{sobakasu@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE.txt",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rspec",
22
- "Gemfile",
23
- "LICENSE.txt",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "geokit-nominatim.gemspec",
28
- "lib/geokit-nominatim.rb",
29
- "lib/geokit/geocoders/nominatim_geocoder.rb",
30
- "spec/nominatim_geocoder_spec.rb",
31
- "spec/spec_helper.rb"
32
- ]
33
- s.homepage = %q{http://github.com/sobakasu/geokit-nominatim}
34
- s.licenses = ["MIT"]
35
- s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.6.2}
37
- s.summary = %q{Nominatim geocoding provider for geokit}
14
+ s.rubyforge_project = "geokit-nominatim"
38
15
 
39
- if s.respond_to? :specification_version then
40
- s.specification_version = 3
16
+ s.files = `git ls-files | grep -v pkg`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib", "app"]
41
20
 
42
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
- s.add_runtime_dependency(%q<json_pure>, [">= 0"])
44
- s.add_runtime_dependency(%q<geokit>, [">= 0"])
45
- s.add_development_dependency(%q<rspec>, [">= 0"])
46
- s.add_development_dependency(%q<bundler>, [">= 0"])
47
- s.add_development_dependency(%q<jeweler>, [">= 0"])
48
- s.add_development_dependency(%q<rcov>, [">= 0"])
49
- else
50
- s.add_dependency(%q<json_pure>, [">= 0"])
51
- s.add_dependency(%q<geokit>, [">= 0"])
52
- s.add_dependency(%q<rspec>, [">= 0"])
53
- s.add_dependency(%q<bundler>, [">= 0"])
54
- s.add_dependency(%q<jeweler>, [">= 0"])
55
- s.add_dependency(%q<rcov>, [">= 0"])
56
- end
57
- else
58
- s.add_dependency(%q<json_pure>, [">= 0"])
59
- s.add_dependency(%q<geokit>, [">= 0"])
60
- s.add_dependency(%q<rspec>, [">= 0"])
61
- s.add_dependency(%q<bundler>, [">= 0"])
62
- s.add_dependency(%q<jeweler>, [">= 0"])
63
- s.add_dependency(%q<rcov>, [">= 0"])
64
- end
21
+ # Gem dependencies
22
+ s.add_dependency("json_pure", "~> 1.7")
23
+ s.add_dependency("geokit", "~> 1.6")
65
24
  end
66
-
@@ -1,5 +1,6 @@
1
1
  class Geokit::Geocoders::NominatimGeocoder < Geokit::Geocoders::Geocoder
2
2
 
3
+ VERSION = "1.0.1"
3
4
  PLACE_KEYS = %W{city state postcode country country_code house_number house
4
5
  hamlet}
5
6
  PROVIDER = 'nominatim'
@@ -23,7 +24,7 @@ class Geokit::Geocoders::NominatimGeocoder < Geokit::Geocoders::Geocoder
23
24
  opts = options.merge(:q => address_str, :limit => 1,
24
25
  :format => :xml, :addressdetails => 1)
25
26
  opts.delete(:server)
26
- params = opts.collect { |k,v| "#{k}=#{escape(v)}" }.join("&")
27
+ params = opts.collect { |k,v| "#{k}=#{URI.escape(v.to_s)}" }.join("&")
27
28
 
28
29
  # send query
29
30
  url = "#{server}?#{params}"
@@ -32,6 +33,7 @@ class Geokit::Geocoders::NominatimGeocoder < Geokit::Geocoders::Geocoder
32
33
 
33
34
  # parse response
34
35
  xml = server_res.body
36
+ xml = xml.force_encoding('utf-8') if xml.respond_to?(:force_encoding)
35
37
  logger.debug "nominatim geocoding. Address: #{address}. Result: #{xml}"
36
38
  self.parse_response(xml, res)
37
39
  res
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geokit-nominatim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,112 +9,73 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-25 00:00:00.000000000 +09:30
13
- default_executable:
12
+ date: 2012-05-24 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: json_pure
17
- requirement: &2152833080 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
- - - ! '>='
19
+ - - ~>
21
20
  - !ruby/object:Gem::Version
22
- version: '0'
21
+ version: '1.7'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *2152833080
26
- - !ruby/object:Gem::Dependency
27
- name: geokit
28
- requirement: &2152832100 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: *2152832100
37
- - !ruby/object:Gem::Dependency
38
- name: rspec
39
- requirement: &2152831220 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: '0'
45
- type: :development
46
- prerelease: false
47
- version_requirements: *2152831220
48
- - !ruby/object:Gem::Dependency
49
- name: bundler
50
- requirement: &2152830320 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
51
25
  none: false
52
26
  requirements:
53
- - - ! '>='
27
+ - - ~>
54
28
  - !ruby/object:Gem::Version
55
- version: '0'
56
- type: :development
57
- prerelease: false
58
- version_requirements: *2152830320
29
+ version: '1.7'
59
30
  - !ruby/object:Gem::Dependency
60
- name: jeweler
61
- requirement: &2152829580 !ruby/object:Gem::Requirement
31
+ name: geokit
32
+ requirement: !ruby/object:Gem::Requirement
62
33
  none: false
63
34
  requirements:
64
- - - ! '>='
35
+ - - ~>
65
36
  - !ruby/object:Gem::Version
66
- version: '0'
67
- type: :development
37
+ version: '1.6'
38
+ type: :runtime
68
39
  prerelease: false
69
- version_requirements: *2152829580
70
- - !ruby/object:Gem::Dependency
71
- name: rcov
72
- requirement: &2152828720 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
73
41
  none: false
74
42
  requirements:
75
- - - ! '>='
43
+ - - ~>
76
44
  - !ruby/object:Gem::Version
77
- version: '0'
78
- type: :development
79
- prerelease: false
80
- version_requirements: *2152828720
45
+ version: '1.6'
81
46
  description: Nominatim geocoding provider for geokit
82
- email: sobakasu@gmail.com
47
+ email:
48
+ - sobakasu@gmail.com
83
49
  executables: []
84
50
  extensions: []
85
- extra_rdoc_files:
86
- - LICENSE.txt
87
- - README.rdoc
51
+ extra_rdoc_files: []
88
52
  files:
89
53
  - .document
54
+ - .gitignore
90
55
  - .rspec
91
56
  - Gemfile
57
+ - HISTORY.txt
92
58
  - LICENSE.txt
93
59
  - README.rdoc
94
60
  - Rakefile
95
- - VERSION
96
61
  - geokit-nominatim.gemspec
97
62
  - lib/geokit-nominatim.rb
98
63
  - lib/geokit/geocoders/nominatim_geocoder.rb
99
64
  - spec/nominatim_geocoder_spec.rb
100
65
  - spec/spec_helper.rb
101
- has_rdoc: true
102
66
  homepage: http://github.com/sobakasu/geokit-nominatim
103
- licenses:
104
- - MIT
67
+ licenses: []
105
68
  post_install_message:
106
69
  rdoc_options: []
107
70
  require_paths:
108
71
  - lib
72
+ - app
109
73
  required_ruby_version: !ruby/object:Gem::Requirement
110
74
  none: false
111
75
  requirements:
112
76
  - - ! '>='
113
77
  - !ruby/object:Gem::Version
114
78
  version: '0'
115
- segments:
116
- - 0
117
- hash: 2076618883302095355
118
79
  required_rubygems_version: !ruby/object:Gem::Requirement
119
80
  none: false
120
81
  requirements:
@@ -122,9 +83,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
83
  - !ruby/object:Gem::Version
123
84
  version: '0'
124
85
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 1.6.2
86
+ rubyforge_project: geokit-nominatim
87
+ rubygems_version: 1.8.24
127
88
  signing_key:
128
89
  specification_version: 3
129
90
  summary: Nominatim geocoding provider for geokit
130
- test_files: []
91
+ test_files:
92
+ - spec/nominatim_geocoder_spec.rb
93
+ - spec/spec_helper.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.0