omniauth-fitbit 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -1
- data/README.md +2 -2
- data/lib/omniauth/strategies/fitbit.rb +1 -1
- data/lib/omniauth-fitbit/version.rb +1 -1
- data/spec/omniauth/strategies/fitbit_spec.rb +18 -1
- metadata +59 -52
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,7 @@ In Rails, create a new file under config/initializers called omniauth.rb to plug
|
|
22
22
|
|
23
23
|
```ruby
|
24
24
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
25
|
-
provider :
|
25
|
+
provider :fitbit, 'consumer_key', 'consumer_secret'
|
26
26
|
end
|
27
27
|
```
|
28
28
|
|
@@ -35,4 +35,4 @@ For a short tutorial on how to use OmniAuth in your Rails application, visit [th
|
|
35
35
|
|
36
36
|
## Copyright
|
37
37
|
|
38
|
-
Copyright (c) 2012 TK Gospodinov. See [LICENSE](https://github.com/tkgospodinov/omniauth-fitbit/blob/master/LICENSE.md) for details.
|
38
|
+
Copyright (c) 2012 TK Gospodinov. See [LICENSE](https://github.com/tkgospodinov/omniauth-fitbit/blob/master/LICENSE.md) for details.
|
@@ -28,7 +28,7 @@ module OmniAuth
|
|
28
28
|
:city => raw_info['user']['city'],
|
29
29
|
:state => raw_info['user']['state'],
|
30
30
|
:country => raw_info['user']['country'],
|
31
|
-
:dob => Date.strptime(raw_info['user']['dateOfBirth'], '%Y-%m-%d'),
|
31
|
+
:dob => !raw_info['user']['dateOfBirth'].empty? ? Date.strptime(raw_info['user']['dateOfBirth'], '%Y-%m-%d'):nil,
|
32
32
|
:member_since => Date.strptime(raw_info['user']['memberSince'], '%Y-%m-%d'),
|
33
33
|
:locale => raw_info['user']['locale'],
|
34
34
|
:timezone => raw_info['user']['timezone']
|
@@ -90,4 +90,21 @@ describe "OmniAuth::Strategies::Fitbit" do
|
|
90
90
|
subject.info[:country].should eq("US")
|
91
91
|
end
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
|
+
context 'dateOfBirth is empty' do
|
95
|
+
before :each do
|
96
|
+
subject.stub(:raw_info) {
|
97
|
+
{
|
98
|
+
"user" =>
|
99
|
+
{
|
100
|
+
"dateOfBirth" => "",
|
101
|
+
"memberSince" => "2010-01-01",
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
end
|
106
|
+
it 'when return nil' do
|
107
|
+
subject.info[:dob].should be_nil
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
metadata
CHANGED
@@ -1,55 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-fitbit
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- TK Gospodinov
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2013-06-18 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: omniauth-oauth
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '1.0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
requirements:
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
27
25
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 0
|
30
|
+
version: "1.0"
|
38
31
|
type: :runtime
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: multi_xml
|
39
35
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 0
|
42
|
+
version: "0"
|
43
|
+
type: :runtime
|
44
|
+
version_requirements: *id002
|
46
45
|
description: OmniAuth strategy for Fitbit
|
47
|
-
email:
|
46
|
+
email:
|
48
47
|
- tk@gospodinov.net
|
49
48
|
executables: []
|
49
|
+
|
50
50
|
extensions: []
|
51
|
+
|
51
52
|
extra_rdoc_files: []
|
52
|
-
|
53
|
+
|
54
|
+
files:
|
53
55
|
- .gitignore
|
54
56
|
- Gemfile
|
55
57
|
- LICENSE.md
|
@@ -63,31 +65,36 @@ files:
|
|
63
65
|
- omniauth-fitbit.gemspec
|
64
66
|
- spec/omniauth/strategies/fitbit_spec.rb
|
65
67
|
- spec/spec_helper.rb
|
68
|
+
has_rdoc: true
|
66
69
|
homepage: http://github.com/tkgospodinov/omniauth-fitbit
|
67
70
|
licenses: []
|
71
|
+
|
68
72
|
post_install_message:
|
69
73
|
rdoc_options: []
|
70
|
-
|
74
|
+
|
75
|
+
require_paths:
|
71
76
|
- lib
|
72
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
requirements:
|
81
|
-
- -
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
version: "0"
|
84
91
|
requirements: []
|
92
|
+
|
85
93
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
94
|
+
rubygems_version: 1.3.6
|
87
95
|
signing_key:
|
88
96
|
specification_version: 3
|
89
97
|
summary: OmniAuth strategy for Fitbit
|
90
|
-
test_files:
|
98
|
+
test_files:
|
91
99
|
- spec/omniauth/strategies/fitbit_spec.rb
|
92
100
|
- spec/spec_helper.rb
|
93
|
-
has_rdoc:
|