coderunner 0.12.8 → 0.12.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.8
1
+ 0.12.10
data/coderunner.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "coderunner"
8
- s.version = "0.12.8"
8
+ s.version = "0.12.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edmund Highcock"]
@@ -84,7 +84,7 @@ class RemoteCodeRunner < CodeRunner
84
84
 
85
85
  DISPLAY_REMOTE_INVOCATION = false
86
86
 
87
- RUNNER_CACHE = ENV['HOME'] + '/.remote_code_runner_cache'
87
+ RUNNER_CACHE = ENV['HOME'] + '/.coderunner/remote_cache/'
88
88
 
89
89
  def initialize(host, folder, copts = {})
90
90
  @folder = folder
@@ -213,106 +213,106 @@ class TestCodeRunner < Test::Unit::TestCase
213
213
  #assert(!FileTest.exist?('results/submitting'))
214
214
  #end
215
215
 
216
- #def test_latex_graphkit
217
- #Dir.chdir('test/results') do
218
- ##@runner.print_out(0)
219
- #sds = @runner.run_graphkit('sides;;[1,2].include? id')
220
- ##p sds
221
- #sds.ylabel = 'Hello'
222
- #sds.data.each_with_index{|dk,i| dk.title = i.to_s}
223
- #sds.xlabel = '\(\Gamma_{\epsilon}\)'
224
- #sds.title = 'Area of the Sides'
225
- ##sds.gnuplot
226
- ##pp sds
227
- ##pid1 = sds.gnuplot
216
+ def test_latex_graphkit
217
+ Dir.chdir('test/results') do
218
+ #@runner.print_out(0)
219
+ sds = @runner.run_graphkit('sides;;[1,2].include? id')
220
+ #p sds
221
+ sds.ylabel = 'Hello'
222
+ sds.data.each_with_index{|dk,i| dk.title = i.to_s}
223
+ sds.xlabel = '\(\Gamma_{\epsilon}\)'
224
+ sds.title = 'Area of the Sides'
225
+ #sds.gnuplot
226
+ #pp sds
227
+ #pid1 = sds.gnuplot
228
228
 
229
- #sds.gnuplot_write('latgraph.eps', latex: true)
230
- ##pid = system "okular #{Dir.pwd}/latgraph.eps"
231
- ##sleep 3
232
- ##Process.kill 'TERM', pid
233
- ##Process.kill 'TERM', pid1
234
- #end
235
- #end
229
+ sds.gnuplot_write('latgraph.eps', latex: true)
230
+ #pid = system "okular #{Dir.pwd}/latgraph.eps"
231
+ #sleep 3
232
+ #Process.kill 'TERM', pid
233
+ #Process.kill 'TERM', pid1
234
+ end
235
+ end
236
236
 
237
- #def test_graphkit_multiplot
238
- #Dir.chdir('test/results') do
237
+ def test_graphkit_multiplot
238
+ Dir.chdir('test/results') do
239
239
 
240
- #######################
241
- ## Make 3 random graphs
242
- #######################
240
+ ######################
241
+ # Make 3 random graphs
242
+ ######################
243
243
 
244
244
 
245
- ## As usual, data can be an array or a GSL::Vector
246
- #kit1 = GraphKit.autocreate(x: {data: [0,2,4], title: 'A label with latex \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [3.3, 5.5, 10], title: 'Label with latex \(\beta\)', units: '\(v_{thi}\)'})
247
- #kit1.title = 'First Graph'
248
- #kit1.gp.label = '\'A label\' at 2,7' # This 'gp' syntax is new. You can set pretty much any gnuplot option like this - see gnuplot help set
249
- #kit1.data[0].title = 'A new title'
245
+ # As usual, data can be an array or a GSL::Vector
246
+ kit1 = GraphKit.autocreate(x: {data: [0,2,4], title: 'A label with latex \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [3.3, 5.5, 10], title: 'Label with latex \(\beta\)', units: '\(v_{thi}\)'})
247
+ kit1.title = 'First Graph'
248
+ kit1.gp.label = '\'A label\' at 2,7' # This 'gp' syntax is new. You can set pretty much any gnuplot option like this - see gnuplot help set
249
+ kit1.data[0].title = 'A new title'
250
250
 
251
- #kit2 = GraphKit.autocreate(x: {data: [0,2,4], title: 'Stuff \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [2, -1, 2], title: 'Some \(\beta\)', units: '\(v_{thi}\)'})
252
- #kit2.title = 'Second Graph'
253
- #kit2.data[0].gp.with = 'lp linewidth 6' # See gnuplot help plot for data options
254
- #kit2.gp.key = 'off'
255
- #kit2.xlabel = 'A NEW XLABEL'
251
+ kit2 = GraphKit.autocreate(x: {data: [0,2,4], title: 'Stuff \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [2, -1, 2], title: 'Some \(\beta\)', units: '\(v_{thi}\)'})
252
+ kit2.title = 'Second Graph'
253
+ kit2.data[0].gp.with = 'lp linewidth 6' # See gnuplot help plot for data options
254
+ kit2.gp.key = 'off'
255
+ kit2.xlabel = 'A NEW XLABEL'
256
256
 
257
- #kit3 = GraphKit.autocreate(x: {data: [0,5,10], title: 'Mouse Height \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [4, 3, 4], title: 'Mouse weight \(\kappa\)', units: '\(v_{thi}\)'})
258
- #kit3.title = 'Mouse info'
259
- #kit3.data[0].gp.with = 'lp'
260
- #kit3.gp.key = 'off'
257
+ kit3 = GraphKit.autocreate(x: {data: [0,5,10], title: 'Mouse Height \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [4, 3, 4], title: 'Mouse weight \(\kappa\)', units: '\(v_{thi}\)'})
258
+ kit3.title = 'Mouse info'
259
+ kit3.data[0].gp.with = 'lp'
260
+ kit3.gp.key = 'off'
261
261
 
262
- ######################
263
- ## Plot a single one
264
- ######################
262
+ #####################
263
+ # Plot a single one
264
+ #####################
265
265
 
266
- #pp kit1
267
- #kit1.gnuplot_write('first_graph.eps', latex: true) #Just plot it by itself
268
- ##system "okular #{Dir.pwd}/first_graph.eps"
269
- #pp kit1
266
+ pp kit1
267
+ kit1.gnuplot_write('first_graph.eps', latex: true) #Just plot it by itself
268
+ #system "okular #{Dir.pwd}/first_graph.eps"
269
+ pp kit1
270
270
 
271
- ############################
272
- ## Plot multiple graphs
273
271
  ###########################
272
+ # Plot multiple graphs
273
+ ##########################
274
274
 
275
- ##$debug_gnuplot=true
276
- #kit1.gnuplot_write('aname.eps', latex: true)
277
- ##exit
278
- #kit2.gnuplot_write('anothername.eps', latex: true)
279
- #kit3.gnuplot_write('athirdname.eps', latex: true, size: "2.0in,2.0in")
275
+ #$debug_gnuplot=true
276
+ kit1.gnuplot_write('aname.eps', latex: true)
277
+ #exit
278
+ kit2.gnuplot_write('anothername.eps', latex: true)
279
+ kit3.gnuplot_write('athirdname.eps', latex: true, size: "2.0in,2.0in")
280
280
 
281
- #my_preamble = <<EOF
282
- #\\documentclass{article}
283
- #%\documentclass[aip,reprint]{}
284
- #\\usepackage{graphics,bm,overpic,subfigure,color}
281
+ my_preamble = <<EOF
282
+ \\documentclass{article}
283
+ %\documentclass[aip,reprint]{}
284
+ \\usepackage{graphics,bm,overpic,subfigure,color}
285
285
 
286
- #\\pagestyle{empty}
287
- #\\begin{document}
288
- #\\begin{figure}
289
- #EOF
286
+ \\pagestyle{empty}
287
+ \\begin{document}
288
+ \\begin{figure}
289
+ EOF
290
290
 
291
291
 
292
- ## Can use default preamble - just don't include preamble option in function call GraphKit.latex_multiplot('all_graphs.eps')
293
- #GraphKit.latex_multiplot('all_graphs.eps', preamble: my_preamble) do
294
- #<<EOF
295
- #\\subfigure{
296
- #\\includegraphics{aname}
297
- #}
298
- #\\subfigure{
299
- #\\begin{overpic}{anothername}
300
- #% The location is in percent of image width
301
- #\\put(44,22){\\includegraphics[scale=.45]
302
- #{athirdname}}
303
- #\\end{overpic}
304
- #}
305
- #EOF
292
+ # Can use default preamble - just don't include preamble option in function call GraphKit.latex_multiplot('all_graphs.eps')
293
+ GraphKit.latex_multiplot('all_graphs.eps', preamble: my_preamble) do
294
+ <<EOF
295
+ \\subfigure{
296
+ \\includegraphics{aname}
297
+ }
298
+ \\subfigure{
299
+ \\begin{overpic}{anothername}
300
+ % The location is in percent of image width
301
+ \\put(44,22){\\includegraphics[scale=.45]
302
+ {athirdname}}
303
+ \\end{overpic}
304
+ }
305
+ EOF
306
306
 
307
- #end
308
- ##system "okular #{Dir.pwd}/all_graphs.eps"
309
- #assert_equal("all_graphs.eps: PostScript document text conforming DSC level 2.0, type EPS\n", `file all_graphs.eps`)
307
+ end
308
+ #system "okular #{Dir.pwd}/all_graphs.eps"
309
+ assert_equal("all_graphs.eps: PostScript document text conforming DSC level 2.0, type EPS\n", `file all_graphs.eps`)
310
310
 
311
- #end # Dir.chdir
311
+ end # Dir.chdir
312
312
 
313
313
 
314
314
 
315
- #end # def
315
+ end # def
316
316
 
317
317
  end # class TestCodeRunner
318
318
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coderunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.8
4
+ version: 0.12.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: