omniauth-pinterest 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-pinterest.gemspec
4
+ gemspec
5
+
6
+ group :development, :test do
7
+ gem 'guard'
8
+ gem 'guard-rspec'
9
+ gem 'guard-bundler'
10
+ gem 'growl'
11
+ gem 'rb-fsevent'
12
+ end
@@ -0,0 +1,74 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-pinterest (1.0.0)
5
+ omniauth (~> 1.0)
6
+ omniauth-oauth2 (~> 1.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ addressable (2.2.7)
12
+ crack (0.3.1)
13
+ diff-lcs (1.1.3)
14
+ faraday (0.7.6)
15
+ addressable (~> 2.2)
16
+ multipart-post (~> 1.1)
17
+ rack (~> 1.1)
18
+ ffi (1.0.11)
19
+ growl (1.0.3)
20
+ guard (1.0.1)
21
+ ffi (>= 0.5.0)
22
+ thor (~> 0.14.6)
23
+ guard-bundler (0.1.3)
24
+ bundler (>= 1.0.0)
25
+ guard (>= 0.2.2)
26
+ guard-rspec (0.7.0)
27
+ guard (>= 0.10.0)
28
+ hashie (1.2.0)
29
+ multi_json (1.2.0)
30
+ multipart-post (1.1.5)
31
+ oauth2 (0.5.2)
32
+ faraday (~> 0.7)
33
+ multi_json (~> 1.0)
34
+ omniauth (1.0.3)
35
+ hashie (~> 1.2)
36
+ rack
37
+ omniauth-oauth2 (1.0.0)
38
+ oauth2 (~> 0.5.0)
39
+ omniauth (~> 1.0)
40
+ rack (1.4.1)
41
+ rack-test (0.6.1)
42
+ rack (>= 1.0)
43
+ rb-fsevent (0.9.0)
44
+ rspec (2.9.0)
45
+ rspec-core (~> 2.9.0)
46
+ rspec-expectations (~> 2.9.0)
47
+ rspec-mocks (~> 2.9.0)
48
+ rspec-core (2.9.0)
49
+ rspec-expectations (2.9.1)
50
+ diff-lcs (~> 1.1.3)
51
+ rspec-mocks (2.9.0)
52
+ simplecov (0.6.1)
53
+ multi_json (~> 1.0)
54
+ simplecov-html (~> 0.5.3)
55
+ simplecov-html (0.5.3)
56
+ thor (0.14.6)
57
+ webmock (1.8.6)
58
+ addressable (>= 2.2.7)
59
+ crack (>= 0.1.7)
60
+
61
+ PLATFORMS
62
+ ruby
63
+
64
+ DEPENDENCIES
65
+ growl
66
+ guard
67
+ guard-bundler
68
+ guard-rspec
69
+ omniauth-pinterest!
70
+ rack-test
71
+ rb-fsevent
72
+ rspec (~> 2.7)
73
+ simplecov
74
+ webmock
@@ -0,0 +1,11 @@
1
+ guard 'rspec', :version => 2 do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+ end
6
+
7
+
8
+ guard 'bundler' do
9
+ watch('Gemfile')
10
+ watch(/^.+\.gemspec/)
11
+ end
@@ -0,0 +1,21 @@
1
+ # OmniAuth Pinterest
2
+
3
+ This is the unofficial OmniAuth strategy for authenticating to Pinterest. To
4
+ use it, you'll need to sign up for an OAuth2 Application ID and Secret
5
+ on the [Pinterest Developer website](http://pinterest.com/developers/api).
6
+
7
+ ## Basic Usage
8
+
9
+ use OmniAuth::Builder do
10
+ provider :pinterest, ENV['PINTEREST_ID'], ENV['PINTEREST_SECRET']
11
+ end
12
+
13
+ ## License
14
+
15
+ Copyright (c) 2012 Jonathan Markwell and Intridea, Inc.
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ desc 'Default: run specs.'
6
+ task :default => :spec
7
+
8
+ desc "Run specs"
9
+ RSpec::Core::RakeTask.new
@@ -0,0 +1,2 @@
1
+ require "omniauth-pinterest/version"
2
+ require 'omniauth/strategies/pinterest'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Pinterest
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Pinterest < OmniAuth::Strategies::OAuth2
6
+ option :client_options, {
7
+ :site => 'https://pinterest.com',
8
+ :authorize_url => 'https://pinterest.com/oauth/authorize',
9
+ :token_url => 'https://api.pinterest.com/v2/oauth/access_token'
10
+ }
11
+
12
+ def request_phase
13
+ options[:scope] ||= 'read'
14
+ options[:response_type] ||= 'code'
15
+ super
16
+ end
17
+
18
+ uid { raw_info['id'] }
19
+
20
+ info do
21
+ {
22
+ 'nickname' => raw_info['username'],
23
+ 'name' => raw_info['full_name'],
24
+ 'image' => raw_info['image_url'],
25
+ }
26
+ end
27
+
28
+ def raw_info
29
+ @data ||= access_token.params["user"]
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/omniauth-pinterest/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Jonathan Markwell"]
6
+ gem.email = ["jonathan.markwell@gmail.com"]
7
+ gem.description = %q{OmniAuth strategy for Pinterest.}
8
+ gem.summary = %q{OmniAuth strategy for Pinterest.}
9
+ gem.homepage = "https://github.com/jot/omniauth-pinterest"
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ gem.name = "omniauth-pinterest"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = OmniAuth::Pinterest::VERSION
17
+
18
+ gem.add_dependency 'omniauth', '~> 1.0'
19
+ gem.add_dependency 'omniauth-oauth2', '~> 1.0'
20
+
21
+ gem.add_development_dependency 'rspec', '~> 2.7'
22
+ gem.add_development_dependency 'rack-test'
23
+ gem.add_development_dependency 'webmock'
24
+ gem.add_development_dependency 'simplecov'
25
+
26
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe OmniAuth::Strategies::Pinterest do
4
+ it 'should have tests' do
5
+ pending
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+ require 'rspec'
6
+ require 'rack/test'
7
+ require 'webmock/rspec'
8
+ require 'omniauth'
9
+ require 'omniauth-pinterest'
10
+
11
+ RSpec.configure do |config|
12
+ config.include WebMock::API
13
+ config.include Rack::Test::Methods
14
+ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
15
+ end
16
+
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-pinterest
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jonathan Markwell
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: omniauth
16
+ requirement: &70245145280900 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70245145280900
25
+ - !ruby/object:Gem::Dependency
26
+ name: omniauth-oauth2
27
+ requirement: &70245145280400 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70245145280400
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &70245145279860 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '2.7'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70245145279860
47
+ - !ruby/object:Gem::Dependency
48
+ name: rack-test
49
+ requirement: &70245145279380 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70245145279380
58
+ - !ruby/object:Gem::Dependency
59
+ name: webmock
60
+ requirement: &70245145278520 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70245145278520
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: &70245145277920 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *70245145277920
80
+ description: OmniAuth strategy for Pinterest.
81
+ email:
82
+ - jonathan.markwell@gmail.com
83
+ executables: []
84
+ extensions: []
85
+ extra_rdoc_files: []
86
+ files:
87
+ - Gemfile
88
+ - Gemfile.lock
89
+ - Guardfile
90
+ - README.md
91
+ - Rakefile
92
+ - lib/omniauth-pinterest.rb
93
+ - lib/omniauth-pinterest/version.rb
94
+ - lib/omniauth/strategies/pinterest.rb
95
+ - omniauth-pinterest.gemspec
96
+ - spec/omniauth/strategies/pinterest_spec.rb
97
+ - spec/spec_helper.rb
98
+ homepage: https://github.com/jot/omniauth-pinterest
99
+ licenses: []
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ none: false
112
+ requirements:
113
+ - - ! '>='
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ requirements: []
117
+ rubyforge_project:
118
+ rubygems_version: 1.8.11
119
+ signing_key:
120
+ specification_version: 3
121
+ summary: OmniAuth strategy for Pinterest.
122
+ test_files:
123
+ - spec/omniauth/strategies/pinterest_spec.rb
124
+ - spec/spec_helper.rb