Class: Studium::ShowLecturesOnTheCommandline

Inherits:
Base
  • Object
show all
Defined in:
lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/run.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/help.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/menu.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/reset.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/konsole.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/constants.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/initialize.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb

Overview

Studium::ShowLecturesOnTheCommandline

Constant Summary collapse

IMAGE_FOR_THE_COMPLETED_MODULE =
#

Studium::ShowLecturesOnTheCommandline::IMAGE_FOR_THE_COMPLETED_MODULE

This constant resides here because it is only used by this .rb file.

#
'<img src="/home/x/data/images/studium/COMPLETED_MODULE.png" '\
'style="margin-left: 1em; border: 3px solid black">'.dup
NAMESPACE =
#

NAMESPACE

#
inspect
ALSO_SHOW_URL =
#

ALSO_SHOW_URL

If this constant is set to true then this class will also show the URL to the target course.

#
true

Constants inherited from Base

Base::ARRAY_HTML_COLOURS_IN_USE, Base::CHECK_FOR_INCORRECT_ENTRIES_IN_THE_QUESTION_ANSWER_FILE_THAT_SHOULD_BE_COMMENTS, Base::COLOURS, Base::COMMON_YEAR_DAYS_IN_MONTH, Base::GRAY, Base::LEFT_PADDING, Base::N_CHARACTERS_PER_LINE, Base::UNICODE_RIGHT_ARROW

Constants included from Colours

Colours::COLOURS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#add_proper_year_entry_to_this_line, #already_solved_this_lva_number?, #append_what_into, #available_topics_as_short_name, #average_grade, #bachelor_master_or_diploma, #base_dir?, #be_silent, #be_verbose?, #beautiful_url, #change_directory, #cheering_person, #cliner, #colour_for_ects_points, #colourize_percentage, #commandline_arguments?, #commandline_arguments_joined, #commandline_arguments_with_hyphens?, #convert_this_array_of_lectures_into_the_full_dataset, #copy, #cpruby, #create_directory, #create_file, #csv_file?, #current_month?, #datum?, #day_month_year, #debug?, #delete_file, #directory_of_the_exam_topics?, #directory_to_my_exam_topics, #directory_to_the_exam_topics?, #disable_colours, #disable_colours_globally, #do_not_be_verbose, #do_not_use_opn, #do_these_curricula_include_both_a_bachelor_and_a_master_curriculum?, #does_this_line_include_a_german_weekday?, #does_this_line_include_a_html_colour?, #e, #ecomment, #editor?, #ee, #enable_colours, #enable_colours_globally, #enable_debug, #encoding?, #english_to_german_weekday, #ensure_main_encoding, #ensure_that_the_log_directory_exists, #eparse, #erev, #esystem, #etomato, #exit_program, #expand_topic, #extract_dd_mm_yyyy, #file_lecture_information?, #file_read_with_proper_encoding, #filter_away_invalid_questions, #find_corresponding_exam_topic, #first_argument?, #first_non_hyphen_argument?, #from_curriculum_id_to_university, #german_date_notation, #german_weekday?, #german_weekdays?, #has_a_bachelor_curriculum?, #has_a_master_curriculum?, #has_this_exam_topic_been_solved?, #has_year_entry?, #hh_mm_ss_dd_mm_yyyy, #horizontal_bar?, #html_log_directory?, #is_a_master_lecture?, #is_a_weekday?, #is_connected_to_the_www?, #is_on_roebe?, #is_prüfungsimmanent?, #is_this_a_valid_html_colour?, #is_this_day_today?, #konsole_support?, #last_file?, #lectures_from_indi1, #lectures_from_indi2, #lectures_from_indi3, #lectures_from_indi4, #lectures_from_the_bachelor_genetik_curriculum, #lectures_from_the_individual_vektor_curricula, #load_yaml_dataset, #move_file, #n_days_difference_from_today_to_this_day, #no_ext_name, #no_file_at, #number_to_month, #obtain, #obtain_lectures_from_this_curriculum, #open_in_editor, #path_to_exam_topic?, #read_dataset_from_a_curriculum_file, #read_in_exam_dataset_from_this_file, #read_this_file_with_default_encoding, #readlines_from_this_input_file, #register_sigint, #remove_empty_strings, #remove_escape_sequences, #remove_internal_comments, #remove_leading_comments, #remove_leading_weekday_names_from, #remove_newlines, #remove_tags_from_this_input, #rename_kde_konsole_tab, #rename_konsole_tab?, #replace_all_html_colours_in_this, #replace_bold_token_with_default_colour, #replace_italic_token_with_default_colour, #replace_italic_token_with_this_colour, #replace_regular_numbers_with_unicode_numbers, #replace_underline_token_with_default_colour, #replace_underline_token_with_this_colour, #return_all_bachelor_lectures, #return_all_exams_on_this_day, #return_all_numbers_from, #return_all_registered_curricula, #return_all_steop_lectures, #return_current_year, #return_dataset_for_this_topic, #return_dataset_from_this_curriculum_file, #return_dd_mm_yy_and_time_from, #return_directory_for, #return_ects_points_from_these_lectures, #return_either_grey_or_the_custom_colour_for_answers, #return_either_grey_or_the_custom_colour_for_questions, #return_file_for_this_curriculum, #return_german_name_for_this_english_month, #return_german_weekday_of?, #return_hh_mm_ss_from, #return_hour_from_this, #return_lectures_from_bachelor_vektor_curriculum, #return_lectures_with_at_the_least_one_upcoming_exam, #return_local_path_of_this_pwdstud, #return_lva_number_of_this_lecture, #return_month_fitting_to_this_input, #return_n_days_until_monday, #return_n_days_until_sunday, #return_n_exam_questions_in, #return_n_questions_were_answered_for_this_topic, #return_name_of_the_weekday, #return_name_of_this_curriculum, #return_name_of_this_curriculum_based_on_its_id_number, #return_opnn, #return_passed_courses, #return_pwd, #return_random_curriculum, #return_sanitized_dataset_from_the_file_lecture_information, #return_solved_lectures, #return_steop_lectures, #return_the_remote_homepage_url, #return_this_line_has_n_characters_as_html_colour_tags, #return_title_from_this_curriculum_file, #rev, #right_arrow?, #rinstall2, #roebe_exam_directory?, #ruby_src_dir_at_home?, #runmode?, #sanitize_this_topic, #sanitize_url, #select_lectures_with_this_key, #set_be_quiet, #set_be_verbose, #set_commandline_mode, #set_runmode, #set_this_cd_alias_to, #set_www_mode, #sfancy, #shall_we_make_use_of_unicode_symbols?, #show_todays_date, #simp, #sort_these_lecture_names_by_time, #spacer, #swarn, #this_month_has_n_days?, #total_ects_points_passed, #translate_dd_mm_yyyy_to_weekday, #try_to_require_the_rcfiles, #turn_this_array_into_the_full_dataset, #unicode_blocks_line, #use_colours?, #use_opn?, #vertical_bar?, #web_liner, #weekday?, #weekdays?, #word_wrap, #write_what_into, #www_connection_is_unavailable, #www_mode?, #yaml_dir?

Methods included from Colours

#bold_blue, #bold_red, #bold_yellow, #cadetblue, #chartreuse, crimson, #darkgray, darkgreen, darkseagreen, deepskyblue, #deepskyblue, default_colour, #dimgray, disable_colours, #dodgerblue, e, #efancy, enable_colours, #ewarn, #forestgreen, gold, #grey, lightblue, lightgreen, #lightslategray, #lightsteelblue, #mediumorchid, #mediumseagreen, #oldlace, #olivedrab, orange, orangered, #orchid, palevioletred, #papayawhip, rev, royalblue, sdir, #sdir, sfancy, #sfancy, sfile, #sfile, simp, #simp, slateblue, steelblue, #steelblue, #swarn, swarn, #teal, turquoise, use_colours?, use_this_colour_for_exam_answers, use_this_colour_for_exam_questions, #yellow

Constructor Details

#initialize(commandline_arguments = [], run_already = true) ⇒ ShowLecturesOnTheCommandline

#

initialize

#


12
13
14
15
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
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/initialize.rb', line 12

def initialize(
    commandline_arguments = [],
    run_already           = true
  )
  reset
  case commandline_arguments
  when :do_not_run_yet
    commandline_arguments = nil
    run_already = false
  end
  set_commandline_arguments(
    commandline_arguments
  )
  case run_already
  # ======================================================================= #
  # === :do_not_run_yet
  # ======================================================================= #
  when :do_not_run_yet
    run_already = false
  end
  # ======================================================================= #
  # === Handle blocks given to this class
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :do_not_run_yet
    # ===================================================================== #
    when :do_not_run_yet
      run_already = false
    # ===================================================================== #
    # === :www
    # ===================================================================== #
    when :www
      set_www_mode
    end
  end
  run if run_already
end

Class Method Details

.[](commandline_arguments = ARGV, run_already = true) ⇒ Object

#

Studium::ShowLecturesOnTheCommandline[]

#


396
397
398
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 396

def self.[](commandline_arguments = ARGV, run_already = true)
  new(commandline_arguments, run_already)
end

Instance Method Details

#add_to_the_dataset_without_any_further_checks(i) ⇒ Object

#

add_to_the_dataset_without_any_further_checks

#


311
312
313
314
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 311

def add_to_the_dataset_without_any_further_checks(i)
  @dataset << i
  @dataset.flatten!
end

#check_for_title_entry_in_the_file(this_file = dataset? ) ⇒ Object

#

check_for_title_entry_in_the_file

You can put a line within a curriculum such as:

@title Biologie Basisblock

The method will check for this. However had, you can also avoid using such a title, by having a header section, as a comment, where the second line should contain the title of the lecture.

The latter is the default (and recommended) mode.

#


131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 131

def check_for_title_entry_in_the_file(
    this_file = dataset?
  )
  temporary_dataset = Studium.read_dataset_from_a_curriculum_file(
    this_file,
    :retain_comments
  )
  # ======================================================================= #
  # If the second line in the curriculum-file starts with '# === #'
  #
  # This is recommended for all registered curricula.
  # ======================================================================= #
  if temporary_dataset[1].start_with?('# === ')
    use_this_title = temporary_dataset[1]
    set_title(use_this_title)
  # ======================================================================= #
  # else check for a @title entry
  # ======================================================================= #
  elsif this_file.any? {|line|
      line.start_with? '@title'
    }
    set_title(
      dataset.select {|line| line.start_with? '@title ' }
    )
    # ===================================================================== #
    # In this case, grab the title, and remove that line.
    # So, we will reject all entries that include '@title '.
    # ===================================================================== #
    dataset.reject! {|line| line.start_with? '@title '}
    dataset.compact!
    set_dataset(dataset)
  end
end

#clear_old_datasetObject

#

clear_old_dataset

#


359
360
361
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 359

def clear_old_dataset
  @dataset = []
end

#consider_generating_a_graphviz_image_displaying_the_modules(use_this_dataset) ⇒ Object

#

consider_generating_a_graphviz_image_displaying_the_modules

#


438
439
440
441
442
443
444
445
446
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
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 438

def consider_generating_a_graphviz_image_displaying_the_modules(
    use_this_dataset
  )
  require 'image_paradise/graphviz/generate_graphviz_image.rb'
  copy = use_this_dataset.dup
  copy.map! {|entry|
    if entry.include? '#'
      entry = entry[0 .. ( entry.index('#') - 1 )]
    end
    entry.strip
  }
  copy = turn_this_array_into_the_full_dataset(
    copy.flatten, @lecture_dataset
  )
  # ======================================================================= #
  # Next, we will work on this modified dataset. 
  # ======================================================================= #
  hash_containing_the_module_dependencies = {}
  copy.each_pair {|name_of_the_lecture, inner_hash|
    if inner_hash
      individual_curricula = inner_hash[:individual_curricula]
      if individual_curricula
        selection = individual_curricula.select {|most_inner_hash|
          most_inner_hash[:name_of_the_curriculum].include? @title
        }.first
        if selection
          individual_curriculum_module = selection[:individual_curriculum_module]
          if individual_curriculum_module
            individual_curriculum_module = individual_curriculum_module.first
          end
          individual_curriculum_depends_on_these_modules = selection[:individual_curriculum_depends_on_these_modules]
          hash_containing_the_module_dependencies[individual_curriculum_module] =
            individual_curriculum_depends_on_these_modules
        end
      end
    end
  }
  # ======================================================================= #
  # Next pass this Hash into class GenerateGraphvizImage.
  # ======================================================================= #
  ImageParadise::GenerateGraphvizImage.new(
    hash_containing_the_module_dependencies
  ) { :use_bold_font_and_german }
end

#consider_generating_a_html_file(i = @generate_html_file) ⇒ Object

#

consider_generating_a_html_file (html tag)

This method can generate a .html file. As a consequence it is fairly long and messy.

#


128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
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
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 128

def consider_generating_a_html_file(
    i = @generate_html_file
  )

  if i
    if is_on_roebe?
      # =================================================================== #
      # Install the project first in this case, so that the regexes
      # are up-to-date. This may take quite some time, so it is better
      # to move this to the end of the method, after the browser
      # has loaded the page. Actually - we can not do this if we
      # want to have up-to-date URLs.
      # =================================================================== #
      Studium.install_the_project_on_the_given_hostsystem
    end
    html_file = "#{log_dir?}html/"\
                "#{title?.to_s.tr(' ','_').delete('(),')}.html"
    _ = ''.dup
    if www_mode?
      # In this case, do not use the <meta> tag and similar entities.
    else
      _ << '<meta charset="UTF-8">'  
      _ << "#{N}<html>#{N}"
      _ << "<head>#{N}"
      _ << "<title>#{title?.to_s}</title>#{N}"
    end
    # ===================================================================== #
    # Add tooltip.css next.
    # ===================================================================== #
    _ << '<link rel="stylesheet" type="text/css" href="../../../home/x/DATA/CSS/balloon.css">'
    if www_mode?
      # And do nothing as well here.
    else
      _ << "</head>#{N}"
      _ << "<body style=\"font-size: 1.5em; "\
           "font-family: monospace; "\
           "padding: 1px; "\
           "margin: 0px\">#{N}" # <- Open the <body> tax here.
    end
    _ << '<div style="border: 1px solid black; padding:2px;">'
    # ===================================================================== #
    # Add the title of the curriculum next, as a darkblue and bold
    # <h1> tag. An example for such a title may be a String like
    # "Bachelorcurriculum Informatik".
    # ===================================================================== #
    _ << HtmlTags.h1(
      title?.to_s, css_style: 'font-weight: bold; color: darkblue'
    )+N
    remote_url = ::Studium.return_homepage_of_this_lecture(title?.to_s)
    _ << '<b style="margin-left:1em">
    Link to the remote page:
    </b>
    <a style="font-weight: bold; color: darkblue" href="'+remote_url+'">'+title?.to_s+'</a>'
    if show_loaded_from_which_file? and loaded_from_which_file?
      loaded_from_which_file?.each {|this_file|
        _ << '<h2 style="color:slateblue; margin-bottom:4px; margin-left: 0.75em;">
              Loaded from the file:
              </h2>'+N
        _ << '<b style="margin-left:2.0em; font-size:larger; color:blue">'+
              File.basename(this_file)+'</b>
              ( <span style="font-weight: bold; color:steelblue">'+this_file+'</span> )
              <br><br><br>'+N
      }
    end
    hash = {}
    # ===================================================================== #
    # === Iterate over the lectures here
    #
    # Next iterate over all lectures that are part of the curriculum
    # and build up a temporary Hash, with which we will work.
    # ===================================================================== #
    all_lectures?.each {|this_lecture|
      # =================================================================== #
      # raw_name_of_the_lecture will also include the lva-id.
      # =================================================================== #
      if this_lecture.include? '#' # Handle possible comments next.
        raw_name_of_the_lecture = this_lecture[0 .. (this_lecture.index('#')-1)].strip
      else
        raw_name_of_the_lecture = this_lecture.dup
      end
      raw_name_of_the_lecture.squeeze!(' ') # <- Trying this as of March 2018.
      # =================================================================== #
      # === Pointer to the lecture-dataset
      #
      # Obtain a pointer to the lecture dataset next.
      # =================================================================== #
      pointer_to_the_lecture_dataset = @lecture_dataset[raw_name_of_the_lecture]
      if pointer_to_the_lecture_dataset.nil?
        next
      end
      hash[raw_name_of_the_lecture] = pointer_to_the_lecture_dataset
    }
    if @this_curriculum_has_n_ects_points_in_total >= 270.0
      @individual_curriculum = false
      # ^^^ ad-hoc hack.
    end
    # ===================================================================== #
    # === Handle modules of an individual curriculum
    #
    # Next, if we have an individual curriculum, we will use a slightly
    # different way to order the modules. How is it determined whether
    # the given curriculum at hand is an individual one? We will
    # simply use @individual_curriculum.
    # ===================================================================== #
    if @individual_curriculum
      new_hash = ::Studium::SortedIndividualCurricula.new(hash, name_of_the_curriculum?)
      # =================================================================== #
      # Rewrite the variable called `hash` next.
      # =================================================================== #
      hash.clear
      (1 .. new_hash.max?).each {|module_number|
        pointer = new_hash[module_number]
        if pointer.nil?
          e 'A nil-value was found for module number '+
            steelblue(module_number)+'.'
          e
          e 'The hash was:'
          e
          pp new_hash
          e
        end
        pointer.each {|name_of_the_lecture, inner_hash|
        hash[name_of_the_lecture] = inner_hash
        }
      }
    end
    @name_of_the_individual_curriculum_module = ''.dup
    index = 0
    # ===================================================================== #
    # === Iterate over all lectures
    #
    # Next, iterate over all lectures. An individual entry may look
    # like this:
    #
    #   185.A47 Physiologie und Grundlagen der Pathologie # 4.5 ECTS, VO, TU WIEN
    #
    # Because we may want to sort the dataset according to individual
    # modules, we will first sort that dataset completely, before
    # proceeding.
    # ===================================================================== #
    hash.each_pair {|this_lecture, pointer_to_the_lecture_dataset| index += 1
      splitted = this_lecture.split(' ')
      lva_id = splitted.first # Obtain the ID of the lva.
      # =================================================================== #
      # The variable `name_of_the_lecture` contains just the name of
      # the lecture alone, without leading LVA ID number.
      # =================================================================== #
      name_of_the_lecture = splitted[1..-1].join(' ').strip
      # =================================================================== #
      # Next, determine some helper-variables. Since as of July 2018
      # we will try another approach to obtain the specific entries of
      # our main Hash, via a more generic method called obtain().
      # =================================================================== #
      n_ects_points      = obtain(:ects,               pointer_to_the_lecture_dataset)
      university         = obtain(:university,         pointer_to_the_lecture_dataset)
      lecture_type       = obtain(:type,               pointer_to_the_lecture_dataset)
      bereits_absolviert = obtain(:already_solved,     pointer_to_the_lecture_dataset)
      curricula          = obtain(:curricula,          pointer_to_the_lecture_dataset)
      is_a_steop_lecture = obtain(:is_a_steop_lecture, pointer_to_the_lecture_dataset)
      semester           = obtain(:semester,           pointer_to_the_lecture_dataset).to_s # Must have .to_s due to nil-values.
      if pointer_to_the_lecture_dataset.has_key? :homepage
        # ================================================================= #
        # In this case everything is fine. We will continue.
        # ================================================================= #
      else
        e crimson('The lecture `')+
          sfancy(this_lecture)+
          crimson('` does not have a registered')
        e crimson('remote homepage entry.')
        open_this_in_the_browser = false
        if open_this_in_the_browser and
           is_on_roebe? and
           commandline_mode?
          # =============================================================== #
          # On my home system we will batch-open these in the browser.
          # This will only work if they are registered in BeautifulUrl
          # though. It will thus not work for every lecture, but it may
          # work for many lectures, which can thus be updated.
          # =============================================================== #
          e crimson('Opening the URL to this lecture in the editor now, so that')
          e crimson('this erroneous entry can be corrected.')
          this_url = Studium.return_remote_homepage_of_this_lecture(this_lecture)
          if this_url != this_lecture # Means we found something.
            Studium.open_this_remote_url(this_url)
            sleep(0.75)
          end
        end
      end
      # =================================================================== #
      # Since as of 15.04.2019, we will tap into the method
      # Studium.return_homepage_of_this_lecture() to determine the
      # remote URL.
      #
      # In the past we used the BeautifulUrl for this, but it is better
      # to make use of the automatically generated regexp-case-when menu,
      # residing in the file called
      # 'regexes_for_the_registered_lectures.rb'.
      # =================================================================== #
      use_this_as_remote_url = ::Studium.return_homepage_of_this_lecture(this_lecture)
      case semester
      when 'both'
        semester = 'Sommer / Winter'
      when 'winter'
        semester = 'Winter'
      when 'summer'
        semester = 'Sommer'
      end
      # =================================================================== #
      # Also add this to the hash that contains the lectures. We could
      # use `this_lecture` as key, but I prefer the name alone, without
      # leading lva id. Note that this would, in theory, conflict if we
      # have lectures that have the same name but a different LVA ID.
      # =================================================================== #
      @hash_containing_the_lectures_for_this_curriculum[name_of_the_lecture] =
        pointer_to_the_lecture_dataset
      @hash_containing_the_lectures_for_this_curriculum[name_of_the_lecture].update(
        remote_url: use_this_as_remote_url
      )
      bereits_absolviert = ja_oder_nein(bereits_absolviert)
      case bereits_absolviert
      when 'Ja'
        colourized_bereits_absolviert = '<b style="color:green">'+bereits_absolviert
        # ================================================================= #
        # Also append the date when this exam has been completed
        # successfully.
        # ================================================================= #
        on_which_date = @hash_containing_the_lectures_for_this_curriculum[name_of_the_lecture][:already_solved_at].to_s
        colourized_bereits_absolviert <<
          ", absolviert am</b> <b style=\"color:darkgreen\">#{on_which_date}</b>"
      else
        colourized_bereits_absolviert = '<b style="color:red">'+bereits_absolviert+'</b>'
      end
      # =================================================================== #
      # === Check special-content for the individual curriculum
      # =================================================================== #
      if individual_curriculum? and
         pointer_to_the_lecture_dataset.has_key?(:individual_curricula) and
         pointer_to_the_lecture_dataset[:individual_curricula].has_key?(:individual_curriculum_module)
        individual_curriculum_module  = pointer_to_the_lecture_dataset[:individual_curricula][:individual_curriculum_module]
        name_of_the_curriculum_module = pointer_to_the_lecture_dataset[:individual_curricula][:name_of_the_curriculum_module]
        if individual_curriculum_module.is_a? Array
          individual_curriculum_module = individual_curriculum_module.first
        end
        if @name_of_the_individual_curriculum_module != individual_curriculum_module 
          @name_of_the_individual_curriculum_module = individual_curriculum_module
          # =============================================================== #
          # Next we will show the name of the Module at hand. This will
          # be done only for lectures that are part of an individual
          # curriculum. We also need to determine the name of the
          # curriculum.
          # =============================================================== #
          # n_ects_in_this_module = Studium.return_n_ects_in_this_module(
          #   @name_of_the_individual_curriculum_module,
          #   individual_curriculum_module,
          #   :use_what_is_best # <- Not ideal for speed-reasons, but for now this must suffice.
          # )
          # n_ects_in_this_module = '<span style="color: darkgreen">('+
          #                          n_ects_in_this_module.to_s+
          #                          ' ECTS)</span>'
          # ^^^ we tried this on 31.12.2019, but it does not work very well.
          _ << '<h1><b style="color:midnightblue">Module</b> '\
               '<span style="color:#510042">'+
               @name_of_the_individual_curriculum_module+
               '</span> '+
               '<b style="color:midnightblue">'+
               name_of_the_curriculum_module.strip+
               '</b>'
          n_ects_in_that_module = ::Studium.return_n_ects_in_that_module(
            title?,
            @name_of_the_individual_curriculum_module,
            @lecture_dataset
          )
          # =============================================================== #
          # Show how many ECTS points are in that module.
          # =============================================================== #
          _ << " <span style=\"font-size:0.8em\">[#{n_ects_in_that_module} ECTS in this module]</span>"
          # =============================================================== #
          # Since as of 29.02.2020 we will also notify whether we have
          # completed this module or whether we have not.
          # =============================================================== #
          if ::Studium.query_based_on_curriculum_title_whether_this_module_been_completed(
              title?,
              @name_of_the_individual_curriculum_module,
              @lecture_dataset
            )
            _ << IMAGE_FOR_THE_COMPLETED_MODULE.dup
          end
          # =============================================================== #
          # And close the header-tag as well.
          # =============================================================== #
          _ << '</h1>' # + n_ects_in_this_module
        end
      end
      # =================================================================== #
      # Add the university-logo as well. This image can also be clicked
      # on via a <a href=""> tag.
      # =================================================================== #
       = return_proper_logo_for_this_university(university)
      # clickable_logo = '<a href="'+return_remote_url(this_lecture)+'">'+clickable_logo+'</a>'
      # ^^^ disabled the above as of 16.04.2019
       = '<a href="'+use_this_as_remote_url+'">'++'</a>'
      _ << '<span style="margin-left:2.0em">'+
           
      # =================================================================== #
      # If it is a STEOP lecture then a special "STEOP image" will be
      # shown.
      # =================================================================== #
      if is_a_steop_lecture
        _ << return_proper_logo_for_this_university(:steop_picture)
      end
      # =================================================================== #
      # Next, we add the name of the lecture. This can either be
      # `this_lecture`, which will include the lecture-id,
      # or `name_of_the_lecture`, which will NOT include the lecture-id.
      # =================================================================== #
      if bereits_absolviert == 'Nein'
        # ================================================================= #
        # In this case we will use slightly different colours.
        # ================================================================= #
        bold_name_of_the_lecture = '<b style="font-size:larger; color: navy">'+
          this_lecture+
        '</b>'
      else # this is the default
        bold_name_of_the_lecture = '<b style="font-size:larger">'+
          this_lecture+
        '</b>'
      end
      _ << " Lehrveranstaltung <b>##{index}</b>:</span> "+
           bold_name_of_the_lecture+
           ', Bereits <b>absolviert</b>? <span style="font-size:larger">'+
            colourized_bereits_absolviert+'</span>'\
           ' (LVA Nummer: <b>'+lva_id.to_s+'</b>; '\
           'ECTS: <b>'+n_ects_points.to_s+'</b>; '\
           'Lecture Type: <b>'+lecture_type+'</b>; '\
           'Semester: <b>'+semester+'</b>; '
      _ << "University: <b>#{university}</b>) "
      # =================================================================== #
      # Add bachelor-or-master lecture next but only for unsolved
      # lectures.
      # =================================================================== #
      if bereits_absolviert == 'Nein'
        _ << (curricula)
      end
      # =================================================================== #
      # Next check whether the lecture is a practical course. If it is we
      # will add a certain image, but only if it is NOT yet solved.
      # =================================================================== #
      if is_this_lecture_a_practical_course?(lecture_type) and
         (bereits_absolviert == 'Nein')
        _ << PRACTICAL_COURSE_IMAGE
      end
      _ << BR+N
      # =================================================================== #
      # If the lecture has not been solved yet, we will show the remote
      # URL. However had, via the commandline flag --show-all-URLs this
      # can be overruled.
      # =================================================================== #
      shall_we_show_the_url = false
      if @show_all_URLs or (bereits_absolviert == 'Nein')
        shall_we_show_the_url = true
      end
      # =================================================================== #
      # === Show the associated URL to the given lecture.
      # =================================================================== #
      if shall_we_show_the_url
        this_url = ::Studium.return_homepage_of_this_lecture(this_lecture)
        _ << return_arrow_pointing_to_the_right_side('3em')
        _ << '<a style="margin-left: 5em; font-size: larger; font-weight:bold" href="'+this_url+'">'+
             this_url+
             '</a>'+BR+N
        # ================================================================= #
        # === Show Moodle entries
        #
        # Since as of 28.10.2019 we will also display the Moodle link
        # to this course.
        # ================================================================= #
        url_to_moodle = ::Studium.return_remote_moodle_link_of_this_lecture(this_lecture)
        _ << return_arrow_pointing_to_the_right_side('3em')
        if (url_to_moodle == this_lecture) and !url_to_moodle.include?('http')
          url_to_moodle = '[No remote URL for Moodle is known for this course.]'
          _ << '<span style="margin-left: 5em; font-size: larger; font-weight:bold; color: darkblue" href="'+url_to_moodle+'">'+
               url_to_moodle+
               '</span>'+BR+N
        else
          _ << '<a style="margin-left: 5em; font-size: larger; font-weight:bold" href="'+url_to_moodle+'">'+
               url_to_moodle+
               '</a>'+BR+N
        end
        # ================================================================= #
        # Next, determine when the next exam may happen but only do so
        # when the instance variable @show_next_exams is true. We will
        # also NOT do any checking here and simply use the first found
        # entry, if we are instructed to show the next upcoming exams.
        # The user has to update the file lecture_information on his/her
        # own.
        # ================================================================= #
        if @show_next_exams
          if pointer_to_the_lecture_dataset.has_key? 'exams'
            array_upcoming_exams = pointer_to_the_lecture_dataset['exams']
            first_entry = array_upcoming_exams.first
            first_entry = remove_weekdays(first_entry)
            weekday = first_entry
            if weekday.include? ','
              weekday = weekday.split(',').first
            end
            weekday = english_to_german_weekday(
              translate_dd_mm_yyyy_to_weekday(weekday)
            )
            _ << '<span style="font-weight:bold; font-size: larger;margin-left:9em"> ^^^ '+
                 '<b style="color: teal">Next exam:</b> '+
                 weekday+' '+
                 first_entry+'</span>'+BR+N
          end
        end
      end
    }
    # =================================================================== #
    # Next add how many lectures are in this Curriculum.
    # =================================================================== #
    _ << BR+
         return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved(:use_for_html).join(' ')+N
    _ << BR+BR+
         return_how_many_ects_points_this_curriculum_has_in_total(:no_colours)+'<br>'+N
    _ << BR+
         return_how_many_ects_points_have_been_passed_already(:use_for_html).join(' ')+N
    # =================================================================== #
    # Determine how many lectures are missing still.
    # =================================================================== #
    n_missing_lectures = n_total_lectures?.to_i - n_lectures_completed?
    _ << "#{BR}#{BR}There are still <b>#{n_missing_lectures.to_s}</b> lectures missing "\
         "before this curriculum has been completed successfully."
    # =================================================================== #
    # Next, add average grade, if we are using it at all altogether.
    # =================================================================== #
    if @do_report
      average_grade = return_the_average_grade
      _ << "\n<br><br>The <span style=\"font-weight:800;padding-left:2px; padding-right:2px;background-color: black; color:gold\">average grade</span> "\
           "is: <b style=\"color:darkgreen\">#{average_grade}</b>\n\n<br><br>"
    end
    # =================================================================== #
    # Also add the timetable of upcoming exams next, a html <div>.
    # =================================================================== #
    if @show_next_exams
      _ << "#{return_timetable_of_upcoming_exams}#{N}"
    end
    _ << "#{N}</div>"
    _ << @append_this_string_onto_the_html_string
    # =================================================================== #
    # Store into e. g.:
    #   "#{log_dir?}html/#{title?.to_s.tr(' ','_').delete('()')}.html"
    # =================================================================== #
    set_html_string(_)
    _ << "</html>#{N}"
    # =================================================================== #
    # We will only generate a .html file if we are using the commandline
    # variant.
    # =================================================================== #
    if cmdline?
      result = "Next storing into\n".dup
      result << "  `#{sfile(html_file)}`\n"
      also_open_in_the_browser = true
      if also_open_in_the_browser
        result << "\nThat page will be opened via the browser as well."
        opnn; e result
        write_what_into(_, html_file)
        Open.in_browser(html_file) { :be_silent } # Don't show the exact command.
      end
    end
  end
end

#consider_generating_a_spreadsheet(i = @title) ⇒ Object

#

consider_generating_a_spreadsheet

#


100
101
102
103
104
105
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 100

def consider_generating_a_spreadsheet(
    i = @title
  )
  require 'studium/utility_scripts/generate_spreadsheet.rb'
  Studium::GenerateSpreadsheet.new(i)
end

#consider_showing_to_which_universities_the_lectures_belong_toObject

#

consider_showing_to_which_universities_the_lectures_belong_to

We should only show as to which university a particular lecture belongs to if it is an individual curriculum. Other curricula all belong to one particular university, so showing the “table” on the commandline is useless.

#


72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 72

def consider_showing_to_which_universities_the_lectures_belong_to
  if @show_to_which_universities_the_lectures_belong_to
    first_argument = @commandline_arguments
    if first_argument.is_a? Array
      first_argument = first_argument.first
    end
    first_argument = first_argument.to_s.delete('-')
    if cmdline?
      e
      e 'The percentage-value of lectures attributed to '\
        'the different'
      e 'universities will be shown next:'
    end
    _ = Studium::LecturesAttributedToUniversities.new(first_argument) {
      :do_not_show_the_title_and_do_not_report
    }
    splitted_html_string = _.html_string.split("\n")
    # ===================================================================== #
    # Also embed this into a little <div> container next:
    # ===================================================================== #
    @append_this_string_onto_the_html_string <<
      '<div style="padding: 0.70em; background-color: black; '\
      'font-size: 1.0em; font-family: monospace;">'
      splitted_html_string.each {|line|
        @append_this_string_onto_the_html_string << "<b>#{line.strip}</b><br>#{N}"
      }
      @append_this_string_onto_the_html_string << '</div>'
    # ===================================================================== #
    # And now we can report our findings, if we are on the commandline.
    # ===================================================================== #
    _.report if cmdline?
  end
end

#dataset?Boolean Also known as: all_lectures?, dataset_holding_all_lectures, lectures?

#

dataset?

#

Returns:

  • (Boolean)


274
275
276
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 274

def dataset?
  @dataset
end

#determine_from_which_files_to_read(i = FILE_MASTER_VEKTORX, type_of_the_curriculum = :bachelor) ⇒ Object Also known as: determine_from_which_file_to_read

#

determine_from_which_files_to_read

This method will also assign towards the instance variables The available curricula are stored within file_constants.rb in the studium/constants/ subdirectory.

#


72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
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
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 72

def determine_from_which_files_to_read(
    i                      = FILE_MASTER_VEKTORX, # Default entry comes here.
    type_of_the_curriculum = :bachelor
  )
  # ======================================================================= #
  # The following case/when menu describes where we can find the
  # curriculum file and what "type", e. g. bachelor or master,
  # it is.
  # ======================================================================= #
  case i # case tag
  # ======================================================================= #
  # === :bachelor_forstwirtschaft
  # ======================================================================= #
  when :bachelor_forstwirtschaft
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :bachelor_informatik_und_molekulare_biologie
  # ======================================================================= #
  when :bachelor_informatik_und_molekulare_biologie,
       :bachelor_biologische_informatik,
       :indi3
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
    is_an_individual_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :master_bioinformatics_and_molecular_biotechnology
  #
  # This refers to the indi4 curriculum.
  # ======================================================================= #
  when :master_bioinformatics_and_molecular_biotechnology,
       :indi4
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
    is_an_individual_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :master_dummy_curriculum
  #
  # This refers to any dummy curriculum that we may want to test,
  # for master-curricula.
  # ======================================================================= #
  when :master_dummy_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :bachelor_dummy_curriculum
  #
  # This refers to any dummy curriculum that we may want to test.
  # ======================================================================= #
  when :bachelor_dummy_curriculum,
       :dummy
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :bachelor_vektor_curriculum
  # ======================================================================= #
  when :bachelor_vektor_curriculum,
       :bachelor_vektorx_curriculum,
       :indi1
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
    is_an_individual_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :master_vektoren_curriculum
  # ======================================================================= #
  when :master_vektoren_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
    is_an_individual_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :bachelor_bioinformatik_und_biotechnologie
  # ======================================================================= #
  when :bachelor_bioinformatik_und_biotechnologie
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
    is_an_individual_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :bachelor_mikrobiologie_individuelles_curriculum
  #
  # Removed as of 29.02.2020.
  # ======================================================================= #
  # when :bachelor_mikrobiologie_individuelles_curriculum,
  #      :bachelor_mikrobiologie_curriculum,
  #      :bachelor_mikrobiologie,
  #      :mikrobiologie
  #   i = return_and_check_file_for_this_curriculum(i)
  #   is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_molekularbiologie_graz
  # ======================================================================= #
  when :bachelor_molekularbiologie_graz,
       :bachelor_molekularbiologie_graz_curriculum,
       :bachelor_molekularbiologie,
       :bachelor_molekularbiologie_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_ernährung_curriculum
  # ======================================================================= #
  when :bachelor_ernährung_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_verfahrenstechnik_curriculum
  # ======================================================================= #
  when :bachelor_verfahrenstechnik_curriculum,
       :verfahrenstechnik_curriculum,
       :verfahrenstechnik
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_genetik_curriculum
  # ======================================================================= #
  when :bachelor_genetik_curriculum,
       :genetik_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :master_genetik_und_entwicklungsbiologie_curriculum
  # ======================================================================= #
  when :master_genetik_und_entwicklungsbiologie_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :master_pharmazie_curriculum
  # ======================================================================= #
  when :master_pharmazie_curriculum,
       :master_pharmazie
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :bachelor_pharmazie_curriculum
  # ======================================================================= #
  when :bachelor_pharmazie_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :master_biologische_chemie_curriculum
  # ======================================================================= #
  when :master_biologische_chemie_curriculum,
       :master_biologische_chemie
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :master_lmbt_curriculum
  # ======================================================================= #
  when :master_lmbt_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :bachelor_boku_lmbt_curriculum
  # ======================================================================= #
  when :bachelor_boku_lmbt_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :technical_chemistry_curriculum
  # ======================================================================= #
  when :bachelor_technical_chemistry_curriculum,
       :technical_chemistry_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
    do_show_lecture_attribution_to_universities
  # ======================================================================= #
  # === :bachelor_informatik_curriculum
  # ======================================================================= #
  when :bachelor_informatik_curriculum,
       :bachelor_informatik,
       :binformatik
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_ktww_curriculum
  # ======================================================================= #
  when :bachelor_ktww_curriculum,
       :bachelor_boku_ktww_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_agrarwissenschaften_curriculum
  # ======================================================================= #
  when :bachelor_agrarwissenschaften_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_medizinische_informatik_curriculum
  # ======================================================================= #
  when :bachelor_medizinische_informatik_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_botanik_curriculum
  # ======================================================================= #
  when :bachelor_botanik_curriculum,
       :bachelor_botanik
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :master_bioinformatik_curriculum
  # ======================================================================= #
  when :master_bioinformatik_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :bachelor_ökologie_curriculum
  # ======================================================================= #
  when :bachelor_ökologie_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_master_tu_wien
  # ======================================================================= #
  when :bachelor_master_tu_wien
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_master_curriculum
  # ======================================================================= #
  # === :master_molbio_curriculum
  # ======================================================================= #
  when :master_molbio_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :master_immunobiology_curriculum
  # ======================================================================= #
  when :master_immunobiology_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :bachelor_chemie_curriculum
  # ======================================================================= #
  when :bachelor_chemie_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_boku_ubrm_curriculum
  # ======================================================================= #
  when :bachelor_boku_ubrm_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :master_tu_vienna_biotechnology_curriculum
  # ======================================================================= #
  when :master_tu_vienna_biotechnology_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_master_curriculum
  # ======================================================================= #
  # === :bachelor_molekulare_biologie_curriculum
  # ======================================================================= #
  when :bachelor_molekulare_biologie_curriculum
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  # ======================================================================= #
  # === :bachelor_basisblock_biologie
  # ======================================================================= #
  when :bachelor_basisblock_biologie
    i = return_and_check_file_for_this_curriculum(i)
    is_bachelor_curriculum
  end
  if i.include? 'master_individuelles_' # This must be a master-lecture then.
    type_of_the_curriculum = :master
  end if i.is_a? String
  # ======================================================================= #
  # We must work on Arrays past this point.
  # ======================================================================= #
  unless i.is_a? Array
    i = [i]
  end
  i.flatten! # Keep this important Array flat.
  @read_from_these_files = i
end

#determine_the_type_of_the_curriculum(i = :bachelor) ⇒ Object

#

determine_the_type_of_the_curriculum (type tag)

The allowed types are currently:

:bachelor
:master
:bachelor_and_master

The default will be towards :bachelor.

#


387
388
389
390
391
392
393
394
395
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 387

def determine_the_type_of_the_curriculum(
    i = :bachelor
  )
  case i
  when :bachelor_master
    i = :bachelor_and_master # Slight sanitize-operation here.
  end
  @type_of_the_curriculum = i
end

#do_all_actions_after_the_main_dataset_was_read_inObject

#

do_all_actions_after_the_main_dataset_was_read_in

#


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/run.rb', line 12

def do_all_actions_after_the_main_dataset_was_read_in
  iterate_over_the_lectures
  consider_showing_to_which_universities_the_lectures_belong_to
  # ======================================================================= #
  # The next method will output something like:
  #   "A total of 52 lectures are part of this Curriculum."
  # ======================================================================= #
  if commandline?
    report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
    report_how_many_ects_points_have_been_passed_already
    report_how_many_ects_points_are_in_this_curriculum
    report_the_average_grade
    report_the_university_attribution
  end
  consider_generating_a_html_file
end

#do_generate_a_html_fileObject

#

do_generate_a_html_file

This method can be used to generate a .html file no matter what.

The other method, consider_generating_a_html_file, will instead honour a certain instance variable.

#


62
63
64
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 62

def do_generate_a_html_file
  consider_generating_a_html_file(true)
end

#do_not_read_in_from_a_fileObject

#

do_not_read_in_from_a_file

#


444
445
446
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 444

def do_not_read_in_from_a_file
  @read_from_these_files = false
end

#do_not_report_anythingObject Also known as: do_not_report

#

do_not_report_anything

#


75
76
77
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 75

def do_not_report_anything
  @do_report = false
end

#do_not_show_loaded_from_which_fileObject

#

do_not_show_loaded_from_which_file

#


375
376
377
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 375

def do_not_show_loaded_from_which_file
  @show_loaded_from_which_file = false
end

#do_not_show_the_next_examsObject

#

do_not_show_the_next_exams

Use this method if you do NOT want to show the next exams.

#


368
369
370
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 368

def do_not_show_the_next_exams
  @show_next_exams = false
end

#do_show_all_URLsObject

#

do_show_all_URLs

#


192
193
194
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 192

def do_show_all_URLs
  @show_all_URLs = true
end

#do_show_lecture_attribution_to_universitiesObject

#

do_show_lecture_attribution_to_universities

#


60
61
62
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 60

def do_show_lecture_attribution_to_universities
  @show_to_which_universities_the_lectures_belong_to = true
end

#exclude_title_entries_from_the_main_datasetObject

#

exclude_title_entries_from_the_main_dataset

#


247
248
249
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 247

def exclude_title_entries_from_the_main_dataset
  @dataset.reject! {|line| line.start_with? '@title ' }
end

#html_string?Boolean

#

html_string?

#

Returns:

  • (Boolean)


118
119
120
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 118

def html_string?
  @html_string
end

#individual_curriculum?Boolean Also known as: is_it_an_individual_curriculum?

#

individual_curriculum?

#

Returns:

  • (Boolean)


486
487
488
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 486

def individual_curriculum?
  @individual_curriculum
end

#is_an_individual_curriculumObject

#

is_an_individual_curriculum

#


500
501
502
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 500

def is_an_individual_curriculum
  @individual_curriculum = true
end

#is_bachelor_curriculumObject

#

is_bachelor_curriculum

#


458
459
460
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 458

def is_bachelor_curriculum
  determine_the_type_of_the_curriculum(:bachelor)
end

#is_bachelor_master_curriculumObject

#

is_bachelor_master_curriculum

#


465
466
467
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 465

def is_bachelor_master_curriculum
  determine_the_type_of_the_curriculum(:bachelor_master)
end

#is_master_curriculumObject

#

is_master_curriculum

Denote that our curriculum at hand is a master-curriculum.

#


437
438
439
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 437

def is_master_curriculum
  determine_the_type_of_the_curriculum(:master)
end

#is_not_an_individual_curriculumObject

#

is_not_an_individual_curriculum

#


493
494
495
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 493

def is_not_an_individual_curriculum
  @individual_curriculum = false
end

#is_this_a_registered_lecture?(i) ⇒ Boolean

#

is_this_a_registered_lecture?

#

Returns:

  • (Boolean)


431
432
433
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 431

def is_this_a_registered_lecture?(i)
  @lecture_dataset.has_key?(i.strip)
end

#is_this_lecture_a_practical_course?(lecture_type) ⇒ Boolean

#

is_this_lecture_a_practical_course?

#

Returns:

  • (Boolean)


233
234
235
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 233

def is_this_lecture_a_practical_course?(lecture_type)
  ARRAY_LECTURE_TYPES_THAT_ARE_MANDATORY_CONTINUOUS_ASSESSMENT.include? lecture_type
end

#iterate_over_the_lectures(i = @dataset) ⇒ Object Also known as: do_the_main_iteration

#

iterate_over_the_lectures (iterate tag)

#


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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 42

def iterate_over_the_lectures(
    i = @dataset
  )
  i.each_with_index {|line, index| index += 1
    result = ''.dup # This is the line that will be reported to the user.
    # ===================================================================== #
    # Since as of January 2018 the dataset has already been sanitized a
    # bit before coming to this method, so there will no longer be any
    # '#' characters. In the past, the variable line would look like
    # this:
    #
    #   "754117 Mikrobiologie - Übungen (AW)              # 2.0 ECTS, UE\n"
    #
    # That is why the next line still checks for this.
    # ===================================================================== #
    if line and line.include?('#')
      raw_line = line[0 .. (line.index('#') - 1)] # ← raw_line is like: "754117 Mikrobiologie - Übungen (AW)"
    # ===================================================================== #
    # The next code checks for a leading LVA-id entry, but it must also
    # keep in mind that ID entries may be like this: "185.A47"
    # ===================================================================== #
    # elsif starts_with_a_lecture_id_entry?(line)
    #   raw_line = line.split(' ')[1 .. -1].join(' ').strip.dup
    else
      raw_line = line.dup
    end
    raw_line.strip! # ← Added this in December 2019.
    raw_line.squeeze!(' ') # ← Added this as of March 2018.
    # ===================================================================== #
    # Obtain the remote URL. Since as of 20.02.2018, this requires that
    # the beautiful_url project also deals with leading numbers, so all
    # entries must have that too, as an additional qualifier.
    #
    # On November 2019 support for BeautifulUrl was removed, and
    # replaced with Studium.return_remote_url_of_this_lecture()
    # instead.
    # ===================================================================== #
    remote_url = Studium.return_remote_url_of_this_lecture(raw_line)
    if remote_url == raw_line
      e crimson("No registered remote homepage for #{raw_line}.")
    end
    splitted = raw_line.split(' ')
    lecture_id = splitted.first # ← Obtain the lecture id.
    name_of_the_lecture = splitted[1..-1].join(' ')
    padded_index = ('('+index.to_s+')').rjust(5)
    colourized_index = slategray(padded_index)
    # ===================================================================== #
    # Create a colourized string for the remote URL next.
    # ===================================================================== #
    colourized_remote_url = N+dodgerblue('')+
                              dodgerblue(remote_url)+
                              dodgerblue('')
    pointer_to_the_lecture = @lecture_dataset[raw_line]
    if pointer_to_the_lecture and
       pointer_to_the_lecture.has_key?(:already_solved)
      already_solved = pointer_to_the_lecture[:already_solved]
    else
      opnn; e "#{swarn('Problem with `')}#{sfancy(raw_line)}#{swarn('`:')}"
      opnn; e swarn('no registered key called :already_solved was found')
      # =================================================================== #
      # Also inform the user whether this lecture is registered at all.
      # If not, notify the user about this.
      # =================================================================== #
      unless main_dataset?.has_key? raw_line
        opnn; e swarn('The lecture ')+sfancy(raw_line)+swarn(' has not yet been')
        opnn; e swarn('registered in the file `')+
                sfancy('lecture_information.yml')+
                swarn('`.')
      end
      pp pointer_to_the_lecture
      already_solved = false
    end
    if pointer_to_the_lecture.nil?
      opnn; e "Skipping this lecture (#{sfancy(raw_line)})"
      opnn; e 'as it is not registered or otherwise missing.'
      next
    end
    # ===================================================================== #
    # Deconstruct the content of our hash-"pointer" next.
    # ===================================================================== #
    n_ects_points = pointer_to_the_lecture[:ects]
    @this_curriculum_has_n_ects_points_in_total += n_ects_points
    padded_name_of_the_lecture = name_of_the_lecture.ljust(76)
    padded_n_ects_points = n_ects_points.to_s.rjust(5)
    colourized_n_ects_points = steelblue(padded_n_ects_points)
    expanded_ja_oder_nein = ja_oder_nein(already_solved)
    case expanded_ja_oder_nein
    when 'Ja'
      colourized_ja_oder_nein = lightgreen(expanded_ja_oder_nein.rjust(4))
    when 'Nein' # Lectures that were not yet passed, will be highlighted in red.
      colourized_ja_oder_nein = crimson(expanded_ja_oder_nein.rjust(4))
    end
    fancified_already_solved = 'Bereits absolviert? '+colourized_ja_oder_nein+'. '
    result << colourized_index+' '+
              sfancy(padded_name_of_the_lecture)+' '+
              fancified_already_solved+
              '('+mediumseagreen('LVA Nummer: ')+
              sfancy(lecture_id.rjust(7))
    grade = nil
    if already_solved
      # =================================================================== #
      # Obtain the grade of this lecture.
      # =================================================================== #
      if pointer_to_the_lecture.has_key? :grade
        grade = pointer_to_the_lecture[:grade]
        # ================================================================= #
        # We must keep in mind that the grade can also be a '+' character.
        # We can not calculate the average number from entries that are
        # '+' Strings, so we will ignore these entries - but we will
        # do so not here but lateron, when we calculate the average grade.
        # ================================================================= #
        @array_storing_the_grades << grade
      end
      @n_lectures_are_already_solved += 1
      @n_ects_were_passed_so_far += n_ects_points
      # =================================================================== #
      # If the lecture was already solved then we will not show
      # the remote URL.
      # =================================================================== #
      colourized_remote_url = ''
    end
    result << ', '+mediumseagreen('n ECTS: ')+colourized_n_ects_points
    if grade
      result << ', '+mediumseagreen('Grade: '+grade.to_s)
    end
    unless ALSO_SHOW_URL
      colourized_remote_url = ''
    end
    if @do_report and cmdline? # We only report this on the commandline.
      result << ') '+colourized_remote_url
      e result
    end
  }
  if @this_curriculum_has_n_ects_points_in_total >= 270.0
    # ===================================================================== #
    # This check is to avoid checking for combined bachelor-master
    # individual curricula, as we can not show a correct module
    # chain in this case really - or at the least not without
    # additional code (23.12.2019).
    # ===================================================================== #
  else
    if is_it_an_individual_curriculum? and is_on_roebe?
      consider_generating_a_graphviz_image_displaying_the_modules(
        i
      )
      consider_generating_a_spreadsheet
    end
  end
end

#ja_oder_nein(i = 'nein') ⇒ Object

#

ja_oder_nein

Input “true” will become “Ja” and input “false” will become “Nein”.

#


654
655
656
657
658
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 654

def ja_oder_nein(
    i = 'nein'
  )
  Studium.ja_oder_nein(i)
end

#lecture_dataset?Boolean Also known as: main_dataset?

#

lecture_dataset?

#

Returns:

  • (Boolean)


212
213
214
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 212

def lecture_dataset?
  @lecture_dataset
end
#

menu (menu tag)

#


14
15
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/menu.rb', line 14

def menu(
    i = commandline_arguments?
  )
  if i.is_a? Array
    i.each {|entry| menu(entry) }
  else
    case i.to_s # case tag
    # ===================================================================== #
    # === lectures_commandline --bachelor-vektorx
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?vektorx?$/i,
         /^-?-?bachelor(-|_| )?vektore?n?$/,
         /^-?-?bachelor(-|_| )?vector$/,
         /^-?-?bachelor(-|_| )?vector(-|_| )?curriculum$/,
         /^-?-?molekularsimulatorisch(-|_| )?therapeutische(-|_| )?vektoren$/i,
         /^-?-?bachelor(-|_| )?molekularsimulatorisch(-|_| )?therapeutische(-|_| )?vektoren$/i,
         /^-?-?bachelor(-|_| )?individuelles(-|_| )?curriculum(-|_| )?molekularsimulatorische(-|_| )?vektoren(-|_| )?in(-|_| )?der(-|_| )?biotechnologie$/i,
         /^-?-?bachelor(-|_| )?individuelles(-|_| )?curriculum(-|_| )?molekularsimulatorische(-|_| )?vektoren(-|_| )?in(-|_| )?biotechnologie(-|_| )?und(-|_| )?bioinformatik$/i,
         /^-?-?bvektor$/i,
         /^-?-?individuelles(-|_| )?bachelor(-|_| )?studium/i,
         /^-?-?indi1$/i,
         /^-?-?indi$/i,
         'vektoren'
      use_bachelor_vektor_curriculum
    # ===================================================================== #
    # === lectures_commandline --aggregate
    #
    # This entry point really combines all curricula and lectures
    # that I intend to pass.
    #
    # Invocation example on my home system:
    #
    #   bigaggregate
    #
    # ===================================================================== #
    when /^-?-?aggregate$/i
      use_master_vektoren_curriculum # Combine the bachelor-master curricula.
      is_not_an_individual_curriculum
      prepend_this_to_dataset(
        %i(
          bachelor_vektorx_curriculum
          master_vektorx_curriculum
          bachelor_informatik_und_molekulare_biologie
          bachelor_lbt
          bachelor_bioinformatik_an_der_boku

          master_lbt
          master_bioinformatik_an_der_boku
        ) # bachelor_agrarwissenschaften
          # bachelor_tu_wien
      )
      prepend_this_to_dataset(
        ['892100 Physik (KTWW+HNT)']
      )
      sanitize_the_dataset
      uniq_the_dataset
    # ===================================================================== #
    # === lectures_commandline --biologische_informatik
    #
    # This is indi3.
    # ===================================================================== #
    when /^-?-?biologische(-|_| )?informatik$/i,
         /^-?-?bachelor(-|_| )?biologische(-|_| )?informatik$/i,
         /^-?-?indi3$/i
      use_bachelor_biologische_informatik
    # ===================================================================== #
    # === lectures_commandline --indi4
    #
    # This is indi4.
    # ===================================================================== #
    when /^-?-?master(-|_| )?bioinformatics(-|_| )?and(-|_| )?molecular(-|_| )?biotechnology$/i,
         /^-?-?indi4$/i
      use_master_bioinformatics_and_molecular_biotechnology
    # ===================================================================== #
    # === lectures_commandline --bioinf2
    #
    # This is indi2.
    # ===================================================================== #
    when /^-?-?bioinf2$/i,
         /^-?-?bachelor(-|_| )?bioinformatik(-|_| )?und(-|_| )?molekulare(-|_| )?biotechnologie$/i,
         /^-?-?bachelor(-|_| )?bioinformatik(-|_| )?und(-|_| )?biotechnologie$/i,
         /^-?-?bachelor(-|_| )?bioinformatik(-|_| )?an(-|_| )?der(-|_| )?boku$/i,
         /^-?-?indi2$/i
      use_bachelor_bioinformatik_und_molekulare_biotechnologie
    # ===================================================================== #
    # === lectures_commandline --mdummy
    # ===================================================================== #
    when /^-?-?master(-|_| )?dummy(-|_| )?curriculum$/i,
         /^-?-?mdummy$/i
      use_master_dummy_curriculum
    # ===================================================================== #
    # === lectures_commandline --dummy
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?dummy(-|_| )?curriculum$/i,
         /^-?-?bdummy$/i,
         /^-?-?dummy$/i
      use_bachelor_dummy_curriculum
    # ===================================================================== #
    # === lectures_commandline --aggregate-only-individual-curricula
    #
    # This entry point combines all individual curricula and lectures
    # in these curricula that I wish to pass.
    # ===================================================================== #
    when /^-?-?aggregate(-|_| )?only(-|_| )?individual(-|_| )?curricula$/i
      use_master_vektoren_curriculum # Combine the bachelor-master curricula.
      prepend_this_to_dataset(
        %i(
          bachelor_vektorx_curriculum
          bachelor_informatik_und_molekulare_biologie
          bachelor_bioinformatik_an_der_boku
        )
      )
      sanitize_the_dataset
      uniq_the_dataset
    # ===================================================================== #
    # === lectures_commandline --lmbt_curriculum
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?lm?bt$/i,
         /^-?-?bachelor(-|_| )?lm?bt$(-|_| )?curriculum/i,
         /^-?-?lm?bt$(-|_| )?curriculum/i,
         'lmbt',
         /lbt/i
      use_bachelor_lmbt_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor-master-vektorx
    #
    # This entry point is the "bachelor-master-vector" joint
    # curriculum.
    #
    # Another invocation example:
    #
    #   lectures_commandline --bmvec
    #
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?master(-|_| )?vektorx?$/i,
         /^-?-?bachelor(-|_| )?master(-|_| )?vektoren$/i,
         /^-?-?bachelor(-|_| )?master(-|_| )?vector$/i,
         /^-?-?bmvec$/i,
         /^-?-?bmvek$/i
      use_master_vektoren_curriculum # Combine the bachelor-master curricula.
      prepend_this_to_dataset(:bachelor_vektorx_curriculum) # And then prepend the dataset.
    # ===================================================================== #
    # === master_vektoren
    #
    # This entry point deals with the master lecture of the
    # vector-curriculum.
    #
    # Invocation example:
    #
    #   lectures_commandline --master_vektorx
    #
    # ===================================================================== #
    when /^-?-?master(-|_| )?ve(c|k)torx$/,
         /^-?-?master(_|-)?molekularsimulatorisch(_|-)?therapeutische(_|-)?vektoren$/i,
         /^-?-?master(_|-)?individuelles(_|-)?curriculum(_|-)?molekularsimulatorische(_|-)?vektoren/i, # lcommandline --master-individuelles-curriculum-molekularsimulatorische-vektoren
         /^-?-?master(_|-)?vektoren$/i,
         /^-?-?master(-|_| )?ve(c|k)tors?$/,
         /^-?-?master(-|_| )?individuell/,
         'mastervect',
         'mastersim'
      use_master_vektoren_curriculum
    # ===================================================================== #
    # === lectures_commandline --forstwirtschaft
    # ===================================================================== #
    when /^-?-?forstwirtschaft$/i,
         /^-?-?bachelor(-|_| )?forstwirtschaft$/i
      use_bachelor_forstwirtschaft
    # ===================================================================== #
    # === lectures_commandline --bachelor-ern
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?ernährung?$/,
         /^-?-?bachelor(-|_| )?ern$/,
         /^-?-?bachelor(-|_| )?ernährung(_|-)?uni(_|-)?wien$/,
         /^-?-?bachelor(-|_| )?ernährungswissenschaften$/,
         /^-?-?bachelor(-|_| )?nutrition(_|-)?science$/i,
         /-?-?ernährung/,
         'ernährungswissenschaften',
         'ern'
      use_bachelor_ernährung_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor_molekularbiologie_graz
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?molekularbiologie(-|_| )?graz$/i,
         /^-?-?bachelor(-|_| )?molekularbiologie(-|_| )?graz(-|_| )?curriculum$/i,
         /^-?-?bachelor(-|_| )?molbio(-|_| )?graz$/i,
         /^-?-?bachelor(-|_| )?molekularbiologie$/i,
         /^-?-?graz$/i
      use_bachelor_molekularbiologie_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor-pharmazie
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?pharmazie$/i,
         /^-?-?pharmazie$/i,
         /^-?-?pharm$/i,
         /^-?-?bachelor(-|_| )?pharm$/i
      use_bachelor_pharmazie_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor_verfahrenstechnik
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?verfahrenstechnik$/i,
         /^-?-?verfahrenstechnik$/i
      use_bachelor_verfahrenstechnik_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor_technical_chemistry
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?technical(-|_| )?chemistry?$/i
      use_bachelor_technical_chemistry_curriculum
    # ===================================================================== #
    # === lectures_commandline --master-lmbt
    # ===================================================================== #
    when /^-?-?(-|_| )?lm?bt$/i,
         /^-?-?master(-|_| )?lm?bt(-|_| )?curriculum$/i,
         /^-?-?master(-|_| )?biotech$/i,
         /^-?-?master(-|_| )?lmbt$/i,
         /LBT2/i,
         'biotechnology',
         'masterbiotech'
      use_master_lmbt_curriculum
    # ===================================================================== #
    # === lectures_commandline --master-pharmazie
    # ===================================================================== #
    when /^-?-?master(-|_| )?pharmazie$/i,
         /^-?-?master(-|_| )?pharmazie(-|_| )?curriculum$/i,
         'mpharmacy',
         'mpharma'
      use_master_pharmazie_curriculum
    # ===================================================================== #
    # === lectures_commandline --master-biologische-chemie
    # ===================================================================== #
    when /^-?-?master(-|_| )?biologische(-|_| )?chemie$/i,
         /^-?-?master(-|_| )?biologische(-|_| )?chemie(-|_| )?curriculum$/i,
         /^-?-?biologische(-|_| )?chemie$/i,
         'mbiochem'
      use_master_biologische_chemie_curriculum
    # ===================================================================== #
    # === lectures_commandline --tu_master_biotech
    # ===================================================================== #
    when /^-?-?master(_|-)?tu(_|-)?biotechnology$/i,
         /^-?-?tu(_|-)?master(_|-)?biotech$/i,
         /^-?-?master(_|-)?tu(_|-)?wien(_|-)?biotechnologie$/i,
         /^-?-?tu(_|-)?vienna(_|-)?biotech(_|-)?master$/i,
         /^-?-?master(_|-)?tuwienbiotech$/i,
         /^-?-?tu(_|-)?wien(_|-)?biotech$/i
      use_tu_master_biotechnology_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor-mikrobiologie
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?mikrobiologie$/i,
         /^-?-?mikrobiologie$/i,
         /^-?-?microbiology$/i
      use_mikrobiologie_individuelles_curriculum
    # ===================================================================== #
    # === lectures_commandline --priority-points
    # ===================================================================== #
    when /^-?-?priority(-|_| )?points$/i
      use_priority_points
    # ===================================================================== #
    # === lectures_commandline --informatik_curriculum
    # ===================================================================== #
    when /^-?-?informatik(_|-)?curriculum$/i,
         /^-?-?informatik$/i,
         /^-?-?bachelor(_|-)?informatik$/i,
         /^-?-?bachelor(_|-)?informatik(_|-)?curriculum$/i,
         'informatik'
      use_bachelor_informatik_curriculum
    # ===================================================================== #
    # === lectures_commandline --ktww_curriculum
    # ===================================================================== #
    when /^-?-?ktww(_|-)?curriculum$/i,
         /^-?-?boku(_|-)?ktww$/i,
         /^-?-?ktww$/i,
         /^-?-?bachelor(_|-)?ktww$/i,
         /^-?-?bachelor(_|-)?boku(_|-)?ktww(_|-)?curriculum$/i
      use_bachelor_ktww_curriculum
    # ===================================================================== #
    # === --no-html-page
    # ===================================================================== #
    when /^-?-?no(-|_| )?html(-|_| )?page$/,
         /^-?-?no(-|_| )?html$/
      no_html_page
    # ===================================================================== #
    # === lectures_commandline --aw_curriculum
    # ===================================================================== #
    when /^-?-?aw(_|-)?curriculum$/i,
         /^-?-?boku(_|-)?aw$/i,
         /^-?-?AW$/i,
         /^-?-?agrarwissenschaften$/i,
         /^-?-?bachelor(_|-)?agrarwissenschaften$/i,
         'bachelorAW'
      use_bachelor_agrarwissenschaften_curriculum
    # ===================================================================== #
    # === lectures_commandline --master-genetik-und-entwicklungsbiologie
    # ===================================================================== #
    when /^-?-?master(-|_| )?genetik(-|_| )?und(-|_| )?entwicklungsbiologie$/i,
         /^-?-?master(-|_| )?genetik(-|_| )?und(-|_| )?entwicklungsbiologie(-|_| )?curriculum$/i
      use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum
    # ===================================================================== #
    # === lectures_commandline --master_bioinformatik
    # ===================================================================== #
    when /^-?-?master(_|-)?bioinformatik$/i,
         /^-?-?master(_|-)?bioinformatics$/i
      use_uni_vienna_master_bioinformatics_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor_medizinische_informatik
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?medizinische(-|_| )?informatik$/i
      use_bachelor_medizinische_informatik_curriculum
    # ===================================================================== #
    # === lectures_commandline --molbio
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?molekularbiologie$/,
         /^-?-?bachelor(-|_| )?molekulare(-|_| )?biologie$/, # lectures_commandline --bachelor_molekulare_biologie
         /^-?-?bachelor(-|_| )?molbio$/,
         /^-?-?molbio$/,
         /^-?-?mbio$/,
         'molekularebiologie'
      use_bachelor_molbio_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor-chemie
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?chemie?$/,
         /^-?-?bachelor(-|_| )?chemie?uni(_|-)?wien$/,
         /^-?-?bachelor(-|_| )?chemie(-|_| )?uni(-|_| )?wien$/,
         /^-?-?uni(-|_| )?wien(-|_| )?chemie$/,
         /^-?-?uniwien(-|_| )?bachelor(-|_| )?chemie$/,
         /^-?-?chem(-|_| )?bach$/i, # lcommandline --chembach
         'chemie'
      use_bachelor_chemie_curriculum
    # ===================================================================== #
    # === lectures_commandline --show-all-URLs
    #
    # This can be triggered like so:
    #
    #   studiumsolved --show-all-URLs --tuwienbiotech
    #
    # ===================================================================== #
    when /^-?-?show(_|-)?all(_|-)?URLs$/i
      do_show_all_URLs
    # ===================================================================== #
    # === lectures_commandline --bachelor_ökologie_curriculum
    # ===================================================================== #
    when /^-?-?bachelor(_|-)?ökologie(_|-)?curriculum$/i,
         /^-?-?bachelor(_|-)?ecology(_|-)?curriculum/i,
         'ökologie'
      use_bachelor_ökologie_curriculum
    # ===================================================================== #
    # === lectures_commandline --molbio2
    # ===================================================================== #
    when /^-?-?master(-|_| )?molekularbiologie$/,
         /^-?-?master(-|_| )?molekulare(-|_| )?biologie/i,
         /^-?-?master(-|_| )?molbio$/,
         /^-?-?molbio2$/,
         /^-?-?mbio2$/,
         'mmolbio'
      use_master_molbio_curriculum
    # ===================================================================== #
    # === lectures_commandline --master_immunobiologie
    # ===================================================================== #
    when /^-?-?master(-|_| )?immunobiologie$/i,
         /^-?-?master(-|_| )?immunobiology$/i,
         /^-?-?master(-|_| )?immunobio$/i,
         /^-?-?master(-|_| )?immunbiology$/i,
         /^-?-?master(-|_| )?immuno$/i,
         /^-?-?immunbio$/i
      use_master_immunobiology_curriculum
    # ===================================================================== #
    # === lectures_commandline --biologie_basisblock
    # ===================================================================== #
    when /^-?-?uniwien(_|-)?biologie(_|-)?basisblock$/i,
         /^-?-?bachelor(_|-)?biologie(_|-)?basisblock$/i,
         /^-?-?bachelor(_|-)?biologe(_|-)?basisblock$/i,
         /^-?-?biologie(_|-)?basisblock$/i,
         /^-?-?bachelor(_|-)?biologie/i,
         /^-?-?biologie(_|-)?base$/i,
         /^-?-?biologie(_|-)?1$/i,
         'biologiebasisblock',
         'biologie',
         'uniwienbiologie'
      use_bachelor_biologie_basisblock_curriculum
    # ===================================================================== #
    # === lectures_commandline --genetic
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?genetik$/,
         /^-?-?bachelor(-|_| )?genetics$/,
         /^-?-?bachelor(-|_| )?mikrobiologie(-|_| )?und(-|_| )?genetik$/,
         /^-?-?geneti(c|k)$/,
         /^-?-?genetics$/,
         'mikrobiologie'
      use_bachelor_genetik_curriculum
    # ===================================================================== #
    # === curriculum bachelor_master_lmbt_curriculum
    # ===================================================================== #
    when /^-?-?lmbt(-|_| )?complete/i,
         /^-?-?bachelor(-|_| )?master(-|_| )?lmbt(-|_| )?curriculum$/i
      use_master_lmbt_curriculum
      prepend_this_to_dataset(:bachelor_lmbt_curriculum)
    # ===================================================================== #
    # === lectures_commandline --bachelor_master_tu_wien
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?master(-|_| )?tu(-|_| )?wien$/i,
         /bachelor(-|_| )?master(-|_| )?individuelles(-|_| )?studium(-|_| )?an(-|_| )?der(-|_| )?tu(-|_| )?wien$/i
      use_bachelor_master_tu_wien_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor_botanik
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?botanik(-|_| )?curriculum$/i,
         /^-?-?bachelor(-|_| )?botanik$/i,
         /^botanik$/,
         'botany'
      use_bachelor_botanik_curriculum
    # ===================================================================== #
    # === lectures_commandline --bachelor-boku-ubrm
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?boku(-|_| )?ubrm$/i,
         /^-?-?boku(-|_| )?ubrm$/i,
         /^-?-?ubrm$/i
      use_bachelor_ubrm_curriculum
    # ===================================================================== #
    # === curriculum --master_immunobiologie --do-not-show-upcoming-exams
    # ===================================================================== #
    when /-?-?do-?not-?show-?upcoming-?exams/,
         /-?-?do-?not-?show-?next-?exams/,
         /-?-?no-?next-?exams/
      do_not_show_the_next_exams
    # ===================================================================== #
    # === curriculum --files
    # ===================================================================== #
    when /-?-?files?\??/,
         /-?-?fshow(_|-)?important(_|-)?files/
      show_important_files
      exit
    # ===================================================================== #
    # === curriculum --help
    # ===================================================================== #
    when /^-?-?help$/
      show_help
      exit
    # ===================================================================== #
    # === lectures_commandline --available-curricula
    # ===================================================================== #
    when /-?-?available-?curricula/,
         /-?-?show-?available/
      show_available_curricula
      exit
    else # else tag
      opnn; e "Unknown input `#{sfancy(i)}` "\
              "(in the method #{__method__}())"
      exit # We will exit since as of April 2018; less confusing to do so.
    end
  end
end

#n_ects_points_in_total?Boolean Also known as: total_ects_points?

#

n_ects_points_in_total?

#

Returns:

  • (Boolean)


262
263
264
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 262

def n_ects_points_in_total?
  @this_curriculum_has_n_ects_points_in_total
end

#n_ects_were_passed_in_this_curriculum?Boolean Also known as: n_ects_were_passed_in_this_curriculum, n_ects_were_passed_so_far

#

n_ects_were_passed_in_this_curriculum?

#

Returns:

  • (Boolean)


254
255
256
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 254

def n_ects_were_passed_in_this_curriculum?
  @n_ects_were_passed_so_far
end

#n_lectures_are_already_solved?Boolean Also known as: n_lectures_completed?

#

n_lectures_are_already_solved?

#

Returns:

  • (Boolean)


219
220
221
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 219

def n_lectures_are_already_solved?
  @n_lectures_are_already_solved
end

#n_lectures_in_this_curriculum?Boolean

#

n_lectures_in_this_curriculum?

#

Returns:

  • (Boolean)


82
83
84
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 82

def n_lectures_in_this_curriculum?
  @dataset.size
end

#n_total_lectures?Boolean

#

n_total_lectures?

#

Returns:

  • (Boolean)


226
227
228
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 226

def n_total_lectures?
  @dataset.size
end

#no_html_and_do_not_report_anythingObject

#

no_html_and_do_not_report_anything

#


644
645
646
647
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 644

def no_html_and_do_not_report_anything
  no_html
  do_not_report_anything
end

#no_html_pageObject Also known as: no_html

#

no_html_page7

#


168
169
170
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 168

def no_html_page
  @generate_html_file = false
end

#obtain_sanitized_dataset_from(i) ⇒ Object

#

obtain_sanitized_dataset_from

This method combines two other methods - loading the dataset that belongs to a Curriculum; and sorting that dataset.

#


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
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 322

def obtain_sanitized_dataset_from(i)
  # ======================================================================= #
  # Keep in mind that the following method also allows for optional
  # arguments such as :remove_comments_and_title
  #
  # We do not need to do this for this file, though, as this file may
  # probably make use of all the information it can get.
  # ======================================================================= #
  dataset = Studium.read_dataset_from_a_curriculum_file(i).map(&:chomp)
  # ======================================================================= #
  # Next, we must check for duplicate entries. For now we will work on
  # the dataset obtained above ^^^ but if we need a more accurate 
  # approach, we should work on the name + LVA-ID of the lecture at
  # hand instead.
  # ======================================================================= #
  unless dataset == dataset.uniq
    e 'We have found at the least one duplicate entry. This will be '\
      'shown next:'
    e
    these_are_the_duplicates = {}
    these_are_the_duplicates.default = 0
    dataset.each {|this_entry|
      these_are_the_duplicates[this_entry] += 1
    }
    these_are_the_duplicates.select {|key, value| value > 1 }.each {|duplicate, n_times|
      e sfancy("  #{duplicate}")
    }
    e
    e 'Please correct these entries before we can continue.'
    exit
  end
  sort_dataset(dataset) if @shall_we_sort_the_dataset
end

#opnn(i = NAMESPACE) ⇒ Object

#

opnn

#


663
664
665
666
667
668
669
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 663

def opnn(i = NAMESPACE)
  if block_given?
    super(i) { yield }
  else
    super(i)
  end
end

#prepend_this_to_dataset(i = :bachelor_biologie_basisblock_curriculum) ⇒ Object

#

prepend_this_to_dataset

An Array can be given to this method. If a symbol is given, such as :bachelor_lbt, then that symbol will be treated in a special way as far as this method is concerned.

#


273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 273

def prepend_this_to_dataset(
    i = :bachelor_biologie_basisblock_curriculum
  )
  original_input = i.dup
  if i.is_a? Symbol
    # ===================================================================== #
    # Here we will handle input such as :bachelor_lbt.
    # ===================================================================== #
    i = return_curriculum_file_based_on_this_input(i)
  end
  if i.is_a? Array
    i.flatten.each {|entry| prepend_this_to_dataset(entry) }
  else
    if i.nil?
      e 'A nil value was encountered, onto the method called '+
        steelblue('prepend_this_dataset()')+'.'
      e 'The original input was: '+
        royalblue(original_input.to_s)
    elsif File.exist? i # Read in existing files.
      array = obtain_sanitized_dataset_from(i)
      @dataset = array+@dataset
      @dataset.flatten!
      exclude_title_entries_from_the_main_dataset
    # ===================================================================== #
    # The next check is for ad-hoc addition of lectures, such as via:
    #   ['892100 Physik (KTWW+HNT)']
    # ===================================================================== #
    elsif is_this_a_registered_lecture? i
      @dataset << i
    else
      opnn; e "No file exists at #{sfile(i)}."
    end
  end
end

#read_from_these_files?Boolean Also known as: loaded_from_which_file?, curriculum_file?, curriculum_file_location?, curriculum_file_location, curriculum?

#

read_from_these_files?

#

Returns:

  • (Boolean)


348
349
350
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 348

def read_from_these_files?
  @read_from_these_files # This also means to keep track of the position of the curriculum-file.
end

#read_in_dataset_from_this_file(i) ⇒ Object

#

read_in_dataset_from_this_file

Input to this method should be a String, not an Array.

#


91
92
93
94
95
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 91

def read_in_dataset_from_this_file(i)
  @dataset << obtain_sanitized_dataset_from(i)
  @dataset.flatten!
  check_for_title_entry_in_the_file(i)
end

#read_in_main_dataset_from_the_existing_files(i = @read_from_these_files) ⇒ Object

#

read_in_main_dataset_from_the_existing_files

This method will read in from an Array, which is usually stored in the instance variables @read_from_these_files.

Input to this method can be like this:

["/Programs/Ruby/2.5.1/lib/ruby/site_ruby/2.5.0/studium/yaml/curricula/master_bioinformatik_066875.yml"]
#


367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 367

def read_in_main_dataset_from_the_existing_files(
    i = @read_from_these_files
  )
  if i
    i.each {|this_file|
      # =================================================================== #
      # The next method will read into the variable @dataset.
      # =================================================================== #
      if File.exist? this_file.to_s
        read_in_dataset_from_this_file(this_file) # Delegate to this method.
      else
        opnn; e "Can not read from non-existing file "\
                "`#{sfile(this_file)}`."
        opnn; e 'The original input to the method '+
                sfancy(__method__.to_s)+' was '+
                sfancy(i)+' (class '+i.to_s+')'
        opnn; e 'The '+orange('caller-stack')+' will be shown next:'
        e
        pp caller()
        e
        exit
      end
    }
  end
end

#report_how_many_ects_points_are_in_this_curriculumObject

#

report_how_many_ects_points_are_in_this_curriculum

#


182
183
184
185
186
187
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 182

def report_how_many_ects_points_are_in_this_curriculum
  if @do_report
    e return_how_many_ects_points_this_curriculum_has_in_total
    e
  end
end

#report_how_many_ects_points_have_been_passed_alreadyObject

#

report_how_many_ects_points_have_been_passed_already

#


47
48
49
50
51
52
53
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 47

def report_how_many_ects_points_have_been_passed_already
  array = return_how_many_ects_points_have_been_passed_already
  e array.first
  e
  e array.last
  e
end

#report_how_many_exams_have_been_passed_alreadyObject

#

report_how_many_exams_have_been_passed_already

To invoke this method try:

emo --agrarwissenschaften
#


63
64
65
66
67
68
69
70
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 63

def report_how_many_exams_have_been_passed_already
  n_lectures_are_in_this_curriculum = n_lectures_in_this_curriculum?
  opnn; e sfancy(@n_lectures_are_already_solved.to_s)+' lectures have '\
          'already been passed out'
  opnn; e 'of a total '+
          slateblue(n_lectures_are_in_this_curriculum.to_s)+', in '\
          'the curriculum '+simp(title?.to_s)+'.'
end

#report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solvedObject

#

report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved

#


199
200
201
202
203
204
205
206
207
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 199

def report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
  array = return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
  if @do_report
    e
    e array[0]
    e array[1]
    e
  end
end

#report_the_average_gradeObject

#

report_the_average_grade

#


110
111
112
113
114
115
116
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 110

def report_the_average_grade
  if @do_report
    average_grade = return_the_average_grade
    e "The #{gold('average grade')} is: #{sfancy(average_grade)}"
    e
  end
end

#report_the_university_attributionObject

#

report_the_university_attribution

This method will report the university-attribution of that curriculum.

#


384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 384

def report_the_university_attribution
  require 'studium/toplevel_methods/report_n_ects_per_university.rb'
  # ======================================================================= #
  # We must build up our main Hash next. That Hash should look e. g.
  # like this:
  #
  #   {
  #     "TU Wien"=>115.5,
  #     "Uni Wien"=>30.0,
  #     "BOKU Wien"=>26.0,
  #     "Vetmed Wien"=>8.5
  #   }
  #
  # ======================================================================= #
  sanitize_the_dataset
  hash = {}
  @dataset.each {|entry|
    pointer = @lecture_dataset[entry]
    if pointer
      n_ects = pointer[:ects]
      this_university = pointer[:university]
      if hash.has_key? this_university
        hash[this_university] += n_ects
      else
        hash[this_university] = n_ects
      end
    else
      e steelblue('No entry found for ')+
        royalblue(entry.to_s)
    end
    
  }
  Studium.report_n_ects_per_university(hash, n_ects_points_in_total?)
end

#report_title(this_title = @title) ⇒ Object Also known as: display_the_name_of_the_curriculum

#

report_title

Use this method to report the title of the Curriculum at hand.

#


611
612
613
614
615
616
617
618
619
620
621
622
623
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 611

def report_title(
    this_title = @title
  )
  if this_title
    e; e springgreen(this_title); e
  else
    opnn; e 'No title was set via @title. This is '\
            'currently disallowed, so we exit now.'
    opnn; e "The file to read from was `"\
            "#{sfancy(@read_from_this_file)}`."
    exit
  end
end

#resetObject

#

reset

#


12
13
14
15
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/reset.rb', line 12

def reset
  super()
  is_bachelor_curriculum # ← This is just to set a default.
  # ======================================================================= #
  # === @lecture_dataset
  #
  # This variable keeps track of all registered lectures at the
  # universities.
  # ======================================================================= #
  @lecture_dataset = return_dataset_from_the_file_lecture_information
  # ======================================================================= #
  # === @this_curriculum_has_n_ects_points_in_total
  # ======================================================================= #
  @this_curriculum_has_n_ects_points_in_total = 0
  # ======================================================================= #
  # === @n_ects_were_passed_so_far
  # ======================================================================= #
  @n_ects_were_passed_so_far = 0
  # ======================================================================= #
  # === @shall_we_sort_the_dataset
  # ======================================================================= #
  @shall_we_sort_the_dataset = true # ← Whether to sort the dataset or not.
  # ======================================================================= #
  # === @dataset
  # ======================================================================= #
  @dataset = []
  # ======================================================================= #
  # === @title
  #
  # Which title to use for this curriculum.
  # ======================================================================= #
  @title = nil
  # ======================================================================= #
  # === @hash_containing_the_lectures_for_this_curriculum
  #
  # The following hash will contain the lectures that are used for
  # the curriculum. Specifically it will be used to autogenerate the
  # .html file.
  # ======================================================================= #
  @hash_containing_the_lectures_for_this_curriculum = {}
  # ======================================================================= #
  # === @individual_curriculum
  #
  # The following variable determines whether this lecture is an
  # individual curriculum or whether it is not.
  # ======================================================================= #
  @individual_curriculum = false
  # ======================================================================= #
  # === @show_next_exams
  # ======================================================================= #
  @show_next_exams = true
  # ======================================================================= #
  # === @n_lectures_are_already_solved
  # ======================================================================= #
  @n_lectures_are_already_solved = 0
  # ======================================================================= #
  # Next, determine from which files we will read.
  # ======================================================================= #
  determine_from_which_files_to_read
  # ======================================================================= #
  # === @array_storing_the_grades
  # ======================================================================= #
  @array_storing_the_grades = []
  # ======================================================================= #
  # === @generate_html_file
  #
  # If the following variable is true then this class will additionally
  # generate a .html file.
  # ======================================================================= #
  @generate_html_file = true
  # ======================================================================= #
  # === @mode
  #
  # The @mode can be :commandline or :www.
  # ======================================================================= #
  @mode = :commandline
  # ======================================================================= #
  # === @show_loaded_from_which_file
  # ======================================================================= #
  @show_loaded_from_which_file = true
  # ======================================================================= #
  # === @do_report
  # ======================================================================= #
  @do_report = true
  # ======================================================================= #
  # === @show_all_URLs
  # ======================================================================= #
  @show_all_URLs = false
  # ======================================================================= #
  # === @html_string
  # ======================================================================= #
  @html_string = nil
  # ======================================================================= #
  # === @show_to_which_universities_the_lectures_belong_to
  #
  # By default we will not show to which university the given lectures
  # belong to.
  # ======================================================================= #
  @show_to_which_universities_the_lectures_belong_to = false
  # ======================================================================= #
  # === @append_this_string_onto_the_html_string
  #
  # The following instance variable can be used to append more onto
  # the main HTML string.
  # ======================================================================= #
  @append_this_string_onto_the_html_string = ''.dup
end

#return_and_check_file_for_this_curriculum(i) ⇒ Object

#

return_and_check_file_for_this_curriculum

The reason we have this method here is so that we can intercept individual curricula. If it is an individual curriculum then we will also show the university-attribution in the generated .html file.

#


17
18
19
20
21
22
23
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 17

def return_and_check_file_for_this_curriculum(i)
  if i.to_s.include?('individuelles_curriculum') or
     i.to_s.include?('vector') # Special exception.
    do_show_lecture_attribution_to_universities
  end
  return_file_for_this_curriculum(i) # ← in studium/base/curriculum.rb
end

#return_arrow_pointing_to_the_right_side(optional_margin_left = nil) ⇒ Object

#

return_arrow_pointing_to_the_right_side

#


42
43
44
45
46
47
48
49
50
51
52
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 42

def return_arrow_pointing_to_the_right_side(
    optional_margin_left = nil
  )
  if optional_margin_left
    '<img src="/home/x/DATA/images/STD/PFEIL6_red.png" style="margin-left:'+
    optional_margin_left.to_s+
    '">'.dup
  else
    '<img src="/home/x/DATA/images/STD/PFEIL6_red.png">'.dup
  end
end

#return_bachelor_or_master_logo(this_lecture = nil) ⇒ Object

#

Here we differ between bachelor-logo and the master-logo.

By default, we will operate on @type_of_the_curriculum, but this can be wrong in a mixed bachelor-master curriculum.

#


584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 584

def (
    this_lecture = nil
  )
  if this_lecture.nil?
    case @type_of_the_curriculum
    when :bachelor
      BACHELOR_IMAGE
    when :master
      MASTER_IMAGE
    end
  else
    # ===================================================================== #
    # Else assume an Array was given.
    # ===================================================================== #
    if this_lecture.any? {|entry| entry.start_with?('033') }
      BACHELOR_IMAGE
    else
      MASTER_IMAGE
    end
  end
end

#return_how_many_ects_points_have_been_passed_already(use_for = @mode) ⇒ Object

#

return_how_many_ects_points_have_been_passed_already

#


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
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 16

def return_how_many_ects_points_have_been_passed_already(
    use_for = @mode
  )
  n_percent = (
    (@n_ects_were_passed_so_far.to_f * 100) / n_ects_points_in_total?
  ).round(2)
  # ======================================================================= #
  # The next variable is not colourized by default, so that we can use
  # it for the :use_for_html entry point that will come next. A similar
  # reason is valid for the variable called `second_part`.
  # ======================================================================= #
  colourized_n_ECTS_points_were_passed = @n_ects_were_passed_so_far.to_s
  second_part = "  <b>#{@title}</b>."
  case use_for
  when :use_for_html # (html tag, www tag)
    first_part = "In total we have passed <b>#{colourized_n_ECTS_points_were_passed} ECTS "\
                 "points</b> (<b>#{n_percent.to_s+'%'}</b>) so far in the"
  when :commandline, :default # This is the default.
    colourized_n_ECTS_points_were_passed = plum(
      colourized_n_ECTS_points_were_passed
    )
    first_part = "In total we have passed #{colourized_n_ECTS_points_were_passed} ECTS "\
                 "points (#{orangered(n_percent.to_s+'%')}) so far in the"
    second_part = "  #{sfancy(@title)}."
  end
  [ first_part, second_part ]
end

#return_how_many_ects_points_this_curriculum_has_in_total(use_colours = true) ⇒ Object

#

return_how_many_ects_points_this_curriculum_has_in_total

#


283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
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
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 283

def return_how_many_ects_points_this_curriculum_has_in_total(
    use_colours = true
  )
  case use_colours
  when :no_colours
    use_colours = false
  end
  n_ects_points = @this_curriculum_has_n_ects_points_in_total
  # ======================================================================= #
  # Use colours, if issued to do so. On the commandline, this will
  # be the tomato colour.
  # ======================================================================= #
  if use_colours
    n_ects_points = tomato(n_ects_points)
  else
    n_ects_points = "<b>#{n_ects_points}</b>" # In this case we will assume www-use.
  end
  # ======================================================================= #
  # Next, return the Strings that informs the user how many ECTS points
  # the given curriculm has, in total. Since as of November 2019, we
  # will also inform the user how many of these ECTS require a
  # continuous mandatory assessment ("prüfungsimmanent").
  # ======================================================================= #
  n_ects_prüfungsimmanent = 0
  @dataset.each {|line|
    # ===================================================================== #
    # A line may look like this:
    #
    #   182.711 Betriebssysteme                            # 2.0 ECTS, VO
    #
    # ===================================================================== #
    name = line.dup
    if name.include? '#'
      name = name[0 .. (name.index('#') - 1)]
      name.strip!
      # =================================================================== #
      # Must still squeeze a bit:
      # =================================================================== #
      name.squeeze!(' ')
      if @lecture_dataset.has_key? name
        pointer = @lecture_dataset[name]
        n_ects  = pointer[:ects].to_f
        type    = pointer[:type]
        if is_prüfungsimmanent?(type)
          n_ects_prüfungsimmanent += n_ects
        end
      end
    end
  }
  n_percent_prüfungsimmanent = ((
    n_ects_prüfungsimmanent.to_f * 100.0
  ) / @this_curriculum_has_n_ects_points_in_total.to_f).round(1)
  colourized_n_ects_prüfungsimmanent =
    skyblue(n_percent_prüfungsimmanent.to_s.dup)
  "This curriculum has #{n_ects_points} ECTS points "\
  "in total, of which "\
  "#{colourized_n_ects_prüfungsimmanent} ECTS "\
  "("+n_percent_prüfungsimmanent.to_s+"%)\n"\
  "require continuous mandatory assessment "\
  "(#{orangered('prüfungsimmanent')})."
end

#return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved(optional_use_colours = true) ⇒ Object

#

return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved

This method will return an Array with two members. The reason for this is that it is easier on the commandline to output two Arrays; and to also use this when we autogenerate a .html file.

#


199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 199

def return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved(
    optional_use_colours = true
  )
  n_percent = (
    (@n_lectures_are_already_solved.to_i * 100) / @dataset.size.to_f
  ).round(1)
  case optional_use_colours # Use colours in this case.
  when :use_for_html # (html tag, www tag)
    colourized_n_percent_finished = ' (<b>'+n_percent.to_s+'% finished'+'</b>)'
    first_part = "A total of <b>#{@dataset.size.to_s}</b> lectures are part of this Curriculum."
    second_part = "<b>#{@n_lectures_are_already_solved.to_s}</b> of these "\
                  "are already solved.#{colourized_n_percent_finished}"
  when :no_colours, false
    colourized_n_percent_finished = ' ('+n_percent.to_s+'% finished'+')'
    first_part = "A total of #{@dataset.size.to_s} lectures are part of this Curriculum."
    second_part = "#{@n_lectures_are_already_solved.to_s} of these "\
                  "are already solved.#{colourized_n_percent_finished}"
  else # This here is the default clause.
    colourized_n_percent_finished = ' ('+orangered(n_percent.to_s+'% finished')+')'
    first_part = "A total of #{springgreen(@dataset.size.to_s)} "\
                 "lectures are part of this Curriculum."
    second_part = "#{springgreen(@n_lectures_are_already_solved.to_s)} of these "\
                  "are already solved.#{colourized_n_percent_finished}"
  end
  [ first_part, second_part ]
end

#return_proper_logo_for_this_university(i) ⇒ Object

#

return_proper_logo_for_this_university

#


422
423
424
425
426
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 422

def return_proper_logo_for_this_university(
    i
  )
  Studium.return_proper_university_image(i)
end

#return_the_average_gradeObject

#

return_the_average_grade

This method will return the average grade. So for example, if we have passed three exams, with a grade of 2, 3 and 4, respectively, then the average grade will be 2 + 3 + 4 = 9 / 3 → 3.

#


254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 254

def return_the_average_grade
  # ======================================================================= #
  # We must work on a copy, because some grades, such as '+', are not
  # useful for calculating the average grade - hence we will have to
  # weed these entries out, for the purpose of calculating the
  # average grade through this method here.
  # ======================================================================= #
  array_storing_the_grades = @array_storing_the_grades.dup
  array_storing_the_grades.reject! {|grade|
    grade == '+' or grade == 'E' # Remove '+' and 'E' exam results.
  }
  average_grade = (
    array_storing_the_grades.sum.to_f / array_storing_the_grades.size
  ).round(2)
  return average_grade
end

#return_timetable_of_upcoming_examsObject

#

return_timetable_of_upcoming_exams

This method is for the display of a HTML timetable <div> element.

It will be near the bottom part of the auto-generated .html file, if we actually wish to generate a .html file.

#


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 74

def return_timetable_of_upcoming_exams
  # ======================================================================= #
  # The dataset consists of the lectures that are part of this curriculum.
  # ======================================================================= #
  new_hash = {}
  dataset = @hash_containing_the_lectures_for_this_curriculum
  # ======================================================================= #
  # We have to time-sort this.
  # ======================================================================= #
  dataset = dataset.sort_by {|name_of_the_lecture, inner_hash|
    if inner_hash.has_key? 'exams'
      exams = inner_hash['exams']
      if exams.is_a? Array
        exams = exams.first
        if exams.include? ', '
          exams = exams.split(', ').first.strip
        end
      end
    else
      exams = '01.01.2500' # <- Fake time stamp.
    end
    if exams.empty?
      exams = '01.01.2500' # <- Fake time stamp.
    end
    Time.parse(exams)
  }
  dataset.each {|inner_array|
    key   = inner_array.first
    value = inner_array.last
    new_hash[key] = value
  }
  Studium.return_div_timetable_of_upcoming_exams(dataset)
end

#runObject

#

run (run tag)

The menu() method has to come before any other methods here.

#


34
35
36
37
38
39
40
41
42
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/run.rb', line 34

def run
  menu # First, pass the commandline into the menu-method.
  read_in_main_dataset_from_the_existing_files
  if commandline?
    try_to_rename_kde_konsole_tab
    report_title
  end
  do_all_actions_after_the_main_dataset_was_read_in # Continue here.
end

#sanitize_the_datasetObject

#

sanitize_the_dataset

#


527
528
529
530
531
532
533
534
535
536
537
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 527

def sanitize_the_dataset
  @dataset.map! {|entry|
    entry = entry.dup if entry.frozen?
    entry.squeeze!(' ')
    if entry.include? '#'
      entry = entry[0 .. (entry.index('#')-1)]
    end
    entry.strip!
    entry
  }
end

#set_commandline_arguments(i) ⇒ Object

#

set_commandline_arguments

#


229
230
231
232
233
234
235
236
237
238
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 229

def set_commandline_arguments(i)
  # ======================================================================= #
  # We will handle empty Arrays a bit differently if we are on
  # a roebe-system.
  # ======================================================================= #
  if i.is_a?(Array) and i.empty?
    i << :bachelor_vektorx # Set a default value here.
  end
  @commandline_arguments = i
end

#set_dataset(i) ⇒ Object Also known as: set_all_lectures

#

set_dataset

#


243
244
245
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 243

def set_dataset(i)
  @dataset = i
end

#set_html_string(i) ⇒ Object

#

set_html_string

#


111
112
113
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 111

def set_html_string(i)
  @html_string = i.to_s.dup
end

#set_title(i) ⇒ Object Also known as: set_title_of_the_curriculum

#

set_title

The title of the Curriculum in question. Should be hardcoded in the file.

#


631
632
633
634
635
636
637
638
639
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 631

def set_title(i)
  i = i.first if i.is_a? Array
  i = i.dup.delete(N) # Want to work on a String really.
  if i.start_with? '# ==='
    i.sub!(/^# === /,'')
  end
  i.sub!(/^@title /,'') if i.include? '@title '
  @title = i.strip.chomp
end

#show_available_curriculaObject

#

show_available_curricula

This method will show the available Curricula.

Invocation example:

studium_solved --show-available
#


43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 43

def show_available_curricula
  e 'These curricula are available:'
  e
  Studium.return_array_location_of_all_registered_curricula.each {|entry|
    if entry.is_a? Array
      entry.each {|inner_entry|
        e "  #{sfancy(File.basename(inner_entry).sub(/\.yml$/,''))}"
      }
    else
      e "  #{sfancy(File.basename(entry).sub(/\.yml$/,'').strip)}"
    end
  }; e
end

#show_helpObject

#

show_help (help tag)

The help options for class Studium::ShowLecturesOnTheCommandline are stored in this method here.

To invoke this method, do:

show_lectures_on_the_commandline --help
#


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/help.rb', line 22

def show_help
  e
  opnn { :no_trailing_colon }
  help_string = <<-EOF


The following help-options are available and documented:

EOF
  e help_string
  ecomment "  #{slateblue('--available-curricula?')}         # show "\
           "which curricula are available"
  ecomment "  #{slateblue('--do-not-show-upcoming-exams')}   # Do not show upcoming exams"
  ecomment "  #{slateblue('--show-all-URLs')}                # Also "\
           "show remote URLs of already solved lectures"
  ecomment "  #{slateblue('--priority-points')}              # Display "\
           "a curriculum based on priority points"
  ecomment "  #{slateblue('--use-this-curriculum=foo.md')}   # use "\
           "this curriculum as specified in the file"
  e
end

#show_important_files(use_this_file = FILE_LECTURE_INFORMATION) ⇒ Object

#

show_important_files

This method will show the file that has all lectures registered.

Usage example:

curriculum --files?
#


24
25
26
27
28
29
30
31
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 24

def show_important_files(
    use_this_file = FILE_LECTURE_INFORMATION
  )
  e "The following file is the most important file by far:"
  e
  e "  #{sfile(use_this_file)}"
  e
end

#show_loaded_from_which_file?Boolean

#

show_loaded_from_which_file?

#

Returns:

  • (Boolean)


175
176
177
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 175

def show_loaded_from_which_file?
  @show_loaded_from_which_file
end

#sort_dataset(i = @dataset) ⇒ Object

#

sort_dataset

This method will sort the dataset, according to the name of the lecture rather than the leading ID number.

#


545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 545

def sort_dataset(
    i = @dataset
  )
  i.sort_by! {|line|
    # ===================================================================== #
    # The next line will split on ' ' tokens, take all but the first
    # entry, rejoin, strip and delete '(' tokens. So essentially we
    # will strip away the leading numbers from the line at hand.
    # ===================================================================== #
    line.split(' ')[1 .. -1].join(' ').strip
  }
end

#starts_with_a_lecture_id_entry?(i) ⇒ Boolean

#

starts_with_a_lecture_id_entry?

#

Returns:

  • (Boolean)


561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 561

def starts_with_a_lecture_id_entry?(i)
  result = false
  if i.include? ' '
    splitted = i.split(' ')
    first_entry = splitted.first
    # ===================================================================== #
    # See: https://rubular.com/r/EKEk3QuWRQ1s
    # ===================================================================== #
    if first_entry =~ /^\d+\.?[A-Z]*\d{1,4}$/
      result = true
    end
  end
  result
end

#title?Boolean Also known as: return_name_of_the_curriculum, name_of_the_curriculum, name_of_the_curriculum?

#

title?

#

Returns:

  • (Boolean)


507
508
509
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 507

def title?
  @title
end

#try_to_rename_kde_konsole_tab(use_this_title = return_name_of_the_curriculum) ⇒ Object

#

try_to_rename_kde_konsole_tab

This method can be used to rename the KDE Konsole tab.

#


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/konsole.rb', line 16

def try_to_rename_kde_konsole_tab(
    use_this_title = return_name_of_the_curriculum
  )
  if rename_konsole_tab?
    begin
      require 'roebe/requires/require_kde_konsole.rb'
      Roebe::KdeKonsole.new(use_this_title) { :be_quiet }
    rescue LoadError
      if is_on_roebe?
        e "The #{steelblue('class Roebe::KdeKonsole')} is not "\
          "available. Install the roebe-gem."
      end
    end
  end
end

#type_of_the_curriculum?Boolean Also known as: curriculum_type?

#

type_of_the_curriculum?

#

Returns:

  • (Boolean)


240
241
242
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 240

def type_of_the_curriculum?
  @type_of_the_curriculum
end

#uniq_the_datasetObject

#

uniq_the_dataset

This ad-hoc method will simply eliminate all the duplicates that may exist in the main dataset at hand. It is only called from within menu() right now (December 2019).

#


520
521
522
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 520

def uniq_the_dataset
  @dataset.uniq!
end

#use_bachelor_agrarwissenschaften_curriculumObject

#

use_bachelor_agrarwissenschaften_curriculum

#


500
501
502
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 500

def use_bachelor_agrarwissenschaften_curriculum
  determine_from_which_file_to_read(:bachelor_agrarwissenschaften_curriculum)
end

#use_bachelor_bioinformatik_und_molekulare_biotechnologieObject

#

use_bachelor_bioinformatik_und_molekulare_biotechnologie

#


619
620
621
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 619

def use_bachelor_bioinformatik_und_molekulare_biotechnologie
  determine_from_which_file_to_read(:bachelor_bioinformatik_und_biotechnologie)
end

#use_bachelor_biologie_basisblock_curriculumObject

#

use_bachelor_biologie_basisblock_curriculum

#


563
564
565
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 563

def use_bachelor_biologie_basisblock_curriculum
  determine_from_which_file_to_read(:bachelor_basisblock_biologie)
end

#use_bachelor_biologische_informatikObject

#

use_bachelor_biologische_informatik

#


42
43
44
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 42

def use_bachelor_biologische_informatik
  determine_from_which_file_to_read(:bachelor_biologische_informatik)
end

#use_bachelor_botanik_curriculumObject

#

use_bachelor_botanik_curriculum

#


514
515
516
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 514

def use_bachelor_botanik_curriculum
  determine_from_which_file_to_read(:bachelor_botanik_curriculum)
end

#use_bachelor_chemie_curriculumObject

#

use_bachelor_chemie_curriculum

#


542
543
544
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 542

def use_bachelor_chemie_curriculum
  determine_from_which_file_to_read(:bachelor_chemie_curriculum)
end

#use_bachelor_dummy_curriculumObject

#

use_bachelor_dummy_curriculum

#


35
36
37
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 35

def use_bachelor_dummy_curriculum
  determine_from_which_file_to_read(:bachelor_dummy_curriculum)
end

#use_bachelor_ernährung_curriculumObject

#

use_bachelor_ernährung_curriculum

#


400
401
402
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 400

def use_bachelor_ernährung_curriculum
  determine_from_which_file_to_read(:bachelor_ernährung_curriculum)
end

#use_bachelor_forstwirtschaftObject

#

use_bachelor_forstwirtschaft

#


626
627
628
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 626

def use_bachelor_forstwirtschaft
  determine_from_which_file_to_read(:bachelor_forstwirtschaft)
end

#use_bachelor_genetik_curriculumObject

#

use_bachelor_genetik_curriculum

#


521
522
523
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 521

def use_bachelor_genetik_curriculum
  determine_from_which_file_to_read(:bachelor_genetik_curriculum)
end

#use_bachelor_informatik_curriculumObject

#

use_bachelor_informatik_curriculum

#


486
487
488
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 486

def use_bachelor_informatik_curriculum
  determine_from_which_file_to_read(:bachelor_informatik_curriculum)
end

#use_bachelor_ktww_curriculumObject

#

use_bachelor_ktww_curriculum

#


605
606
607
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 605

def use_bachelor_ktww_curriculum
  determine_from_which_file_to_read(:bachelor_boku_ktww_curriculum)
end

#use_bachelor_lmbt_curriculumObject

#

use_bachelor_lmbt_curriculum

#


493
494
495
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 493

def use_bachelor_lmbt_curriculum
  determine_from_which_file_to_read(:bachelor_boku_lmbt_curriculum)
end

#use_bachelor_master_tu_wien_curriculumObject

#

use_bachelor_master_tu_wien_curriculum

#


507
508
509
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 507

def use_bachelor_master_tu_wien_curriculum
  determine_from_which_file_to_read(:bachelor_master_tu_wien)
end

#use_bachelor_medizinische_informatik_curriculumObject

#

use_bachelor_medizinische_informatik_curriculum

#


472
473
474
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 472

def use_bachelor_medizinische_informatik_curriculum
  determine_from_which_file_to_read(:bachelor_medizinische_informatik_curriculum)
end

#use_bachelor_molbio_curriculumObject

#

use_bachelor_molbio_curriculum

#


577
578
579
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 577

def use_bachelor_molbio_curriculum
  determine_from_which_file_to_read(:bachelor_molekulare_biologie_curriculum)
end

#use_bachelor_molekularbiologie_curriculumObject Also known as: use_bachelor_molekularbiologie_graz_curriculum

#

use_bachelor_molekularbiologie_curriculum

#


414
415
416
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 414

def use_bachelor_molekularbiologie_curriculum
  determine_from_which_file_to_read(:bachelor_molekularbiologie_graz_curriculum)
end

#use_bachelor_pharmazie_curriculumObject

#

use_bachelor_pharmazie_curriculum

#


407
408
409
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 407

def use_bachelor_pharmazie_curriculum
  determine_from_which_file_to_read(:bachelor_pharmazie_curriculum)
end

#use_bachelor_technical_chemistry_curriculumObject

#

use_bachelor_technical_chemistry_curriculum

#


584
585
586
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 584

def use_bachelor_technical_chemistry_curriculum
  determine_from_which_file_to_read(:technical_chemistry_curriculum)
end

#use_bachelor_ubrm_curriculumObject

#

use_bachelor_ubrm_curriculum

#


598
599
600
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 598

def use_bachelor_ubrm_curriculum
  determine_from_which_file_to_read(:bachelor_boku_ubrm_curriculum)
end

#use_bachelor_vektor_curriculumObject

#

use_bachelor_vektor_curriculum

This method is to be used to read from the bachelor-vektorx curriculum.

#


59
60
61
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 59

def use_bachelor_vektor_curriculum
  determine_from_which_file_to_read(:bachelor_vektor_curriculum)
end

#use_bachelor_verfahrenstechnik_curriculumObject

#

use_bachelor_verfahrenstechnik_curriculum

#


591
592
593
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 591

def use_bachelor_verfahrenstechnik_curriculum
  determine_from_which_file_to_read(:bachelor_verfahrenstechnik_curriculum)
end

#use_bachelor_ökologie_curriculumObject

#

use_bachelor_ökologie_curriculum

#


479
480
481
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 479

def use_bachelor_ökologie_curriculum
  determine_from_which_file_to_read(:bachelor_ökologie_curriculum)
end

#use_master_bioinformatics_and_molecular_biotechnologyObject

#

use_master_bioinformatics_and_molecular_biotechnology

#


49
50
51
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 49

def use_master_bioinformatics_and_molecular_biotechnology
  determine_from_which_file_to_read(:master_bioinformatics_and_molecular_biotechnology)
end

#use_master_biologische_chemie_curriculumObject

#

use_master_biologische_chemie_curriculum

#


421
422
423
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 421

def use_master_biologische_chemie_curriculum
  determine_from_which_file_to_read(:master_biologische_chemie_curriculum)
end

#use_master_dummy_curriculumObject

#

use_master_dummy_curriculum

#


28
29
30
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 28

def use_master_dummy_curriculum
  determine_from_which_file_to_read(:master_dummy_curriculum)
end

#use_master_immunobiology_curriculumObject

#

use_master_immunobiology_curriculum

#


556
557
558
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 556

def use_master_immunobiology_curriculum
  determine_from_which_file_to_read(:master_immunobiology_curriculum)
end

#use_master_lmbt_curriculumObject

#

use_master_lmbt_curriculum

#


428
429
430
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 428

def use_master_lmbt_curriculum
  determine_from_which_file_to_read(:master_lmbt_curriculum)
end

#use_master_molbio_curriculumObject

#

use_master_molbio_curriculum

#


528
529
530
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 528

def use_master_molbio_curriculum
  determine_from_which_file_to_read(:master_molbio_curriculum)
end

#use_master_pharmazie_curriculumObject

#

use_master_pharmazie_curriculum

#


549
550
551
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 549

def use_master_pharmazie_curriculum
  determine_from_which_file_to_read(:master_pharmazie_curriculum)
end

#use_master_vektoren_curriculumObject

#

use_master_vektoren_curriculum

#


633
634
635
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 633

def use_master_vektoren_curriculum
  determine_from_which_file_to_read(:master_vektoren_curriculum)
end

#use_mikrobiologie_individuelles_curriculumObject Also known as: use_mikrobiologie_curriculum

#

use_mikrobiologie_individuelles_curriculum

#


612
613
614
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 612

def use_mikrobiologie_individuelles_curriculum
  determine_from_which_file_to_read(:bachelor_mikrobiologie_individuelles_curriculum)
end

#use_priority_pointsObject

#

use_priority_points

This will use priority_points as dataset.

Invocation example:

ShowLecturesOnTheCommandline --priority-points
#


361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 361

def use_priority_points
  _ = main_dataset?
  _.select! {|a,b|
    b.has_key? :priority_points
  }
  is_master_curriculum # ← Hardcoded for now.
  do_not_read_in_from_a_file
  set_title 'Custom individual curriculum based on priority points'
  # ======================================================================= #
  # We only need to use the names of the lectures, hence why we will
  # use the method .keys().
  # ======================================================================= #
  set_all_lectures(_.keys)
end

#use_tu_master_biotechnology_curriculumObject

#

use_tu_master_biotechnology_curriculum

#


570
571
572
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 570

def use_tu_master_biotechnology_curriculum
  determine_from_which_file_to_read(:master_tu_vienna_biotechnology_curriculum)
end

#use_uni_vienna_master_bioinformatics_curriculumObject

#

use_uni_vienna_master_bioinformatics_curriculum

#


535
536
537
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 535

def use_uni_vienna_master_bioinformatics_curriculum
  determine_from_which_file_to_read(:master_bioinformatik_curriculum)
end

#use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculumObject

#

use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum

#


451
452
453
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 451

def use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum
  determine_from_which_file_to_read(:master_genetik_und_entwicklungsbiologie_curriculum)
end