fellowshipone 2.0.0 → 2.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: 62cb24583d770d51d4bbcaa1da51bd4b3385d99a
4
- data.tar.gz: 0857cfb2ce47912d9459c0761c827d5e99245902
3
+ metadata.gz: df5c9b89ae1ee55d15f5f465d12362df2a5827e0
4
+ data.tar.gz: 31178b96d931d9bc59a9ab5abbc60a3bf0599acf
5
5
  SHA512:
6
- metadata.gz: a5aa25ee6e43cc373d013907147fd1644a2f29bf3075c9ae09d723235372977d7d4f98d9f49796862a9a2e88f7e9eb195ebed9e31627a01c684a261c2094663c
7
- data.tar.gz: a06e43e12c702a214e8fd7932f70cc991af8818eb1a30d4a9f42584d2bc8f9c3be7407e5f5999dfde10cc85889bbfb1b4637c006628c293abecf26c858434421
6
+ metadata.gz: 5c0908f2f48f67bd77ef693c46d00e913b7e461d5746cf2734013be40d8ebb8f87dab709377c36288af96856abf19faf561c7a8381bff1a8712ea00724a7fddf
7
+ data.tar.gz: 26e358fb0e9f417dd8fc39ff23c802efa31ea9c8b5a8204c649852b2f0226a5d2753ec657f0a2ee83aa706df4e58a99edf8e52d9fd486e4db57485a8822d2d66
@@ -1,8 +1,8 @@
1
- $:.push File.expand_path("../lib", __FILE__)
1
+ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'fellowshipone'
5
- s.version = '2.0.0'
5
+ s.version = '2.1.0'
6
6
  s.authors = ['Taylor Brooks']
7
7
  s.email = ['tbrooks@gmail.com']
8
8
  s.homepage = 'https://github.com/taylorbrooks/fellowshipone'
@@ -11,21 +11,22 @@ Gem::Specification.new do |s|
11
11
  s.description = 'Ruby gem/plugin to interact with the FellowshipOne API (https://developer.fellowshipone.com/). Checkout the project on github for more detail.'
12
12
  s.license = 'MIT'
13
13
 
14
- s.add_development_dependency "bundler"
15
- s.add_development_dependency "rake"
16
- s.add_development_dependency "minitest"
17
- s.add_development_dependency "vcr"
18
- s.add_development_dependency "webmock"
14
+ s.add_development_dependency 'bundler'
15
+ s.add_development_dependency 'minitest'
16
+ s.add_development_dependency 'rake'
17
+ s.add_development_dependency 'vcr'
18
+ s.add_development_dependency 'webmock'
19
19
 
20
- s.add_runtime_dependency "faraday"
21
- s.add_runtime_dependency "faraday_middleware"
22
- s.add_runtime_dependency "simple_oauth"
23
- s.add_runtime_dependency "hashie"
24
- s.add_runtime_dependency "json"
25
- s.add_runtime_dependency "addressable"
20
+ s.add_runtime_dependency 'addressable'
21
+ s.add_runtime_dependency 'faraday'
22
+ s.add_runtime_dependency 'faraday_middleware'
23
+ s.add_runtime_dependency 'hashie'
24
+ s.add_runtime_dependency 'json'
25
+ s.add_runtime_dependency 'oauth'
26
+ s.add_runtime_dependency 'simple_oauth'
26
27
 
27
28
  s.files = `git ls-files`.split("\n").delete_if { |f| !(f =~ /^examples/).nil? }
28
29
  s.test_files = `git ls-files -- {test,features}/*`.split("\n")
29
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
30
- s.require_paths = ["lib"]
30
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
31
+ s.require_paths = ['lib']
31
32
  end
@@ -1 +1,2 @@
1
1
  require_relative 'fellowshipone/client.rb'
2
+ require_relative 'fellowshipone/connection.rb'
@@ -26,36 +26,24 @@ module Fellowshipone
26
26
  @logger = logger
27
27
  end
28
28
 
29
- def get(path, options={})
30
- connection.get do |req|
31
- req.url(path, options)
32
- end.body
29
+ def get(path, options = {})
30
+ connection.get(path, options).body
33
31
  end
34
32
 
35
- def post(path, req_body)
36
- connection.post do |req|
37
- req.url(path)
38
- req.body = req_body
39
- end.body
33
+ def post(path, options = {})
34
+ connection.post(path, options).body
40
35
  end
41
36
 
42
- def put(path, req_body)
43
- connection.put do |req|
44
- req.url path
45
- req.body = req_body
46
- end
37
+ def put(path, options = {})
38
+ connection.put(path, options).body
47
39
  end
48
40
 
49
41
  def delete(path, options = {})
50
- connection.delete do |req|
51
- req.url path
52
- end.body
42
+ connection.delete(path, options).body
53
43
  end
54
44
 
55
45
  def save
56
- connection.put do |req|
57
- req.url path
58
- end.body
46
+ connection.put(path, {}).body
59
47
  end
60
48
 
61
49
  private
@@ -0,0 +1,18 @@
1
+ require 'oauth'
2
+
3
+ module Fellowshipone
4
+ class Connection
5
+ def self.connect(church_code:, consumer_key:, consumer_secret:, callback_url:)
6
+ consumer = OAuth::Consumer.new(
7
+ consumer_key,
8
+ consumer_secret,
9
+ site: "https://#{church_code}.fellowshiponeapi.com",
10
+ request_token_path: '/v1/Tokens/RequestToken',
11
+ authorize_path: '/v1/PortalUser/Login',
12
+ access_token_path: '/v1/Tokens/AccessToken'
13
+ )
14
+
15
+ consumer.get_request_token(oauth_callback: callback_url)
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fellowshipone
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-05 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: faraday
84
+ name: addressable
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: faraday_middleware
98
+ name: faraday
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: simple_oauth
112
+ name: faraday_middleware
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -151,7 +151,21 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: addressable
154
+ name: oauth
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: simple_oauth
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
171
  - - ">="
@@ -180,6 +194,7 @@ files:
180
194
  - fellowshipone.gemspec
181
195
  - lib/fellowshipone.rb
182
196
  - lib/fellowshipone/client.rb
197
+ - lib/fellowshipone/connection.rb
183
198
  - lib/fellowshipone/resources/communication.rb
184
199
  - lib/fellowshipone/resources/contribution.rb
185
200
  - lib/fellowshipone/resources/fund.rb