omniauth-osm 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ 1.8.7-p371
data/README.md CHANGED
@@ -36,6 +36,12 @@ You will obviously have to put in your key and secret, which you get when you re
36
36
 
37
37
  Now just follow the README at: https://github.com/intridea/omniauth
38
38
 
39
+ ## Other Servers
40
+
41
+ If you would like to use this plugin against another OSM server, such as the test development server you can use the environment variable OSM_AUTH_SITE to set the server to connect to.
42
+
43
+ You could for example use the gem figaro to configure the environment variable, or roll your own preinitialiser similar to the OpenStreetMap website.
44
+
39
45
  ## Note on Patches/Pull Requests
40
46
 
41
47
  - Fork the project.
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Osm
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -6,7 +6,15 @@ module OmniAuth
6
6
  class Osm < OmniAuth::Strategies::OAuth
7
7
  option :name, "osm"
8
8
 
9
- option :client_options, :site => 'http://www.openstreetmap.org'
9
+ def self.site
10
+ if ENV['OSM_AUTH_SITE']
11
+ ENV['OSM_AUTH_SITE']
12
+ else
13
+ "http://www.openstreetmap.org"
14
+ end
15
+ end
16
+
17
+ option :client_options, :site => site
10
18
  option :fetch_permissions, false
11
19
 
12
20
  uid { raw_info['id'] }
@@ -13,8 +13,15 @@ describe OmniAuth::Strategies::Osm do
13
13
  end
14
14
 
15
15
  describe '#client_options' do
16
- it 'has correct Osm site' do
17
- subject.options.client_options.site.should eq('http://www.openstreetmap.org')
16
+ it 'has correct default production site' do
17
+ OmniAuth::Strategies::Osm.site.should eq('http://www.openstreetmap.org')
18
+ end
19
+
20
+ it 'should use the correct environment site override' do
21
+ stub_const("ENV", {'OSM_AUTH_SITE' => 'http://api06.dev.openstreetmap.org'})
22
+ # Can't test the subject directly here as the site was set on class load,
23
+ # but could still override it via an options hash if you wanted to
24
+ OmniAuth::Strategies::Osm.site.should eq('http://api06.dev.openstreetmap.org')
18
25
  end
19
26
  end
20
27
 
@@ -106,7 +113,7 @@ EOX
106
113
 
107
114
  it "initializes raw_info properly if no xml is returned" do
108
115
  response_body = "foo bar"
109
- access_token = mock(:get => mock(:body => response_body))
116
+ access_token = double(:get => double(:body => response_body))
110
117
  subject.should_receive(:access_token).and_return(access_token)
111
118
 
112
119
  subject.raw_info.should eq({"languages" => []})
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-osm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Christoph B\xC3\xBCnte"
@@ -15,10 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-09 00:00:00 Z
18
+ date: 2013-10-25 00:00:00 +02:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirement: &id001 !ruby/object:Gem::Requirement
22
23
  none: false
23
24
  requirements:
24
25
  - - ~>
@@ -28,12 +29,12 @@ dependencies:
28
29
  - 1
29
30
  - 0
30
31
  version: "1.0"
31
- prerelease: false
32
- requirement: *id001
33
32
  type: :runtime
34
33
  name: omniauth-oauth
34
+ version_requirements: *id001
35
+ prerelease: false
35
36
  - !ruby/object:Gem::Dependency
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ requirement: &id002 !ruby/object:Gem::Requirement
37
38
  none: false
38
39
  requirements:
39
40
  - - ~>
@@ -43,12 +44,12 @@ dependencies:
43
44
  - 0
44
45
  - 9
45
46
  version: "0.9"
46
- prerelease: false
47
- requirement: *id002
48
47
  type: :development
49
48
  name: rake
49
+ version_requirements: *id002
50
+ prerelease: false
50
51
  - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
+ requirement: &id003 !ruby/object:Gem::Requirement
52
53
  none: false
53
54
  requirements:
54
55
  - - ~>
@@ -58,12 +59,12 @@ dependencies:
58
59
  - 2
59
60
  - 7
60
61
  version: "2.7"
61
- prerelease: false
62
- requirement: *id003
63
62
  type: :development
64
63
  name: rspec
64
+ version_requirements: *id003
65
+ prerelease: false
65
66
  - !ruby/object:Gem::Dependency
66
- version_requirements: &id004 !ruby/object:Gem::Requirement
67
+ requirement: &id004 !ruby/object:Gem::Requirement
67
68
  none: false
68
69
  requirements:
69
70
  - - ~>
@@ -73,12 +74,12 @@ dependencies:
73
74
  - 0
74
75
  - 5
75
76
  version: "0.5"
76
- prerelease: false
77
- requirement: *id004
78
77
  type: :development
79
78
  name: simplecov
79
+ version_requirements: *id004
80
+ prerelease: false
80
81
  - !ruby/object:Gem::Dependency
81
- version_requirements: &id005 !ruby/object:Gem::Requirement
82
+ requirement: &id005 !ruby/object:Gem::Requirement
82
83
  none: false
83
84
  requirements:
84
85
  - - ~>
@@ -88,10 +89,10 @@ dependencies:
88
89
  - 1
89
90
  - 7
90
91
  version: "1.7"
91
- prerelease: false
92
- requirement: *id005
93
92
  type: :development
94
93
  name: webmock
94
+ version_requirements: *id005
95
+ prerelease: false
95
96
  description: OpenStreetMap strategy for OmniAuth 1.0a
96
97
  email: christoph@sozialhelden.de
97
98
  executables: []
@@ -102,8 +103,8 @@ extra_rdoc_files: []
102
103
 
103
104
  files:
104
105
  - .gitignore
105
- - .rbenv-version
106
106
  - .rspec
107
+ - .ruby-version
107
108
  - .rvmrc
108
109
  - .travis.yml
109
110
  - Gemfile
@@ -117,6 +118,7 @@ files:
117
118
  - spec/integration.spec
118
119
  - spec/omniauth/strategies/osm_spec.rb
119
120
  - spec/spec_helper.rb
121
+ has_rdoc: true
120
122
  homepage: https://github.com/sozialhelden/omniauth-osm
121
123
  licenses: []
122
124
 
@@ -146,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
148
  requirements: []
147
149
 
148
150
  rubyforge_project: omniauth-osm
149
- rubygems_version: 1.8.15
151
+ rubygems_version: 1.6.2
150
152
  signing_key:
151
153
  specification_version: 3
152
154
  summary: OpenStreetMap strategy for OmniAuth 1.0a
@@ -1 +0,0 @@
1
- 1.8.7-p352