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 ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - ruby-head
6
+ - jruby
7
+ - rbx-18mode
8
+ - rbx-19mode
data/README.md CHANGED
@@ -1,24 +1,29 @@
1
- # Omniauth::Hatena
1
+ # Omniauth Hatena
2
2
 
3
- TODO: Write a gem description
3
+ A Strategy to auth with Hatena in OmniAuth.
4
4
 
5
- ## Installation
5
+ Get your ConsumerKey here:http://developer.hatena.ne.jp/ja/documents/auth/apis/oauth/consumer
6
6
 
7
- Add this line to your application's Gemfile:
7
+ ## Usage
8
+
9
+ Add this line to your app's `Gemfile`:
8
10
 
9
11
  gem 'omniauth-hatena'
10
12
 
11
- And then execute:
13
+ And add the following to your `config/initializers/omniauth.rb`:
12
14
 
13
- $ bundle
15
+ Rails.application.config.middleware.use OmniAuth::Builder do
16
+ provider :hatena, "consumer_key", "consumer_secret"
17
+ end
14
18
 
15
- Or install it yourself as:
19
+ You can specify scope like the following
16
20
 
17
- $ gem install omniauth-hatena
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
- ## Usage
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
@@ -1,2 +1,7 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => :spec
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Hatena
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -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
@@ -18,4 +18,6 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.add_dependency 'multi_json', '~> 1.3'
20
20
  gem.add_runtime_dependency 'omniauth-oauth', '~> 1.0'
21
+ gem.add_development_dependency 'rspec', '~> 2.9'
22
+ gem.add_development_dependency 'rake', '~> 0.9.2.2'
21
23
  end
@@ -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
@@ -0,0 +1,8 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+
4
+ require 'rspec'
5
+ require 'omniauth-hatena'
6
+
7
+ RSpec.configure do |config|
8
+ end
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.2
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-29 00:00:00.000000000 Z
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: &70139731379940 !ruby/object:Gem::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: *70139731379940
24
+ version_requirements: *70224544812980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: omniauth-oauth
27
- requirement: &70139731378120 !ruby/object:Gem::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: *70139731378120
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: