torigoya_kit 0.0.11 → 0.2.0

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.
data/spec/spec_helper.rb CHANGED
@@ -4,14 +4,20 @@ require 'torigoya_kit'
4
4
 
5
5
  def make_ticket
6
6
  # source
7
- source = TorigoyaKit::SourceData.new("prog.cpp", <<EOS
8
- #include <csignal>
9
- #include <iostream>
7
+ source = TorigoyaKit::SourceData.new("prog.c", <<EOS
8
+ #include <stdio.h>
9
+ #include <signal.h>
10
+ #include <errno.h>
11
+ #include <string.h>
10
12
 
11
13
  int main() {
12
- std::cout << "hello!" << std::endl;
13
- std::raise(8);
14
- std::cout << "unreachable!" << std::endl;
14
+ puts("hello!");
15
+ if ( raise(9) != 0 ) {
16
+ printf("errno=%d : %s\\n", errno, strerror( errno ));
17
+ }
18
+ puts("unreachable!");
19
+
20
+ return 0;
15
21
  }
16
22
  EOS
17
23
  )
@@ -20,13 +26,30 @@ EOS
20
26
  sources = [source]
21
27
 
22
28
  # build instruction
23
- bi = TorigoyaKit::BuildInstruction.new(TorigoyaKit::ExecutionSetting.new("", [], 10, 512 * 1024 * 1024),
24
- TorigoyaKit::ExecutionSetting.new("", [], 10, 512 * 1024 * 1024)
25
- )
29
+ compile_s = TorigoyaKit::ExecutionSetting.new(
30
+ ["/usr/bin/gcc", "-c", "prog.c", "-o", "prog.o"],
31
+ [],
32
+ 10,
33
+ 512 * 1024 * 1024
34
+ )
35
+ link_s = TorigoyaKit::ExecutionSetting.new(
36
+ ["/usr/bin/gcc", "prog.o", "-o", "prog.out"],
37
+ ["PATH=/usr/bin:/bin"],
38
+ 10,
39
+ 512 * 1024 * 1024
40
+ )
41
+ bi = TorigoyaKit::BuildInstruction.new(compile_s, link_s)
42
+
26
43
  # input
27
- input = TorigoyaKit::Input.new(nil,
28
- TorigoyaKit::ExecutionSetting.new("", [], 10, 512 * 1024 * 1024)
29
- )
44
+ input = TorigoyaKit::Input.new(
45
+ nil,
46
+ TorigoyaKit::ExecutionSetting.new(
47
+ ["./prog.out"],
48
+ [],
49
+ 10,
50
+ 512 * 1024 * 1024
51
+ )
52
+ )
30
53
 
31
54
  # inputs
32
55
  inputs = [input]
@@ -35,7 +58,7 @@ EOS
35
58
  ri = TorigoyaKit::RunInstruction.new(inputs)
36
59
 
37
60
  # ticket!
38
- ticket = TorigoyaKit::Ticket.new("aaa", 0, "test", sources, bi, ri)
61
+ ticket = TorigoyaKit::Ticket.new("", sources, bi, ri)
39
62
 
40
63
  return ticket
41
64
  end
data/torigoya_kit.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["yutopp@gmail.com"]
11
11
  spec.summary = %q{Toolkits for Torigoya}
12
12
  spec.description = %q{This library can control TorigoyaCage}
13
- spec.homepage = "http://yutopp.net/"
13
+ spec.homepage = "https://github.com/yutopp/torigoya_kit"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
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.11
4
+ version: 0.2.0
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-16 00:00:00.000000000 Z
11
+ date: 2015-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,6 +72,7 @@ files:
72
72
  - lib/torigoya_kit/session.rb
73
73
  - lib/torigoya_kit/stream_result.rb
74
74
  - lib/torigoya_kit/ticket.rb
75
+ - lib/torigoya_kit/typeutil.rb
75
76
  - lib/torigoya_kit/version.rb
76
77
  - spec/cases/package_utils_spec.rb
77
78
  - spec/cases/protocol_spec.rb
@@ -79,7 +80,7 @@ files:
79
80
  - spec/cases/ticket_spec.rb
80
81
  - spec/spec_helper.rb
81
82
  - torigoya_kit.gemspec
82
- homepage: http://yutopp.net/
83
+ homepage: https://github.com/yutopp/torigoya_kit
83
84
  licenses:
84
85
  - MIT
85
86
  metadata: {}
@@ -99,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  version: '0'
100
101
  requirements: []
101
102
  rubyforge_project:
102
- rubygems_version: 2.2.2
103
+ rubygems_version: 2.4.5
103
104
  signing_key:
104
105
  specification_version: 4
105
106
  summary: Toolkits for Torigoya