growthforecast-client 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/VERSION +1 -1
- data/bin/growthforecast-client +1 -1
- data/lib/growthforecast-client.rb +1 -1
- data/lib/{cli/growthforecast-client.rb → growthforecast/cli.rb} +11 -3
- data/lib/growthforecast/client.rb +6 -2
- data/spec/{cli/growthforecast-client_spec.rb → growthforecast/cli_spec.rb} +2 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f08451a6391693686e7860e69d4c73e07332021
|
4
|
+
data.tar.gz: 9b40c514b10a6362fbaf075a70610f36a1514c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91f7bfe0c54e4768d8a952bec31930edd5071a1ec890091f3341be6463c90f76fe4136bcff88f3cc945aef7fe91ffe78bcc65e575863abdfc83c03e6c30c0b3f
|
7
|
+
data.tar.gz: 4a83edef7f730f1824ec975fc664bb67d1dccf969856d5ae8483b266cff6a86c2245c3757fcbfbf93a5eb7143cbfd170be1559d5fdbc73275997b558cf4cad38
|
data/CHANGELOG.md
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/bin/growthforecast-client
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require 'growthforecast/client'
|
2
|
-
require 'cli
|
2
|
+
require 'growthforecast/cli'
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
require 'thor'
|
3
3
|
|
4
|
-
|
5
|
-
class GrowthforecastClient < Thor
|
4
|
+
class GrowthForecast::CLI < Thor
|
6
5
|
desc 'delete_graph <url>', 'delete a graph or graphs under a url'
|
7
6
|
long_desc <<-LONGDESC
|
8
7
|
Delete a graph or graphs under a <url> where <url> is the one obtained from the view, e.g.,
|
@@ -23,6 +22,15 @@ class GrowthforecastClient < Thor
|
|
23
22
|
puts "\tclass:#{e.class}\t#{e.message}"
|
24
23
|
end
|
25
24
|
end
|
25
|
+
graphs = client.list_complex(service_name, section_name, graph_name)
|
26
|
+
graphs.each do |graph|
|
27
|
+
begin
|
28
|
+
client.delete_complex(graph['service_name'], graph['section_name'], graph['graph_name'])
|
29
|
+
puts "Deleted #{e graph['service_name']}/#{e graph['section_name']}/#{e graph['graph_name']}"
|
30
|
+
rescue => e
|
31
|
+
puts "\tclass:#{e.class}\t#{e.message}"
|
32
|
+
end
|
33
|
+
end
|
26
34
|
end
|
27
35
|
|
28
36
|
no_tasks do
|
@@ -40,4 +48,4 @@ class GrowthforecastClient < Thor
|
|
40
48
|
end
|
41
49
|
end
|
42
50
|
end
|
43
|
-
|
51
|
+
|
@@ -221,8 +221,12 @@ module GrowthForecast
|
|
221
221
|
# "section_name"=>"hostname",
|
222
222
|
# "id"=>3},
|
223
223
|
# ]
|
224
|
-
def list_complex
|
225
|
-
get_json('/json/list/complex')
|
224
|
+
def list_complex(service_name = nil, section_name = nil, graph_name = nil)
|
225
|
+
graphs = get_json('/json/list/complex')
|
226
|
+
graphs = graphs.select {|g| g['service_name'] == service_name } if service_name
|
227
|
+
graphs = graphs.select {|g| g['section_name'] == section_name } if section_name
|
228
|
+
graphs = graphs.select {|g| g['graph_name'] == graph_name } if graph_name
|
229
|
+
graphs
|
226
230
|
end
|
227
231
|
|
228
232
|
# Create a complex graph
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe CLI
|
3
|
+
describe GrowthForecast::CLI do
|
4
4
|
include_context "setup_growthforecast_client"
|
5
|
-
before(:all) { @cli = CLI
|
5
|
+
before(:all) { @cli = GrowthForecast::CLI.new }
|
6
6
|
|
7
7
|
context "#split_path" do
|
8
8
|
context 'list service url' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: growthforecast-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- .rdebugrc
|
121
121
|
- .rspec
|
122
122
|
- .travis.yml
|
123
|
+
- CHANGELOG.md
|
123
124
|
- Gemfile
|
124
125
|
- LICENSE
|
125
126
|
- README.md
|
@@ -129,10 +130,10 @@ files:
|
|
129
130
|
- examples/create_complex.rb
|
130
131
|
- examples/edit_graph.rb
|
131
132
|
- growthforecast-client.gemspec
|
132
|
-
- lib/cli/growthforecast-client.rb
|
133
133
|
- lib/growthforecast-client.rb
|
134
|
+
- lib/growthforecast/cli.rb
|
134
135
|
- lib/growthforecast/client.rb
|
135
|
-
- spec/
|
136
|
+
- spec/growthforecast/cli_spec.rb
|
136
137
|
- spec/growthforecast/client_spec.rb
|
137
138
|
- spec/spec_helper.rb
|
138
139
|
- spec/support/mock.rb
|
@@ -161,7 +162,7 @@ signing_key:
|
|
161
162
|
specification_version: 4
|
162
163
|
summary: A Ruby Client Library for GrowthForecast API
|
163
164
|
test_files:
|
164
|
-
- spec/
|
165
|
+
- spec/growthforecast/cli_spec.rb
|
165
166
|
- spec/growthforecast/client_spec.rb
|
166
167
|
- spec/spec_helper.rb
|
167
168
|
- spec/support/mock.rb
|