torigoya_kit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/torigoya_kit/ticket.rb +20 -2
- data/lib/torigoya_kit/version.rb +1 -1
- data/spec/cases/package_utils_spec.rb +4 -3
- data/spec/cases/ticket_spec.rb +30 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 117dd3ed04ca9b45661fc8ec954f23496225bb91
|
4
|
+
data.tar.gz: ac06594fad4b21c999704b4959837ee9a5867260
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14a58bf5cd197d8548787ddddf442dd5138ea4c3bef0cd8e468c36c13806c475a6466b3e1609af4cd7d889324961979af758e44f22b3e1ee594ddef92f31b4d0
|
7
|
+
data.tar.gz: 3785c3a1f3d781fc9901aa864f244430019615b0b3383d9bfe1381d1c15bcf9373dac3c7b3743c018a331e6a88e14c76289ec44414de62edbcc46f2d427d2fd4
|
data/lib/torigoya_kit/ticket.rb
CHANGED
@@ -121,8 +121,26 @@ module TorigoyaKit
|
|
121
121
|
|
122
122
|
unless @structured_command.nil?
|
123
123
|
raise InvalidFormatError.new("type of structured_command must be Array") unless @structured_command.is_a?(Array)
|
124
|
-
@structured_command.
|
125
|
-
|
124
|
+
@structured_command.map! do |e|
|
125
|
+
if e.is_a?(Hash)
|
126
|
+
raise InvalidFormatError.new("couln't convert type of element of structured_command") unless e.size == 1
|
127
|
+
fl = e.flatten
|
128
|
+
if fl[1].nil?
|
129
|
+
Command.new(fl[0])
|
130
|
+
else
|
131
|
+
Command.new(fl[0], fl[1])
|
132
|
+
end
|
133
|
+
elsif e.is_a?(Array)
|
134
|
+
raise InvalidFormatError.new("couln't convert type of element of structured_command") unless e.length == 1 || e.length == 2
|
135
|
+
if e.length == 1
|
136
|
+
Command.new(e[0])
|
137
|
+
elsif e.length == 2
|
138
|
+
Command.new(e[0], e[1])
|
139
|
+
end
|
140
|
+
else
|
141
|
+
raise InvalidFormatError.new("type of element of structured_command must be Command") unless e.is_a?(Command)
|
142
|
+
e
|
143
|
+
end
|
126
144
|
end
|
127
145
|
else
|
128
146
|
@structured_command = []
|
data/lib/torigoya_kit/version.rb
CHANGED
@@ -139,7 +139,8 @@ describe :package_utils do
|
|
139
139
|
|
140
140
|
build_date = Time.now
|
141
141
|
pkgs = [{ name: "torigoya-llvm-3.4_3.4_amd64.deb", date: build_date },
|
142
|
-
{ name: "torigoya-llvm_999.2014.4.4.205650_amd64.deb", date: build_date },
|
142
|
+
{ name: "torigoya-llvm_999.2014.4.4.205650_amd64.deb", date: build_date },
|
143
|
+
]
|
143
144
|
|
144
145
|
begin
|
145
146
|
pkgs.each do |e|
|
@@ -151,9 +152,9 @@ describe :package_utils do
|
|
151
152
|
profs = h.list_profiles
|
152
153
|
|
153
154
|
expect(profs.length).to eq 2
|
154
|
-
expect(profs[0].package_name).to eq pkgs[0][:name]
|
155
|
+
#expect(profs[0].package_name).to eq pkgs[0][:name]
|
155
156
|
expect(profs[0].built_date).to eq pkgs[0][:date]
|
156
|
-
expect(profs[1].package_name).to eq pkgs[1][:name]
|
157
|
+
#expect(profs[1].package_name).to eq pkgs[1][:name]
|
157
158
|
expect(profs[1].built_date).to eq pkgs[1][:date]
|
158
159
|
end
|
159
160
|
end # Dir
|
data/spec/cases/ticket_spec.rb
CHANGED
@@ -54,28 +54,46 @@ describe :ticket do
|
|
54
54
|
]
|
55
55
|
expected = TorigoyaKit::ExecutionSetting.new("test command", commands, 100, 200)
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
cloned_commands = [TorigoyaKit::Command.new("A=", "B"),
|
58
|
+
TorigoyaKit::Command.new("unit")
|
59
|
+
]
|
60
|
+
cloned_dummy = TorigoyaKit::ExecutionSetting.new("test command", cloned_commands, 100, 200)
|
61
61
|
|
62
|
-
expect(
|
62
|
+
expect(cloned_dummy).to eq expected
|
63
63
|
end
|
64
64
|
|
65
65
|
it "setting" do
|
66
|
-
|
67
|
-
expect(
|
66
|
+
cloned_es = TorigoyaKit::ExecutionSetting.new("", [], 0, 0)
|
67
|
+
expect(cloned_es).to eq dummy_es
|
68
68
|
end
|
69
69
|
|
70
70
|
it "build inst" do
|
71
|
-
|
72
|
-
|
71
|
+
cloned_es = TorigoyaKit::ExecutionSetting.new("", [], 0, 0)
|
72
|
+
cloned_bi = TorigoyaKit::BuildInstruction.new(cloned_es, cloned_es)
|
73
73
|
|
74
|
-
expect(
|
74
|
+
expect(cloned_bi).to eq dummy_bi
|
75
75
|
end
|
76
76
|
|
77
77
|
it "run inst" do
|
78
|
-
|
79
|
-
expect(
|
78
|
+
cloned_ri = TorigoyaKit::RunInstruction.new([])
|
79
|
+
expect(cloned_ri).to eq dummy_ri
|
80
|
+
end
|
81
|
+
|
82
|
+
it "setting conversion list" do
|
83
|
+
commands = [TorigoyaKit::Command.new("A=", "B"),
|
84
|
+
TorigoyaKit::Command.new("unit")
|
85
|
+
]
|
86
|
+
expected = TorigoyaKit::ExecutionSetting.new("test command", commands, 100, 200)
|
87
|
+
|
88
|
+
expect(TorigoyaKit::ExecutionSetting.new("test command", [["A=", "B"], ["unit"]], 100, 200)).to eq expected
|
89
|
+
end
|
90
|
+
|
91
|
+
it "setting conversion list" do
|
92
|
+
commands = [TorigoyaKit::Command.new("A=", "B"),
|
93
|
+
TorigoyaKit::Command.new("unit")
|
94
|
+
]
|
95
|
+
expected = TorigoyaKit::ExecutionSetting.new("test command", commands, 100, 200)
|
96
|
+
|
97
|
+
expect(TorigoyaKit::ExecutionSetting.new("test command", [{"A=" => "B"}, {"unit"=>nil}], 100, 200)).to eq expected
|
80
98
|
end
|
81
99
|
end
|