omniauth-ravelry 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 59135b12fd9d6aa9b998628f6532b976ad5b5613
4
+ data.tar.gz: 4aa15a3cd92b47583a8b00fb9942e1498c042490
5
+ SHA512:
6
+ metadata.gz: 2b77976828dc93e34da4e7258208ec918dde68f16478f551cd914e0bd7f94be039654a58d206481a0e968709e3ed7ba4c7b836192a30ad4c4238bede89a3c677
7
+ data.tar.gz: 246c79303c9d6c3b403c045c5033574a351974db2a57f95adef8014ab159120f8586df6ef638e05f7d630d3b0d549d37635d2b786462fd610b64386d63bcf733
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Ravelry
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -4,16 +4,22 @@ module OmniAuth
4
4
  module Strategies
5
5
  class Ravelry < OmniAuth::Strategies::OAuth
6
6
  option :name, 'ravelry'
7
- option :client_options, {
8
- :site => 'https://api.ravelry.com'
9
- }
7
+ option :client_options,
8
+ { site: 'https://api.ravelry.com',
9
+ authorize_url: 'https://www.ravelry.com/oauth/authorize',
10
+ request_token_url: 'https://www.ravelry.com/oauth/request_token',
11
+ access_token_url: 'https://www.ravelry.com/oauth/access_token' }
10
12
 
11
13
  uid{ request.params['username'] }
12
14
 
13
15
  info do
14
16
  {
15
- :name => raw_info['name'],
16
- :location => raw_info['city']
17
+ 'name' => raw_info['first_name'],
18
+ 'location' => raw_info['location'],
19
+ 'nickname' => raw_info['username'],
20
+ 'first_name' => raw_info['first_name'],
21
+ 'description' => raw_info['about_me'],
22
+ 'image' => raw_info['small_photo_url']
17
23
  }
18
24
  end
19
25
 
@@ -24,7 +30,7 @@ module OmniAuth
24
30
  end
25
31
 
26
32
  def raw_info
27
- @raw_info ||= MultiJson.decode(access_token.get("/people/#{uid}.json").body)
33
+ @raw_info ||= MultiJson.decode(access_token.get("https://api.ravelry.com/people/#{uid}.json").body)['user']
28
34
  end
29
35
 
30
36
  end
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ describe OmniAuth::Strategies::Ravelry do
4
+ subject :ravelry do
5
+ OmniAuth::Strategies::Ravelry.new nil, @options || { }
6
+ end
7
+
8
+ describe '#options' do
9
+ subject(:options) { ravelry.options }
10
+ describe '#name' do
11
+ subject { options.name }
12
+ it { should eq 'ravelry' }
13
+ end
14
+ describe '#client_options' do
15
+ subject(:client_options) { options.client_options }
16
+ describe '#site' do
17
+ subject { client_options.site }
18
+ it { should eq 'https://api.ravelry.com' }
19
+ end
20
+ describe '#authorize_url' do
21
+ subject { client_options.authorize_url }
22
+ it { should eq 'https://www.ravelry.com/oauth/authorize' }
23
+ end
24
+ describe '#request_token_url' do
25
+ subject { client_options.request_token_url }
26
+ it { should eq 'https://www.ravelry.com/oauth/request_token' }
27
+ end
28
+ describe '#access_token_url' do
29
+ subject { client_options.access_token_url }
30
+ it { should eq 'https://www.ravelry.com/oauth/access_token' }
31
+ end
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,110 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-ravelry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Emily Price
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-08-20 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: omniauth
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.1.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.1.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: omniauth-oauth
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.0.1
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.0.1
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: multi_json
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - "~>"
84
74
  - !ruby/object:Gem::Version
85
75
  version: '2.7'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - "~>"
92
81
  - !ruby/object:Gem::Version
93
82
  version: '2.7'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rack-test
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  description: OmniAuth strategy for Ravelry
@@ -114,7 +101,7 @@ executables: []
114
101
  extensions: []
115
102
  extra_rdoc_files: []
116
103
  files:
117
- - .gitignore
104
+ - ".gitignore"
118
105
  - Gemfile
119
106
  - LICENSE
120
107
  - README.markdown
@@ -123,36 +110,32 @@ files:
123
110
  - lib/omniauth/ravelry/version.rb
124
111
  - lib/omniauth/strategies/ravelry.rb
125
112
  - omniauth-ravelry.gemspec
113
+ - spec/omniauth/strategies/ravelry_spec.rb
126
114
  - spec/spec_helper.rb
127
115
  homepage: http://github.com/duien/omniauth-ravelry
128
116
  licenses: []
117
+ metadata: {}
129
118
  post_install_message:
130
119
  rdoc_options: []
131
120
  require_paths:
132
121
  - lib
133
122
  required_ruby_version: !ruby/object:Gem::Requirement
134
- none: false
135
123
  requirements:
136
- - - ! '>='
124
+ - - ">="
137
125
  - !ruby/object:Gem::Version
138
126
  version: '0'
139
- segments:
140
- - 0
141
- hash: 1481847332923177785
142
127
  required_rubygems_version: !ruby/object:Gem::Requirement
143
- none: false
144
128
  requirements:
145
- - - ! '>='
129
+ - - ">="
146
130
  - !ruby/object:Gem::Version
147
131
  version: '0'
148
- segments:
149
- - 0
150
- hash: 1481847332923177785
151
132
  requirements: []
152
133
  rubyforge_project:
153
- rubygems_version: 1.8.24
134
+ rubygems_version: 2.4.5
154
135
  signing_key:
155
- specification_version: 3
136
+ specification_version: 4
156
137
  summary: OmniAuth strategy for Ravelry
157
138
  test_files:
139
+ - spec/omniauth/strategies/ravelry_spec.rb
158
140
  - spec/spec_helper.rb
141
+ has_rdoc: