crun 0.0.1 → 0.0.2
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/CHANGELOG.rdoc +4 -0
- data/README.rdoc +2 -1
- data/bin/crun +13 -7
- data/examples/crun_conf.rb +1 -1
- data/examples/greeting.c +1 -0
- data/lib/version.rb +1 -1
- data/test/golden/basic.txt +12 -0
- data/test/golden/conf.txt +4 -0
- data/test/golden/override.txt +20 -0
- data/test/golden/override2.txt +13 -0
- data/test/golden/override3.txt +12 -0
- data/test/golden/template.txt +12 -0
- data/test/result/basic.txt +12 -0
- data/test/result/conf.txt +4 -0
- data/test/result/override.txt +20 -0
- data/test/result/override2.txt +13 -0
- data/test/result/override3.txt +12 -0
- data/test/result/template.txt +12 -0
- data/test/test_crun.rb +43 -0
- metadata +16 -21
- data/doc/Array.html +0 -202
- data/doc/Crun.html +0 -186
- data/doc/CrunMod.html +0 -186
- data/doc/_index.html +0 -115
- data/doc/class_list.html +0 -58
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -339
- data/doc/file.CHANGELOG.html +0 -79
- data/doc/file.README.html +0 -260
- data/doc/file_list.html +0 -63
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -260
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -181
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -75
- data/doc/top-level-namespace.html +0 -282
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -126,6 +126,7 @@ program would be given as:
|
|
126
126
|
* Options for crun:
|
127
127
|
* -crun-compopts:=-O2
|
128
128
|
* crun-compopts:+-lm
|
129
|
+
* crun-compopts:.-std=c99
|
129
130
|
* crun-progopts:=-c 12
|
130
131
|
*/
|
131
132
|
|
@@ -171,10 +172,10 @@ Summary of option setting from first to last:
|
|
171
172
|
* Defaults (from crun program).
|
172
173
|
* ".crun" from home directory.
|
173
174
|
* ".crun" from current directory.
|
175
|
+
* Options embedded to C source file (main file).
|
174
176
|
* "-c" options from files.
|
175
177
|
* "-o" options from Crun CLI.
|
176
178
|
* "-p" options for program (only).
|
177
|
-
* Options embedded to C source file (main file).
|
178
179
|
|
179
180
|
|
180
181
|
= Issues
|
data/bin/crun
CHANGED
@@ -41,6 +41,9 @@ def apply_opt( opt )
|
|
41
41
|
elsif opt.split(':+').length == 2
|
42
42
|
parts = opt.split(':+')
|
43
43
|
@crun[parts[0]].push parts[1]
|
44
|
+
elsif opt.split(':.').length == 2
|
45
|
+
parts = opt.split(':.')
|
46
|
+
@crun[parts[0]].unshift parts[1]
|
44
47
|
end
|
45
48
|
end
|
46
49
|
|
@@ -48,6 +51,7 @@ if Opt['template'].given
|
|
48
51
|
puts "\
|
49
52
|
/*
|
50
53
|
* crun-compopts:+-O2
|
54
|
+
* crun-progopts:+-f file.txt
|
51
55
|
*/
|
52
56
|
|
53
57
|
#include <stdio.h>
|
@@ -115,13 +119,6 @@ if Opt['debug'].given
|
|
115
119
|
@crun['crunopts'].push '-g'
|
116
120
|
end
|
117
121
|
|
118
|
-
# Read in selected user confs.
|
119
|
-
if Opt['conf'].given
|
120
|
-
Opt['conf'].value.each do |userconf|
|
121
|
-
load userconf if File.exist? userconf
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
122
|
|
126
123
|
# ------------------------------------------------------------
|
127
124
|
# Collect compilation options from c-file.
|
@@ -138,6 +135,15 @@ File.readlines( cfiles[0] ).each do |line|
|
|
138
135
|
end
|
139
136
|
|
140
137
|
|
138
|
+
# ------------------------------------------------------------
|
139
|
+
# Read in selected user confs.
|
140
|
+
if Opt['conf'].given
|
141
|
+
Opt['conf'].value.each do |userconf|
|
142
|
+
load userconf if File.exist? userconf
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
|
141
147
|
# ------------------------------------------------------------
|
142
148
|
# Collect compilation options from CLI.
|
143
149
|
|
data/examples/crun_conf.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
@crun['compopts'].push "-O2"
|
2
|
-
@crun['progopts'].
|
2
|
+
@crun['progopts'].unshift "-c 4"
|
data/examples/greeting.c
CHANGED
data/lib/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
Greeting #1!
|
2
|
+
Greeting #2!
|
3
|
+
Greeting #3!
|
4
|
+
Greeting #4!
|
5
|
+
Greeting #5!
|
6
|
+
Greeting #6!
|
7
|
+
Greeting #7!
|
8
|
+
Greeting #8!
|
9
|
+
Greeting #9!
|
10
|
+
Greeting #10!
|
11
|
+
Greeting #11!
|
12
|
+
Greeting #12!
|
13
|
+
Greeting #13!
|
14
|
+
Greeting #14!
|
15
|
+
Greeting #15!
|
16
|
+
Greeting #16!
|
17
|
+
Greeting #17!
|
18
|
+
Greeting #18!
|
19
|
+
Greeting #19!
|
20
|
+
Greeting #20!
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Greeting #1!
|
2
|
+
Greeting #2!
|
3
|
+
Greeting #3!
|
4
|
+
Greeting #4!
|
5
|
+
Greeting #5!
|
6
|
+
Greeting #6!
|
7
|
+
Greeting #7!
|
8
|
+
Greeting #8!
|
9
|
+
Greeting #9!
|
10
|
+
Greeting #10!
|
11
|
+
Greeting #11!
|
12
|
+
Greeting #12!
|
13
|
+
Greeting #13!
|
14
|
+
Greeting #14!
|
15
|
+
Greeting #15!
|
16
|
+
Greeting #16!
|
17
|
+
Greeting #17!
|
18
|
+
Greeting #18!
|
19
|
+
Greeting #19!
|
20
|
+
Greeting #20!
|
data/test/test_crun.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
# Select training if you want to renew golden files.
|
4
|
+
#TRAINING = true
|
5
|
+
TRAINING = false
|
6
|
+
|
7
|
+
|
8
|
+
# Test execution routine.
|
9
|
+
def runTest( test, cmdopts )
|
10
|
+
rf = "result/#{test}.txt"
|
11
|
+
gf = "golden/#{test}.txt"
|
12
|
+
|
13
|
+
system( "export RUBYLIB=../lib; ../bin/crun #{cmdopts} > #{rf}" )
|
14
|
+
|
15
|
+
if TRAINING
|
16
|
+
# Populate golden files after inspection.
|
17
|
+
system( "cp #{rf} #{gf}" )
|
18
|
+
end
|
19
|
+
|
20
|
+
assert( system( "diff #{rf} #{gf}" ), "FAILED: diff #{rf} #{gf}" )
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Tests.
|
25
|
+
class CrunTest < Test::Unit::TestCase
|
26
|
+
|
27
|
+
def setup
|
28
|
+
Dir.chdir( 'test' )
|
29
|
+
FileUtils.mkdir_p "result"
|
30
|
+
end
|
31
|
+
|
32
|
+
def teardown
|
33
|
+
Dir.chdir( '..' )
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_basic() runTest( "basic", "-f ../examples/greeting.c" ); end
|
37
|
+
def test_conf() runTest( "conf", "-f ../examples/greeting.c -c ../examples/crun_conf.rb" ); end
|
38
|
+
def test_override() runTest( "override", "-f ../examples/greeting.c -c ../examples/crun_conf.rb -o \"progopts:.-c 20\"" ); end
|
39
|
+
def test_override2() runTest( "override2", "-f ../examples/greeting.c -o \"progopts:.-c 13\"" ); end
|
40
|
+
def test_override3() runTest( "override3", "-f ../examples/greeting.c -o \"progopts:+-c 13\"" ); end
|
41
|
+
def test_template() runTest( "template", "-f ../examples/greeting.c -o \"progopts:+-c 13\" -t" ); end
|
42
|
+
|
43
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: como
|
@@ -55,24 +55,19 @@ files:
|
|
55
55
|
- examples/greeting.c
|
56
56
|
- examples/sizeof.c
|
57
57
|
- examples/crun_conf.rb
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
- doc/class_list.html
|
72
|
-
- doc/_index.html
|
73
|
-
- doc/file.CHANGELOG.html
|
74
|
-
- doc/CrunMod.html
|
75
|
-
- doc/frames.html
|
58
|
+
- test/golden/override.txt
|
59
|
+
- test/golden/override3.txt
|
60
|
+
- test/golden/basic.txt
|
61
|
+
- test/golden/override2.txt
|
62
|
+
- test/golden/conf.txt
|
63
|
+
- test/golden/template.txt
|
64
|
+
- test/test_crun.rb
|
65
|
+
- test/result/override.txt
|
66
|
+
- test/result/override3.txt
|
67
|
+
- test/result/basic.txt
|
68
|
+
- test/result/override2.txt
|
69
|
+
- test/result/conf.txt
|
70
|
+
- test/result/template.txt
|
76
71
|
- bin/crun
|
77
72
|
homepage:
|
78
73
|
licenses:
|
@@ -98,5 +93,5 @@ rubyforge_project:
|
|
98
93
|
rubygems_version: 1.8.23
|
99
94
|
signing_key:
|
100
95
|
specification_version: 3
|
101
|
-
summary:
|
96
|
+
summary: C-program prototyping environment.
|
102
97
|
test_files: []
|
data/doc/Array.html
DELETED
@@ -1,202 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>
|
7
|
-
Class: Array
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.7.6
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '';
|
20
|
-
framesUrl = "frames.html#!Array.html";
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="_index.html">Index (A)</a> »
|
35
|
-
|
36
|
-
|
37
|
-
<span class="title">Array</span>
|
38
|
-
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id="search">
|
44
|
-
|
45
|
-
<a class="full_list_link" id="class_list_link"
|
46
|
-
href="class_list.html">
|
47
|
-
Class List
|
48
|
-
</a>
|
49
|
-
|
50
|
-
<a class="full_list_link" id="method_list_link"
|
51
|
-
href="method_list.html">
|
52
|
-
Method List
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="file_list.html">
|
57
|
-
File List
|
58
|
-
</a>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
<div class="clear"></div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<iframe id="search_frame"></iframe>
|
65
|
-
|
66
|
-
<div id="content"><h1>Class: Array
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
<dt class="r1">Inherits:</dt>
|
75
|
-
<dd class="r1">
|
76
|
-
<span class="inheritName">Object</span>
|
77
|
-
|
78
|
-
<ul class="fullTree">
|
79
|
-
<li>Object</li>
|
80
|
-
|
81
|
-
<li class="next">Array</li>
|
82
|
-
|
83
|
-
</ul>
|
84
|
-
<a href="#" class="inheritanceTree">show all</a>
|
85
|
-
|
86
|
-
</dd>
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
<dt class="r2 last">Defined in:</dt>
|
97
|
-
<dd class="r2 last">bin/crun</dd>
|
98
|
-
|
99
|
-
</dl>
|
100
|
-
<div class="clear"></div>
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
<h2>
|
111
|
-
Instance Method Summary
|
112
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
113
|
-
</h2>
|
114
|
-
|
115
|
-
<ul class="summary">
|
116
|
-
|
117
|
-
<li class="public ">
|
118
|
-
<span class="summary_signature">
|
119
|
-
|
120
|
-
<a href="#crun-instance_method" title="#crun (instance method)">- (Object) <strong>crun</strong> </a>
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
</span>
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
<span class="summary_desc"><div class='inline'>
|
135
|
-
<p>Join array elements with space.</p>
|
136
|
-
</div></span>
|
137
|
-
|
138
|
-
</li>
|
139
|
-
|
140
|
-
|
141
|
-
</ul>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
<div id="instance_method_details" class="method_details_list">
|
147
|
-
<h2>Instance Method Details</h2>
|
148
|
-
|
149
|
-
|
150
|
-
<div class="method_details first">
|
151
|
-
<h3 class="signature first" id="crun-instance_method">
|
152
|
-
|
153
|
-
- (<tt>Object</tt>) <strong>crun</strong>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
</h3><div class="docstring">
|
160
|
-
<div class="discussion">
|
161
|
-
|
162
|
-
<p>Join array elements with space.</p>
|
163
|
-
|
164
|
-
|
165
|
-
</div>
|
166
|
-
</div>
|
167
|
-
<div class="tags">
|
168
|
-
|
169
|
-
|
170
|
-
</div><table class="source_code">
|
171
|
-
<tr>
|
172
|
-
<td>
|
173
|
-
<pre class="lines">
|
174
|
-
|
175
|
-
|
176
|
-
169
|
177
|
-
170
|
178
|
-
171</pre>
|
179
|
-
</td>
|
180
|
-
<td>
|
181
|
-
<pre class="code"><span class="info file"># File 'bin/crun', line 169</span>
|
182
|
-
|
183
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_crun'>crun</span>
|
184
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
185
|
-
<span class='kw'>end</span></pre>
|
186
|
-
</td>
|
187
|
-
</tr>
|
188
|
-
</table>
|
189
|
-
</div>
|
190
|
-
|
191
|
-
</div>
|
192
|
-
|
193
|
-
</div>
|
194
|
-
|
195
|
-
<div id="footer">
|
196
|
-
Generated on Sun Dec 25 20:31:45 2016 by
|
197
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
198
|
-
0.8.7.6 (ruby-2.3.1).
|
199
|
-
</div>
|
200
|
-
|
201
|
-
</body>
|
202
|
-
</html>
|