rcfiles 1.2.150
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 +555 -0
- data/bin/rcfiles +12 -0
- data/bin/rcfiles_run_it +7 -0
- data/doc/README.gen +516 -0
- data/img/LOGO_FOR_THE_RCFILES_PROJECT.png +0 -0
- data/lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb +137 -0
- data/lib/rcfiles/class/colours.rb +54 -0
- data/lib/rcfiles/class/initialize.rb +66 -0
- data/lib/rcfiles/class/misc.rb +300 -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 +111 -0
- data/lib/rcfiles/commandline/commandline.rb +187 -0
- data/lib/rcfiles/constants/constants.rb +253 -0
- data/lib/rcfiles/directory_aliases/README.md +2 -0
- data/lib/rcfiles/directory_aliases/directory_aliases.rb +647 -0
- data/lib/rcfiles/directory_aliases/toplevel_stored_dataset.rb +177 -0
- data/lib/rcfiles/directory_aliases/yaml_file_used_by_class_directory_aliases.rb +67 -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 +47 -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 +21877 -0
- data/lib/rcfiles/rcfiles/cd_aliases_rc +15582 -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/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 +18151 -0
- data/lib/rcfiles/rcfiles/ps1_rc +9 -0
- data/lib/rcfiles/rcfiles/special_aliases_rc +8 -0
- data/lib/rcfiles/rcfiles/system_rc +13 -0
- data/lib/rcfiles/rcfiles/system_settings_rc +192 -0
- data/lib/rcfiles/rcfiles/term_rc +9 -0
- data/lib/rcfiles/rcfiles/video_rc +24 -0
- data/lib/rcfiles/requires/require_the_directory_aliases.rb +7 -0
- data/lib/rcfiles/requires/require_the_rcfiles_constants.rb +18 -0
- data/lib/rcfiles/requires/require_the_rcfiles_project.rb +67 -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/convert_global_variables_in_the_cd_aliases_file_to_a_standalone_yaml_file.rb +50 -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 +341 -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 +35 -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 +24690 -0
- data/lib/rcfiles/yaml/cd_aliases.yml +16308 -0
- data/lib/rcfiles/yaml/global_variables/README.md +3 -0
- data/lib/rcfiles/yaml/global_variables/global_variables_extracted_from_the_file_cd_aliases.yml +121 -0
- data/lib/rcfiles/yaml/ls_colours.yml +128 -0
- data/lib/rcfiles/yaml/path_variable.yml +14 -0
- data/lib/rcfiles/yaml/pkgconfig.yml +46 -0
- data/lib/rcfiles/yaml/programs_aliases.yml +19808 -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 +526 -0
- data/lib/rcfiles/yaml/use_psych_or_syck.yml +1 -0
- data/lib/rcfiles.rb +1 -0
- data/rcfiles.gemspec +57 -0
- data/test/testing_directory_aliases.rb +47 -0
- data/test/testing_using_another_path_to_directory_aliases.rb +17 -0
- data/test/testing_yaml_to_rcfiles.rb +9 -0
- metadata +204 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# This file was automatically generated at: 26.03.2023
|
3
|
+
#
|
4
|
+
# The filename is:
|
5
|
+
#
|
6
|
+
# /home/x/programming/ruby/src/rcfiles/lib/rcfiles/rcfiles/ps1_rc
|
7
|
+
#
|
8
|
+
# =========================================================================== #
|
9
|
+
export PS1="\\033[48;5;0;38;5;3m"'${PWD%%*/}/'"\\033[0m"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# This file was automatically generated at: 04.07.2021
|
3
|
+
#
|
4
|
+
# The filename is:
|
5
|
+
#
|
6
|
+
# /home/x/programming/ruby/src/rcfiles/lib/rcfiles/rcfiles/special_aliases_rc
|
7
|
+
#
|
8
|
+
# =========================================================================== #
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# This file was automatically generated at: 26.03.2023
|
3
|
+
#
|
4
|
+
# The filename is:
|
5
|
+
#
|
6
|
+
# /home/x/programming/ruby/src/rcfiles/lib/rcfiles/rcfiles/system_rc
|
7
|
+
#
|
8
|
+
# =========================================================================== #
|
9
|
+
export computer_name="computer4"
|
10
|
+
export distribution_name="HiveOS"
|
11
|
+
export os_name="HiveOS"
|
12
|
+
export email="shevy@inbox.lt"
|
13
|
+
export create_image_gallery="false"
|
@@ -0,0 +1,192 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# This file was automatically generated at: 26.03.2023
|
3
|
+
#
|
4
|
+
# The filename is:
|
5
|
+
#
|
6
|
+
# /home/x/programming/ruby/src/rcfiles/lib/rcfiles/rcfiles/system_settings_rc
|
7
|
+
#
|
8
|
+
# =========================================================================== #
|
9
|
+
export USERS="/home"
|
10
|
+
export USERS_X="/home/x"
|
11
|
+
export RSRC=""
|
12
|
+
export IS_STD_SYSTEM="1"
|
13
|
+
export ABIWORD_FONTPATH="/System/Fonts"
|
14
|
+
export THEMES="$USR/share/themes"
|
15
|
+
export FRAME_BUFFER0="/dev/fb0"
|
16
|
+
export DEFAULT_DELAY_PLAYING_SONGS="2.2"
|
17
|
+
export LANGUAGE="en_US"
|
18
|
+
export SYSTEM_EDITOR="nano"
|
19
|
+
export MY_SYSTEM="/System"
|
20
|
+
export SYS="$MY_SYSTEM"
|
21
|
+
export SYSTEM_DIR="$MY_SYSTEM"
|
22
|
+
export MYSYSTEM="$MY_SYSTEM"
|
23
|
+
export SYSTEM_LOGS="$MY_SYSTEM/Logs"
|
24
|
+
export SYSTEM_LOG="$SYSTEM_LOGS"
|
25
|
+
export MY_CDROM="$MOUNT/CDROM"
|
26
|
+
export CDROM="$MY_CDROM"
|
27
|
+
export RECIPES="$MY_SYSTEM/Recipes"
|
28
|
+
export MY_FILES="$MY_SYSTEM# $MY_SYSTEM/Files"
|
29
|
+
export DEPOT="/Depot"
|
30
|
+
export DEPOT_DIR="$DEPOT"
|
31
|
+
export SL="$MY_SYSTEM"
|
32
|
+
export SLE="$SL/Index/bin"
|
33
|
+
export SLB="$SLE"
|
34
|
+
export SLL="$SL/Index/lib"
|
35
|
+
export RBIN="/bin"
|
36
|
+
export MY_BIN="$UBIN"
|
37
|
+
export DEV="/dev"
|
38
|
+
export BASE_LIB="/lib"
|
39
|
+
export USR="/usr"
|
40
|
+
export MY_ULIB="$USR/lib"
|
41
|
+
export UBIN="$USR/bin"
|
42
|
+
export USR_INCLUDE="$USR/include"
|
43
|
+
export U_INC="$USR_INCLUDE"
|
44
|
+
export USRINC="$USR_INCLUDE"
|
45
|
+
export UINCLUDE="$USR_INCLUDE"
|
46
|
+
export TMP_PREFIX="$USR/test"
|
47
|
+
export MYTMPDIR="$DEPOT/jj"
|
48
|
+
export DEST_DIR="$MYTMPDIR"
|
49
|
+
export MY_TMP_DIR="$MYTMPDIR"
|
50
|
+
export VAR="$MY_SYSTEM"
|
51
|
+
export MY_CODECS="$MY_SYSTEM/Codecs/"
|
52
|
+
export CODECSDIR="$MY_CODECS"
|
53
|
+
export USRSRC="$USR/src"
|
54
|
+
export FIREWIRE="$MY_MNT/Firewire"
|
55
|
+
export MOUNT1="$USB1"
|
56
|
+
export MOUNT2="$USB2"
|
57
|
+
export MOUNT3="$USB3"
|
58
|
+
export MOUNT4="$USB4"
|
59
|
+
export MOUNT5="$USB5"
|
60
|
+
export MOUNT6="$USB6"
|
61
|
+
export SYSLOGS="$VAR/Logs"
|
62
|
+
export SYSLOGLOG="$SYSLOGS"
|
63
|
+
export SYSLOG="$SYSLOGS"
|
64
|
+
export LOG="$SYSLOGS"
|
65
|
+
export MY_SYSLIB_DIR="/usr/lib/"
|
66
|
+
export MY_SYSLIBS="$MY_SYSLIB_DIR"
|
67
|
+
export MY_SYSLIB="$MY_SYSLIB_DIR"
|
68
|
+
export SYSLIB_DIR="$MY_SYSLIB_DIR"
|
69
|
+
export MYSYSLIB="$MY_SYSLIB_DIR"
|
70
|
+
export MY_SYSLIBRARIES="$MY_SYSLIB_DIR"
|
71
|
+
export SYSLIBRARIES="$MY_SYSLIB_DIR"
|
72
|
+
export MY_SYSL="$MY_SYSLIB_DIR"
|
73
|
+
export SYSMAN="$SYSLINKS/Manuals"
|
74
|
+
export TRADITIONAL_ETC="/etc"
|
75
|
+
export INIT_DIR="$TRADITIONAL_ETC/init.d/"
|
76
|
+
export SYS_SETTINGS="$MY_SYSTEM/Settings"
|
77
|
+
export ETC="$SYS_SETTINGS"
|
78
|
+
export SYSSET="$SYS_SETTINGS"
|
79
|
+
export SYSTASKS="$SYSLINKS/Tasks"
|
80
|
+
export MY_PKGCONFIG="/usr/lib/pkgconfig"
|
81
|
+
export MYPKGCONFIG="$MY_PKGCONFIG"
|
82
|
+
export PKGCONFIG_DIR="$MY_PKGCONFIG"
|
83
|
+
export SYSPKGCONFIG="$MY_PKGCONFIG"
|
84
|
+
export PKG="/usr/lib/pkgconfig"
|
85
|
+
export DEPOT_PKG="$PKG_DIR"
|
86
|
+
export MY_PACKAGES="$PKG_DIR"
|
87
|
+
export PACKAGE_DIR="$PKG_DIR"
|
88
|
+
export PACKAGES_DIR="$PKG_DIR"
|
89
|
+
export MY_PKG="$PKG_DIR"
|
90
|
+
export DEPOT_ISO="$DEPOT/ISOs"
|
91
|
+
export DEP_ISO="$DEPOT_ISO"
|
92
|
+
export SYSETC="$ETC"
|
93
|
+
export FSTAB="/etc/fstab# hmm"
|
94
|
+
export ULOCAL="$USR/local"
|
95
|
+
export ULOC="$ULOCAL"
|
96
|
+
export ULB="$ULOCAL/bin"
|
97
|
+
export SHARED_FOLDER="$DEPOT/SharedFolder/"
|
98
|
+
export SHAREDFOLDER="$SHARED_FOLDER"
|
99
|
+
export ULOCALSHARE="$ULOCAL/share"
|
100
|
+
export XINITTAB="/etc/inittab"
|
101
|
+
export MY_SWAP="$DEV/sda2"
|
102
|
+
export MY_MNT="/Mount"
|
103
|
+
export MOUNT="$MY_MNT"
|
104
|
+
export MY_MOUNT="$MY_MNT"
|
105
|
+
export MY_ROOT="/root"
|
106
|
+
export LOCAL_HOME="$USERS"
|
107
|
+
export MY_FRAME_BUFFERING="/dev/fb0"
|
108
|
+
export USING_LAPTOP="0"
|
109
|
+
export MY_XORG="$MY_PROGRAMS/X11"
|
110
|
+
export XCONFIG="/etc/X11/xorg.conf"
|
111
|
+
export X11_CONFIG="$XCONFIG"
|
112
|
+
export X11DOC="$MY_XORG/lib/X11/doc"
|
113
|
+
export MODULES="$ETC/modules"
|
114
|
+
export XORGLOG="/var/log/Xorg.0.log"
|
115
|
+
export PASSWD="$TRADITIONAL_ETC/passwd"
|
116
|
+
export SHADOW="$TRADITIONAL_ETC/shadow"
|
117
|
+
export FIRMWARE_INSTALL_DIR="/lib/firmware"
|
118
|
+
export LILO="/etc/lilo.conf"
|
119
|
+
export UPDATE_TYPE="svn"
|
120
|
+
export GRUBCONF="/boot/grub/grub.conf"
|
121
|
+
export GRUBMENU="$GRUBCONF"
|
122
|
+
export MY_GRUB="$GRUBCONF"
|
123
|
+
export GRUBLIST="$GRUBCONF"
|
124
|
+
export GRUB_MENU="$GRUBCONF"
|
125
|
+
export GRUB="$GRUBCONF"
|
126
|
+
export FESTPLATTE1="$MOUNT/HDD1"
|
127
|
+
export FESTPLATTE2="$MOUNT/HDD2"
|
128
|
+
export FIRST_HD="$FESTPLATTE1"
|
129
|
+
export SECOND_HD="$FESTPLATTE2"
|
130
|
+
export FEST1="$FESTPLATTE1"
|
131
|
+
export FEST2="$SECOND_HD"
|
132
|
+
export CDDEV="/dev/cdrom"
|
133
|
+
export LIVECD="$MOUNT/LIVECD"
|
134
|
+
export MY_LIVECD="$DEPOT/LIVECD"
|
135
|
+
export MYLIVECD="$LIVECD"
|
136
|
+
export DEPOT_VIDEO="$DEPOT/Video"
|
137
|
+
export DEPVID="$DEPOT_VIDEO"
|
138
|
+
export ACLOCAL_FLAGS="-I /usr/share/aclocal"
|
139
|
+
export XCHATSHAREDIR="/usr/local/share/xchat"
|
140
|
+
export KEYTABLE="de-latin1-nodeadkeys"
|
141
|
+
export KEYBOARDTYPE="pc105"
|
142
|
+
export KEYMAP="de-latin1"
|
143
|
+
export PAGER="most"
|
144
|
+
export SYSFONTS="$MY_SYSTEM/Fonts"
|
145
|
+
export MY_FONTS="$SYSFONTS"
|
146
|
+
export INPUTRC="/etc/inputrc"
|
147
|
+
export IS_ON_GOBOLINUX="0"
|
148
|
+
export MY_SYSSHARE_DIR="$SYSLINKS/Shared"
|
149
|
+
export SYSSHARED="$MY_SYSSHARE_DIR"
|
150
|
+
export SYSSHARE="$MY_SYSSHARE_DIR"
|
151
|
+
export SYSSHARE_DIR="$MY_SYSSHARE_DIR"
|
152
|
+
export MY_SYSSHARED="$MY_SYSSHARE_DIR"
|
153
|
+
export SYSLINKS="$MY_SYSTEM"
|
154
|
+
export SYSLINK="$SYSLINKS"
|
155
|
+
export SYSDAEMONS="$SYSLINKS/Daemons"
|
156
|
+
export SYSENV="$SYSLINKS/Environment"
|
157
|
+
export MY_SYSBINARIES="$MY_SYSBIN"
|
158
|
+
export MY_SYSBIN_DIR="/usr/bin"
|
159
|
+
export MY_SYSBIN="$MY_SYSBIN_DIR"
|
160
|
+
export SYSEXEC="$MY_SYSBIN_DIR"
|
161
|
+
export SYSBIN_DIR="$MY_SYSBIN_DIR"
|
162
|
+
export SYSBINARIES="$MY_SYSBIN_DIR"
|
163
|
+
export MY_SYSHEADERS="/usr/include"
|
164
|
+
export SYSINC="$MY_SYSHEADERS"
|
165
|
+
export SYSINC_DIR="$MY_SYSHEADERS"
|
166
|
+
export MY_SYSINCLUDE_DIR="$MY_SYSHEADERS"
|
167
|
+
export SYSINCLUDEE="$MY_SYSHEADERS"
|
168
|
+
export MY_SYSINCLUDE="$MY_SYSHEADERS"
|
169
|
+
export MY_SYSINC="$MY_SYSHEADERS"
|
170
|
+
export SYSI="$MY_SYSHEADERS"
|
171
|
+
export CHARSET="UTF-8"
|
172
|
+
export TZ="Etc/UTC+2"
|
173
|
+
export MY_TEMP="/home/Temp"
|
174
|
+
export TMPDIR="$MY_TEMP"
|
175
|
+
export TEMP_DIR="$MY_TEMP"
|
176
|
+
export PROGRAMS_DIR="$USERS/Programs"
|
177
|
+
export MY_PROGRAMS="$PROGRAMS_DIR"
|
178
|
+
export P="$PROGRAMS_DIR"
|
179
|
+
export USB1="$MY_MNT/USB1"
|
180
|
+
export MOUNT_USB1="$USB1"
|
181
|
+
export USB2="$MY_MNT/USB2"
|
182
|
+
export MOUNT_USB2="$USB2"
|
183
|
+
export USB3="$MY_MNT/USB3"
|
184
|
+
export MOUNT_USB3="$USB3"
|
185
|
+
export USB4="$MY_MNT/USB4"
|
186
|
+
export MOUNT_USB4="$USB4"
|
187
|
+
export USB5="$MY_MNT/USB5"
|
188
|
+
export MOUNT_USB5="$USB5"
|
189
|
+
export USB6="$MY_MNT/USB6"
|
190
|
+
export COOKBOOK_DIRECTORY="/home/x/programming/ruby/src/rbt/lib/rbt/yaml/"
|
191
|
+
export REAL_COOKBOOK_DIRECTORY="$COOKBOOK_DIRECTORY/cookbooks"
|
192
|
+
export LC_ALL="en_US.utf8"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# This file was automatically generated at: 26.03.2023
|
3
|
+
#
|
4
|
+
# The filename is:
|
5
|
+
#
|
6
|
+
# /home/x/programming/ruby/src/rcfiles/lib/rcfiles/rcfiles/term_rc
|
7
|
+
#
|
8
|
+
# =========================================================================== #
|
9
|
+
export TERM="xterm-256color"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# This file was automatically generated at: 26.03.2023
|
3
|
+
#
|
4
|
+
# The filename is:
|
5
|
+
#
|
6
|
+
# /home/x/programming/ruby/src/rcfiles/lib/rcfiles/rcfiles/video_rc
|
7
|
+
#
|
8
|
+
# =========================================================================== #
|
9
|
+
export MY_DVD="$MOUNT/DVD"
|
10
|
+
export MYDVD="$MY_DVD"
|
11
|
+
export DVDD="$MY_DVD"
|
12
|
+
export MOUNTED_DVD="$MY_DVD"
|
13
|
+
export MY_DVD_COVER="$IMG/VIDEO/COVERS"
|
14
|
+
export DVDCOVER="${MY_DVD_COVER}/DVD_COVER.jpg"
|
15
|
+
export DVD_COVER="$DVDCOVER"
|
16
|
+
export CLIPS="$DEPOT/Video"
|
17
|
+
export DEPOT_DVD="$DEPOT/DVD"
|
18
|
+
export VIDEO="$CLIPS"
|
19
|
+
export MY_VIDEOS="$CLIPS"
|
20
|
+
export VID="$VIDEO"
|
21
|
+
export VIDEO_STREAM_1="http://streaming-26c3-ice.fem-net.de:3000/saal1"
|
22
|
+
export VIDEO_STREAM_2="http://streaming-26c3-ice.fem-net.de:3000/saal2"
|
23
|
+
export VIDEO_STREAM_3="http://streaming-26c3-ice.fem-net.de:3000/saal3"
|
24
|
+
export MAIN_VIDEO_PLAYER="mplayer"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/requires/require_the_directory_aliases.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'rcfiles/directory_aliases/directory_aliases.rb'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# This file will also "bundle" together all the constants for this project.
|
6
|
+
# =========================================================================== #
|
7
|
+
# require 'rcfiles/requires/require_the_rcfiles_constants.rb'
|
8
|
+
# =========================================================================== #
|
9
|
+
require 'rcfiles/project/project.rb'
|
10
|
+
require 'rcfiles/constants/constants.rb'
|
11
|
+
# =========================================================================== #
|
12
|
+
# We will also pull in the .rb files under files/ because they were
|
13
|
+
# original part of constants/.
|
14
|
+
# =========================================================================== #
|
15
|
+
require 'rcfiles/files/file_aliases.rb'
|
16
|
+
require 'rcfiles/files/file_cd_aliases.rb'
|
17
|
+
require 'rcfiles/files/file_programs_aliases.rb'
|
18
|
+
require 'rcfiles/files/file_system_settings.rb'
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/requires/require_the_rcfiles_project.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'rcfiles/requires/try_to_require_syck_and_psych.rb'
|
8
|
+
# =========================================================================== #
|
9
|
+
# Require the project/*rb files next:
|
10
|
+
# =========================================================================== #
|
11
|
+
require 'rcfiles/project/project.rb'
|
12
|
+
require 'rcfiles/requires/require_the_rcfiles_constants.rb'
|
13
|
+
require 'rcfiles/version/version.rb'
|
14
|
+
# =========================================================================== #
|
15
|
+
# Next require the files under the files/ subdirectory:
|
16
|
+
# =========================================================================== #
|
17
|
+
require 'rcfiles/files/file_aliases.rb'
|
18
|
+
require 'rcfiles/files/file_cd_aliases.rb'
|
19
|
+
require 'rcfiles/files/file_programs_aliases.rb'
|
20
|
+
require 'rcfiles/files/file_system_settings.rb'
|
21
|
+
# =========================================================================== #
|
22
|
+
# Require the help-file:
|
23
|
+
# =========================================================================== #
|
24
|
+
require 'rcfiles/help/help.rb'
|
25
|
+
# =========================================================================== #
|
26
|
+
# Next require the colours:
|
27
|
+
# =========================================================================== #
|
28
|
+
require 'rcfiles/colours/colours.rb'
|
29
|
+
# =========================================================================== #
|
30
|
+
# Next, load up the .rb files under rcfiles/toplevel_methods. We will
|
31
|
+
# keep misc.rb last since it pulls in a few other .rb files.
|
32
|
+
# =========================================================================== #
|
33
|
+
%w(
|
34
|
+
convert
|
35
|
+
e
|
36
|
+
esystem
|
37
|
+
infer
|
38
|
+
is_on_roebe
|
39
|
+
main_directory
|
40
|
+
n_registered_aliases_in_total
|
41
|
+
rds
|
42
|
+
remove_newlines
|
43
|
+
report
|
44
|
+
return_standard_header
|
45
|
+
use_quotes
|
46
|
+
run_it
|
47
|
+
use_psych_or_syck
|
48
|
+
generate_yaml_files
|
49
|
+
autogenerate_rc_file_from_this_yaml_file
|
50
|
+
misc
|
51
|
+
).each {|this_file|
|
52
|
+
require "rcfiles/toplevel_methods/#{this_file}.rb"
|
53
|
+
}
|
54
|
+
# =========================================================================== #
|
55
|
+
# Require rcfiles commandline-related code:
|
56
|
+
# =========================================================================== #
|
57
|
+
require 'rcfiles/commandline/commandline.rb'
|
58
|
+
# =========================================================================== #
|
59
|
+
# Next require the main class of the rcfiles project:
|
60
|
+
# =========================================================================== #
|
61
|
+
require 'rcfiles/class/rcfiles.rb'
|
62
|
+
# =========================================================================== #
|
63
|
+
# And also require the directory_aliases component that is part of the
|
64
|
+
# rcfiles project since May 2019 (and rewritten in May 2022):
|
65
|
+
# =========================================================================== #
|
66
|
+
require 'rcfiles/requires/require_the_directory_aliases.rb'
|
67
|
+
require 'rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/requires/try_to_require_syck_and_psych.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'rcfiles/toplevel_methods/use_psych_or_syck.rb'
|
8
|
+
|
9
|
+
case Rcfiles.use_psych_or_syck?
|
10
|
+
when :psych
|
11
|
+
require 'psych'
|
12
|
+
when :syck
|
13
|
+
begin
|
14
|
+
require 'try_syck'
|
15
|
+
rescue LoadError
|
16
|
+
require 'syck'
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/toplevel_methods/autogenerate_rc_file_from_this_yaml_file.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
require 'rcfiles/toplevel_methods/convert.rb'
|
10
|
+
require 'rcfiles/toplevel_methods/main_directory.rb'
|
11
|
+
require 'rcfiles/toplevel_methods/rds.rb'
|
12
|
+
require 'rcfiles/toplevel_methods/return_standard_header.rb'
|
13
|
+
require 'rcfiles/toplevel_methods/save_file.rb'
|
14
|
+
|
15
|
+
begin
|
16
|
+
require 'opn'
|
17
|
+
rescue LoadError; end
|
18
|
+
|
19
|
+
# ========================================================================= #
|
20
|
+
# === Rcfiles.populate_this_directory
|
21
|
+
# ========================================================================= #
|
22
|
+
def self.populate_this_directory(i)
|
23
|
+
self.store_at = i
|
24
|
+
generate_the_most_important_rcfiles
|
25
|
+
end
|
26
|
+
|
27
|
+
# ========================================================================= #
|
28
|
+
# === Rcfiles.autogenerate_rc_file_from_this_yaml_file
|
29
|
+
#
|
30
|
+
# The first argument to this method shall denote the full path to an
|
31
|
+
# existing .yml file.
|
32
|
+
#
|
33
|
+
# The second argument determines whether we will be verbose or silent.
|
34
|
+
# Verbose in this context means to display text to the user.
|
35
|
+
#
|
36
|
+
# Invocation example:
|
37
|
+
#
|
38
|
+
# Rcfiles.autogenerate_rc_file_from_this_yaml_file('/home/x/data/PROGRAMMING_LANGUAGES/RUBY/src/rcfile_generator/lib/rcfile_generator/yaml/cd_aliases.yml')
|
39
|
+
#
|
40
|
+
# ========================================================================= #
|
41
|
+
def self.autogenerate_rc_file_from_this_yaml_file(
|
42
|
+
this_yaml_file = 1,
|
43
|
+
be_verbose = true
|
44
|
+
)
|
45
|
+
# ======================================================================= #
|
46
|
+
# Next denote the base directory to use.
|
47
|
+
# ======================================================================= #
|
48
|
+
base_directory_to_use = main_directory?
|
49
|
+
# ======================================================================= #
|
50
|
+
# Handle some common symbols next. These are assumed to be shortcuts.
|
51
|
+
# Additionally we will support some numbers as well.
|
52
|
+
# ======================================================================= #
|
53
|
+
case this_yaml_file # case tag
|
54
|
+
# ======================================================================= #
|
55
|
+
# === :cd_aliases
|
56
|
+
# ======================================================================= #
|
57
|
+
when :cd_aliases,
|
58
|
+
1,
|
59
|
+
'1'
|
60
|
+
this_yaml_file = file_cd_aliases?
|
61
|
+
# ======================================================================= #
|
62
|
+
# === :aliases
|
63
|
+
# ======================================================================= #
|
64
|
+
when :aliases,
|
65
|
+
2,
|
66
|
+
'2'
|
67
|
+
this_yaml_file = file_aliases?
|
68
|
+
# ======================================================================= #
|
69
|
+
# === :program_aliases
|
70
|
+
# ======================================================================= #
|
71
|
+
when :program_aliases,
|
72
|
+
3,
|
73
|
+
'3'
|
74
|
+
this_yaml_file = file_programs_aliases?
|
75
|
+
end
|
76
|
+
if File.exist? this_yaml_file
|
77
|
+
where = rds(
|
78
|
+
base_directory_to_use+
|
79
|
+
File.basename(this_yaml_file).
|
80
|
+
sub(/\.yml$/,'')+'_rc'.dup
|
81
|
+
)
|
82
|
+
# ===================================================================== #
|
83
|
+
# If the file exists, we can continue. We will assume that the
|
84
|
+
# yaml file at hand is of export-type, that is, the variables
|
85
|
+
# will be like: export FOO="bar"
|
86
|
+
# ===================================================================== #
|
87
|
+
if be_verbose
|
88
|
+
opn; e "Next loading from the file #{sfile(this_yaml_file)}"
|
89
|
+
end
|
90
|
+
yaml_dataset = YAML.load_file(this_yaml_file)
|
91
|
+
# store_this_data = ensure_main_encoding(''.dup)
|
92
|
+
# store_this_data << ensure_main_encoding(return_standard_header(where))
|
93
|
+
store_this_data = return_standard_header(where).dup
|
94
|
+
store_this_data << convert_hash_to_export_file(yaml_dataset, :ensure_proper_encoding)
|
95
|
+
if be_verbose
|
96
|
+
opn; e "Storing into -> `#{sfile(where)}`."
|
97
|
+
end
|
98
|
+
write_what_into(store_this_data.chomp, where)
|
99
|
+
end
|
100
|
+
end; self.instance_eval { alias generate autogenerate_rc_file_from_this_yaml_file } # === Rcfiles.generate
|
101
|
+
|
102
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/toplevel_methods/change_directory.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === Rcfiles.change_directory
|
11
|
+
# ========================================================================= #
|
12
|
+
def self.change_directory(i)
|
13
|
+
Dir.chdir(i) if File.directory? i
|
14
|
+
end; self.instance_eval { alias cd change_directory } # === Rcfiles.cd
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# This file contains code that can convert a .yml file into a bash
|
6
|
+
# rcfile, either using "alias" or "export" statements.
|
7
|
+
# =========================================================================== #
|
8
|
+
# require 'rcfiles/toplevel_methods/convert.rb'
|
9
|
+
# Rcfiles.convert_this_hash_to_export_file
|
10
|
+
# =========================================================================== #
|
11
|
+
module Rcfiles
|
12
|
+
|
13
|
+
require 'rcfiles/constants/constants.rb'
|
14
|
+
require 'rcfiles/toplevel_methods/remove_newlines.rb'
|
15
|
+
require 'rcfiles/toplevel_methods/use_quotes.rb'
|
16
|
+
|
17
|
+
# ========================================================================= #
|
18
|
+
# === Rcfiles.convert_this_hash_to_alias_file
|
19
|
+
#
|
20
|
+
# This method expects a Hash as input.
|
21
|
+
# ========================================================================= #
|
22
|
+
def self.convert_this_hash_to_alias_file(
|
23
|
+
hash
|
24
|
+
)
|
25
|
+
_ = ''.dup # <- Our return String.
|
26
|
+
hash.each_pair {|key, value|
|
27
|
+
value = remove_newlines(value.to_s.strip)
|
28
|
+
if @use_quotes
|
29
|
+
_ << "alias '#{key}'=\"#{value}\"#{N}"
|
30
|
+
else
|
31
|
+
_ << "alias #{key}=#{value}#{N}"
|
32
|
+
end
|
33
|
+
} if hash
|
34
|
+
return _
|
35
|
+
end; self.instance_eval { alias convert_hash_to_alias_file convert_this_hash_to_alias_file } # === Rcfiles.convert_hash_to_alias_file
|
36
|
+
|
37
|
+
# ========================================================================= #
|
38
|
+
# === Rcfiles.convert_this_array_to_export_file
|
39
|
+
#
|
40
|
+
# This method expects an Array as input.
|
41
|
+
#
|
42
|
+
# Arrays are handled a bit differently, though - they will be aggregated
|
43
|
+
# into one input value for "export".
|
44
|
+
# ========================================================================= #
|
45
|
+
def self.convert_this_array_to_export_file(
|
46
|
+
array,
|
47
|
+
optional_second_input_as_name_of_the_export_variable = 'PKG_CONFIG_PATH'
|
48
|
+
)
|
49
|
+
if array and array.is_a?(Array)
|
50
|
+
_ = ''.dup # <- Our return String.
|
51
|
+
joined = array.join(':').strip
|
52
|
+
_ << "export #{optional_second_input_as_name_of_the_export_variable}=\"#{joined}\"#{N}"
|
53
|
+
return _
|
54
|
+
else
|
55
|
+
array
|
56
|
+
end
|
57
|
+
end; self.instance_eval { alias convert_array_to_export_file convert_this_array_to_export_file } # === Rcfiles.convert_array_to_export_file
|
58
|
+
|
59
|
+
# ========================================================================= #
|
60
|
+
# === Rcfiles.convert_this_input_to_export_file
|
61
|
+
# ========================================================================= #
|
62
|
+
def self.convert_this_input_to_export_file(
|
63
|
+
i, optional_second_input_as_name_of_the_export_variable = nil
|
64
|
+
)
|
65
|
+
case i
|
66
|
+
when Hash
|
67
|
+
# ===================================================================== #
|
68
|
+
# Hashes will ignore the optional second argument to this method, even
|
69
|
+
# if it has been provided. The reason is primarily because we expect
|
70
|
+
# a key -> value entry of a Hash already, so the kew is known; whereas
|
71
|
+
# for an Array, we actually need the user to supply the name of the
|
72
|
+
# key at hand.
|
73
|
+
# ===================================================================== #
|
74
|
+
convert_this_hash_to_export_file(i)
|
75
|
+
when Array
|
76
|
+
convert_this_array_to_export_file(i, optional_second_input_as_name_of_the_export_variable)
|
77
|
+
when String
|
78
|
+
convert_this_array_to_export_file([i], optional_second_input_as_name_of_the_export_variable)
|
79
|
+
else
|
80
|
+
e "Unregistered input-class (#{i.class})"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# ========================================================================= #
|
85
|
+
# === Rcfiles.convert_this_hash_to_export_file
|
86
|
+
#
|
87
|
+
# This method expects a Hash as input. If you need a bit more flexibility
|
88
|
+
# then you are encouraged to use the other method, called
|
89
|
+
# Rcfiles.convert_this_input_to_export_file() instead.
|
90
|
+
# ========================================================================= #
|
91
|
+
def self.convert_this_hash_to_export_file(
|
92
|
+
hash,
|
93
|
+
ensure_proper_encoding = false
|
94
|
+
)
|
95
|
+
case ensure_proper_encoding
|
96
|
+
when :ensure_proper_encoding
|
97
|
+
ensure_proper_encoding = true
|
98
|
+
end
|
99
|
+
_ = ''.dup # <- Our return String.
|
100
|
+
hash.each_pair {|key, value|
|
101
|
+
value = value.to_s.strip
|
102
|
+
if ensure_proper_encoding
|
103
|
+
value = ensure_proper_encoding_for(value)
|
104
|
+
key = ensure_proper_encoding_for(value)
|
105
|
+
end
|
106
|
+
value = value.tr("\n", ' ').squeeze(' ')
|
107
|
+
_ << "export #{key}=\"#{value}\"#{N}"
|
108
|
+
} if hash
|
109
|
+
return _
|
110
|
+
end; self.instance_eval { alias convert_hash_to_export_file convert_this_hash_to_export_file } # === Rcfiles.convert_hash_to_export_file
|
111
|
+
|
112
|
+
end
|
113
|
+
|
114
|
+
if __FILE__ == $PROGRAM_NAME
|
115
|
+
Rcfiles.convert_this_hash_to_export_file(
|
116
|
+
{ cat: :tom, mouse: :jerry }
|
117
|
+
)
|
118
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'rcfiles/toplevel_methods/convert_global_variables_in_the_cd_aliases_file_to_a_standalone_yaml_file.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module Rcfiles
|
8
|
+
|
9
|
+
require 'rcfiles/toplevel_methods/e.rb'
|
10
|
+
|
11
|
+
# ========================================================================= #
|
12
|
+
# === Rcfiles.convert_global_variables_in_the_cd_aliases_file_to_a_standalone_yaml_file
|
13
|
+
#
|
14
|
+
# This method will collect all $ global variables found in the file
|
15
|
+
# called "cd_aliases.yml" into a standalone .yml file. That .yml file
|
16
|
+
# can then be loaded by other projects.
|
17
|
+
# ========================================================================= #
|
18
|
+
def self.convert_global_variables_in_the_cd_aliases_file_to_a_standalone_yaml_file(
|
19
|
+
use_this_as_the_input_file =
|
20
|
+
'/home/x/programming/ruby/src/rcfiles/lib/rcfiles/yaml/cd_aliases.yml'
|
21
|
+
)
|
22
|
+
require 'yaml'
|
23
|
+
require 'convert_global_env'
|
24
|
+
require 'save_file'
|
25
|
+
use_this_regex = /\$(\w+)/ # See: https://rubular.com/r/w75cLOvTTDfJvL
|
26
|
+
_ = use_this_as_the_input_file
|
27
|
+
if File.exist? _
|
28
|
+
dataset = File.read(_)
|
29
|
+
scanned = dataset.scan(use_this_regex).flatten.uniq
|
30
|
+
# Now we have the array. We next have to build up our main Hash.
|
31
|
+
hash = {}
|
32
|
+
scanned.each {|this_key|
|
33
|
+
hash[this_key] = ConvertGlobalEnv['$'+this_key]
|
34
|
+
}
|
35
|
+
what = YAML.dump(hash)
|
36
|
+
into = '/home/x/programming/ruby/src/rcfiles/lib/rcfiles/yaml/global_variables/'\
|
37
|
+
'global_variables_extracted_from_the_file_cd_aliases.yml'
|
38
|
+
e 'Storing into the file `'+into+'`.'
|
39
|
+
SaveFile.write_what_into(what, into)
|
40
|
+
store_this = YAML.dump(scanned)
|
41
|
+
else
|
42
|
+
e 'No file exists at '+_+'.'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
if __FILE__ == $PROGRAM_NAME
|
49
|
+
Rcfiles.convert_global_variables_in_the_cd_aliases_file_to_a_standalone_yaml_file
|
50
|
+
end
|