runch 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +8 -0
- data/lib/runch/language.rb +6 -1
- data/lib/runch/language/cc.rb +18 -0
- data/lib/runch/version.rb +1 -1
- data/sample/hello.cc +8 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d516bf652a7de016436d10ecf2d4e670003bc5c
|
4
|
+
data.tar.gz: 8529ec0a17efd639189e8ce52dd69a39184e6f80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69b3f5c486e93d1f702c359164039e8cd9a23bf807b9393be37517d2da21c80f11487448b8b0cc8d014ba98511770a2c5800994afef52c4bc870a95d2f8a2b45
|
7
|
+
data.tar.gz: 3708e703a5d698f97bdf5587ee0acb75ff1a2ef8bff1625089c554f5baf06bcbfc8fa5bb3cedbb1c5ad0d62d1020c4701e84bb28b2e70d77d0cea407696b3fa0
|
data/NEWS.md
CHANGED
data/lib/runch/language.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "runch/language/c"
|
2
|
+
require "runch/language/cc"
|
2
3
|
require "runch/language/java"
|
3
4
|
|
4
5
|
module Runch
|
@@ -6,7 +7,11 @@ module Runch
|
|
6
7
|
module_function
|
7
8
|
def create(main_source, *files)
|
8
9
|
extname = File.extname(main_source)[1..-1]
|
9
|
-
|
10
|
+
if /\A(cc|cp|cpp|cxx)\z/ =~ extname
|
11
|
+
CC.new(main_source, files)
|
12
|
+
else
|
13
|
+
const_get(extname.capitalize).new(main_source, files)
|
14
|
+
end
|
10
15
|
end
|
11
16
|
end
|
12
17
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "runch/language/base"
|
2
|
+
|
3
|
+
module Runch
|
4
|
+
module Language
|
5
|
+
class CC
|
6
|
+
include Base
|
7
|
+
|
8
|
+
def compile(tmpdir)
|
9
|
+
basename = File.basename(@main_source, ".*")
|
10
|
+
filename = File.basename(@main_source)
|
11
|
+
main_source = File.join(tmpdir, filename)
|
12
|
+
executable = File.join(tmpdir, basename)
|
13
|
+
system("g++", "-o", executable, main_source)
|
14
|
+
executable
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/runch/version.rb
CHANGED
data/sample/hello.cc
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Yokoyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,11 +58,13 @@ files:
|
|
58
58
|
- lib/runch/language.rb
|
59
59
|
- lib/runch/language/base.rb
|
60
60
|
- lib/runch/language/c.rb
|
61
|
+
- lib/runch/language/cc.rb
|
61
62
|
- lib/runch/language/java.rb
|
62
63
|
- lib/runch/version.rb
|
63
64
|
- runch.gemspec
|
64
65
|
- sample/Hello.java
|
65
66
|
- sample/hello.c
|
67
|
+
- sample/hello.cc
|
66
68
|
homepage: https://github.com/myokoym/runch
|
67
69
|
licenses:
|
68
70
|
- MIT
|