exprc 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/exprc +4 -5
- data/exprc.gemspec +1 -1
- metadata +1 -1
data/bin/exprc
CHANGED
@@ -21,7 +21,7 @@ ARGV.options do |o|
|
|
21
21
|
key = nil
|
22
22
|
percentile = nil
|
23
23
|
|
24
|
-
o.banner = "usage: exprc list|show|test|create|destroy [options]"
|
24
|
+
o.banner = "usage: exprc list|show|test|create|destroy|version [options]"
|
25
25
|
o.on("-n", "--name n", String, "name of metric") { |n| name = n }
|
26
26
|
o.on("-t", "--type t", String, "type of metric") { |t| type = t }
|
27
27
|
o.on("-w", "--window w", Integer, "window of metric in seconds") { |w| window = w }
|
@@ -37,11 +37,13 @@ ARGV.options do |o|
|
|
37
37
|
exprd_api_url = ENV["EXPRD_API_URL"]
|
38
38
|
|
39
39
|
abort("! error: an action is required (e.g list).\n\n#{o}") if (!action || action.empty?)
|
40
|
-
abort("! error: unrecognized action #{action}.") if !%w{list show test create update destroy}.include?(action)
|
40
|
+
abort("! error: unrecognized action #{action}.") if !%w{list show test create update destroy version}.include?(action)
|
41
41
|
abort("! error: missing EXPRD_API_URL.\n\n#{o}") if (!exprd_api_url || exprd_api_url.empty?)
|
42
42
|
abort("! error: unrecognized args: #{ARGV.join(" ")}.") if !ARGV.empty?
|
43
43
|
|
44
44
|
case action
|
45
|
+
when "version"
|
46
|
+
puts("0.0.2")
|
45
47
|
when "list"
|
46
48
|
begin
|
47
49
|
names = JSON.parse(RestClient.get("#{exprd_api_url}/metrics"))
|
@@ -73,9 +75,6 @@ ARGV.options do |o|
|
|
73
75
|
end
|
74
76
|
when "test"
|
75
77
|
abort("! error: missing --name.\n\n#{o}") if (!name || name.empty?)
|
76
|
-
abort("! error: missing --type.\n\n#{o}") if (!type || type.empty?)
|
77
|
-
abort("! error: missing --window.\n\n#{o}") if !window
|
78
|
-
abort("! error: missing --delay.\n\n#{o}") if !delay
|
79
78
|
$stdout.print("* testing metric #{name}...")
|
80
79
|
begin
|
81
80
|
params = {
|
data/exprc.gemspec
CHANGED