loader_droid 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/loader_droid +34 -19
- metadata +29 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e8048470713f84bd3991c4dc7b7ad791af8d71c
|
4
|
+
data.tar.gz: d9a49bb8de67170e586280fb412926c2c93ac4b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc0f855267105cc664ae7fea1b1c0438af5edceccc6f24b89cffc5e7b39d6cbbef29fbb21d687c4464ae3149508949f0b2a2383a3f69c701d4e8d17e8108fbe
|
7
|
+
data.tar.gz: fb25d7f9b87735d6f60a21b52201eb959b8142a08c3283fffe857dac0802ac9f01a3fed40d7f1ef755d35d09408177230e37b029e4b675974445a106bf360356
|
data/bin/loader_droid
CHANGED
@@ -6,37 +6,52 @@ require_relative "../case_manager.rb"
|
|
6
6
|
|
7
7
|
class LoaderDroid < Thor
|
8
8
|
|
9
|
-
desc "solutions
|
10
|
-
def solutions(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
desc "solutions YML_FILE PASSWORD", "List solutions"
|
10
|
+
def solutions(properties_yml_file, password)
|
11
|
+
config = YAML.load_file(properties_yml_file)
|
12
|
+
c = CaseManager.new(config["server"]["base_url"], config["server"]["username"], password)
|
13
|
+
|
14
|
+
begin
|
15
|
+
response = c.solution_list
|
16
|
+
json = JSON.parse(response.body)
|
17
|
+
|
18
|
+
say "Found #{json.count} solutions"
|
19
|
+
json.each do |solution_json|
|
20
|
+
say "#{solution_json["name"]}", :green
|
21
|
+
end
|
22
|
+
rescue Exception => e
|
23
|
+
say "Connection failed: #{e.message}", :red
|
16
24
|
end
|
25
|
+
|
17
26
|
end
|
18
27
|
|
19
28
|
desc "create_case YML_FILE PASSWORD", "Create a case"
|
20
29
|
method_options :count => 1
|
21
30
|
def create_case(properties_yml_file, password)
|
22
31
|
config = YAML.load_file(properties_yml_file)
|
32
|
+
count = options[:count]
|
23
33
|
c = CaseManager.new(config["server"]["base_url"], config["server"]["username"], password)
|
24
34
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
35
|
+
begin
|
36
|
+
case_properties = config["case_properties"]
|
37
|
+
count.times do
|
38
|
+
dynamic_properties = {}
|
39
|
+
config["dynamic_case_properties"].each_pair do |k,v|
|
40
|
+
dynamic_properties[k] = eval(v)
|
41
|
+
end
|
31
42
|
|
32
|
-
|
33
|
-
|
34
|
-
|
43
|
+
all_case_properties = {}
|
44
|
+
all_case_properties.merge!(dynamic_properties) if dynamic_properties
|
45
|
+
all_case_properties.merge!(case_properties) if case_properties
|
35
46
|
|
36
|
-
|
47
|
+
say "Creating case with properties #{all_case_properties}"
|
37
48
|
|
38
|
-
|
39
|
-
|
49
|
+
response = c.create_case(config["solution_name"], config["case_type"], all_case_properties)
|
50
|
+
end
|
51
|
+
say "Created #{count} new case(s)", :green
|
52
|
+
rescue Exception => e
|
53
|
+
say "Connection failed: #{e.message}", :red
|
54
|
+
end
|
40
55
|
end
|
41
56
|
|
42
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loader_droid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
description: A gem to help loading cases into Case Manager
|
56
84
|
email: matt@futureworkshops.com
|
57
85
|
executables:
|