omniauth-xero 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a9a6bf9ab9fe21da4e3ddb0aeb57cb0cbd8d712f
4
+ data.tar.gz: 5b79002e4168ad4d4f3c393de596a7f69e307915
5
+ SHA512:
6
+ metadata.gz: 12563dbbe9b7b540107c714b0f77999357a909ce480032b20eabb31a827660153f81c6385a92ec98d9854c3c84bc13017dce9ac9dcd969debbfefd1b7f29a49e
7
+ data.tar.gz: 5220c3d06351f6e587eb47fcdc6775748928f73df1938be92373d32bebd8ebe3dca64c53031a1e89f02f4683b2ae2a2cb84a5364934c6c5b24caed88ce8ae298
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ cache: bundler
3
+ sudo: false
4
+ rvm:
5
+ - 2.2.3
6
+ script:
7
+ - "bundle exec rake"
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # Omniauth Xero
1
+ # Omniauth Xero [![Build Status](https://travis-ci.org/kaleworsley/omniauth-xero.png?branch=master)](https://travis-ci.org/kaleworsley/omniauth-xero) [![Code Climate](https://codeclimate.com/github/kaleworsley/omniauth-xero.png)](https://codeclimate.com/github/kaleworsley/omniauth-xero)
2
+
2
3
 
3
4
  [Omniauth Xero](https://github.com/kaleworsley/omniauth-xero) is an [OmniAuth](https://github.com/intridea/omniauth) authentication strategy for [Xero](http://www.xero.com).
4
5
 
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ rescue LoadError
7
+ end
8
+
9
+ task default: :spec
@@ -1,5 +1,4 @@
1
1
  require "omniauth/strategies/oauth"
2
- require "multi_xml"
3
2
 
4
3
  module OmniAuth
5
4
  module Strategies
@@ -27,8 +26,14 @@ module OmniAuth
27
26
  { "raw_info" => raw_info }
28
27
  end
29
28
 
29
+ private
30
+
30
31
  def raw_info
31
- @raw_info ||= MultiXml.parse(access_token.get("/api.xro/2.0/Users").body)["Response"]["Users"]["User"]
32
+ @raw_info ||= users.find { |user| user["IsSubscriber"] }
33
+ end
34
+
35
+ def users
36
+ @users ||= JSON.parse(access_token.get("/api.xro/2.0/Users", {'Accept'=>'application/json'}).body)["Users"]
32
37
  end
33
38
  end
34
39
  end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Xero
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -19,10 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "omniauth-oauth", "~> 1.0"
22
- spec.add_runtime_dependency "multi_xml", "~> 0.5"
23
22
 
24
23
  spec.add_development_dependency "bundler", "~> 1.3"
25
24
  spec.add_development_dependency "rake"
26
25
  spec.add_development_dependency "rspec", "~> 2.0"
27
-
28
26
  end
@@ -7,19 +7,19 @@ describe "OmniAuth::Strategies::Xero" do
7
7
 
8
8
  context 'client options' do
9
9
  it 'has correct site' do
10
- subject.options.client_options.site.should eq('https://api.xero.com')
10
+ expect(subject.options.client_options.site).to eq('https://api.xero.com')
11
11
  end
12
12
 
13
13
  it 'has correct request token path' do
14
- subject.options.client_options.request_token_path.should eq('/oauth/RequestToken')
14
+ expect(subject.options.client_options.request_token_path).to eq('/oauth/RequestToken')
15
15
  end
16
16
 
17
17
  it 'has correct access token path' do
18
- subject.options.client_options.access_token_path.should eq('/oauth/AccessToken')
18
+ expect(subject.options.client_options.access_token_path).to eq('/oauth/AccessToken')
19
19
  end
20
20
 
21
21
  it 'has correct authorize path' do
22
- subject.options.client_options.authorize_path.should eq('/oauth/Authorize')
22
+ expect(subject.options.client_options.authorize_path).to eq('/oauth/Authorize')
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,94 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-xero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kale Worsley
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-24 00:00:00.000000000 Z
11
+ date: 2015-10-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: omniauth-oauth
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.0'
30
- - !ruby/object:Gem::Dependency
31
- name: multi_xml
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: '0.5'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '0.5'
46
27
  - !ruby/object:Gem::Dependency
47
28
  name: bundler
48
29
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
30
  requirements:
51
- - - ~>
31
+ - - "~>"
52
32
  - !ruby/object:Gem::Version
53
33
  version: '1.3'
54
34
  type: :development
55
35
  prerelease: false
56
36
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
37
  requirements:
59
- - - ~>
38
+ - - "~>"
60
39
  - !ruby/object:Gem::Version
61
40
  version: '1.3'
62
41
  - !ruby/object:Gem::Dependency
63
42
  name: rake
64
43
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
44
  requirements:
67
- - - ! '>='
45
+ - - ">="
68
46
  - !ruby/object:Gem::Version
69
47
  version: '0'
70
48
  type: :development
71
49
  prerelease: false
72
50
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
51
  requirements:
75
- - - ! '>='
52
+ - - ">="
76
53
  - !ruby/object:Gem::Version
77
54
  version: '0'
78
55
  - !ruby/object:Gem::Dependency
79
56
  name: rspec
80
57
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
58
  requirements:
83
- - - ~>
59
+ - - "~>"
84
60
  - !ruby/object:Gem::Version
85
61
  version: '2.0'
86
62
  type: :development
87
63
  prerelease: false
88
64
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
65
  requirements:
91
- - - ~>
66
+ - - "~>"
92
67
  - !ruby/object:Gem::Version
93
68
  version: '2.0'
94
69
  description: Xero authentication strategy for OmniAuth.
@@ -98,7 +73,8 @@ executables: []
98
73
  extensions: []
99
74
  extra_rdoc_files: []
100
75
  files:
101
- - .gitignore
76
+ - ".gitignore"
77
+ - ".travis.yml"
102
78
  - Gemfile
103
79
  - LICENSE.txt
104
80
  - README.md
@@ -112,28 +88,28 @@ files:
112
88
  homepage: http://github.com/kaleworsley/omniauth-xero
113
89
  licenses:
114
90
  - MIT
91
+ metadata: {}
115
92
  post_install_message:
116
93
  rdoc_options: []
117
94
  require_paths:
118
95
  - lib
119
96
  required_ruby_version: !ruby/object:Gem::Requirement
120
- none: false
121
97
  requirements:
122
- - - ! '>='
98
+ - - ">="
123
99
  - !ruby/object:Gem::Version
124
100
  version: '0'
125
101
  required_rubygems_version: !ruby/object:Gem::Requirement
126
- none: false
127
102
  requirements:
128
- - - ! '>='
103
+ - - ">="
129
104
  - !ruby/object:Gem::Version
130
105
  version: '0'
131
106
  requirements: []
132
107
  rubyforge_project:
133
- rubygems_version: 1.8.23
108
+ rubygems_version: 2.4.5
134
109
  signing_key:
135
- specification_version: 3
110
+ specification_version: 4
136
111
  summary: Xero authentication strategy for OmniAuth.
137
112
  test_files:
138
113
  - spec/omniauth/strategies/xero_spec.rb
139
114
  - spec/spec_helper.rb
115
+ has_rdoc: