pagerduty 2.1.1 → 4.0.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.
metadata CHANGED
@@ -1,30 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagerduty
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Somerville
8
8
  - Orien Madgwick
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-06 00:00:00.000000000 Z
12
+ date: 2022-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: json
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 1.7.7
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: 1.7.7
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: bundler
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -71,18 +57,17 @@ dependencies:
71
57
  name: rubocop
72
58
  requirement: !ruby/object:Gem::Requirement
73
59
  requirements:
74
- - - ">="
60
+ - - "<"
75
61
  - !ruby/object:Gem::Version
76
- version: '0'
62
+ version: '0.77'
77
63
  type: :development
78
64
  prerelease: false
79
65
  version_requirements: !ruby/object:Gem::Requirement
80
66
  requirements:
81
- - - ">="
67
+ - - "<"
82
68
  - !ruby/object:Gem::Version
83
- version: '0'
84
- description: Provides a lightweight interface for calling the PagerDuty Integration
85
- API
69
+ version: '0.77'
70
+ description: Provides a lightweight interface for calling the PagerDuty Events API
86
71
  email:
87
72
  - charlie@charliesomerville.com
88
73
  - _@orien.io
@@ -90,28 +75,24 @@ executables: []
90
75
  extensions: []
91
76
  extra_rdoc_files: []
92
77
  files:
93
- - ".gitignore"
94
- - ".rubocop.yml"
95
- - ".travis.yml"
96
- - Gemfile
78
+ - CHANGELOG.md
97
79
  - LICENSE.txt
98
80
  - README.md
99
- - Rakefile
100
81
  - lib/pagerduty.rb
82
+ - lib/pagerduty/events_api_v1.rb
83
+ - lib/pagerduty/events_api_v2.rb
101
84
  - lib/pagerduty/http_transport.rb
102
85
  - lib/pagerduty/version.rb
103
- - pagerduty.gemspec
104
- - script/setup.sh
105
- - spec/pagerduty/http_transport_spec.rb
106
- - spec/pagerduty_spec.rb
107
- - spec/spec_helper.rb
108
- - spec/support/warnings.rb
109
- homepage: http://github.com/envato/pagerduty
86
+ homepage: https://github.com/envato/pagerduty
110
87
  licenses:
111
88
  - MIT
112
- metadata: {}
113
- post_install_message: "\nIf upgrading to pagerduty 2.0.0 please note the API changes:\nhttps://github.com/envato/pagerduty#upgrading-to-version-200\n
114
- \ "
89
+ metadata:
90
+ bug_tracker_uri: https://github.com/envato/pagerduty/issues
91
+ changelog_uri: https://github.com/envato/pagerduty/blob/v4.0.0/CHANGELOG.md
92
+ documentation_uri: https://www.rubydoc.info/gems/pagerduty/4.0.0
93
+ homepage_uri: https://github.com/envato/pagerduty
94
+ source_code_uri: https://github.com/envato/pagerduty/tree/v4.0.0
95
+ post_install_message:
115
96
  rdoc_options: []
116
97
  require_paths:
117
98
  - lib
@@ -119,20 +100,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
100
  requirements:
120
101
  - - ">="
121
102
  - !ruby/object:Gem::Version
122
- version: '0'
103
+ version: '2.3'
123
104
  required_rubygems_version: !ruby/object:Gem::Requirement
124
105
  requirements:
125
106
  - - ">="
126
107
  - !ruby/object:Gem::Version
127
108
  version: '0'
128
109
  requirements: []
129
- rubyforge_project:
130
- rubygems_version: 2.7.6
131
- signing_key:
110
+ rubygems_version: 3.3.7
111
+ signing_key:
132
112
  specification_version: 4
133
- summary: Pagerduty Integration API client library
134
- test_files:
135
- - spec/pagerduty/http_transport_spec.rb
136
- - spec/pagerduty_spec.rb
137
- - spec/spec_helper.rb
138
- - spec/support/warnings.rb
113
+ summary: PagerDuty Events API client library
114
+ test_files: []
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- *.lock
2
- rdoc
3
- *.log
4
- .DS_Store
5
- *.swp
6
- *.swo
7
- pkg
8
- .bundle
9
- /bin
data/.rubocop.yml DELETED
@@ -1,38 +0,0 @@
1
- AllCops:
2
- Exclude:
3
- - .bundle/**/*
4
- - bin/**/*
5
- - vendor/**/*
6
-
7
- Layout/AccessModifierIndentation:
8
- EnforcedStyle: outdent
9
-
10
- Metrics/BlockLength:
11
- Enabled: true
12
- Exclude:
13
- - spec/**/*
14
-
15
- Style/BlockDelimiters:
16
- Exclude:
17
- - spec/**/*
18
-
19
- Style/Documentation:
20
- Enabled: false
21
-
22
- Style/GuardClause:
23
- Enabled: false
24
-
25
- Style/SpecialGlobalVars:
26
- Enabled: false
27
-
28
- Style/StringLiterals:
29
- EnforcedStyle: double_quotes
30
-
31
- Style/TrailingCommaInArguments:
32
- EnforcedStyleForMultiline: comma
33
-
34
- Style/TrailingCommaInArrayLiteral:
35
- EnforcedStyleForMultiline: comma
36
-
37
- Style/TrailingCommaInHashLiteral:
38
- EnforcedStyleForMultiline: comma
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- cache: bundler
4
- rvm:
5
- - 2.5.0
6
- - 2.4.3
7
- - 2.3.6
8
- - 2.2.9
9
- - 2.1.10
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in pagerduty.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require "rubocop/rake_task"
4
-
5
- task default: %i[spec rubocop]
6
-
7
- RSpec::Core::RakeTask.new(:spec) do |t|
8
- t.verbose = false
9
- t.ruby_opts = "-w"
10
- end
11
-
12
- RuboCop::RakeTask.new(:rubocop)
data/pagerduty.gemspec DELETED
@@ -1,32 +0,0 @@
1
-
2
- lib = File.expand_path("lib", __dir__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "pagerduty/version"
5
-
6
- Gem::Specification.new do |gem|
7
- gem.name = "pagerduty"
8
- gem.version = Pagerduty::VERSION
9
- gem.authors = ["Charlie Somerville", "Orien Madgwick"]
10
- gem.email = ["charlie@charliesomerville.com", "_@orien.io"]
11
- gem.description =
12
- "Provides a lightweight interface for calling the PagerDuty Integration API"
13
- gem.summary = "Pagerduty Integration API client library"
14
- gem.homepage = "http://github.com/envato/pagerduty"
15
- gem.license = "MIT"
16
-
17
- gem.post_install_message = %(
18
- If upgrading to pagerduty 2.0.0 please note the API changes:
19
- https://github.com/envato/pagerduty#upgrading-to-version-200
20
- )
21
-
22
- gem.files = `git ls-files`.split($/)
23
- gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
24
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
25
- gem.require_paths = ["lib"]
26
-
27
- gem.add_runtime_dependency "json", ">= 1.7.7"
28
- gem.add_development_dependency "bundler"
29
- gem.add_development_dependency "rake"
30
- gem.add_development_dependency "rspec-given"
31
- gem.add_development_dependency "rubocop"
32
- end
data/script/setup.sh DELETED
@@ -1,8 +0,0 @@
1
- #!/bin/bash
2
-
3
- echo "This command will setup your local dev environment, including"
4
- echo " * bundle install"
5
- echo
6
-
7
- echo "Bundling..."
8
- bundle install --binstubs bin --path .bundle
@@ -1,132 +0,0 @@
1
-
2
- require "spec_helper"
3
-
4
- describe Pagerduty::HttpTransport do
5
- Given(:http_transport) { Pagerduty::HttpTransport.new(options) }
6
-
7
- Given(:options) { {} }
8
- Given(:http) { spy }
9
- Given(:http_proxy) { spy(new: http) }
10
- Given { allow(http).to receive(:request).and_return(standard_response) }
11
- Given { allow(Net::HTTP).to receive(:Proxy).and_return(http_proxy) }
12
- Given(:post) { spy }
13
- Given { allow(Net::HTTP::Post).to receive(:new).and_return(post) }
14
-
15
- describe "::send_payload" do
16
- Given(:payload) {
17
- {
18
- event_type: "trigger",
19
- service_key: "test-srvc-key",
20
- description: "test-desc",
21
- details: { key: "value" },
22
- }
23
- }
24
-
25
- When(:response) { http_transport.send_payload(payload) }
26
-
27
- describe "provides the correct request" do
28
- Then {
29
- expect(post).to have_received(:body=).with(
30
- '{"event_type":"trigger",'\
31
- '"service_key":"test-srvc-key",'\
32
- '"description":"test-desc",'\
33
- '"details":{"key":"value"}}',
34
- )
35
- }
36
- end
37
-
38
- describe "handles all responses" do
39
- context "PagerDuty successfully creates the incident" do
40
- Given {
41
- allow(http)
42
- .to receive(:request)
43
- .and_return(response_with_body(<<-JSON))
44
- {
45
- "status": "success",
46
- "incident_key": "My Incident Key",
47
- "message": "Event processed"
48
- }
49
- JSON
50
- }
51
-
52
- Then { expect(response).to include("status" => "success") }
53
- Then {
54
- expect(response).to include("incident_key" => "My Incident Key")
55
- }
56
- end
57
-
58
- context "PagerDuty fails to create the incident" do
59
- Given {
60
- allow(http)
61
- .to receive(:request)
62
- .and_return(response_with_body(<<-JSON))
63
- {
64
- "status": "failure",
65
- "message": "Event not processed"
66
- }
67
- JSON
68
- }
69
- Then { expect(response).to include("status" => "failure") }
70
- Then { expect(response).to_not include("incident_key") }
71
- end
72
-
73
- context "PagerDuty responds with HTTP bad request" do
74
- Given { allow(http).to receive(:request).and_return(bad_request) }
75
- Then { expect(response).to have_raised Net::HTTPServerException }
76
- end
77
- end
78
-
79
- describe "HTTPS use" do
80
- Then { expect(http).to have_received(:use_ssl=).with(true) }
81
- Then { expect(http).to_not have_received(:ca_path=) }
82
- Then { expect(http).to_not have_received(:verify_depth=) }
83
- Then {
84
- expect(http)
85
- .to have_received(:verify_mode=)
86
- .with(OpenSSL::SSL::VERIFY_PEER)
87
- }
88
- end
89
-
90
- describe "proxy use" do
91
- Given(:options) {
92
- {
93
- proxy_host: "test-proxy-host",
94
- proxy_port: "test-proxy-port",
95
- proxy_username: "test-proxy-username",
96
- proxy_password: "test-proxy-password",
97
- }
98
- }
99
- Then {
100
- expect(Net::HTTP)
101
- .to have_received(:Proxy)
102
- .with(
103
- "test-proxy-host",
104
- "test-proxy-port",
105
- "test-proxy-username",
106
- "test-proxy-password",
107
- )
108
- }
109
- end
110
-
111
- describe "timeouts" do
112
- Then { expect(http).to have_received(:open_timeout=).with(60) }
113
- Then { expect(http).to have_received(:read_timeout=).with(60) }
114
- end
115
- end
116
-
117
- def standard_response
118
- response_with_body(
119
- '{ "status": "success", "incident_key": "My Incident Key" }',
120
- )
121
- end
122
-
123
- def response_with_body(body)
124
- response = Net::HTTPSuccess.new 1.1, "200", "OK"
125
- allow(response).to receive(:body).and_return(body)
126
- response
127
- end
128
-
129
- def bad_request
130
- Net::HTTPBadRequest.new 1.1, "400", "Bad Request"
131
- end
132
- end