pagerduty_tools 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/oncall-email.rb CHANGED
@@ -19,13 +19,13 @@
19
19
  # Original script contributed by Jeffrey Wescott
20
20
  # (https://github.com/binaryfeed). Thanks!
21
21
 
22
- require 'psych'
23
- require 'net/smtp'
24
- require 'optparse'
25
-
26
22
  lib = File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
27
23
  $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
28
24
 
25
+ require 'psychout'
26
+ require 'net/smtp'
27
+ require 'optparse'
28
+
29
29
  require 'pagerduty_tools'
30
30
 
31
31
  # Look for reporting options
@@ -14,12 +14,12 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- require 'psych'
18
- require 'hpricot'
19
-
20
17
  lib = File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
21
18
  $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
22
19
 
20
+ require 'psychout'
21
+ require 'hpricot'
22
+
23
23
  require 'pagerduty_tools'
24
24
 
25
25
  if (ARGV.length == 0)
@@ -24,12 +24,13 @@
24
24
  # PagerDuty login cookies will be stored at ~/.pagerduty-cookies, so you
25
25
  # should only need to enter login credentials on the first run.
26
26
 
27
- require 'psych'
27
+ lib = File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
28
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
29
+
30
+ require 'psychout'
28
31
  require 'nokogiri'
29
32
  require 'optparse'
30
33
 
31
- lib = File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
32
- $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
33
34
 
34
35
  require 'pagerduty_tools'
35
36
 
@@ -19,15 +19,15 @@
19
19
  # Gathers information about incidents and alerts during a PagerDuty
20
20
  # rotation, and reports on them.
21
21
 
22
- require 'psych'
22
+ lib = File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
23
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
24
+
25
+ require 'psychout'
23
26
  require 'date'
24
27
  require 'json'
25
28
  require 'nokogiri'
26
29
  require 'optparse'
27
30
 
28
- lib = File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
29
- $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
30
-
31
31
  require 'pagerduty_tools'
32
32
 
33
33
  ONE_DAY = 60 * 60 * 24
@@ -1,6 +1,6 @@
1
1
 
2
2
  module PagerdutyTools
3
3
  unless defined?(VERSION)
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
6
6
  end
data/lib/psychout.rb ADDED
@@ -0,0 +1,17 @@
1
+ # Thanks to Andre Arko for suggesting this as a workaround. That it is needed...
2
+
3
+ # Psych could be a gem
4
+ begin
5
+ gem 'psych'
6
+ rescue Gem::LoadError
7
+ end if defined?(Gem)
8
+
9
+ # Psych could be a stdlib
10
+ begin
11
+ # it's too late if Syck is already loaded
12
+ require 'psych' unless defined?(Syck)
13
+ rescue LoadError
14
+ end
15
+
16
+ # Psych might NOT EXIST AT ALL
17
+ require 'yaml'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagerduty_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &70299971998040 !ruby/object:Gem::Requirement
16
+ requirement: &70193468838820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70299971998040
24
+ version_requirements: *70193468838820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fuubar
27
- requirement: &70299971997620 !ruby/object:Gem::Requirement
27
+ requirement: &70193468838380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70299971997620
35
+ version_requirements: *70193468838380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: psych
38
- requirement: &70299971997040 !ruby/object:Gem::Requirement
38
+ requirement: &70193468837700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.1'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70299971997040
46
+ version_requirements: *70193468837700
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: chronic
49
- requirement: &70299971996500 !ruby/object:Gem::Requirement
49
+ requirement: &70193468837080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0.6'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70299971996500
57
+ version_requirements: *70193468837080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: highline
60
- requirement: &70299971996040 !ruby/object:Gem::Requirement
60
+ requirement: &70193468836520 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '1.6'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70299971996040
68
+ version_requirements: *70193468836520
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: json
71
- requirement: &70299971995580 !ruby/object:Gem::Requirement
71
+ requirement: &70193468835860 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '1.6'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70299971995580
79
+ version_requirements: *70193468835860
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: mechanize
82
- requirement: &70299971995120 !ruby/object:Gem::Requirement
82
+ requirement: &70193468835260 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '2.0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70299971995120
90
+ version_requirements: *70193468835260
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: nokogiri
93
- requirement: &70299971994660 !ruby/object:Gem::Requirement
93
+ requirement: &70193468834680 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '1.5'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70299971994660
101
+ version_requirements: *70193468834680
102
102
  description: Set of libraries and command-line tools to make better use of PagerDuty.
103
103
  email:
104
104
  - marc@precipice.org
@@ -126,6 +126,7 @@ files:
126
126
  - lib/pagerduty_tools/pagerduty.rb
127
127
  - lib/pagerduty_tools/report.rb
128
128
  - lib/pagerduty_tools/version.rb
129
+ - lib/psychout.rb
129
130
  - pagerduty_tools.gemspec
130
131
  homepage: https://github.com/precipice/pagerduty_tools
131
132
  licenses: