torigoya_kit 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/torigoya_kit/ticket.rb +28 -26
- data/lib/torigoya_kit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 999776c7602a6d66137041332ac53ffa4b88c006
|
4
|
+
data.tar.gz: ba931846ab6dee04bfb08b236a4420f00b7d45bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8972e1018c50349e1151890804e6c0bb80fb7f206196624bf4b03a1bedff9341cf96c013a652e4ac0e77b6e35832bc5c5c8e369502d022a52949aabd1a0a140
|
7
|
+
data.tar.gz: f0868e4984988365618b5c818ead54a8e4a9fbc865c60129028aec13950e19a673982f9f98005122fdabd2e9a361500aa5b16594131b027fac35263583976d78
|
data/lib/torigoya_kit/ticket.rb
CHANGED
@@ -44,10 +44,10 @@ module TorigoyaKit
|
|
44
44
|
if @name.nil?
|
45
45
|
@name = "*default*"
|
46
46
|
else
|
47
|
-
raise InvalidFormatError.new("name must be String") unless @name.is_a?(String)
|
47
|
+
raise InvalidFormatError.new("#{self.class}: name must be String (but #{@name.class})") unless @name.is_a?(String)
|
48
48
|
end
|
49
|
-
raise InvalidFormatError.new("code must be String") unless @code.is_a?(String)
|
50
|
-
raise InvalidFormatError.new("is_compressed must be Boolean") unless @is_compressed.is_a?(TrueClass) || @is_compressed.is_a?(FalseClass)
|
49
|
+
raise InvalidFormatError.new("#{self.class}: code must be String (but #{@code.class})") unless @code.is_a?(String)
|
50
|
+
raise InvalidFormatError.new("#{self.class}: is_compressed must be Boolean (but #{@is_compressed.class})") unless @is_compressed.is_a?(TrueClass) || @is_compressed.is_a?(FalseClass)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -80,9 +80,9 @@ module TorigoyaKit
|
|
80
80
|
private
|
81
81
|
def validate
|
82
82
|
unless @key.nil?
|
83
|
-
raise InvalidFormatError.new("key must be String") unless @key.is_a?(String)
|
83
|
+
raise InvalidFormatError.new("#{self.class}: key must be String (but #{@key.class})") unless @key.is_a?(String)
|
84
84
|
end
|
85
|
-
raise InvalidFormatError.new("value must be String") unless @value.is_a?(String)
|
85
|
+
raise InvalidFormatError.new("#{self.class}: value must be String (but #{@value.class})") unless @value.is_a?(String)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -120,16 +120,16 @@ module TorigoyaKit
|
|
120
120
|
private
|
121
121
|
def validate
|
122
122
|
unless @command_line.nil?
|
123
|
-
raise InvalidFormatError.new("type of command_line must be String") unless @command_line.is_a?(String)
|
123
|
+
raise InvalidFormatError.new("#{self.class}: type of command_line must be String (but #{@command_line.class})") unless @command_line.is_a?(String)
|
124
124
|
else
|
125
125
|
@command_line = ""
|
126
126
|
end
|
127
127
|
|
128
128
|
unless @structured_command.nil?
|
129
|
-
raise InvalidFormatError.new("type of structured_command must be Array") unless @structured_command.is_a?(Array)
|
129
|
+
raise InvalidFormatError.new("#{self.class}: type of structured_command must be Array (but #{@structured_command.class})") unless @structured_command.is_a?(Array)
|
130
130
|
@structured_command.map! do |e|
|
131
131
|
if e.is_a?(Hash)
|
132
|
-
raise InvalidFormatError.new("couln't convert type of element of structured_command") unless e.size == 1
|
132
|
+
raise InvalidFormatError.new("#{self.class}: couln't convert type of element of structured_command (Hash: size is not 1)") unless e.size == 1
|
133
133
|
fl = e.flatten
|
134
134
|
if fl[1].nil?
|
135
135
|
Command.new(fl[0])
|
@@ -137,14 +137,14 @@ module TorigoyaKit
|
|
137
137
|
Command.new(fl[0], fl[1])
|
138
138
|
end
|
139
139
|
elsif e.is_a?(Array)
|
140
|
-
raise InvalidFormatError.new("couln't convert type of element of structured_command") unless e.length == 1 || e.length == 2
|
140
|
+
raise InvalidFormatError.new("#{self.class}: couln't convert type of element of structured_command (Array: length is not 1 or 2)") unless e.length == 1 || e.length == 2
|
141
141
|
if e.length == 1
|
142
142
|
Command.new(e[0])
|
143
143
|
elsif e.length == 2
|
144
144
|
Command.new(e[0], e[1])
|
145
145
|
end
|
146
146
|
else
|
147
|
-
raise InvalidFormatError.new("type of element of structured_command must be Command") unless e.is_a?(Command)
|
147
|
+
raise InvalidFormatError.new("#{self.class}: type of element of structured_command must be Command (but #{e.class})") unless e.is_a?(Command)
|
148
148
|
e
|
149
149
|
end
|
150
150
|
end
|
@@ -152,8 +152,8 @@ module TorigoyaKit
|
|
152
152
|
@structured_command = []
|
153
153
|
end
|
154
154
|
|
155
|
-
raise InvalidFormatError.new("type of cpu_limit must be Integer") unless @cpu_limit.is_a?(Integer)
|
156
|
-
raise InvalidFormatError.new("type of memory_limit must be Integer") unless @memory_limit.is_a?(Integer)
|
155
|
+
raise InvalidFormatError.new("#{self.class}: type of cpu_limit must be Integer (but #{@cpu_limit.class})") unless @cpu_limit.is_a?(Integer)
|
156
|
+
raise InvalidFormatError.new("#{self.class}: type of memory_limit must be Integer (but #{@memory_limit.class})") unless @memory_limit.is_a?(Integer)
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
@@ -169,7 +169,7 @@ module TorigoyaKit
|
|
169
169
|
|
170
170
|
def to_tuple
|
171
171
|
return [@compile_setting.to_tuple,
|
172
|
-
@link_setting.to_tuple
|
172
|
+
unless @link_setting.nil? then @link_setting.to_tuple else nil end
|
173
173
|
]
|
174
174
|
end
|
175
175
|
|
@@ -184,8 +184,10 @@ module TorigoyaKit
|
|
184
184
|
|
185
185
|
private
|
186
186
|
def validate()
|
187
|
-
raise InvalidFormatError.new("type of compile_setting must be ExecutionSetting") unless @compile_setting.is_a?(ExecutionSetting)
|
188
|
-
|
187
|
+
raise InvalidFormatError.new("#{self.class}: type of compile_setting must be ExecutionSetting (but #{@compile_setting.class})") unless @compile_setting.is_a?(ExecutionSetting)
|
188
|
+
unless @link_setting.nil?
|
189
|
+
raise InvalidFormatError.new("#{self.class}: type of link_setting must be ExecutionSetting (but #{@link_setting.class})") unless @link_setting.is_a?(ExecutionSetting)
|
190
|
+
end
|
189
191
|
end
|
190
192
|
end
|
191
193
|
|
@@ -215,9 +217,9 @@ module TorigoyaKit
|
|
215
217
|
private
|
216
218
|
def validate()
|
217
219
|
unless @stdin.nil?
|
218
|
-
raise InvalidFormatError.new("type of stdin must be SourceData") unless @stdin.is_a?(SourceData)
|
220
|
+
raise InvalidFormatError.new("#{self.class}: type of stdin must be SourceData (but #{@stdin.class})") unless @stdin.is_a?(SourceData)
|
219
221
|
end
|
220
|
-
raise InvalidFormatError.new("type of run_setting must be ExecutionSetting") unless @run_setting.is_a?(ExecutionSetting)
|
222
|
+
raise InvalidFormatError.new("#{self.class}: type of run_setting must be ExecutionSetting (but #{@run_setting.class})") unless @run_setting.is_a?(ExecutionSetting)
|
221
223
|
end
|
222
224
|
end
|
223
225
|
|
@@ -244,9 +246,9 @@ module TorigoyaKit
|
|
244
246
|
|
245
247
|
private
|
246
248
|
def validate()
|
247
|
-
raise InvalidFormatError.new("type of inputs must be Array") unless @inputs.is_a?(Array)
|
249
|
+
raise InvalidFormatError.new("#{self.class}: type of inputs must be Array (but #{@inputs.class})") unless @inputs.is_a?(Array)
|
248
250
|
@inputs.each do |e|
|
249
|
-
raise InvalidFormatError.new("type of element of inputs must be Input") unless e.is_a?(Input)
|
251
|
+
raise InvalidFormatError.new("#{self.class}: type of element of inputs must be Input (but #{e.class})") unless e.is_a?(Input)
|
250
252
|
end
|
251
253
|
end
|
252
254
|
end
|
@@ -290,17 +292,17 @@ module TorigoyaKit
|
|
290
292
|
|
291
293
|
private
|
292
294
|
def validate()
|
293
|
-
raise InvalidFormatError.new("type of base_name must be String") unless @base_name.is_a?(String)
|
294
|
-
raise InvalidFormatError.new("type of proc_id must be Integer") unless @proc_id.is_a?(Integer)
|
295
|
-
raise InvalidFormatError.new("type of proc_version must be String") unless @proc_version.is_a?(String)
|
296
|
-
raise InvalidFormatError.new("type of source_codes must be Array") unless @source_codes.is_a?(Array)
|
295
|
+
raise InvalidFormatError.new("#{self.class}: type of base_name must be String (but #{@base_name.class})") unless @base_name.is_a?(String)
|
296
|
+
raise InvalidFormatError.new("#{self.class}: type of proc_id must be Integer (but #{@proc_id.class})") unless @proc_id.is_a?(Integer)
|
297
|
+
raise InvalidFormatError.new("#{self.class}: type of proc_version must be String (but #{@proc_version.class})") unless @proc_version.is_a?(String)
|
298
|
+
raise InvalidFormatError.new("#{self.class}: type of source_codes must be Array (but #{@source_codes.class})") unless @source_codes.is_a?(Array)
|
297
299
|
@source_codes.each do |e|
|
298
|
-
raise InvalidFormatError.new("type of element of source_codes must be SourceData") unless e.is_a?(SourceData)
|
300
|
+
raise InvalidFormatError.new("#{self.class}: type of element of source_codes must be SourceData (but #{e.class})") unless e.is_a?(SourceData)
|
299
301
|
end
|
300
302
|
unless @build_inst.nil?
|
301
|
-
raise InvalidFormatError.new("type of build_inst must be BuildInstruction") unless @build_inst.is_a?(BuildInstruction)
|
303
|
+
raise InvalidFormatError.new("#{self.class}: type of build_inst must be BuildInstruction (but #{@build_inst.class})") unless @build_inst.is_a?(BuildInstruction)
|
302
304
|
end
|
303
|
-
raise InvalidFormatError.new("type of run_inst must be RunInstruction") unless @run_inst.is_a?(RunInstruction)
|
305
|
+
raise InvalidFormatError.new("#{self.class}: type of run_inst must be RunInstruction (but #{@run_inst.class})") unless @run_inst.is_a?(RunInstruction)
|
304
306
|
end
|
305
307
|
end
|
306
308
|
|
data/lib/torigoya_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torigoya_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yutopp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|