ebm 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/commands/periodic.rb +54 -0
- data/lib/commands.rb +1 -0
- data/lib/ebm.rb +1 -0
- data/lib/info.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA512:
|
3
|
-
metadata.gz: 5a51322fa4f1dd04b5df1fbe05f5b43365627b15600f45791be45260277396921a7987aee15b49e48dcf6f3e696508d32afac89fac8b4d8936f27dc648879d21
|
4
|
-
data.tar.gz: 0effc84cefbf5ee888f4297e7bbb82bd9f49bc77c6ddc328b5ee11bb60f6e57ad4e95d3cd0be242890fd4afedaef2e779ceabcb8c9e7f0b2991ddfbefeba2915
|
5
2
|
SHA1:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 223f7a32ac701e393907dd0909e1cf49734bea4c
|
4
|
+
data.tar.gz: 843ea1460f7e9c9e303b292bfce13abce04f5d2a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fac82fb82f1835d6d85c33a87ea4e20b37ff1a9bb711a8d02c98fd1dc24b6bb09928713ef11f6ad19e99a94d607d9608339d467eadb259b528a537bcd27215fa
|
7
|
+
data.tar.gz: 5468fddc39eea3ce2366f16e435325738c43423374d1e47ebba7695686854d5e8dd48bee762b048c44cab5596bba0f4094ee9cda0332d405931b63e4397fb226
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#
|
2
|
+
# Greg Seitz
|
3
|
+
#
|
4
|
+
# Copyright 2013, eBay Inc.
|
5
|
+
# All rights reserved.
|
6
|
+
# http://www.ebay.com
|
7
|
+
#
|
8
|
+
module Commands
|
9
|
+
class Periodic
|
10
|
+
|
11
|
+
# holds the options that were passed
|
12
|
+
# you can set any initial defaults here
|
13
|
+
def options
|
14
|
+
@options ||= {
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
# required options
|
19
|
+
def required_options
|
20
|
+
@required_options ||= Set.new [
|
21
|
+
:command,
|
22
|
+
:interval
|
23
|
+
]
|
24
|
+
end
|
25
|
+
|
26
|
+
def register(opts, global_options)
|
27
|
+
opts.banner = "Usage: periodic [options]"
|
28
|
+
opts.description = "Run a periodic command"
|
29
|
+
|
30
|
+
opts.on('-c', "--command name", "Required - Command to run.") do |v|
|
31
|
+
options[:command] = v
|
32
|
+
end
|
33
|
+
|
34
|
+
opts.on('-i', "--interval value", Integer, "Required - Interval in seconds.") do |v|
|
35
|
+
options[:interval] = v
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def run(global_options)
|
41
|
+
|
42
|
+
# see if we can open the config file - we append the .config suffix
|
43
|
+
# the file is expected to be in JSON format
|
44
|
+
command = options[:command]
|
45
|
+
interval = options[:interval]
|
46
|
+
|
47
|
+
while true
|
48
|
+
EbmSharedLib::CL.do_cmd_result(command)
|
49
|
+
sleep(interval)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
data/lib/commands.rb
CHANGED
data/lib/ebm.rb
CHANGED
data/lib/info.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Seitz
|
@@ -52,6 +52,7 @@ extra_rdoc_files: []
|
|
52
52
|
files:
|
53
53
|
- lib/commands/list_configs.rb
|
54
54
|
- lib/commands/make_sample.rb
|
55
|
+
- lib/commands/periodic.rb
|
55
56
|
- lib/commands/prepare.rb
|
56
57
|
- lib/commands/status.rb
|
57
58
|
- lib/commands/tag.rb
|