omniauth-venmo 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43c3c6a45b943b060325c3531cd415e6faf67a24
4
- data.tar.gz: 6a1ffdfead99d716690ede1aa0140150bec37bd8
3
+ metadata.gz: e878f2af8226f539ff1e04aafc9f096995c0da30
4
+ data.tar.gz: 78ef250218274c9a7ed34b53fc5d72c761435d88
5
5
  SHA512:
6
- metadata.gz: c2ec28de14cdf3ceadbe8827508707262479242b0147f77095fdd2beb380a8e7c96714ff3c1614e6b5e09157ec608101f154a9e37cd43854eeb81ea68d300030
7
- data.tar.gz: 11937b054a35d26978812e810abf53b6d440f018fc59f1b51ca866ae52b1a5e43ec74ba2eed12132db9041531d2020a574e70894ad423eb23e81a9fdfd922be4
6
+ metadata.gz: 22748e2880421099571ab560bbce758eb2e2932cb9d43ca361f321e70f1348b5f6ff73cc43d7ef28b029258b1b5eee8cad8c7c2c4c55de3ac963711a49940200
7
+ data.tar.gz: 84a76513ddef0df5153ff65ac35588fb8673daed8585955d624bee2f77f0bbf89dceccae553bfba19ed8189470e4721d1c121ee50a74ed92b1e2aaba0f514541
data/.rubocop.yml ADDED
@@ -0,0 +1,80 @@
1
+ AllCops:
2
+ Include:
3
+ - 'Gemfile'
4
+ - 'Rakefile'
5
+ - 'omniauth-venmo.gemspec'
6
+ Exclude:
7
+ - 'lib/omniauth-venmo.rb'
8
+
9
+ # Avoid long parameter lists
10
+ ParameterLists:
11
+ Max: 4
12
+ CountKeywordArgs: true
13
+
14
+ MethodLength:
15
+ CountComments: false
16
+ Max: 14
17
+
18
+ # Avoid more than `Max` levels of nesting.
19
+ BlockNesting:
20
+ Max: 2
21
+
22
+ # Align with the style guide.
23
+ CollectionMethods:
24
+ PreferredMethods:
25
+ map: 'collect'
26
+ reduce: 'inject'
27
+ find: 'detect'
28
+ find_all: 'select'
29
+
30
+ # Limit line length
31
+ LineLength:
32
+ Enabled: false
33
+
34
+ # Disable documentation checking until a class needs to be documented once
35
+ Documentation:
36
+ Enabled: false
37
+
38
+ # Enforce Ruby 1.8-compatible hash syntax
39
+ HashSyntax:
40
+ EnforcedStyle: hash_rockets
41
+
42
+ # No spaces inside hash literals
43
+ SpaceInsideHashLiteralBraces:
44
+ EnforcedStyle: no_space
45
+
46
+ # Allow dots at the end of lines
47
+ DotPosition:
48
+ Enabled: false
49
+
50
+ # Don't require magic comment at the top of every file
51
+ Encoding:
52
+ Enabled: false
53
+
54
+ # Enforce outdenting of access modifiers (i.e. public, private, protected)
55
+ AccessModifierIndentation:
56
+ EnforcedStyle: outdent
57
+
58
+ EmptyLinesAroundAccessModifier:
59
+ Enabled: true
60
+
61
+ # Align ends correctly
62
+ EndAlignment:
63
+ AlignWith: variable
64
+
65
+ # Indentation of when/else
66
+ CaseIndentation:
67
+ IndentWhenRelativeTo: end
68
+ IndentOneStep: false
69
+
70
+ Lambda:
71
+ Enabled: false
72
+
73
+ HandleExceptions:
74
+ Enabled: false
75
+
76
+ RaiseArgs:
77
+ EnforcedStyle: compact
78
+
79
+ TrailingComma:
80
+ Enabled: false
data/.travis.yml CHANGED
@@ -3,11 +3,15 @@ gemfile:
3
3
  - Gemfile
4
4
  language: ruby
5
5
  rvm:
6
- - rbx-18mode
7
- - rbx-19mode
8
- - jruby-18mode
9
- - jruby-19mode
10
- - 1.8.7
11
6
  - 1.9.2
12
7
  - 1.9.3
13
8
  - 2.0.0
9
+ - 2.1.0
10
+ - rbx-2
11
+ - ruby-head
12
+ - jruby-19mode
13
+ - jruby-head
14
+ matrix:
15
+ allow_failures:
16
+ - rvm: jruby-head
17
+ - rvm: ruby-head
data/Gemfile CHANGED
@@ -2,6 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake'
4
4
 
5
+ group :development do
6
+ gem 'rubocop'
7
+ end
8
+
5
9
  group :test do
6
10
  gem 'coveralls', :require => false
7
11
  gem 'rack-test'
data/README.md CHANGED
@@ -6,7 +6,7 @@ omniauth-venmo
6
6
 
7
7
  Venmo OAuth2 Strategy for OmniAuth 1.x and supports the OAuth 2.0 server-side flow.
8
8
 
9
- *Venmo API docs are currently in the works and will be released upon completion.*
9
+ You may view the Venmo API documentation [here](https://developer.venmo.com/docs/oauth).
10
10
 
11
11
  ## Installation
12
12
 
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  Currently, there is only one configuration option that needs to be set:
37
37
 
38
- * `scope`: A comma-separated list of permissions you want to request from the user. The available permissions are as follows: `access_feed`, `access_profile`, `access_friends`, and `make_payments`. Default: `access_profile`
38
+ * `scope`: A comma-separated list of permissions you want to request from the user. The available permissions are as follows: `access_email`, `access_phone`, `access_balance`, `access_feed`, `access_profile`, `access_friends`, and `make_payments`. Default: `access_profile`
39
39
 
40
40
  ```ruby
41
41
  Rails.application.config.middleware.use OmniAuth::Builder do
@@ -83,6 +83,26 @@ Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
83
83
  }
84
84
  ```
85
85
 
86
+ ## Supported Ruby Versions
87
+ `omniauth-venmo` is tested under 1.8.7, 1.9.2, 1.9.3, 2.0.0, JRuby (1.8 mode), and Rubinius
88
+ (1.8 and 1.9 modes).
89
+
90
+ ## Versioning
91
+ This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
92
+ of this scheme should be reported as bugs. Specifically, if a minor or patch
93
+ version is released that breaks backward compatibility, that version should be
94
+ immediately yanked and/or a new version should be immediately released that
95
+ restores compatibility. Breaking changes to the public API will only be
96
+ introduced with new major versions. As a result of this policy, you can (and
97
+ should) specify a dependency on this gem using the [Pessimistic Version
98
+ Constraint][pvc] with two digits of precision. For example:
99
+
100
+ spec.add_dependency 'omniauth-venmo', '~> 1.0'
101
+
102
+ [semver]: http://semver.org/
103
+ [pvc]: http://docs.rubygems.org/read/chapter/16#page74
104
+
105
+
86
106
  ## License
87
107
 
88
108
  Copyright (c) 2013 by Tom Milewski
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
2
+ require 'bundler/gem_tasks'
3
3
  require 'rspec/core/rake_task'
4
4
 
5
5
  desc 'Default: run specs.'
6
6
  task :default => :spec
7
7
 
8
- desc "Run specs"
9
- RSpec::Core::RakeTask.new
8
+ desc 'Run specs'
9
+ RSpec::Core::RakeTask.new
@@ -6,16 +6,14 @@ module OmniAuth
6
6
  DEFAULT_SCOPE = 'access_profile'
7
7
 
8
8
  option :provider_ignores_state, true
9
- option :client_options, {
10
- :site => 'https://api.venmo.com',
11
- :authorize_url => '/oauth/authorize',
12
- :token_url => '/oauth/access_token'
13
- }
9
+ option :client_options, :site => 'https://api.venmo.com/v1',
10
+ :authorize_url => '/oauth/authorize',
11
+ :token_url => '/oauth/access_token'
14
12
 
15
13
  uid { raw_info['id'] }
16
14
 
17
15
  info do
18
- prune!({
16
+ prune!(
19
17
  'username' => raw_info['username'],
20
18
  'email' => raw_info['email'],
21
19
  'phone' => raw_info['phone'],
@@ -27,7 +25,7 @@ module OmniAuth
27
25
  'urls' => {
28
26
  'profile' => "https://venmo.com/#{raw_info['username']}"
29
27
  }
30
- })
28
+ )
31
29
  end
32
30
 
33
31
  extra do
@@ -50,7 +48,7 @@ module OmniAuth
50
48
  super
51
49
  end
52
50
 
53
- private
51
+ private
54
52
 
55
53
  def prune!(hash)
56
54
  hash.delete_if do |_, value|
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Venmo
3
- VERSION = "1.0.1"
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -1,2 +1,2 @@
1
1
  require 'omniauth/venmo/version'
2
- require 'omniauth/strategies/venmo'
2
+ require 'omniauth/strategies/venmo'
@@ -1,27 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
3
  require 'omniauth/venmo/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = 'omniauth-venmo'
7
- s.version = OmniAuth::Venmo::VERSION
8
- s.authors = ['Tom Milewski']
9
- s.email = ['tmilewski@gmail.com']
10
- s.summary = 'Venmo strategy for OmniAuth'
11
- s.homepage = 'https://github.com/tmilewski/omniauth-venmo'
12
- s.license = 'MIT'
6
+ s.name = 'omniauth-venmo'
7
+ s.version = OmniAuth::Venmo::VERSION
8
+ s.authors = ['Tom Milewski']
9
+ s.email = ['tmilewski@gmail.com']
10
+ s.summary = 'Venmo strategy for OmniAuth'
11
+ s.description = 'Venmo strategy for OmniAuth v1.2'
12
+ s.homepage = 'https://github.com/tmilewski/omniauth-venmo'
13
+ s.license = 'MIT'
13
14
 
14
15
  s.files = `git ls-files`.split("\n")
15
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
17
+ s.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
17
18
  s.require_paths = ['lib']
18
19
 
19
- s.add_runtime_dependency 'omniauth'
20
+ s.add_runtime_dependency 'omniauth', '~> 1.2'
20
21
  s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1'
21
22
 
22
- s.add_development_dependency 'dotenv'
23
- s.add_development_dependency 'sinatra'
24
- s.add_development_dependency 'rake'
25
- s.add_development_dependency 'rspec', '~> 2.7'
26
- s.add_development_dependency 'simplecov'
23
+ s.add_development_dependency 'dotenv', '~> 0'
24
+ s.add_development_dependency 'sinatra', '~> 0'
27
25
  end
data/spec/app.rb CHANGED
@@ -1,5 +1,5 @@
1
- $:.unshift File.expand_path('..', __FILE__)
2
- $:.unshift File.expand_path('../../lib', __FILE__)
1
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
3
 
4
4
  require 'dotenv'
5
5
  require 'sinatra'
@@ -8,11 +8,11 @@ require 'omniauth-venmo'
8
8
 
9
9
  Dotenv.load
10
10
 
11
- use Rack::Session::Cookie, key: 'key',
12
- domain: "localhost",
13
- path: '/',
14
- expire_after: 14400,
15
- secret: 'secret'
11
+ use Rack::Session::Cookie, :key => 'key',
12
+ :domain => 'localhost',
13
+ :path => '/',
14
+ :expire_after => 14_400,
15
+ :secret => 'secret'
16
16
 
17
17
  use OmniAuth::Builder do
18
18
  provider :venmo, ENV['CLIENT_ID'], ENV['CLIENT_SECRET'], :scope => 'access_profile'
@@ -31,7 +31,7 @@ end
31
31
  get '/auth/:name/callback' do
32
32
  auth = request.env['omniauth.auth']
33
33
 
34
- puts %Q{
34
+ puts %Q(
35
35
  >> UID
36
36
  #{auth.uid.inspect}
37
37
 
@@ -43,7 +43,7 @@ get '/auth/:name/callback' do
43
43
  #
44
44
  >> EXTRA
45
45
  #{auth.extra.inspect}
46
- }
46
+ )
47
47
 
48
- "Check logs for user information."
48
+ 'Check logs for user information.'
49
49
  end
@@ -8,13 +8,13 @@ describe OmniAuth::Strategies::Venmo do
8
8
  end
9
9
  end
10
10
 
11
- context "client options" do
11
+ context 'client options' do
12
12
  it 'should have correct name' do
13
- expect(subject.options.name).to eq("venmo")
13
+ expect(subject.options.name).to eq('venmo')
14
14
  end
15
15
 
16
16
  it 'should have correct site' do
17
- expect(subject.options.client_options.site).to eq('https://api.venmo.com')
17
+ expect(subject.options.client_options.site).to eq('https://api.venmo.com/v1')
18
18
  end
19
19
 
20
20
  it 'should have correct authorize url' do
@@ -30,37 +30,37 @@ describe OmniAuth::Strategies::Venmo do
30
30
  end
31
31
  end
32
32
 
33
- context "#prune!" do
34
- it "should remove nil values" do
33
+ context '#prune!' do
34
+ it 'should remove nil values' do
35
35
  expect(
36
- subject.send(:prune!, { "a" => "b", "c" => nil })
37
- ).to eq({ "a" => "b" })
36
+ subject.send(:prune!, 'a' => 'b', 'c' => nil)
37
+ ).to eq('a' => 'b')
38
38
  end
39
39
 
40
- it "should remove empty values" do
40
+ it 'should remove empty values' do
41
41
  expect(
42
- subject.send(:prune!, { "a" => "b", "c" => "" })
43
- ).to eq({ "a" => "b" })
42
+ subject.send(:prune!, 'a' => 'b', 'c' => '')
43
+ ).to eq('a' => 'b')
44
44
  end
45
45
 
46
- it "should remove nil values recursively" do
46
+ it 'should remove nil values recursively' do
47
47
  expect(
48
- subject.send(:prune!, { "a" => "b", "c" => { "d" => nil} })
49
- ).to eq({ "a" => "b" })
48
+ subject.send(:prune!, 'a' => 'b', 'c' => {'d' => nil})
49
+ ).to eq('a' => 'b')
50
50
 
51
51
  expect(
52
- subject.send(:prune!, { "a" => "b", "c" => { "d" => nil, "e" => "f"} })
53
- ).to eq({ "a" => "b", "c" => {"e" => "f"} })
52
+ subject.send(:prune!, 'a' => 'b', 'c' => {'d' => nil, 'e' => 'f'})
53
+ ).to eq('a' => 'b', 'c' => {'e' => 'f'})
54
54
  end
55
55
 
56
- it "should remove empty values recursively" do
56
+ it 'should remove empty values recursively' do
57
57
  expect(
58
- subject.send(:prune!, { "a" => "b", "c" => { "d" => ""} })
59
- ).to eq({ "a" => "b" })
58
+ subject.send(:prune!, 'a' => 'b', 'c' => {'d' => ''})
59
+ ).to eq('a' => 'b')
60
60
 
61
61
  expect(
62
- subject.send(:prune!, { "a" => "b", "c" => { "d" => "", "e" => "f"} })
63
- ).to eq({ "a" => "b", "c" => {"e" => "f"} })
62
+ subject.send(:prune!, 'a' => 'b', 'c' => {'d' => '', 'e' => 'f'})
63
+ ).to eq('a' => 'b', 'c' => {'e' => 'f'})
64
64
  end
65
65
  end
66
66
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
- $:.unshift File.expand_path('..', __FILE__)
2
- $:.unshift File.expand_path('../../lib', __FILE__)
1
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
3
 
4
4
  require 'rspec'
5
5
  require 'simplecov'
@@ -9,5 +9,5 @@ require 'omniauth'
9
9
  require 'omniauth-venmo'
10
10
 
11
11
  RSpec.configure do |config|
12
- config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
12
+ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
13
13
  end
metadata CHANGED
@@ -1,122 +1,81 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-venmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Milewski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-10 00:00:00.000000000 Z
11
+ date: 2014-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dotenv
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sinatra
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '>='
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rspec
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ~>
88
- - !ruby/object:Gem::Version
89
- version: '2.7'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ~>
95
- - !ruby/object:Gem::Version
96
- version: '2.7'
97
- - !ruby/object:Gem::Dependency
98
- name: simplecov
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '>='
59
+ - - "~>"
102
60
  - !ruby/object:Gem::Version
103
61
  version: '0'
104
62
  type: :development
105
63
  prerelease: false
106
64
  version_requirements: !ruby/object:Gem::Requirement
107
65
  requirements:
108
- - - '>='
66
+ - - "~>"
109
67
  - !ruby/object:Gem::Version
110
68
  version: '0'
111
- description:
69
+ description: Venmo strategy for OmniAuth v1.2
112
70
  email:
113
71
  - tmilewski@gmail.com
114
72
  executables: []
115
73
  extensions: []
116
74
  extra_rdoc_files: []
117
75
  files:
118
- - .gitignore
119
- - .travis.yml
76
+ - ".gitignore"
77
+ - ".rubocop.yml"
78
+ - ".travis.yml"
120
79
  - Gemfile
121
80
  - README.md
122
81
  - Rakefile
@@ -137,17 +96,17 @@ require_paths:
137
96
  - lib
138
97
  required_ruby_version: !ruby/object:Gem::Requirement
139
98
  requirements:
140
- - - '>='
99
+ - - ">="
141
100
  - !ruby/object:Gem::Version
142
101
  version: '0'
143
102
  required_rubygems_version: !ruby/object:Gem::Requirement
144
103
  requirements:
145
- - - '>='
104
+ - - ">="
146
105
  - !ruby/object:Gem::Version
147
106
  version: '0'
148
107
  requirements: []
149
108
  rubyforge_project:
150
- rubygems_version: 2.0.3
109
+ rubygems_version: 2.2.2
151
110
  signing_key:
152
111
  specification_version: 4
153
112
  summary: Venmo strategy for OmniAuth