coderunner 0.17.11 → 0.18.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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +18 -0
- data/README.md +34 -5
- data/VERSION +1 -1
- data/coderunner.gemspec +11 -8
- data/dependencies/Makefile +101 -0
- data/dependencies/README.md +34 -0
- data/dependencies/download_dependencies.sh +20 -0
- data/lib/coderunner.rb +284 -321
- data/lib/coderunner/class_methods.rb +3 -13
- data/lib/coderunner/config.rb +87 -0
- data/lib/coderunner/fortran_namelist.rb +6 -6
- data/lib/coderunner/interactive_config.rb +57 -0
- data/lib/coderunner/interactive_methods.rb +333 -687
- data/lib/coderunner/repository.rb +1 -1
- data/lib/coderunner/run.rb +4 -0
- metadata +8 -5
- data/README.rdoc +0 -19
- data/test/test_coderunnerrepo.rb +0 -108
data/lib/coderunner/run.rb
CHANGED
@@ -732,10 +732,14 @@ def copy_extra_files
|
|
732
732
|
end
|
733
733
|
|
734
734
|
def generate_run_name
|
735
|
+
if CodeRunner::GLOBAL_OPTIONS[:short_run_name]
|
736
|
+
@run_name = %[v#{@version}_id_#@id]
|
737
|
+
else
|
735
738
|
@run_name = %[v#@version] + @naming_pars.inject("") do |str, par|
|
736
739
|
str+="_#{par}_#{send(par).to_s[0...8]}"
|
737
740
|
end
|
738
741
|
@run_name = @run_name.gsub(/\s+/, "_").gsub(/\//, '') + "_id_#@id"
|
742
|
+
end
|
739
743
|
end
|
740
744
|
|
741
745
|
def write_info
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coderunner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Highcock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphkit
|
@@ -193,18 +193,20 @@ extensions:
|
|
193
193
|
extra_rdoc_files:
|
194
194
|
- LICENSE.txt
|
195
195
|
- README.md
|
196
|
-
- README.rdoc
|
197
196
|
files:
|
198
197
|
- ".document"
|
198
|
+
- CONTRIBUTING.md
|
199
199
|
- Gemfile
|
200
200
|
- LICENSE.txt
|
201
201
|
- README.md
|
202
|
-
- README.rdoc
|
203
202
|
- Rakefile
|
204
203
|
- VERSION
|
205
204
|
- bin/coderunner
|
206
205
|
- bin/coderunnerrepo
|
207
206
|
- coderunner.gemspec
|
207
|
+
- dependencies/Makefile
|
208
|
+
- dependencies/README.md
|
209
|
+
- dependencies/download_dependencies.sh
|
208
210
|
- ext/code_runner_ext.c
|
209
211
|
- ext/extconf.rb
|
210
212
|
- ext/graph_kit.c
|
@@ -213,12 +215,14 @@ files:
|
|
213
215
|
- lib/code_runner_extension.rb
|
214
216
|
- lib/coderunner.rb
|
215
217
|
- lib/coderunner/class_methods.rb
|
218
|
+
- lib/coderunner/config.rb
|
216
219
|
- lib/coderunner/feedback.rb
|
217
220
|
- lib/coderunner/fortran_namelist.rb
|
218
221
|
- lib/coderunner/fortran_namelist_c.rb
|
219
222
|
- lib/coderunner/graphs_and_films.rb
|
220
223
|
- lib/coderunner/heuristic_run_methods.rb
|
221
224
|
- lib/coderunner/instance_methods.rb
|
225
|
+
- lib/coderunner/interactive_config.rb
|
222
226
|
- lib/coderunner/interactive_methods.rb
|
223
227
|
- lib/coderunner/long_regexen.rb
|
224
228
|
- lib/coderunner/merged_code_runner.rb
|
@@ -266,7 +270,6 @@ files:
|
|
266
270
|
- test/helper.rb
|
267
271
|
- test/old_test.rb
|
268
272
|
- test/test_coderunner.rb
|
269
|
-
- test/test_coderunnerrepo.rb
|
270
273
|
homepage: http://coderunner.sourceforge.net
|
271
274
|
licenses:
|
272
275
|
- GPLv3
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= coderunner
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to coderunner
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
-
* Fork the project.
|
10
|
-
* Start a feature/bugfix branch.
|
11
|
-
* Commit and push until you are happy with your contribution.
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2012 Edmund Highcock. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|
data/test/test_coderunnerrepo.rb
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'helper'
|
3
|
-
require 'rbconfig'
|
4
|
-
require 'coderunner/repository_manager'
|
5
|
-
|
6
|
-
unless $cpp_command = ENV['CPP']
|
7
|
-
raise "Please specify the environment variable CPP (the C++ compiler)"
|
8
|
-
end
|
9
|
-
$coderunner_folder = File.dirname(File.expand_path(__FILE__)) + '/../'
|
10
|
-
|
11
|
-
module MiniTest::Assertions
|
12
|
-
def assert_system(string)
|
13
|
-
assert(system(string), "System Command: '#{string}'")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
$ruby_command = "#{RbConfig::CONFIG['bindir']}/#{RbConfig::CONFIG['ruby_install_name']}"
|
18
|
-
$coderunnerrepo_command = "#{$ruby_command} -I #{$coderunner_folder}lib/ #{$coderunner_folder}/lib/coderunner/repository_manager.rb"
|
19
|
-
|
20
|
-
class Dummy
|
21
|
-
include CodeRunner::InteractiveMethods
|
22
|
-
end
|
23
|
-
class TestCreate < MiniTest::Test
|
24
|
-
def tfolder
|
25
|
-
'test/createrepo'
|
26
|
-
end
|
27
|
-
def dffolder
|
28
|
-
'myrepo/crdummyfiles'
|
29
|
-
end
|
30
|
-
def setup
|
31
|
-
FileUtils.rm_r(tfolder) if FileTest.exist? tfolder
|
32
|
-
FileUtils.makedirs(tfolder)
|
33
|
-
string = $cpp_command + ' ../cubecalc.cc -o cubecalc'
|
34
|
-
Dir.chdir('test'){CodeRunner.generate_cubecalc}
|
35
|
-
Dir.chdir(tfolder){assert_system string; FileUtils.rm('../cubecalc.cc')}
|
36
|
-
end
|
37
|
-
def test_create
|
38
|
-
Dir.chdir(tfolder) {
|
39
|
-
|
40
|
-
assert_system("#$coderunnerrepo_command init myrepo")
|
41
|
-
#exit
|
42
|
-
assert_system("#$coderunnerrepo_command adrm local ssh://#{ENV['USER']}@localhost/#{Dir.pwd}/remote.cr.git -Y myrepo")
|
43
|
-
#assert_system("#$coderunnerrepo_command adrm local ssh://#{ENV['USER']}@#{`hostname`.chomp}.local/#{Dir.pwd}/remote.git -Y myrepo")
|
44
|
-
assert_system("#$coderunnerrepo_command adrm dummy ssh://dummyuser@nohost/#{Dir.pwd}/remote.cr.git -Y myrepo")
|
45
|
-
assert_system("#$coderunnerrepo_command pushcr -r local -Y myrepo")
|
46
|
-
#assert_equal(false, system("#$coderunnerrepo_command pushcr -r local -Y myrepo"))
|
47
|
-
assert_system("cd myrepo.cr.git; git remote rm dummy")
|
48
|
-
assert_system("#$coderunnerrepo_command pull -Y myrepo")
|
49
|
-
assert_system("#$coderunnerrepo_command push -Y myrepo")
|
50
|
-
FileUtils.makedirs(dffolder)
|
51
|
-
FileUtils.touch(dffolder + '/code_runner_info.rb')
|
52
|
-
FileUtils.touch(dffolder + '/code_runner_results.rb')
|
53
|
-
#assert_system("#$coderunnerrepo_command add myrepo/crdummyfiles -Y myrepo")
|
54
|
-
CodeRunner::RepositoryManager.add_folder('myrepo/crdummyfiles', {})
|
55
|
-
FileUtils.makedirs('myrepo/sims')
|
56
|
-
Dir.chdir('myrepo/sims') do
|
57
|
-
CodeRunner.submit(C: 'cubecalc', m: 'empty', X: '../../cubecalc')
|
58
|
-
CodeRunner.submit(C: 'cubecalc', m: 'empty', X: '../../cubecalc')
|
59
|
-
r = CodeRunner.fetch_runner
|
60
|
-
r.conditions = 'id==2'
|
61
|
-
r.destroy no_confirm: true
|
62
|
-
#CodeRunner.delete(j: 2)
|
63
|
-
FileUtils.touch('.code-runner-irb-save-history')
|
64
|
-
Dummy.new.setup_interactive
|
65
|
-
end
|
66
|
-
CodeRunner::RepositoryManager.remote_synchronize_up('local', 'myrepo/sims', {})
|
67
|
-
CodeRunner::RepositoryManager.remote_synchronize_down('local', 'myrepo/sims', {})
|
68
|
-
Dir.chdir('remote') do
|
69
|
-
FileUtils.makedirs 'sims'
|
70
|
-
Dir.chdir('sims') do
|
71
|
-
system "echo 'Hello' >> dummyfile"
|
72
|
-
#add('dummyfile')
|
73
|
-
system "git add dummyfile"
|
74
|
-
system "git commit -m 'added dummyfile'"
|
75
|
-
#autocommit_all('--Added dummyfile')
|
76
|
-
system "echo 'Hello' >> dummyfile"
|
77
|
-
end
|
78
|
-
#add('dummyfile')
|
79
|
-
end
|
80
|
-
err = assert_raises(RuntimeError){CodeRunner::RepositoryManager.remote_synchronize_up('local', 'myrepo/sims', {})}
|
81
|
-
p err.message
|
82
|
-
Dir.chdir('remote') do
|
83
|
-
Dir.chdir('sims') do
|
84
|
-
system "git add dummyfile"
|
85
|
-
system "git commit -m 'modified dummyfile'"
|
86
|
-
end
|
87
|
-
end
|
88
|
-
Dir.chdir('myrepo/sims') do
|
89
|
-
system "echo 'Hello' >> dummyfile"
|
90
|
-
#add('dummyfile')
|
91
|
-
system "git add dummyfile"
|
92
|
-
system "git commit -m 'added dummyfile'"
|
93
|
-
#autocommit_all('--Added dummyfile')
|
94
|
-
system "echo 'Hello' >> dummyfile"
|
95
|
-
end
|
96
|
-
err = assert_raises(RuntimeError){CodeRunner::RepositoryManager.remote_synchronize_down('local', 'myrepo/sims', {})}
|
97
|
-
p err.message
|
98
|
-
#CodeRunner::RepositoryManager.remote_synchronize_down('local', 'myrepo/sims', {})
|
99
|
-
FileUtils.makedirs('testclone')
|
100
|
-
assert_system("#$coderunnerrepo_command clone ssh://#{ENV['USER']}@localhost/#{Dir.pwd}/remote.cr.git myclone -Y testclone")
|
101
|
-
#assert_system("#$coderunnerrepo_command push -r origin -Y testclone/myclone")
|
102
|
-
CodeRunner::RepositoryManager.push_repository(r: 'origin', Y: 'testclone/myclone')
|
103
|
-
}
|
104
|
-
end
|
105
|
-
def teardown
|
106
|
-
#FileUtils.rm_r(testfolder)
|
107
|
-
end
|
108
|
-
end
|