pager_duty-connection 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +4 -1
- data/lib/pager_duty/connection.rb +2 -3
- data/lib/pager_duty/connection/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8bb93bb921c417024ae1b67084af9b46f665e665777189c9586833ce4b89eb14
|
4
|
+
data.tar.gz: a1c13738d4bbdbed0d1694fe0eebe690a567e8cfc7b2161b1cd702521ce70beb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a86b4f5c25b3af8ac053f3938418eb30dffd2722ee5c33942d52eb1f2316a89455733d42c3514125405b9ce89c56dc840bcca2093996455aadbea37000037633
|
7
|
+
data.tar.gz: 37850cf9bb30d87833859298029b41777bc35c728ffbe89ee4be71a19e8445bf241e25c152d86a410af89c1bbb09bb5cfd2babf76ccec10cfd94635a2f8b523f
|
data/README.md
CHANGED
@@ -47,9 +47,12 @@ Or install it yourself as:
|
|
47
47
|
Working code is worth a thousand words. The basics:
|
48
48
|
|
49
49
|
```ruby
|
50
|
-
# setup the connection
|
50
|
+
# setup the connection with API token
|
51
51
|
pagerduty = PagerDuty::Connection.new(token)
|
52
52
|
|
53
|
+
# setup the connection with OAuth2 token
|
54
|
+
pagerduty = PagerDuty::Connection.new(token, :Bearer)
|
55
|
+
|
53
56
|
# 4 main methods: `get`, `post`, `put`, and `delete`:
|
54
57
|
|
55
58
|
response = pagerduty.get('some/relative/path', params)
|
@@ -146,12 +146,11 @@ module PagerDuty
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
|
-
def initialize(token, debug: false)
|
149
|
+
def initialize(token, token_type: :Token, debug: false)
|
150
150
|
@connection = Faraday.new do |conn|
|
151
151
|
conn.url_prefix = "https://api.pagerduty.com/"
|
152
152
|
|
153
|
-
|
154
|
-
conn.token_auth token
|
153
|
+
conn.authorization(token_type, token)
|
155
154
|
|
156
155
|
conn.use RaiseApiErrorOnNon200
|
157
156
|
conn.use RaiseFileNotFoundOn404
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pager_duty-connection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Nichols
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
|
125
|
-
rubygems_version: 2.6.14.1
|
124
|
+
rubygems_version: 3.0.6
|
126
125
|
signing_key:
|
127
126
|
specification_version: 4
|
128
127
|
summary: Written with the power of faraday, pager_duty-connection tries to be a simple
|