pager_duty-connection 1.1.0 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3eb5818a371ea5cb4a10d94764c7a1308741e81a
4
- data.tar.gz: 71b98026cfede655051b5f4e4cc5c6bcc7a9067e
2
+ SHA256:
3
+ metadata.gz: 8bb93bb921c417024ae1b67084af9b46f665e665777189c9586833ce4b89eb14
4
+ data.tar.gz: a1c13738d4bbdbed0d1694fe0eebe690a567e8cfc7b2161b1cd702521ce70beb
5
5
  SHA512:
6
- metadata.gz: c970053abf61f0c58cc4b602126c892a7eef20821ebb7da2ce400534eb23c410e5bba3837d6aaaf9aee84d15c6034f31560de507e81063cf4644da19fbb9f9cd
7
- data.tar.gz: 681cf2f7aaa12a1893be4167a44bd6717bb3fedb2975af84ff91abd033a3f3e668750f6f1adac56a7c78aaa3d635956317682c70c7ae99ed0339436fe3741a9d
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
- # use token authentication: http://developer.pagerduty.com/documentation/rest/authentication
154
- conn.token_auth token
153
+ conn.authorization(token_type, token)
155
154
 
156
155
  conn.use RaiseApiErrorOnNon200
157
156
  conn.use RaiseFileNotFoundOn404
@@ -1,5 +1,5 @@
1
1
  module PagerDuty
2
2
  class Connection
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
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.1.0
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: 2018-11-20 00:00:00.000000000 Z
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
- rubyforge_project:
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