heart_top 0.2.0 → 0.3.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 +4 -4
- data/README.md +8 -0
- data/lib/heart_top/cli.rb +12 -5
- data/lib/heart_top/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b9fe2c0ca1ae40315774d439d8da1c536c20555
|
4
|
+
data.tar.gz: 3a7954dc62b46f10160acd01646d07907a3d795c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bacc45eeb79fa5285a09e3642d21978212326bf983e4f405f4d8335e7d755bb647d7532caca8ee7c9080759395e7918dc27cf80f1eab1f2f8363dc2f5fb202b1
|
7
|
+
data.tar.gz: 1b8ebd5de252442a8188710c3ced65dce3d49a9a96e0da70ce38d405eec889e409a33fb9f98ad571fbf245cd55b66f2dcd2d45a8cd90af0e09a425c465c10aa9
|
data/README.md
CHANGED
@@ -33,6 +33,14 @@ $ hearttop stop
|
|
33
33
|
$ hearttop -h
|
34
34
|
```
|
35
35
|
|
36
|
+
### Supported Plugins
|
37
|
+
|
38
|
+
- [x] Slack
|
39
|
+
|
40
|
+
```sh
|
41
|
+
$ SLACK_WEBHOOK_URL=http://slack.com/xxx hearttop start
|
42
|
+
```
|
43
|
+
|
36
44
|
## Contributing
|
37
45
|
|
38
46
|
Bug reports and pull requests are welcome on GitHub at https://github.com/faizalzakaria/heart_top.
|
data/lib/heart_top/cli.rb
CHANGED
@@ -27,8 +27,9 @@ module HeartTop
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
def execute
|
31
|
-
|
30
|
+
def execute
|
31
|
+
puts Rainbow("Executing #{@command} ...").green
|
32
|
+
send("#{@command}")
|
32
33
|
end
|
33
34
|
|
34
35
|
def pid_path
|
@@ -39,6 +40,11 @@ module HeartTop
|
|
39
40
|
'/tmp/hearttop.log'
|
40
41
|
end
|
41
42
|
|
43
|
+
def restart
|
44
|
+
stop
|
45
|
+
start
|
46
|
+
end
|
47
|
+
|
42
48
|
def start
|
43
49
|
options = {
|
44
50
|
interval: @interval,
|
@@ -72,8 +78,9 @@ module HeartTop
|
|
72
78
|
case opt
|
73
79
|
when '--help'
|
74
80
|
print_help
|
81
|
+
exit(0)
|
75
82
|
when '--interval'
|
76
|
-
@interval = arg
|
83
|
+
@interval = arg.to_i
|
77
84
|
when '--verbose'
|
78
85
|
@verbose = true
|
79
86
|
end
|
@@ -84,7 +91,7 @@ module HeartTop
|
|
84
91
|
end
|
85
92
|
|
86
93
|
def supported_commands?(cmd)
|
87
|
-
cmd.nil? || %w[stop start].include?(cmd)
|
94
|
+
cmd.nil? || %w[stop start restart].include?(cmd)
|
88
95
|
end
|
89
96
|
|
90
97
|
def print_details
|
@@ -109,7 +116,7 @@ module HeartTop
|
|
109
116
|
--interval [interval], -i [interval]:
|
110
117
|
interval, e.g: 10 (in seconds)
|
111
118
|
|
112
|
-
|
119
|
+
EOF
|
113
120
|
end
|
114
121
|
end
|
115
122
|
end
|
data/lib/heart_top/version.rb
CHANGED