Class: Roebe::Run
- Inherits:
-
Base
show all
- Defined in:
- lib/roebe/classes/run/run.rb,
lib/roebe/classes/run/menu.rb
Overview
Constant Summary
collapse
- USE_THESE_G_PLUS_PLUS_COMPILE_FLAGS =
#
USE_THESE_G_PLUS_PLUS_COMPILE_FLAGS
Note that using -std=c++11 here may lead to compile-related problems.
#
''
- USE_THESE_GCC_COMPILE_FLAGS =
#
USE_THESE_GCC_COMPILE_FLAGS
#
''
Constants inherited
from Base
Base::COLOURS, Base::HOME_DIRECTORY_OF_USER_X, Base::N, Base::NAMESPACE
Class Method Summary
collapse
-
.[](i = '') ⇒ Object
# === Roebe::Run[] ========================================================================= #.
Instance Method Summary
collapse
Methods inherited from Base
#actions, #append_this_onto_that_file, #append_what_into, #be_silent, #be_verbose?, #beautiful_url, #burlywood, #call_next, #chdir, #cheerful_guy, #cliner, #complex_esystem, #convert_global_env, #copy_directory, #copy_file, #cornflowerblue, #create_directory, #crimson, #current_month?, #current_time?, #current_year?, #cyan, #darkcyan, #darkgreen, #darkkhaki, #darkslateblue, #deeppink, #delete_symlink, #do_not_use_the_base_colours, #do_use_the_base_colours, #e, #ecomment, #editor_to_use?, #efancy, #eimp, #emphasis, #ensure_main_encoding, #ensure_utf_encoding, #eparse, #erev, #esteelblue, #etomato, #ewarn, #exit_program, #firebrick, #get_current_day, #get_current_month, #get_files_and_directories, #get_files_from, #get_german_name_for_this_weekday, #gold, #green, #grey, #hh_mm_ss, #hh_mm_ss_day_month_year, #home_dir?, #home_directory_of_user_x?, #infer_the_namespace, #internal_hash?, #is_a_directory?, #is_a_file?, #is_a_jpg_file?, #is_an_image_file?, #is_archive?, #is_audio_file?, #is_in_studium_dir?, #is_multimedia_file?, #is_on_roebe?, #is_on_windows?, #is_studium_available?, #is_symlink?, #is_this_a_ruby_file?, #is_video_file?, #iso_encoding?, #le, #left_colour, #lightblue, #lightgreen, #lightseagreen, #lightsteelblue, #lime, #limegreen, #localhost_to_data, #log_directory?, #main_encoding?, #mediumorchid, #mediumpurple, #mediumseagreen, #mediumslateblue, #mediumspringgreen, #mediumturquoise, #mkdir_p, #mv, #n_days_in_this_month, #n_pages_in_this_pdf_file?, #namespace?, #no_file_exists_at, #ogrey, #olive, #olivedrab, #open_in_browser, #opne, #opnesystem, #opnn, #orange, #orchid, #orev, #palegoldenrod, #palevioletred, #pink, #powderblue, #programs_dir?, #project_base_dir?, #random_html_colour, #rds, #read_file_in_iso_encoding, #read_file_via_the_default_encoding, #read_lines_via_iso_encoding, #readlines_with_main_encoding, #red, #register_sigint, #remove, #remove_directory, #remove_file, #rename_kde_konsole_tab, #replace_localhost_with_data, #report_pwd, #require_rescue, #reset_the_internal_hash, #return_all_directories_from_this_directory, #return_all_files_from_this_directory, #return_current_directory, #return_dd_mm_yyyy, #return_file_or_directory_of, #return_files_from_pwd, #return_last_part_of_the_current_directory, #return_utc, #rev, #right_arrow?, #right_colour, #roebe_log_directory?, #rosybrown, #royalblue, #ruby_base_directory?, #run_in_background, #run_rcfiles_then_run_ata_via_qdbus, #sandybrown, #sdir, #seagreen, #set_be_verbose, #set_xorg_buffer, #sfancy, #sfile, #silent_redirection?, #simp, #simple_esystem, #skyblue, #slateblue, #slategray, #springgreen, #steelblue, #string_italic, #swarn, #symlink, #teal, #temp_dir?, #to_camelcase, #to_counted_hash, #tomato, #touch, #try_to_require_the_beautiful_url_gem, #try_to_require_the_html_template, #try_to_require_the_open_gem, #try_to_require_the_program_information_gem, #try_to_require_the_xorg_buffer, #use_colours?, #verbose_truth, #weekday?, #word_wrap, #write_what_into, #yellow
#append_onto_the_commandline_arguments, #clear_commandline_arguments, #commandline_arguments?, #commandline_arguments_as_string?, #commandline_arguments_without_leading_hyphens?, #first_argument?, #first_argument_without_leading_hyphens?, #has_an_argument_been_passed?, #remove_hyphened_arguments_from_the_commandline_arguments, #return_commandline_arguments_with_leading_hyphens, #second_argument?, #set_commandline_arguments
Constructor Details
#initialize(i = ARGV, run_already = true) ⇒ Run
41
42
43
44
45
46
47
48
49
|
# File 'lib/roebe/classes/run/run.rb', line 41
def initialize(
i = ARGV,
run_already = true
)
register_sigint
reset
set_commandline_arguments(i)
run if run_already
end
|
Class Method Details
.[](i = '') ⇒ Object
729
730
731
|
# File 'lib/roebe/classes/run/run.rb', line 729
def self.[](i = '')
new(i)
end
|
Instance Method Details
#act_based_on_this_extension(extname) ⇒ Object
#
act_based_on_this_extension
#
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
|
# File 'lib/roebe/classes/run/run.rb', line 575
def act_based_on_this_extension(extname)
case extname when 'java',
'class'
compile_this_java_file_then_run_it(@this_file)
when 'rb'
run_this_ruby_file(@this_file)
when 'nim'
compile_this_nim_file_then_run_it(@this_file)
when 'tex'
compile_this_tex_file_then_open_it(@this_file)
when 'cfdg'
compile_this_cfdg_file_and_then_show_it_in_the_browser(@this_file)
when 'cr'
compile_this_crystal_file_then_run_it(@this_file)
when 'c'
compile_this_c_file_then_run_it(@this_file)
when 'cpp'
compile_this_cpp_file_then_run_it(@this_file)
when 'jar'
run_this_jar_file(@this_file)
when 'py'
esystem 'python '+@this_file
when 'cs'
compile_this_csharp_file_then_run_it(@this_file)
else
opnn
e rev+'The extension for '+
sfile(@this_file)+' is not known/registered.'
end
end
|
#can_we_locate_a_native_image_binary?(path = ) ⇒ Boolean
#
can_we_locate_a_native_image_binary?
This method can be used to check whether a binary called “native-image” exists and can be found at the given PATH. The binary called “native-image” is part of the GraalVM.
#
390
391
392
393
394
395
396
397
398
399
400
401
|
# File 'lib/roebe/classes/run/run.rb', line 390
def can_we_locate_a_native_image_binary?(
path = ENV['PATH']
)
result = false splitted = path.split(':') splitted.each {|entry|
if File.exist?(entry.to_s+'native-image')
result = true
end
}
return result
end
|
#check_for_compile_flags_specified_in_the_given_file ⇒ Object
#
check_for_compile_flags_specified_in_the_given_file
This method will scan for lines that contain “ // run ”.
#
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
# File 'lib/roebe/classes/run/run.rb', line 154
def check_for_compile_flags_specified_in_the_given_file
result = nil
if @file_content.include? ' // run '
scanned = @file_content.scan(/^.+ \/\/ run .+/).flatten
first = scanned.first
case first when /SAVE_AS_IS/
first.sub!(/SAVE_AS_IS/,'')
set_store_as_this_name(:use_filename)
when /SAVE_AS (.+)$/
set_store_as_this_name($1.to_s.dup)
end
remaining_arguments = first.sub(/} \/\/ run/,'')
remaining_arguments.squeeze!(' ')
if remaining_arguments.include? filename?
remaining_arguments.sub!(filename?, '')
end
result = remaining_arguments
end
return result
end
|
#check_for_macros_in(i = @file_content) ⇒ Object
#
check_for_macros_in (macro tag)
This method can check for some “macros”.
#
427
428
429
430
431
432
433
434
435
436
437
438
439
|
# File 'lib/roebe/classes/run/run.rb', line 427
def check_for_macros_in(
i = @file_content
)
if i.include?('STORE_AS_DEFAULT') or
i.include?('USE_FILENAME') or
i.include?('SAVE_AS_IS')
@store_as_this_name = remove_file_extension_of(File.basename(which_file?))
elsif i.include? 'STORE_AS'
@store_as_this_name = i.scan(/STORE_AS (.+)/).flatten.first
elsif i.include? 'NAME_IS'
@store_as_this_name = i.scan(/NAME_IS (.+)/).flatten.first
end
end
|
#check_for_polyglot_java_file_in(i = @file_content) ⇒ Object
#
check_for_polyglot_java_file_in
#
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
# File 'lib/roebe/classes/run/run.rb', line 364
def check_for_polyglot_java_file_in(
i = @file_content
)
if i
if i.include? 'context.eval'
use_this_regex = /context.eval\("(.+)",/ which_language = i.scan(use_this_regex).flatten.first.to_s
e steelblue('Enable language support for: ')+
lightgreen(which_language)+rev
@internal_hash[:additional_commandline_arguments] << '--language:'+which_language
@internal_hash[:additional_commandline_arguments] << '--initialize-at-build-time'
end
end
end
|
#compile_this_c_file_then_run_it(i) ⇒ Object
#
compile_this_c_file_then_run_it
This method is the entry point for .c files.
#
226
227
228
229
|
# File 'lib/roebe/classes/run/run.rb', line 226
def compile_this_c_file_then_run_it(i)
verbose_compile_this_file(i)
try_to_run_the_compiled_file
end
|
#compile_this_cfdg_file_and_then_show_it_in_the_browser(i = @this_file, use_this_width = 850) ⇒ Object
#
compile_this_cfdg_file_and_then_show_it_in_the_browser
This method adds support for .cfdg files.
#
408
409
410
411
412
413
414
415
416
417
418
419
420
|
# File 'lib/roebe/classes/run/run.rb', line 408
def compile_this_cfdg_file_and_then_show_it_in_the_browser(
i = @this_file,
use_this_width = 850
)
store_here = ENV['HOME'].to_s+
'/image_paradise/output.png'
cmd_to_run = 'cfdg '+i+' --bordersize=1 -w '+use_this_width.to_s+' -h 450 '+store_here
esystem(cmd_to_run)
if File.exist? store_here
require 'open'
Open.in_browser(store_here)
end
end
|
#compile_this_cpp_file_then_run_it(i) ⇒ Object
#
compile_this_cpp_file_then_run_it
This method is the entry point for .cpp files.
#
181
182
183
184
|
# File 'lib/roebe/classes/run/run.rb', line 181
def compile_this_cpp_file_then_run_it(i)
verbose_compile_this_file(i)
try_to_run_the_compiled_file
end
|
#compile_this_crystal_file_then_run_it(i) ⇒ Object
#
compile_this_crystal_file_then_run_it (crystal tag)
#
234
235
236
237
|
# File 'lib/roebe/classes/run/run.rb', line 234
def compile_this_crystal_file_then_run_it(i)
verbose_compile_this_file(i)
try_to_run_the_compiled_file(i)
end
|
#compile_this_csharp_file_then_run_it(i = @this_file) ⇒ Object
#
compile_this_csharp_file_then_run_it
#
189
190
191
192
|
# File 'lib/roebe/classes/run/run.rb', line 189
def compile_this_csharp_file_then_run_it(i = @this_file)
verbose_compile_this_file(i)
try_to_run_the_compiled_file
end
|
#compile_this_java_file_then_run_it(i) ⇒ Object
#
compile_this_java_file_then_run_it (java tag)
#
643
644
645
646
647
648
649
650
651
652
|
# File 'lib/roebe/classes/run/run.rb', line 643
def compile_this_java_file_then_run_it(i)
verbose_compile_this_file(i)
if Roebe::SyntaxChecker.is_this_java_file_ok?(i)
try_to_run_the_compiled_file unless do_use_a_native_image?
else
e 'The Java file at '+sfile(i)+' appears to contain errors. '\
'Thus no'
e 'attempt will be made to run the .java file.'
end
end
|
#compile_this_nim_file_then_run_it(i) ⇒ Object
#
compile_this_nim_file_then_run_it (nim tag)
#
281
282
283
284
|
# File 'lib/roebe/classes/run/run.rb', line 281
def compile_this_nim_file_then_run_it(i)
verbose_compile_this_file(i)
try_to_run_the_compiled_file
end
|
#compile_this_tex_file_then_open_it(i) ⇒ Object
#
compile_this_tex_file_then_open_it
#
289
290
291
292
293
294
|
# File 'lib/roebe/classes/run/run.rb', line 289
def compile_this_tex_file_then_open_it(i)
require 'open'
verbose_compile_this_file(i)
target_file = i.delete_suffix('.tex')+'.pdf'
::Open.open(target_file)
end
|
#do_enable_code_draw ⇒ Object
96
97
98
|
# File 'lib/roebe/classes/run/run.rb', line 96
def do_enable_code_draw
@internal_hash[:make_use_of_code_draw] = true
end
|
#do_use_a_native_image? ⇒ Boolean
#
do_we_use_a_native_image?
#
299
300
301
|
# File 'lib/roebe/classes/run/run.rb', line 299
def do_use_a_native_image?
@internal_hash[:do_use_a_native_image]
end
|
#enable_do_use_a_native_image ⇒ Object
#
enable_do_use_a_native_image
#
274
275
276
|
# File 'lib/roebe/classes/run/run.rb', line 274
def enable_do_use_a_native_image
@internal_hash[:do_use_a_native_image] = true
end
|
#enable_static_image ⇒ Object
266
267
268
269
|
# File 'lib/roebe/classes/run/run.rb', line 266
def enable_static_image
@internal_hash[:additional_commandline_arguments] <<
'-H:+StaticExecutableWithDynamicLibC'
end
|
#handle_this_directory(i) ⇒ Object
#
handle_this_directory
This method is mostly used for .java files which are spread all over the place.
#
207
208
209
210
|
# File 'lib/roebe/classes/run/run.rb', line 207
def handle_this_directory(i)
target = "#{i}/*.java"
java_compile(target)
end
|
#java_compile(i) ⇒ Object
720
721
722
723
724
|
# File 'lib/roebe/classes/run/run.rb', line 720
def java_compile(i)
esystem(
"javac #{i}", :do_colourize
) { :colourize_first_word_differently }
end
|
#make_use_of_code_draw? ⇒ Boolean
#
make_use_of_code_draw?
#
89
90
91
|
# File 'lib/roebe/classes/run/run.rb', line 89
def make_use_of_code_draw?
@internal_hash[:make_use_of_code_draw]
end
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/roebe/classes/run/menu.rb', line 16
def (
i = return_commandline_arguments_starting_with_hyphens
)
if i.is_a? Array
i.each {|entry| (entry) }
else
case i when /^-?-?same(-|_)?name$/i,
/^-?-?name$/i
if which_file?.nil?
set_which_file(first?.to_s.dup)
end
set_store_as_this_name(:use_filename)
when /^-?-?code(-|_)?draw$/i
@internal_hash[:make_use_of_code_draw] = true
when /^-?-?native(-|_)?static(-|_)?image/,
/^-?-?native(-|_)?static/,
/^-?-?static(-|_)?native$/,
/^-?-?static(-|_)?image$/,
/^-?-?super(-|_)?static$/,
/^-?-?make(-|_)?static$/,
/^-?-?static$/i,
/^-?-?native1$/
enable_static_image
enable_do_use_a_native_image
when /-?-?help/
show_help
exit
when /--static/
enable_static_image
when /^-?-?native(-|_)?image$/,
/^-?-?native$/
enable_do_use_a_native_image
end
end
end
|
#remove_file_extension_of(i) ⇒ Object
#
remove_file_extension_of
#
129
130
131
|
# File 'lib/roebe/classes/run/run.rb', line 129
def remove_file_extension_of(i)
i.sub(/#{File.extname(i)}$/,'')
end
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/roebe/classes/run/run.rb', line 54
def reset
super()
infer_the_namespace
@store_as_this_name = 'a.out'
@internal_hash = {}
@internal_hash[:additional_commandline_arguments] = []
@internal_hash[:do_use_a_native_image] = false
@internal_hash[:make_use_of_code_draw] = false
@consider_appending_this = ''.dup
end
|
#return_camelcase_of(i) ⇒ Object
197
198
199
|
# File 'lib/roebe/classes/run/run.rb', line 197
def return_camelcase_of(i)
i.split('_').map(&:capitalize).join
end
|
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
# File 'lib/roebe/classes/run/run.rb', line 306
def run
set_this_file(
return_first_non_hyphen_commandline_argument
)
@this_file = this_file?
if File.directory? @this_file
handle_this_directory(@this_file)
elsif File.exist? @this_file
@file_content = File.read(
@this_file, encoding: encoding?
)
check_for_macros_in(@file_content)
extname = File.extname(@this_file).delete('.')
act_based_on_this_extension(extname)
if do_use_a_native_image? unless can_we_locate_a_native_image_binary?
etomato 'No native-image binary was found - running the next line'
etomato 'may not work properly.'
end
check_for_polyglot_java_file_in(@file_content)
cmd_to_run = 'native-image '.dup
if @internal_hash[:additional_commandline_arguments] and
!@internal_hash[:additional_commandline_arguments].empty?
cmd_to_run << @internal_hash[:additional_commandline_arguments].join(' ')
end
cmd_to_run << ' '+@this_file.delete_suffix(extname).delete('.')
esystem_colourized cmd_to_run
shorter_filename = @this_file.delete_suffix(extname).
delete('.').
downcase
e rev+
'Next running '+steelblue('upx')+
rev+' to make the resulting ('+
royalblue(shorter_filename)+') file smaller.'
esystem "upx #{shorter_filename}", :do_colourize
_ = "#{shorter_filename}.build_artifacts.txt"
if File.exist?(_)
e "Removing the unnecessary file #{sfile(_)} as well next."
delete(_)
end
end
else
opnn; no_file_exists_at(@this_file)
end
end
|
#run_this_jar_file(i) ⇒ Object
#
run_this_jar_file
This method is specifically for .jar files.
#
217
218
219
|
# File 'lib/roebe/classes/run/run.rb', line 217
def run_this_jar_file(i)
esystem "java -jar #{i} &"
end
|
#run_this_ruby_file(i) ⇒ Object
568
569
570
|
# File 'lib/roebe/classes/run/run.rb', line 568
def run_this_ruby_file(i)
esystem "ruby #{i} &" end
|
#set_store_as_this_name(i = :use_filename) ⇒ Object
#
set_store_as_this_name
#
136
137
138
139
140
141
142
143
144
145
146
147
|
# File 'lib/roebe/classes/run/run.rb', line 136
def set_store_as_this_name(
i = :use_filename
)
case i
when :use_filename
i = remove_file_extension_of(File.basename(which_file?))
end
@store_as_this_name = i
end
|
#set_this_file(i = '') ⇒ Object
Also known as:
set_which_file
103
104
105
106
107
108
109
110
|
# File 'lib/roebe/classes/run/run.rb', line 103
def set_this_file(i = '')
i = i.join(' ').strip if i.is_a? Array
i = i.to_s.dup
unless File.exist?(i)
i = "#{i}.class" if File.exist?("#{i}.class") end
@this_file = i
end
|
#show_help ⇒ Object
255
256
257
258
259
260
261
|
# File 'lib/roebe/classes/run/run.rb', line 255
def show_help
e 'The following options are currently documented:'
e
e ' --native-static-image *.java # Compile a .java '\
'application into a standalone binary'
e
end
|
#this_file? ⇒ Boolean
Also known as:
filename?
115
116
117
|
# File 'lib/roebe/classes/run/run.rb', line 115
def this_file?
@this_file
end
|
#try_to_run_the_compiled_file(i = @store_as_this_name) ⇒ Object
#
try_to_run_the_compiled_file
This method will attempt to run the file a.out or whatever is stored in @store_as_this_name.
#
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
|
# File 'lib/roebe/classes/run/run.rb', line 660
def try_to_run_the_compiled_file(
i = @store_as_this_name
)
if File.exist?(i) and i.end_with?('.exe')
esystem "mono #{i}"
elsif File.exist? i
i.delete_suffix!('.cr') if i.end_with? '.cr'
esystem "./#{i}"
elsif File.exist?("#{i}.java")
cmd = "java".dup
dataset = File.read("#{i}.java")
if dataset.include? 'assert ' cmd << ' -enableassertions'
end
if dataset.include?('classpath:')
dataset =~ /^classpath: "(.+)"/
cmd << " -cp \"#{$1}\""
end
cmd << @consider_appending_this unless @consider_appending_this.empty?
cmd << " #{i}"
e steelblue(cmd)
e
system cmd
elsif File.exist? "#{i}.cs"
cmd = "mono #{i}"
e steelblue(cmd)
e
system cmd
elsif File.exist? "#{i}.py"
cmd = "python #{i}"
e steelblue(cmd)
e
system cmd
else
e "No file `#{sfile(i)}` was found."
end
end
|
#verbose_compile_this_file(i) ⇒ Object
#
verbose_compile_this_file (compile tag)
This method is the one that will attempt to compile the file at hand, e. g. a .c file or a .java file.
#
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
|
# File 'lib/roebe/classes/run/run.rb', line 447
def verbose_compile_this_file(i)
extension_name = File.extname(i).delete('.')
case extension_name when 'tex'
_ = "pdflatex #{i}".dup
when 'nim'
_ = "nim c -d:release #{i}".dup
when 'cr'
_ = "crystal build #{i}".dup
when 'cpp'
if is_on_windows?
_ = "cl /EHsc #{i}".dup
else _ = "g++ #{i}".dup
end
_ << " #{USE_THESE_G_PLUS_PLUS_COMPILE_FLAGS}"
when 'java',
'class'
verbose_exit_unless_javac_could_be_found
_ = 'javac'.dup
if extension_name == 'class'
_ = 'java'.dup
end
dataset = File.read(i)
if dataset.include?('classpath:')
dataset =~ /^classpath: "(.+)"/
_ << " -cp \"#{$1}\""
end
if dataset.include?('import codedraw.')
do_enable_code_draw
end
if make_use_of_code_draw?
_ << " --class-path /home/x/programming/java/src/codedraw/"
end
_ << " #{i.sub(/\.class/,'')}"
@store_as_this_name = i.sub(/\.java$/,'')
when 'cs'
_ = "csc #{i}"
@store_as_this_name = i.delete_suffix('.cs')+'.exe'
when 'c'
_ = "gcc -Wall #{i}".dup
_ << ' '+USE_THESE_GCC_COMPILE_FLAGS
if File.read(i).include? '#include <math.h>'
_ << ' -lm'
end
end
@consider_appending_this = check_for_compile_flags_specified_in_the_given_file.to_s.dup
if (extension_name == 'java') and
File.read(i).include?('import javafx')
@consider_appending_this << ' --module-path $JAVAFX_HOME --add-modules javafx.controls,javafx.fxml'
end
case extension_name
when 'java','cs','nim',
'class',
'tex'
when 'cr'
_ << ' --release'
else
_ << " -o #{@store_as_this_name}" unless is_on_windows?
end
if @consider_appending_this and !@consider_appending_this.empty?
_ << " #{@consider_appending_this}"
end
_.squeeze!(' ') esystem(_, :do_colourize) { :colourize_first_word_differently }
end
|
#verbose_exit_unless_javac_could_be_found ⇒ Object
#
verbose_exit_unless_javac_could_be_found
#
242
243
244
245
246
247
248
249
250
|
# File 'lib/roebe/classes/run/run.rb', line 242
def verbose_exit_unless_javac_could_be_found
_ = `javac 2>&1`
if _.include? 'not found'
opne orange('javac')+
rev+' could not be found. Is Java '\
'installed on the target computer?'
exit
end
end
|
#which_file? ⇒ Boolean
122
123
124
|
# File 'lib/roebe/classes/run/run.rb', line 122
def which_file?
@this_file
end
|