omniauth-hatena 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +2 -0
- data/.travis.yml +8 -0
- data/README.md +15 -10
- data/Rakefile +5 -0
- data/lib/omniauth-hatena/version.rb +1 -1
- data/lib/omniauth/strategies/hatena.rb +1 -1
- data/omniauth-hatena.gemspec +2 -0
- data/spec/omniauth/strategies/hatena_spec.rb +12 -0
- data/spec/spec_helper.rb +8 -0
- metadata +35 -7
data/.rspec
ADDED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,24 +1,29 @@
|
|
1
|
-
# Omniauth
|
1
|
+
# Omniauth Hatena
|
2
2
|
|
3
|
-
|
3
|
+
A Strategy to auth with Hatena in OmniAuth.
|
4
4
|
|
5
|
-
|
5
|
+
Get your ConsumerKey here:http://developer.hatena.ne.jp/ja/documents/auth/apis/oauth/consumer
|
6
6
|
|
7
|
-
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
Add this line to your app's `Gemfile`:
|
8
10
|
|
9
11
|
gem 'omniauth-hatena'
|
10
12
|
|
11
|
-
And
|
13
|
+
And add the following to your `config/initializers/omniauth.rb`:
|
12
14
|
|
13
|
-
|
15
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
16
|
+
provider :hatena, "consumer_key", "consumer_secret"
|
17
|
+
end
|
14
18
|
|
15
|
-
|
19
|
+
You can specify scope like the following
|
16
20
|
|
17
|
-
|
21
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
22
|
+
provider :hatena, "consumer_key", "consumer_secret", :scope => "write_public, read_private"
|
23
|
+
end
|
18
24
|
|
19
|
-
|
25
|
+
Regardless of what you specify, scope contains "read_public" automatically.
|
20
26
|
|
21
|
-
TODO: Write usage instructions here
|
22
27
|
|
23
28
|
## Contributing
|
24
29
|
|
data/Rakefile
CHANGED
@@ -41,7 +41,7 @@ module OmniAuth
|
|
41
41
|
|
42
42
|
def request_phase
|
43
43
|
params = (options.scope || '').split(',').map(&:strip)
|
44
|
-
options.request_params[:scope] = params.push(DEFAULT_SCOPE).join(',')
|
44
|
+
options.request_params[:scope] = params.push(DEFAULT_SCOPE).uniq.join(',')
|
45
45
|
|
46
46
|
old_request_phase
|
47
47
|
end
|
data/omniauth-hatena.gemspec
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OmniAuth::Strategies::Hatena do
|
4
|
+
subject do
|
5
|
+
OmniAuth::Strategies::Hatena.new({})
|
6
|
+
end
|
7
|
+
|
8
|
+
its('options.name') { should == 'hatena' }
|
9
|
+
its('options.client_options.request_token_url') { should == 'https://www.hatena.com/oauth/initiate' }
|
10
|
+
its('options.client_options.access_token_url') { should == 'https://www.hatena.com/oauth/token' }
|
11
|
+
its('options.client_options.authorize_url') { should == 'https://www.hatena.ne.jp/oauth/authorize' }
|
12
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-hatena
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70224544812980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.3'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70224544812980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: omniauth-oauth
|
27
|
-
requirement: &
|
27
|
+
requirement: &70224544812480 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,29 @@ dependencies:
|
|
32
32
|
version: '1.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70224544812480
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &70224544811980 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.9'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70224544811980
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: &70224544811460 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.9.2.2
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70224544811460
|
36
58
|
description: OmniAuth strategy for Hatena
|
37
59
|
email:
|
38
60
|
- yuki@gnnk.net
|
@@ -41,6 +63,8 @@ extensions: []
|
|
41
63
|
extra_rdoc_files: []
|
42
64
|
files:
|
43
65
|
- .gitignore
|
66
|
+
- .rspec
|
67
|
+
- .travis.yml
|
44
68
|
- Gemfile
|
45
69
|
- LICENSE
|
46
70
|
- README.md
|
@@ -49,6 +73,8 @@ files:
|
|
49
73
|
- lib/omniauth-hatena/version.rb
|
50
74
|
- lib/omniauth/strategies/hatena.rb
|
51
75
|
- omniauth-hatena.gemspec
|
76
|
+
- spec/omniauth/strategies/hatena_spec.rb
|
77
|
+
- spec/spec_helper.rb
|
52
78
|
homepage: https://github.com/mururu/omniauth-hatena
|
53
79
|
licenses: []
|
54
80
|
post_install_message:
|
@@ -73,5 +99,7 @@ rubygems_version: 1.8.11
|
|
73
99
|
signing_key:
|
74
100
|
specification_version: 3
|
75
101
|
summary: OmniAuth strategy for Hatena
|
76
|
-
test_files:
|
102
|
+
test_files:
|
103
|
+
- spec/omniauth/strategies/hatena_spec.rb
|
104
|
+
- spec/spec_helper.rb
|
77
105
|
has_rdoc:
|