heart_top 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3323458320eb456251621f2133e26371244e472
4
- data.tar.gz: 445a18599febd626d1cae53215f807c1794f3a66
3
+ metadata.gz: 7b9fe2c0ca1ae40315774d439d8da1c536c20555
4
+ data.tar.gz: 3a7954dc62b46f10160acd01646d07907a3d795c
5
5
  SHA512:
6
- metadata.gz: 4dc44252dfe86817e04797ab4f1964cb63c2b5e278f6b21e9bb56835b52d9cb1c6f5aac43ee873f57dcd94baf7ec00513b15967f46d4d39fcbbd44777c1b3995
7
- data.tar.gz: 35af02250311501ac9538739c7aa63b5375a91a4d6ffcf0e773fbbb7fc17ce21eb5e2dc87d6a3a3261c00bf2ab19b6c12fdb59472d1987df9c9ccb4daf141c24
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
- send("#{@command}!")
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
- EOF
119
+ EOF
113
120
  end
114
121
  end
115
122
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HeartTop
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heart_top
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Faizal Zakaria