Class: Cyberweb::ObtainFilesAndDirectoriesFromThisPath
- Inherits:
-
Base
- Object
- Base
- Cyberweb::ObtainFilesAndDirectoriesFromThisPath
show all
- Includes:
- HtmlTags
- Defined in:
- lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb
Overview
Cyberweb::ObtainFilesAndDirectoriesFromThisPath
Constant Summary
collapse
- FONT_SIZE_TO_USE =
'1.3em'
- SHALL_WE_DEBUG =
#
SHALL_WE_DEBUG
Whether we debug this class or not.
#
false
- ARRAY_IMAGES =
#
ARRAY_IMAGES
All valid image-formats should be denoted into this Array.
#
::Cyberweb::ARRAY_IMAGES
- INFO_DIRECTORY =
#
INFO_DIRECTORY
This is the base directory where to store, unless we use Dir.pwd.
#
'/Depot/Information/'
- HTML =
'.html'
- BE_VERBOSE =
true
- THESE_CSS_CLASSES_ARE_KNOWN_TO_THE_RENDERED_TEMPLATE =
#
THESE_CSS_CLASSES_ARE_KNOWN_TO_THE_RENDERED_TEMPLATE
#
'pad6px BOLD marl2em pad12px BG_Black '\
'rounded_border rounded_corner marr10px '\
'round_black1 round_black2 round_black3 '+
Cyberweb.array_all_html_colours?.join(' ').rstrip
"
#top_header {
border: 2px solid #73AD21;
border-radius: 22px;
padding: 18px;
width: 500px;
height: 140px;
margin-bottom: 1.5em;
margin-left: 8%;
width: 60%;
}
.common_border {
border: 2px solid #73AD21;
border-radius: 22px;
}
a:hover {
color: lightgreen;
}
"
- DEFAULT_CSS_STYLE_FOR_HYPERLINKS =
#
DEFAULT_CSS_STYLE_FOR_HYPERLINKS
#
'
a:link,
a:visited { text-decoration: none; color: gold; }
a:hover { text-decoration: none; color: lightblue; }
'
- IMG_CSS_STYLE =
#
IMG_CSS_STYLE
Determine the default css-rules for each <img> tag to be used.
#
'border: 1px solid black;
border-radius: 8px;
margin-left: 4.5em;
background-color: black;
padding-left: 6px;'.
delete("\n").squeeze(' ')
Constants inherited
from Base
Base::HOME_DIRECTORY_OF_THE_USER_X, Base::NAMESPACE
Class Method Summary
collapse
-
.[](i = ARGV) ⇒ Object
# === Cyberweb::ObtainFilesAndDirectoriesFromThisPath[] ========================================================================= #.
Instance Method Summary
collapse
-
#add(i) ⇒ Object
(also: #_)
# === add (add tag).
-
#add_date_in_the_lower_part_of_the_webpage? ⇒ Boolean
# === add_date_in_the_lower_part_of_the_webpage? ========================================================================= #.
-
#add_hyperlinks_to_subdirectories? ⇒ Boolean
# === add_hyperlinks_to_subdirectories? ========================================================================= #.
-
#add_the_footer_with_hyperlinks(filter_for = '.html', all_subdirectories = :default, show_how_many_pdf_files_are_in_that_subdirectory = false) ⇒ Object
-
#addnl(i) ⇒ Object
# === addnl ========================================================================= #.
-
#append(i) ⇒ Object
# === append (append tag) ========================================================================= #.
-
#append_to_local_css_style(i) ⇒ Object
# === append_to_local_css_style ========================================================================= #.
-
#be_verbose? ⇒ Boolean
# === be_verbose? ========================================================================= #.
-
#body_css_style? ⇒ Boolean
# === body_css_style? ========================================================================= #.
-
#check_whether_at_the_least_one_argument_was_given_and_then_act_accordingly ⇒ Object
# === check_whether_at_the_least_one_argument_was_given_and_then_act_accordingly ========================================================================= #.
-
#clear_directories ⇒ Object
# === clear_directories ========================================================================= #.
-
#clear_files ⇒ Object
(also: #clear_array)
# === clear_files ========================================================================= #.
-
#colour_for_pdf_files(i) ⇒ Object
# === colour_for_pdf_files ========================================================================= #.
-
#consider_appending_the_jquery_string ⇒ Object
# === consider_appending_the_jquery_string ========================================================================= #.
-
#content_of_the_HTML_page? ⇒ Boolean
(also: #content_of_the_html_page?, #html_content?, #html_string?, #main_string?)
# === content_of_the_HTML_page? ========================================================================= #.
-
#directory_containing_all_files? ⇒ Boolean
(also: #input_directory?, #work_on_which_directory?, #work_on_this_directory?, #which_dir?, #main_directory?, #dir?)
# === directory_containing_all_files? ========================================================================= #.
-
#display_the_top_header? ⇒ Boolean
-
#do_debug ⇒ Object
(also: #debug)
# === do_debug ========================================================================= #.
-
#do_include_subdirectories ⇒ Object
# === do_include_subdirectories ========================================================================= #.
-
#do_make_use_of_a_go_down_one_level_link ⇒ Object
# === do_make_use_of_a_go_down_one_level_link ========================================================================= #.
-
#do_not_include_subdirectories ⇒ Object
# === do_not_include_subdirectories ========================================================================= #.
-
#do_not_use_HTML_table_layout ⇒ Object
# === do_not_use_HTML_table_layout ========================================================================= #.
-
#do_open_the_webpage_if_we_are_on_a_roebe_system(i = save_into_this_local_file? ) ⇒ Object
# === do_open_the_webpage_if_we_are_on_a_roebe_system ========================================================================= #.
-
#do_process_all_entries_from_this_directory(i = :pwd, &block) ⇒ Object
(also: #do_obtain_all_files)
# === do_process_all_entries_from_this_directory.
-
#do_store_the_content(what = content_of_the_HTML_page?, , into = save_into_this_local_file? ) ⇒ Object
(also: #do_create_the_html_page, #do_create_the_HTML_page, #save_what_to, #save_file, #append_everything)
# === do_store_the_content (save tag) ========================================================================= #.
-
#do_traverse_into_subdirectories? ⇒ Boolean
# === do_traverse_into_subdirectories? ========================================================================= #.
-
#do_use_HTML_table_layout ⇒ Object
# === do_use_HTML_table_layout ========================================================================= #.
-
#files? ⇒ Boolean
(also: #array_work_on_these_files?, #array_work_on_these_files, #work_on_which_files?, #all_files?)
# === files? ========================================================================= #.
-
#filter_for_these_files(i, files = ) ⇒ Object
(also: #apply_filter, #do_filter_for)
# === filter_for_these_files (filter tag).
-
#gold(i, optional_css_style = '') ⇒ Object
# === gold ========================================================================= #.
-
#include_subdirectories? ⇒ Boolean
# === include_subdirectories? ========================================================================= #.
-
#initialize(commandline_arguments = ARGV, run_already = true, &block) ⇒ ObtainFilesAndDirectoriesFromThisPath
constructor
# === initialize ========================================================================= #.
-
#make_use_of_a_go_down_one_level_link? ⇒ Boolean
# === make_use_of_a_go_down_one_level_link?.
-
#mediumorchid(i, optional_css_style = '') ⇒ Object
# === mediumorchid ========================================================================= #.
-
#mediumseagreen(i, optional_css_style = '') ⇒ Object
# === mediumseagreen ========================================================================= #.
-
#menu(i = commandline_arguments? ) ⇒ Object
-
#n_rows? ⇒ Boolean
# === n_rows? ========================================================================= #.
-
#olivedrab(i, optional_css_style = '') ⇒ Object
# === olivedrab ========================================================================= #.
-
#paleturquoise(i, optional_css_style = '') ⇒ Object
# === paleturquoise ========================================================================= #.
-
#registered_ids? ⇒ Boolean
# === registered_ids? ========================================================================= #.
-
#report_not_registered_commandline_argument(i) ⇒ Object
# === report_not_registered_commandline_argument ========================================================================= #.
-
#report_scanning_directory(i = work_on_which_directory? ) ⇒ Object
# === report_scanning_directory ========================================================================= #.
-
#reset ⇒ Object
# === reset (reset tag) ========================================================================= #.
-
#return_early_and_late_year_from_this_array(i = array_work_on_these_files? ) ⇒ Object
# === return_early_and_late_year_from_this_array.
-
#return_jquery ⇒ Object
# === return_jquery.
-
#return_the_code_for_going_down_one_level ⇒ Object
# === return_the_code_for_going_down_one_level.
-
#return_the_pretty_name_of_the_webpage ⇒ Object
# === return_the_pretty_name_of_the_webpage.
-
#royalblue(i) ⇒ Object
# === royalblue ========================================================================= #.
-
#run ⇒ Object
# === run (run tag) ========================================================================= #.
-
#save_into_this_local_file? ⇒ Boolean
(also: #title?, #store_where?, #stored_where?, #output_file?, #store_into?, #save_into_which_file?, #save?)
# === save_into_this_local_file? ========================================================================= #.
-
#set_background(i) ⇒ Object
(also: #background)
# === set_background.
-
#set_body_css_style(i) ⇒ Object
# === set_body_css_style ========================================================================= #.
-
#set_content_of_the_html_page(i) ⇒ Object
# === set_content_of_the_html_page ========================================================================= #.
-
#set_directory_containing_all_files(i = :pwd) ⇒ Object
(also: #set_work_on_this_directory, #set_this_dir, #set_main_directory)
# === set_directory_containing_all_files ========================================================================= #.
-
#set_files(i) ⇒ Object
(also: #set_array_work_on_these_files, #work_on_these_files=, #files=)
# === set_files ========================================================================= #.
-
#set_save_into_this_local_file(i = "#{INFO_DIRECTORY}/all_files_from_#{input_directory?}") ⇒ Object
(also: #set_store_where, #store_where, #store_where=, #set_page_name, #set_output_page_here)
# === set_save_into_this_local_file ========================================================================= #.
-
#shall_we_debug? ⇒ Boolean
# === shall_we_debug? ========================================================================= #.
-
#show_help ⇒ Object
# === show_help (help tag).
-
#show_year_in_the_header? ⇒ Boolean
-
#sort_how? ⇒ Boolean
# === sort_how? ========================================================================= #.
-
#use_german? ⇒ Boolean
# === use_german? ========================================================================= #.
-
#use_HTML_table_layout? ⇒ Boolean
(also: #use_html_table_layout?, #use_html_table?, #use_HTML_table?)
# === use_HTML_table_layout? ========================================================================= #.
-
#use_jquery? ⇒ Boolean
# === use_jquery? ========================================================================= #.
-
#use_no_size_value? ⇒ Boolean
# === use_no_size_value? ========================================================================= #.
-
#work_on_video_files_only? ⇒ Boolean
# === work_on_video_files_only? ========================================================================= #.
Methods inherited from Base
#be_verbose, #cascading_style_sheets_directory?, #cd, #commandline_mode?, #copyright?, #css_comment, #delete_directory, #do_toggle, #e, #echo_raw, #filename?, #full_path_to_image_directory?, #html_colours?, #html_image, #htmlentities, #img_dir?, #infer_the_namespace, #initialize_the_configuration, #is_a_file?, #is_a_video_file?, #is_an_image_file?, #is_on_roebe?, #last_tag_used?, #last_tag_used_first_element?, #last_tag_used_id?, #mkdir, #mode?, #namespace?, #open_in_browser, #opne, #opnn, #remove_comments_from_this_string_but_preserve_CSS_rules, #remove_html, #return_all_directories, #return_date, #return_program_name, #return_pwd, #ruby_header?, #server_base_directory?, #set_commandline_mode, #set_last_tag_used, #update_the_image_directory, #use_this_relative_directory_for_custom_images?, #www_mode?
#copy_this_file, #cpr, #delete_file, #filename_without_extension?, #read_file_via_utf8_encoding
Methods included from BaseModule
#attach_these_constants, #base_dir?, #beautiful_url, #cd, #create_the_internal_hash, #doctype?, #ee, #ensure_main_encoding, #esystem, #html_templates, #initialize_the_config_if_the_config_hash_is_empty, #internal_hash?, #log_dir?, #no_http, #random_alphabet_characters, #rarrow?, #rds, #remove_comments_from_this_string, #remove_numbers, #require_the_html_templates, #require_these, #return_file_size_in_kb_of, #return_html_comment, #ruby_sitelib_dir?, #sanitize_this_id, #server_base_directory?, #string_remote_image, #today?, #try_to_require_rack, #try_to_require_the_open_gem, #write_what_into
#content_type_is_html, #content_type_is_jpeg, #content_type_is_json, #content_type_is_plain_text
#append_to_the_commandline_arguments, #commandline_arguments?, #first_argument?, #parse_these_commandline_arguments, #second_argument?, #set_commandline_arguments
#all_html_colours, #lightgreen, #rev, #sdir, #sfancy, #sfile, #simp, #steelblue, #tomato
Constructor Details
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/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 136
def initialize(
commandline_arguments = ARGV,
run_already = true,
&block
)
reset
case commandline_arguments
when :do_not_run_yet,
:dont_run_yet
commandline_arguments = []
run_already = false
end
set_commandline_arguments(
commandline_arguments
)
if block_given?
case yield
when :use_jquery,
:jquery
@internal_hash[:use_jquery] = true
when :do_not_run_yet
run_already = false
end
end
case run_already
when :do_not_run_yet,
:dont_run_yet
run_already = false
end
run if run_already
end
|
Class Method Details
.[](i = ARGV) ⇒ Object
#
Cyberweb::ObtainFilesAndDirectoriesFromThisPath[]
#
1426
1427
1428
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1426
def self.[](i = ARGV)
new(i)
end
|
Instance Method Details
#add(i) ⇒ Object
Also known as:
_
#
add (add tag)
This method can be used to add (append) onto the main String that stores the content of the webpage as such.
Use this (and only this) method to append onto the main string - or addnl(), which in turn calls add() anyway
Using the alias _ is also permissive, but I recommend using only add() - it makes the code more explicit without it becoming too long, in my opinion.
#
948
949
950
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 948
def add(i)
@internal_hash[:content_of_the_HTML_page] << i
end
|
#add_date_in_the_lower_part_of_the_webpage? ⇒ Boolean
#
add_date_in_the_lower_part_of_the_webpage?
#
451
452
453
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 451
def add_date_in_the_lower_part_of_the_webpage?
@internal_hash[:add_date_in_the_lower_part_of_the_webpage]
end
|
#add_hyperlinks_to_subdirectories? ⇒ Boolean
#
add_hyperlinks_to_subdirectories?
#
521
522
523
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 521
def add_hyperlinks_to_subdirectories?
@internal_hash[:add_hyperlinks_to_subdirectories]
end
|
#
This method will add the footer, which by default is not used - the user has to provide a commandline argument such as –footer to make use of this feature.
What does the footer contain?
Basically it contains a <div> element, which in turn has various hyperlinks to all subdirectories in the current working directory. It will scan for a random .html page in these subdirectories and return the first match found. (This latter behaviour may be subject to change in the future, pehraps, so do not rely too much on it - we may decide to prioritize some .html pages over others, such as index.html or similar names. But for now, the behaviour is as stated before this addendum.)
Since as of December 2023, no <div> will be appended if it were empty.
#
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1278
def (
filter_for = '.html',
all_subdirectories = :default,
show_how_many_pdf_files_are_in_that_subdirectory = false
)
add_date_in_the_lower_part_of_the_webpage = add_date_in_the_lower_part_of_the_webpage?
case show_how_many_pdf_files_are_in_that_subdirectory
when :count_the_pdf_files
show_how_many_pdf_files_are_in_that_subdirectory = true
end
case all_subdirectories
when :default
all_subdirectories = return_all_directories
end
all_subdirectories.reject! {|entry|
File.symlink?(entry) }
all_files = []
all_subdirectories.each {|this_subdirectory|
this_target = Dir[
rds(
this_subdirectory+'/*'+'.'+filter_for.to_s.delete('.')
)
]
if this_target and this_target.is_a?(Array)
first = this_target.first
all_files << first
end
}
if all_files and !all_files.empty?
_ = ''.dup
all_files.each {|this_html_file|
unless this_html_file.nil? or this_html_file.empty?
use_this_description = "#{rarrow} #{this_html_file}"
if show_how_many_pdf_files_are_in_that_subdirectory
use_this_description = use_this_description.dup if use_this_description.frozen?
use_this_threshold_value = 80
if use_this_description.size > use_this_threshold_value
use_this_description = use_this_description[0 .. use_this_threshold_value]+' [...]'
end
n_pdf_files = Dir["#{File.dirname(this_html_file)}/*.pdf"]
if use_german? case n_pdf_files.size when 1
use_this_description << colour_for_pdf_files(
' ('+n_pdf_files.size.to_s+' .pdf Datei)' )
else
use_this_description << colour_for_pdf_files(
' ('+n_pdf_files.size.to_s+' .pdf Dateien)' )
end
end
if add_date_in_the_lower_part_of_the_webpage
dirname_is = File.dirname(this_html_file)
files_in_that_directory = Dir["#{dirname_is}/*"].select {|entry|
is_a_file?(entry)
}
array = Cyberweb.return_time_range_based_on_this_array(files_in_that_directory)
starting_year = array.first.to_s
ending_year = array.last.to_s
years_description = ''.dup
if (ending_year.to_i > starting_year.to_i) or (starting_year.to_i > ending_year.to_i)
years_description = ' (years: '+starting_year+' - '+ending_year+')'
years_description = ' (Jahre: '+starting_year+' - '+ending_year+')' if use_german?
else years_description = ' (year: '+starting_year+')'
years_description = ' (Jahr: '+starting_year+')' if use_german?
end
use_this_description << olivedrab(
years_description
)
end
end
_ << HtmlTags.a(
this_html_file,
css_class: 'marl1_5em BOLD',
description: use_this_description
)
_ << "<br>\n"
end
}
end
unless _.nil? or _.empty?
div_tag_to_use = HtmlTags.div(
_, 'common_border',
'div_footer_id', 'border: 4px dotted lightgreen;
border-radius: 18px;
margin: 1.6em;
padding: 15px;
font-size: 1.1em;
'
)
addnl(div_tag_to_use)
end
end
|
837
838
839
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 837
def addnl(i)
add("#{i}\n")
end
|
#append(i) ⇒ Object
991
992
993
994
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 991
def append(i)
@internal_hash[:files] << i
@internal_hash[:files].flatten!
end
|
#append_to_local_css_style(i) ⇒ Object
#
append_to_local_css_style
#
368
369
370
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 368
def append_to_local_css_style(i)
@internal_hash[:use_this_local_css_style] << i
end
|
#be_verbose? ⇒ Boolean
999
1000
1001
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 999
def be_verbose?
@internal_hash[:be_verbose]
end
|
#body_css_style? ⇒ Boolean
1185
1186
1187
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1185
def body_css_style?
@internal_hash[:body_css_style]
end
|
#check_whether_at_the_least_one_argument_was_given_and_then_act_accordingly ⇒ Object
#
check_whether_at_the_least_one_argument_was_given_and_then_act_accordingly
#
1220
1221
1222
1223
1224
1225
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1220
def check_whether_at_the_least_one_argument_was_given_and_then_act_accordingly
_ = first_argument?
if _ and File.directory?(_)
do_process_all_entries_from_this_directory(_)
end
end
|
#clear_directories ⇒ Object
753
754
755
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 753
def clear_directories
@internal_hash[:directories].clear
end
|
#clear_files ⇒ Object
Also known as:
clear_array
746
747
748
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 746
def clear_files
@internal_hash[:files].clear
end
|
#colour_for_pdf_files(i) ⇒ Object
1230
1231
1232
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1230
def colour_for_pdf_files(i)
mediumorchid(i)
end
|
#consider_appending_the_jquery_string ⇒ Object
#
consider_appending_the_jquery_string
#
375
376
377
378
379
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 375
def consider_appending_the_jquery_string
if use_jquery?
addnl(return_jquery)
end
end
|
#content_of_the_HTML_page? ⇒ Boolean
Also known as:
content_of_the_html_page?, html_content?, html_string?, main_string?
#
content_of_the_HTML_page?
#
955
956
957
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 955
def content_of_the_HTML_page?
@internal_hash[:content_of_the_HTML_page]
end
|
#directory_containing_all_files? ⇒ Boolean
Also known as:
input_directory?, work_on_which_directory?, work_on_this_directory?, which_dir?, main_directory?, dir?
#
directory_containing_all_files?
#
535
536
537
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 535
def directory_containing_all_files?
@internal_hash[:directory_containing_all_files]
end
|
830
831
832
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 830
def
@internal_hash[:display_the_top_header]
end
|
#do_debug ⇒ Object
Also known as:
debug
811
812
813
814
815
816
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 811
def do_debug
e '='*80
pp input_directory?
pp store_where?
e '='*80
end
|
#do_include_subdirectories ⇒ Object
#
do_include_subdirectories
#
528
529
530
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 528
def do_include_subdirectories
@internal_hash[:include_subdirectories] = true
end
|
#do_make_use_of_a_go_down_one_level_link ⇒ Object
#
do_make_use_of_a_go_down_one_level_link
#
894
895
896
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 894
def do_make_use_of_a_go_down_one_level_link
@internal_hash[:make_use_of_a_go_down_one_level_link] = true
end
|
#do_not_include_subdirectories ⇒ Object
#
do_not_include_subdirectories
#
384
385
386
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 384
def do_not_include_subdirectories
@internal_hash[:include_subdirectories] = false
end
|
#do_not_use_HTML_table_layout ⇒ Object
#
do_not_use_HTML_table_layout
#
1237
1238
1239
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1237
def do_not_use_HTML_table_layout
@internal_hash[:use_HTML_table_layout] = false
end
|
#do_open_the_webpage_if_we_are_on_a_roebe_system(i = save_into_this_local_file?
) ⇒ Object
#
do_open_the_webpage_if_we_are_on_a_roebe_system
#
786
787
788
789
790
791
792
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 786
def do_open_the_webpage_if_we_are_on_a_roebe_system(
i = save_into_this_local_file?
)
if roebe_system?
open_in_browser(i)
end
end
|
#do_process_all_entries_from_this_directory(i = :pwd, &block) ⇒ Object
Also known as:
do_obtain_all_files
#
do_process_all_entries_from_this_directory
Only invoke this method if there is a file.
#
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1083
def do_process_all_entries_from_this_directory(
i = :pwd,
&block
)
if block_given?
yielded = yield
case yielded
when :do_include_subdirectories
do_include_subdirectories
end
end
clear_files
clear_directories
set_directory_containing_all_files(i)
_ = '*'.dup
_ << '*/**' if include_subdirectories?
entries = Dir[main_directory?+_]
@internal_hash[:files] = entries.select {|entry|
File.file?(entry)
}
@internal_hash[:directories] = entries.select {|entry|
File.directory?(entry)
}
end
|
#do_store_the_content(what = content_of_the_HTML_page?,
, into = save_into_this_local_file?
) ⇒ Object
Also known as:
do_create_the_html_page, do_create_the_HTML_page, save_what_to, save_file, append_everything
#
do_store_the_content (save tag)
#
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
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 391
def do_store_the_content(
what = content_of_the_HTML_page?,
into = save_into_this_local_file?
)
into = File.absolute_path(into)
if be_verbose?
opne "Now saving into the file `#{sfile(into)}#{rev}`."
end
if File.exist? into
opne tomato('Warning: ')+
sfile(into)+
tomato(' already exists.')
opne tomato('We will delete it first.')
File.delete(into)
end
raw_title_to_use = File.basename(title?).
tr('_',' ').
delete_suffix('.html')
if raw_title_to_use.include?(' ')
splitted = raw_title_to_use.split(' ')
first_word = splitted[0]
first_word[0, 1] = first_word[0, 1].capitalize
if splitted[1]
second_word = splitted[1]
second_word[0, 1] = second_word[0, 1].capitalize
splitted[1] = second_word
end
raw_title_to_use = splitted.join(' ')
end
use_this_title = raw_title_to_use
@rendered_template = Cyberweb.rendered_template(
title: use_this_title,
css_style: @internal_hash[:use_this_local_css_style],
css_classes: THESE_CSS_CLASSES_ARE_KNOWN_TO_THE_RENDERED_TEMPLATE,
body_css_style: body_css_style?.strip, body: what,
font_size: :use_the_default_font_size
)
write_what_into(@rendered_template.result?, into)
end
|
#do_traverse_into_subdirectories? ⇒ Boolean
#
do_traverse_into_subdirectories?
#
1213
1214
1215
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1213
def do_traverse_into_subdirectories?
@internal_hash[:do_traverse_into_subdirectories]
end
|
#do_use_HTML_table_layout ⇒ Object
#
do_use_HTML_table_layout
#
1244
1245
1246
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1244
def do_use_HTML_table_layout
@internal_hash[:use_HTML_table_layout] = true
end
|
#files? ⇒ Boolean
Also known as:
array_work_on_these_files?, array_work_on_these_files, work_on_which_files?, all_files?
736
737
738
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 736
def files?
@internal_hash[:files]
end
|
#filter_for_these_files(i, files = ) ⇒ Object
Also known as:
apply_filter, do_filter_for
#
filter_for_these_files (filter tag)
This method can be employed to filter for specific files, such as for all .pdf files or for only .gif files.
Typically a Symbol should be passed into this method, but the method will try to remain flexible, so other input arguments are also permissive. The code in the method body may be adjusted to additional use cases, if need be.
Usage examples:
filter_for_these_files(:pdf)
filter_for_these_files('only gif')
#
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
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 485
def filter_for_these_files( i,
files = @internal_hash[:files] )
if i
files.select! {|entry|
case i when :multimedia_files
begin
require 'multimedia_paradise/toplevel_methods/is_audio_file_is_video_file_is_image_file_is_multimedia_file.rb'
::MultimediaParadise.is_a_multimedia_file?(entry)
rescue LoadError; end
when /^only gif/
entry.end_with?('.gif')
else entry.end_with?(i.to_s)
end
}
end
end
|
#gold(i, optional_css_style = '') ⇒ Object
1130
1131
1132
1133
1134
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1130
def gold(
i, optional_css_style = ''
)
'<span style="color: gold; '+optional_css_style+'">'+i.to_s+'</span>'
end
|
#include_subdirectories? ⇒ Boolean
#
include_subdirectories?
#
1206
1207
1208
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1206
def include_subdirectories?
@internal_hash[:include_subdirectories]
end
|
#make_use_of_a_go_down_one_level_link? ⇒ Boolean
#
make_use_of_a_go_down_one_level_link?
This variable will determine whether we will display a “go down one level” entry on the top-header.
#
872
873
874
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 872
def make_use_of_a_go_down_one_level_link?
@internal_hash[:make_use_of_a_go_down_one_level_link]
end
|
#mediumorchid(i, optional_css_style = '') ⇒ Object
1148
1149
1150
1151
1152
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1148
def mediumorchid(
i, optional_css_style = ''
)
'<span style="color: mediumorchid; '+optional_css_style+'">'+i.to_s+'</span>'
end
|
#mediumseagreen(i, optional_css_style = '') ⇒ Object
1166
1167
1168
1169
1170
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1166
def mediumseagreen(
i, optional_css_style = ''
)
'<span style="color: mediumseagreen; '+optional_css_style+'">'+i.to_s+'</span>'
end
|
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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 567
def (
i = commandline_arguments?
)
if i.is_a? Array
i.each {|entry| (entry) }
else
case i when /^-?-?add(-|_)?date(-|_)?in(-|_)?the(-|_)?lower(-|_)?part$/i,
/^-?-?lower(-|_)?part$/i
@internal_hash[:add_date_in_the_lower_part_of_the_webpage] = true
when /^-?-?add(-|_)?hyperlinks(-|_)?to(-|_)?subdirectories$/i,
/^-?-?hyperlinks(-|_)?at(-|_)?the(-|_)?bottom$/i, /^-?-?bottom$/i @internal_hash[:add_hyperlinks_to_subdirectories] = true
when /^-?-?tablelayout$/i,
/^-?-?table$/i,
/^-?-?html(-|_)?tables?$/i, /^-?-?use(-|_)?HTML(-|_)?tables?$/i, /^-?-?use(-|_)?HTML$/i
do_use_HTML_table_layout
when /^-?-?do(-|_)?not(-|_)?include(-|_)?subdirectories$/i
do_not_include_subdirectories
when /^-?-?traverse$/i
@internal_hash[:do_traverse_into_subdirectories] = true
when /^-?-?do(-|_)?include(-|_)?subdirectories$/i,
/^-?-?include(-|_)?subdirectories$/i,
/^-?-?subdirectories$/i, /^-?-?subdirs$/i
do_include_subdirectories
when /^-?-?do(-|_)?not(-|_)?traverse$/i,
/^-?-?simple$/i, /^-?-?ignore(-|_)?subdirectories$/i @internal_hash[:do_traverse_into_subdirectories] = false
when /^-?-?do(-|_)?make(-|_)?use(-|_)?of(-|_)?a(-|_)?go(-|_)?down(-|_)?one(-|_)?level(-|_)?link$/,
/^-?-?go(-|_)?down$/,
/^-?-?do(-|_)?go(-|_)?down$/,
/^-?-?down$/
do_make_use_of_a_go_down_one_level_link
when /^-?-?pwd$/i, :return_pwd
set_this_directory_contains_the_images(:pwd)
set_store_where(:infer)
clear_images
scan_for_images_in_this_directory
the_three_main_actions
do_open_the_webpage_if_we_are_on_a_roebe_system exit
when /^-?-?use(-|_)?no(-|_)?size(-|_)?value$/i,
/^-?-?no(-|_)?special(-|_)?size$/i
@internal_hash[:use_no_size_value] = true
when /^-?-?videos$/i,
/^-?-?videos(-|_)?only$/i
@internal_hash[:work_on_video_files_only] = true
@internal_hash[:sort_how] = :do_not_sort_at_all
when /-?-?njoy$/i,
:njoy
e 'We will use the excellent images from a special directory.'
scan_there :njoy
when /^-?-?table=(.+)$/i
n_rows = $1.to_s.to_i
@internal_hash[:use_n_rows_for_the_html_table] = n_rows
do_use_HTML_table_layout
when '?'
opne 'The file in question will be:'
e
e " #{sfile(store_where?)}"
e
exit
when /^-?-?display(-|_| )?top(-|_| )?header$/i,
/^-?-?do(-|_| )?display(-|_| )?top(-|_| )?header$/i
@internal_hash[:display_the_top_header] = true
when /^-?-?help$/i
show_help
exit
else
if i.is_a?(String) and File.directory?(i)
set_work_on_this_directory(i)
set_save_into_this_local_file(
:use_the_directory_containing_all_images_as_base
)
elsif i.start_with?('--') report_not_registered_commandline_argument(i)
end
end
end
end
|
#n_rows? ⇒ Boolean
965
966
967
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 965
def n_rows?
@internal_hash[:use_n_rows_for_the_html_table]
end
|
#olivedrab(i, optional_css_style = '') ⇒ Object
1139
1140
1141
1142
1143
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1139
def olivedrab(
i, optional_css_style = ''
)
'<span style="color: olivedrab; '+optional_css_style+'">'+i.to_s+'</span>'
end
|
#paleturquoise(i, optional_css_style = '') ⇒ Object
1157
1158
1159
1160
1161
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1157
def paleturquoise(
i, optional_css_style = ''
)
'<span style="color: paleturquoise; '+optional_css_style+'">'+i.to_s+'</span>'
end
|
#registered_ids? ⇒ Boolean
855
856
857
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 855
def registered_ids?
@internal_hash[:registered_ids]
end
|
#report_not_registered_commandline_argument(i) ⇒ Object
#
report_not_registered_commandline_argument
#
972
973
974
975
976
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 972
def report_not_registered_commandline_argument(i)
opne tomato('The commandline argument `')+
steelblue(i)+
tomato('` is not registered.')
end
|
#report_scanning_directory(i = work_on_which_directory?
) ⇒ Object
#
report_scanning_directory
#
821
822
823
824
825
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 821
def report_scanning_directory(
i = work_on_which_directory?
)
opne "Scanning from the directory `#{sdir(i)}`."
end
|
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
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 195
def reset
super()
infer_the_namespace
initialize_the_config_if_the_config_hash_is_empty
set_work_on_this_directory(return_pwd)
@internal_hash[:show_year_in_the_header] = true
@internal_hash[:sort_how] = :sort_by_date @internal_hash[:body_css_style] = '
background-color: black; color: white; font-size: '+FONT_SIZE_TO_USE+';'
set_directory_containing_all_files(:pwd)
@internal_hash[:content_of_the_HTML_page] = ''.dup
@internal_hash[:add_date_in_the_lower_part_of_the_webpage] = false
@internal_hash[:files] = []
@internal_hash[:directories] = []
@internal_hash[:shall_we_debug] = SHALL_WE_DEBUG
@internal_hash[:registered_ids] = []
@internal_hash[:make_use_of_a_go_down_one_level_link] = true
@internal_hash[:use_jquery] = true
@internal_hash[:display_the_top_header] = true
@internal_hash[:use_no_size_value] = false
@internal_hash[:work_on_video_files_only] = false
do_not_include_subdirectories
@internal_hash[:add_hyperlinks_to_subdirectories] = false
@internal_hash[:use_this_local_css_style] = DEFAULT_CSS_STYLE_FOR_HYPERLINKS.dup
@internal_hash[:use_german] = true
@internal_hash[:be_verbose] = BE_VERBOSE
@internal_hash[:use_HTML_table_layout] = false
set_save_into_this_local_file(
:pwd
)
end
|
#return_early_and_late_year_from_this_array(i = array_work_on_these_files?
) ⇒ Object
#
return_early_and_late_year_from_this_array
This method must return an Array, with two elements.
#
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 762
def return_early_and_late_year_from_this_array(
i = array_work_on_these_files?
)
regex_to_use = /(\d{4})/ result = []
simplified_array = i.map {|entry|
_ = File.basename(entry)
_ =~ regex_to_use
$1.to_s.dup.to_i }.sort.uniq
simplified_array.reject! {|entry|
entry == 0
}
result << simplified_array.min
result << simplified_array.max
return result
end
|
#return_jquery ⇒ Object
#
return_jquery
This method will add the jquery version.
In order to do this, we have to tap into the Cyberweb project.
#
848
849
850
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 848
def return_jquery
"\n#{::Cyberweb.return_jquery_string}"
end
|
#return_the_code_for_going_down_one_level ⇒ Object
#
return_the_code_for_going_down_one_level
This code basically inserts some HTML code, in particular a href link.
#
882
883
884
885
886
887
888
889
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 882
def return_the_code_for_going_down_one_level
base_dir_below_the_current_level = File.basename(File.dirname(Dir.pwd))
html_file_below = "#{base_dir_below_the_current_level}.html"
add_this_line = "<br><br>\n<a href=\"../#{html_file_below}\" style=\"font-size: 1.1em; color: lightblue; margin: auto; "\
"margin-left: 6em; "\
"font-weight: bold\">\n→ Go down to the base directory here.</a><br><br><br>\n\n"
return add_this_line
end
|
#return_the_pretty_name_of_the_webpage ⇒ Object
#
return_the_pretty_name_of_the_webpage
This method will return the pretty name of the webpage.
#
460
461
462
463
464
465
466
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 460
def return_the_pretty_name_of_the_webpage
_ = File.basename(save_into_this_local_file?).
delete_suffix('.html').
tr('_',' ')
_ = _.split(' ').map(&:capitalize).join(' ').strip if _.include?(' ')
return _
end
|
#royalblue(i) ⇒ Object
1123
1124
1125
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1123
def royalblue(i)
'<span style="color: royalblue">'+i.to_s+'</span>'
end
|
1417
1418
1419
1420
1421
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1417
def run
do_debug if shall_we_debug?
check_whether_at_the_least_one_argument_was_given_and_then_act_accordingly
end
|
#save_into_this_local_file? ⇒ Boolean
Also known as:
title?, store_where?, stored_where?, output_file?, store_into?, save_into_which_file?, save?
#
save_into_this_local_file?
#
1068
1069
1070
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1068
def save_into_this_local_file?
@internal_hash[:save_into_this_local_file]
end
|
#set_background(i) ⇒ Object
Also known as:
background
#
set_background
Pass the colour that you want to use for the background here, such as :orange or :tomato.
#
1178
1179
1180
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1178
def set_background(i)
@internal_hash[:body_css_style] = "background-color: #{i};"
end
|
#set_body_css_style(i) ⇒ Object
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1192
def set_body_css_style(i)
case i
when :default_for_white_background
i = 'background-color: white; color: black; font-size: '+FONT_SIZE_TO_USE+';'
end
@internal_hash[:body_css_style] = i
end
|
#set_content_of_the_html_page(i) ⇒ Object
#
set_content_of_the_html_page
#
804
805
806
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 804
def set_content_of_the_html_page(i)
@internal_hash[:content_of_the_HTML_page] = i
end
|
#set_directory_containing_all_files(i = :pwd) ⇒ Object
Also known as:
set_work_on_this_directory, set_this_dir, set_main_directory
#
set_directory_containing_all_files
#
547
548
549
550
551
552
553
554
555
556
557
558
559
560
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 547
def set_directory_containing_all_files(
i = :pwd
)
case i
when :pwd,
:return_pwd
i = "#{Dir.pwd}/"
end
i = rds(i)
@internal_hash[:directory_containing_all_files] = i
end
|
#set_files(i) ⇒ Object
Also known as:
set_array_work_on_these_files, work_on_these_files=, files=
981
982
983
984
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 981
def set_files(i)
i = [i].flatten.compact
@internal_hash[:files] = i
end
|
#set_save_into_this_local_file(i = "#{INFO_DIRECTORY}/all_files_from_#{input_directory?}") ⇒ Object
Also known as:
set_store_where, store_where, store_where=, set_page_name, set_output_page_here
#
set_save_into_this_local_file
#
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1013
def set_save_into_this_local_file(
i = "#{INFO_DIRECTORY}/all_files_from_#{input_directory?}"
) case i
when :infer_the_name_from_the_directory_containing_all_images,
:infer,
:use_the_directory_containing_all_images_as_base,
:default
_ = directory_containing_all_files?
i = File.basename(_).downcase
when :use_the_current_working_directory_base_name,
:pwd
i = File.basename(return_pwd).downcase
end
if i
i = i.dup if i.frozen?
i << HTML unless i.end_with? HTML
end
i = File.absolute_path(i)
@internal_hash[:save_into_this_local_file] = i
end
|
#shall_we_debug? ⇒ Boolean
1061
1062
1063
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1061
def shall_we_debug?
@internal_hash[:shall_we_debug]
end
|
#show_help ⇒ Object
#
show_help (help tag)
This method will show usage-information, on the commandline, to the end user.
Invocation example:
images_to_html --help
#
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 916
def show_help
e "#{rev}This class currently allows for these special arguments:"
e
e steelblue(' NJOY')
e steelblue(' PWD')
e steelblue(' ?')
e steelblue(' --videos-only ')+
lightgreen('# to work on video-files only')
e steelblue(' --do-not-traverse ')+
lightgreen('# do not obtain images from any subdirectory')
e steelblue(' --use-HTML-table ')+
lightgreen('# display via a HTML table; currently hardcoded to 3 images per row')
e steelblue(' --table=2 ')+
lightgreen('# use a HTML table, but 2 images per row, so you can change this setting actually')
e steelblue(' --use-no-size-value ')+
lightgreen('# do not use explicit width and height setting; the images will appear as-is')
e
end
|
1006
1007
1008
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1006
def
@internal_hash[:show_year_in_the_header]
end
|
#sort_how? ⇒ Boolean
901
902
903
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 901
def sort_how?
@internal_hash[:sort_how]
end
|
#use_german? ⇒ Boolean
361
362
363
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 361
def use_german?
@internal_hash[:use_german]
end
|
#use_HTML_table_layout? ⇒ Boolean
Also known as:
use_html_table_layout?, use_html_table?, use_HTML_table?
#
use_HTML_table_layout?
#
1251
1252
1253
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1251
def use_HTML_table_layout?
@internal_hash[:use_HTML_table_layout]
end
|
#use_jquery? ⇒ Boolean
862
863
864
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 862
def use_jquery?
@internal_hash[:use_jquery]
end
|
#use_no_size_value? ⇒ Boolean
1054
1055
1056
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 1054
def use_no_size_value?
@internal_hash[:use_no_size_value]
end
|
#work_on_video_files_only? ⇒ Boolean
#
work_on_video_files_only?
#
797
798
799
|
# File 'lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb', line 797
def work_on_video_files_only?
@internal_hash[:work_on_video_files_only]
end
|