rcfiles 1.1.1137
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rcfiles might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +401 -0
- data/bin/rcfiles +7 -0
- data/bin/rcfiles_run_it +7 -0
- data/doc/README.gen +384 -0
- data/lib/rcfiles.rb +1 -0
- data/lib/rcfiles/class/colours.rb +54 -0
- data/lib/rcfiles/class/initialize.rb +66 -0
- data/lib/rcfiles/class/misc.rb +299 -0
- data/lib/rcfiles/class/rcfiles.rb +31 -0
- data/lib/rcfiles/class/reset.rb +26 -0
- data/lib/rcfiles/class/run.rb +17 -0
- data/lib/rcfiles/colours/colours.rb +107 -0
- data/lib/rcfiles/commandline/commandline.rb +170 -0
- data/lib/rcfiles/constants/custom_files.rb +80 -0
- data/lib/rcfiles/constants/encodings.rb +85 -0
- data/lib/rcfiles/constants/misc.rb +75 -0
- data/lib/rcfiles/constants/namespace.rb +18 -0
- data/lib/rcfiles/expand_cd_aliases/constants.rb +50 -0
- data/lib/rcfiles/expand_cd_aliases/expand_cd_aliases.rb +626 -0
- data/lib/rcfiles/expand_cd_aliases/run.rb +18 -0
- data/lib/rcfiles/files/file_aliases.rb +78 -0
- data/lib/rcfiles/files/file_cd_aliases.rb +85 -0
- data/lib/rcfiles/files/file_ls_colours.rb +76 -0
- data/lib/rcfiles/files/file_path_variable.rb +74 -0
- data/lib/rcfiles/files/file_pkgconfig.rb +74 -0
- data/lib/rcfiles/files/file_programs_aliases.rb +68 -0
- data/lib/rcfiles/files/file_ps1.rb +80 -0
- data/lib/rcfiles/files/file_system_settings.rb +66 -0
- data/lib/rcfiles/help/help.rb +46 -0
- data/lib/rcfiles/no_colours.rb +13 -0
- data/lib/rcfiles/project/project.rb +45 -0
- data/lib/rcfiles/rcfiles/README.md +5 -0
- data/lib/rcfiles/rcfiles/aliases_rc +18526 -0
- data/lib/rcfiles/rcfiles/cd_aliases_rc +13313 -0
- data/lib/rcfiles/rcfiles/cflags_rc +9 -0
- data/lib/rcfiles/rcfiles/compile_rc +11 -0
- data/lib/rcfiles/rcfiles/file_information_rc +16 -0
- data/lib/rcfiles/rcfiles/german_umlaute_rc +264 -0
- data/lib/rcfiles/rcfiles/gnome_rc +10 -0
- data/lib/rcfiles/rcfiles/kde_rc +17 -0
- data/lib/rcfiles/rcfiles/kernel_rc +12 -0
- data/lib/rcfiles/rcfiles/lang_rc +9 -0
- data/lib/rcfiles/rcfiles/ldflags_rc +8 -0
- data/lib/rcfiles/rcfiles/ls_colours_rc +9 -0
- data/lib/rcfiles/rcfiles/network_rc +37 -0
- data/lib/rcfiles/rcfiles/path_variable_rc +9 -0
- data/lib/rcfiles/rcfiles/pkgconfig_rc +9 -0
- data/lib/rcfiles/rcfiles/programs_aliases_rc +15597 -0
- data/lib/rcfiles/rcfiles/ps1_rc +9 -0
- data/lib/rcfiles/rcfiles/special_aliases_rc +23 -0
- data/lib/rcfiles/rcfiles/system_rc +13 -0
- data/lib/rcfiles/rcfiles/system_settings_rc +191 -0
- data/lib/rcfiles/rcfiles/term_rc +9 -0
- data/lib/rcfiles/rcfiles/video_rc +24 -0
- data/lib/rcfiles/requires/require_the_expand_cd_aliases.rb +7 -0
- data/lib/rcfiles/requires/require_the_rcfiles_constants.rb +21 -0
- data/lib/rcfiles/requires/require_the_rcfiles_project.rb +66 -0
- data/lib/rcfiles/requires/try_to_require_syck_and_psych.rb +18 -0
- data/lib/rcfiles/toplevel_methods/autogenerate_rc_file_from_this_yaml_file.rb +102 -0
- data/lib/rcfiles/toplevel_methods/change_directory.rb +16 -0
- data/lib/rcfiles/toplevel_methods/convert.rb +118 -0
- data/lib/rcfiles/toplevel_methods/create_windows_cd_aliases_bat_file.rb +51 -0
- data/lib/rcfiles/toplevel_methods/e.rb +16 -0
- data/lib/rcfiles/toplevel_methods/esystem.rb +19 -0
- data/lib/rcfiles/toplevel_methods/generate_yaml_files.rb +148 -0
- data/lib/rcfiles/toplevel_methods/infer.rb +83 -0
- data/lib/rcfiles/toplevel_methods/is_on_roebe.rb +16 -0
- data/lib/rcfiles/toplevel_methods/main_directory.rb +108 -0
- data/lib/rcfiles/toplevel_methods/misc.rb +304 -0
- data/lib/rcfiles/toplevel_methods/n_registered_aliases_in_total.rb +55 -0
- data/lib/rcfiles/toplevel_methods/no_file_exists_at.rb +19 -0
- data/lib/rcfiles/toplevel_methods/notifications.rb +33 -0
- data/lib/rcfiles/toplevel_methods/rds.rb +16 -0
- data/lib/rcfiles/toplevel_methods/remove_newlines.rb +29 -0
- data/lib/rcfiles/toplevel_methods/report.rb +53 -0
- data/lib/rcfiles/toplevel_methods/return_standard_header.rb +36 -0
- data/lib/rcfiles/toplevel_methods/run_it.rb +46 -0
- data/lib/rcfiles/toplevel_methods/save_file.rb +27 -0
- data/lib/rcfiles/toplevel_methods/use_psych_or_syck.rb +50 -0
- data/lib/rcfiles/toplevel_methods/use_quotes.rb +68 -0
- data/lib/rcfiles/toplevel_methods/verbosity.rb +28 -0
- data/lib/rcfiles/version/version.rb +26 -0
- data/lib/rcfiles/yaml/aliases.yml +20991 -0
- data/lib/rcfiles/yaml/cd_aliases.yml +13970 -0
- data/lib/rcfiles/yaml/ls_colours.yml +128 -0
- data/lib/rcfiles/yaml/path_variable.yml +12 -0
- data/lib/rcfiles/yaml/pkgconfig.yml +46 -0
- data/lib/rcfiles/yaml/programs_aliases.yml +17081 -0
- data/lib/rcfiles/yaml/ps1.yml +82 -0
- data/lib/rcfiles/yaml/store_into_this_directory.yml +1 -0
- data/lib/rcfiles/yaml/system_settings.yml +513 -0
- data/lib/rcfiles/yaml/use_psych_or_syck.yml +1 -0
- data/rcfiles.gemspec +56 -0
- data/test/testing_expand_cd_aliases.rb +47 -0
- data/test/testing_yaml_to_rcfiles.rb +9 -0
- metadata +201 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/expand_cd_aliases/run.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
class ExpandCdAliases # === Rcfiles::ExpandCdAliases
|
10
|
+
|
11
|
+
# ========================================================================= #
|
12
|
+
# === run (run tag)
|
13
|
+
# ========================================================================= #
|
14
|
+
def run
|
15
|
+
initialize_main_hash
|
16
|
+
end
|
17
|
+
|
18
|
+
end; end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/files/file_aliases.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
require 'rcfiles/project/project.rb'
|
10
|
+
require 'rcfiles/toplevel_methods/is_on_roebe.rb'
|
11
|
+
require 'rcfiles/toplevel_methods/convert.rb'
|
12
|
+
require 'rcfiles/toplevel_methods/notifications.rb'
|
13
|
+
|
14
|
+
# ========================================================================= #
|
15
|
+
# === Rcfiles.set_file_aliases
|
16
|
+
# ========================================================================= #
|
17
|
+
def self.set_file_aliases(
|
18
|
+
i = :default
|
19
|
+
)
|
20
|
+
case i
|
21
|
+
when :default, nil
|
22
|
+
if is_on_roebe? and File.exist?('/Depot/aliases.yml')
|
23
|
+
i = '/Depot/aliases.yml'
|
24
|
+
else
|
25
|
+
i = "#{project_yaml_dir?}aliases.yml"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
@file_aliases = i
|
29
|
+
end
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === @file_aliases
|
33
|
+
#
|
34
|
+
# On my home system, the value of the toplevel @file_aliases instance
|
35
|
+
# variable points to a file path such as:
|
36
|
+
#
|
37
|
+
# /Programs/Ruby/2.5.0/lib/ruby/site_ruby/2.5.0/rcfile_generator/yaml/aliases.yml
|
38
|
+
#
|
39
|
+
# It may also point to another target location, though.
|
40
|
+
# ========================================================================= #
|
41
|
+
@file_aliases = nil
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# And set it at once.
|
45
|
+
# ========================================================================= #
|
46
|
+
set_file_aliases
|
47
|
+
|
48
|
+
# ========================================================================= #
|
49
|
+
# === Rcfiles.file_aliases?
|
50
|
+
# ========================================================================= #
|
51
|
+
def self.file_aliases?
|
52
|
+
@file_aliases
|
53
|
+
end; self.instance_eval { alias file_aliases file_aliases? } # === Rcfiles.file_aliases
|
54
|
+
|
55
|
+
# ========================================================================= #
|
56
|
+
# === Rcfiles.generate_aliases_rcfile
|
57
|
+
# ========================================================================= #
|
58
|
+
def self.generate_aliases_rcfile
|
59
|
+
_ = @file_aliases
|
60
|
+
if File.exist? _
|
61
|
+
into = "#{main_directory?}aliases_rc"
|
62
|
+
notify_the_user_that_this_file_will_be_generated_from_that_existing_file(into, _)
|
63
|
+
what = return_standard_header(into).dup
|
64
|
+
hash_dataset = YAML.load_file(_)
|
65
|
+
hash_dataset.each_pair {|key, value|
|
66
|
+
if @use_quotes
|
67
|
+
what << "alias '#{key}'=\"#{value}\"\n"
|
68
|
+
else
|
69
|
+
what << "alias #{key}=#{value}\n"
|
70
|
+
end
|
71
|
+
}
|
72
|
+
write_what_into(what, into)
|
73
|
+
else
|
74
|
+
no_file_exists_at(_)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/files/file_cd_aliases.rb'
|
6
|
+
# Rcfiles.file_cd_aliases?
|
7
|
+
# =========================================================================== #
|
8
|
+
module Rcfiles
|
9
|
+
|
10
|
+
require 'rcfiles/project/project.rb'
|
11
|
+
require 'rcfiles/toplevel_methods/is_on_roebe.rb'
|
12
|
+
require 'rcfiles/toplevel_methods/convert.rb'
|
13
|
+
require 'rcfiles/toplevel_methods/notifications.rb'
|
14
|
+
|
15
|
+
# ========================================================================= #
|
16
|
+
# === Rcfiles.set_cd_aliases
|
17
|
+
# ========================================================================= #
|
18
|
+
def self.set_cd_aliases(
|
19
|
+
i = :default
|
20
|
+
)
|
21
|
+
case i
|
22
|
+
when :default, nil
|
23
|
+
if is_on_roebe? and File.exist?('/Depot/cd_aliases.yml')
|
24
|
+
i = '/Depot/cd_aliases.yml'
|
25
|
+
else
|
26
|
+
i = "#{project_yaml_dir?}cd_aliases.yml"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
@file_cd_aliases = i
|
30
|
+
end
|
31
|
+
|
32
|
+
# ========================================================================= #
|
33
|
+
# === Rcfiles::@file_cd_aliases
|
34
|
+
# ========================================================================= #
|
35
|
+
@file_cd_aliases = nil
|
36
|
+
|
37
|
+
set_cd_aliases
|
38
|
+
|
39
|
+
# ========================================================================= #
|
40
|
+
# === Rcfiles.file_cd_aliases?
|
41
|
+
#
|
42
|
+
# This method will keep the location to the cd_aliases.yml file (or
|
43
|
+
# the substitute for it, if the user specified another cd_aliases.yml
|
44
|
+
# file).
|
45
|
+
# ========================================================================= #
|
46
|
+
def self.file_cd_aliases?
|
47
|
+
@file_cd_aliases
|
48
|
+
end; self.instance_eval { alias file_cd_aliases file_cd_aliases? } # === Rcfiles.file_cd_aliases
|
49
|
+
self.instance_eval { alias cd_aliases file_cd_aliases? } # === Rcfiles.cd_aliases
|
50
|
+
self.instance_eval { alias cd_aliases? file_cd_aliases? } # === Rcfiles.cd_aliases?
|
51
|
+
|
52
|
+
# ========================================================================= #
|
53
|
+
# === Rcfiles.generate_cd_aliases_rcfile
|
54
|
+
# ========================================================================= #
|
55
|
+
def self.generate_cd_aliases_rcfile(
|
56
|
+
be_verbose = ::Rcfiles.be_verbose?
|
57
|
+
)
|
58
|
+
_ = @file_cd_aliases
|
59
|
+
if File.exist? _
|
60
|
+
if block_given?
|
61
|
+
yielded = yield
|
62
|
+
if yielded.has_key? :be_verbose
|
63
|
+
be_verbose = yielded.delete(:be_verbose)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
into = "#{main_directory?}cd_aliases_rc"
|
67
|
+
if be_verbose
|
68
|
+
notify_the_user_that_this_file_will_be_generated_from_that_existing_file(into, _)
|
69
|
+
end
|
70
|
+
what = return_standard_header(into).dup
|
71
|
+
hash_dataset = YAML.load_file(_)
|
72
|
+
hash_dataset.each_pair {|key, value|
|
73
|
+
if @use_quotes
|
74
|
+
what << "alias '#{key}'=\"#{value}\"\n"
|
75
|
+
else
|
76
|
+
what << "alias #{key}=#{value}\n"
|
77
|
+
end
|
78
|
+
}
|
79
|
+
write_what_into(what, into)
|
80
|
+
else
|
81
|
+
no_file_exists_at(_) if be_verbose
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/files/file_ls_colours.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
require 'rcfiles/project/project.rb'
|
10
|
+
require 'rcfiles/toplevel_methods/is_on_roebe.rb'
|
11
|
+
require 'rcfiles/toplevel_methods/convert.rb'
|
12
|
+
require 'rcfiles/toplevel_methods/notifications.rb'
|
13
|
+
|
14
|
+
# ========================================================================= #
|
15
|
+
# === Rcfiles.set_file_ls_colours
|
16
|
+
# ========================================================================= #
|
17
|
+
def self.set_file_ls_colours(
|
18
|
+
i = :default
|
19
|
+
)
|
20
|
+
case i
|
21
|
+
when :default, nil
|
22
|
+
if is_on_roebe? and File.exist?('/Depot/ls_colours.yml')
|
23
|
+
i = '/Depot/ls_colours.yml'
|
24
|
+
else
|
25
|
+
i = "#{project_yaml_dir?}ls_colours.yml"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
@file_ls_colours = i
|
29
|
+
end
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === @file_ls_colours
|
33
|
+
#
|
34
|
+
# On my home system, the value of the toplevel @file_ls_colours instance
|
35
|
+
# variable points to a file path such as:
|
36
|
+
#
|
37
|
+
# /Programs/Ruby/2.5.0/lib/ruby/site_ruby/2.5.0/rcfile_generator/yaml/ls_colours.yml
|
38
|
+
#
|
39
|
+
# It may also point to another target location, though.
|
40
|
+
# ========================================================================= #
|
41
|
+
@file_ls_colours = nil
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# And set it at once.
|
45
|
+
# ========================================================================= #
|
46
|
+
set_file_ls_colours
|
47
|
+
|
48
|
+
# ========================================================================= #
|
49
|
+
# === Rcfiles.file_ls_colours?
|
50
|
+
# ========================================================================= #
|
51
|
+
def self.file_ls_colours?
|
52
|
+
@file_ls_colours
|
53
|
+
end; self.instance_eval { alias file_ls_colours file_ls_colours? } # === Rcfiles.file_ls_colours
|
54
|
+
|
55
|
+
# ========================================================================= #
|
56
|
+
# === Rcfiles.generate_ls_colours_rcfile
|
57
|
+
# ========================================================================= #
|
58
|
+
def self.generate_ls_colours_rcfile
|
59
|
+
_ = @file_ls_colours
|
60
|
+
if File.exist? _
|
61
|
+
into = "#{main_directory?}ls_colours_rc"
|
62
|
+
notify_the_user_that_this_file_will_be_generated_from_that_existing_file(into, _)
|
63
|
+
hash = YAML.load_file(_)
|
64
|
+
dataset = hash.map {|key, value| "#{key}=#{value}"}.join(':')
|
65
|
+
# ^^^ dataset is now a String past this point.
|
66
|
+
what = return_standard_header(into).dup
|
67
|
+
what << convert_this_input_to_export_file(
|
68
|
+
dataset, 'LS_COLORS'
|
69
|
+
)
|
70
|
+
write_what_into(what, into)
|
71
|
+
else
|
72
|
+
no_file_exists_at(_)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/files/file_path_variable.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
require 'rcfiles/project/project.rb'
|
10
|
+
require 'rcfiles/toplevel_methods/is_on_roebe.rb'
|
11
|
+
require 'rcfiles/toplevel_methods/convert.rb'
|
12
|
+
require 'rcfiles/toplevel_methods/notifications.rb'
|
13
|
+
|
14
|
+
# ========================================================================= #
|
15
|
+
# === Rcfiles.set_file_path_variable
|
16
|
+
# ========================================================================= #
|
17
|
+
def self.set_file_path_variable(
|
18
|
+
i = :default
|
19
|
+
)
|
20
|
+
case i
|
21
|
+
when :default, nil
|
22
|
+
if is_on_roebe? and File.exist?('/Depot/path_variable.yml')
|
23
|
+
i = '/Depot/path_variable.yml'
|
24
|
+
else
|
25
|
+
i = "#{project_yaml_dir?}path_variable.yml"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
@file_path_variable = i
|
29
|
+
end
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === @file_path_variable
|
33
|
+
#
|
34
|
+
# On my home system, the value of the toplevel @file_path_variable instance
|
35
|
+
# variable points to a file path such as:
|
36
|
+
#
|
37
|
+
# /Programs/Ruby/2.5.0/lib/ruby/site_ruby/2.5.0/rcfile_generator/yaml/path_variable.yml
|
38
|
+
#
|
39
|
+
# It may also point to another target location, though.
|
40
|
+
# ========================================================================= #
|
41
|
+
@file_path_variable = nil
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# And set it at once.
|
45
|
+
# ========================================================================= #
|
46
|
+
set_file_path_variable
|
47
|
+
|
48
|
+
# ========================================================================= #
|
49
|
+
# === Rcfiles.file_path_variable?
|
50
|
+
# ========================================================================= #
|
51
|
+
def self.file_path_variable?
|
52
|
+
@file_path_variable
|
53
|
+
end; self.instance_eval { alias file_path_variable file_path_variable? } # === Rcfiles.file_path_variable
|
54
|
+
|
55
|
+
# ========================================================================= #
|
56
|
+
# === Rcfiles.generate_path_variable_rcfile
|
57
|
+
# ========================================================================= #
|
58
|
+
def self.generate_path_variable_rcfile
|
59
|
+
_ = @file_path_variable
|
60
|
+
if File.exist? _
|
61
|
+
into = "#{main_directory?}path_variable_rc"
|
62
|
+
notify_the_user_that_this_file_will_be_generated_from_that_existing_file(into, _)
|
63
|
+
dataset = YAML.load_file(_)
|
64
|
+
what = return_standard_header(into).dup
|
65
|
+
what << convert_this_input_to_export_file(
|
66
|
+
dataset, 'PATH'
|
67
|
+
)
|
68
|
+
write_what_into(what, into)
|
69
|
+
else
|
70
|
+
no_file_exists_at(_)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/files/file_pkgconfig.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
require 'rcfiles/project/project.rb'
|
10
|
+
require 'rcfiles/toplevel_methods/is_on_roebe.rb'
|
11
|
+
require 'rcfiles/toplevel_methods/convert.rb'
|
12
|
+
require 'rcfiles/toplevel_methods/notifications.rb'
|
13
|
+
|
14
|
+
# ========================================================================= #
|
15
|
+
# === Rcfiles.set_file_pkgconfig
|
16
|
+
# ========================================================================= #
|
17
|
+
def self.set_file_pkgconfig(
|
18
|
+
i = :default
|
19
|
+
)
|
20
|
+
case i
|
21
|
+
when :default, nil
|
22
|
+
if is_on_roebe? and File.exist?('/Depot/pkgconfig.yml')
|
23
|
+
i = '/Depot/pkgconfig.yml'
|
24
|
+
else
|
25
|
+
i = "#{project_yaml_dir?}pkgconfig.yml"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
@file_pkgconfig = i
|
29
|
+
end
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === @file_pkgconfig
|
33
|
+
#
|
34
|
+
# On my home system, the value of the toplevel @file_pkgconfig instance
|
35
|
+
# variable points to a file path such as:
|
36
|
+
#
|
37
|
+
# /Programs/Ruby/2.5.0/lib/ruby/site_ruby/2.5.0/rcfile_generator/yaml/pkgconfig.yml
|
38
|
+
#
|
39
|
+
# It may also point to another target location, though.
|
40
|
+
# ========================================================================= #
|
41
|
+
@file_pkgconfig = nil
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# === Rcfiles.file_pkgconfig?
|
45
|
+
# ========================================================================= #
|
46
|
+
def self.file_pkgconfig?
|
47
|
+
@file_pkgconfig
|
48
|
+
end; self.instance_eval { alias file_pkgconfig file_pkgconfig? } # === Rcfiles.file_pkgconfig
|
49
|
+
|
50
|
+
# ========================================================================= #
|
51
|
+
# And set it at once.
|
52
|
+
# ========================================================================= #
|
53
|
+
set_file_pkgconfig
|
54
|
+
|
55
|
+
# ========================================================================= #
|
56
|
+
# === Rcfiles.generate_pkgconfig_rcfile
|
57
|
+
# ========================================================================= #
|
58
|
+
def self.generate_pkgconfig_rcfile
|
59
|
+
_ = @file_pkgconfig
|
60
|
+
if File.exist? _
|
61
|
+
into = "#{main_directory?}pkgconfig_rc"
|
62
|
+
notify_the_user_that_this_file_will_be_generated_from_that_existing_file(into, _)
|
63
|
+
dataset = YAML.load_file(_)['pkg_config_path']
|
64
|
+
what = return_standard_header(into).dup
|
65
|
+
what << convert_this_input_to_export_file(
|
66
|
+
dataset, 'PKG_CONFIG_PATH'
|
67
|
+
)
|
68
|
+
write_what_into(what, into)
|
69
|
+
else
|
70
|
+
no_file_exists_at(_)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/files/file_programs_aliases.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
require 'rcfiles/project/project.rb'
|
10
|
+
require 'rcfiles/toplevel_methods/is_on_roebe.rb'
|
11
|
+
require 'rcfiles/toplevel_methods/convert.rb'
|
12
|
+
require 'rcfiles/toplevel_methods/notifications.rb'
|
13
|
+
|
14
|
+
# ========================================================================= #
|
15
|
+
# === Rcfiles.set_programs_aliases
|
16
|
+
# ========================================================================= #
|
17
|
+
def self.set_programs_aliases(
|
18
|
+
i = :default
|
19
|
+
)
|
20
|
+
case i
|
21
|
+
when :default, nil
|
22
|
+
if is_on_roebe? and File.exist?('/Depot/programs_aliases.yml')
|
23
|
+
i = '/Depot/programs_aliases.yml'
|
24
|
+
else
|
25
|
+
i = "#{project_yaml_dir?}programs_aliases.yml"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
@file_programs_aliases = i
|
29
|
+
end
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === Rcfiles::@file_programs_aliases
|
33
|
+
# ========================================================================= #
|
34
|
+
@file_programs_aliases = nil
|
35
|
+
|
36
|
+
set_programs_aliases
|
37
|
+
|
38
|
+
# ========================================================================= #
|
39
|
+
# === Rcfiles.file_programs_aliases?
|
40
|
+
# ========================================================================= #
|
41
|
+
def self.file_programs_aliases?
|
42
|
+
@file_programs_aliases
|
43
|
+
end; self.instance_eval { alias file_programs_aliases file_programs_aliases? } # === Rcfiles.file_programs_aliases
|
44
|
+
|
45
|
+
# ========================================================================= #
|
46
|
+
# === Rcfiles.generate_programs_aliases_rcfile
|
47
|
+
# ========================================================================= #
|
48
|
+
def self.generate_programs_aliases_rcfile
|
49
|
+
_ = @file_programs_aliases
|
50
|
+
if File.exist? _
|
51
|
+
into = "#{main_directory?}programs_aliases_rc"
|
52
|
+
notify_the_user_that_this_file_will_be_generated_from_that_existing_file(into, _)
|
53
|
+
what = return_standard_header(into).dup
|
54
|
+
hash_dataset = YAML.load_file(_)
|
55
|
+
hash_dataset.each_pair {|key, value|
|
56
|
+
if @use_quotes
|
57
|
+
what << "alias '#{key}'=\"#{value}\"\n"
|
58
|
+
else
|
59
|
+
what << "alias #{key}=#{value}\n"
|
60
|
+
end
|
61
|
+
}
|
62
|
+
write_what_into(what, into)
|
63
|
+
else
|
64
|
+
no_file_exists_at(_)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|