ftp_paradise 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +319 -0
- data/bin/create_remote_directory +9 -0
- data/bin/ftp_get +17 -0
- data/bin/ftp_gtk3 +7 -0
- data/bin/ftp_upload +42 -0
- data/bin/ftp_upload_binary +18 -0
- data/bin/iftp +7 -0
- data/bin/remote_remove +28 -0
- data/doc/README.gen +302 -0
- data/doc/todo/TODO_FOR_FTP_PARADISE_PROJECT.md +79 -0
- data/ftp_paradise.gemspec +122 -0
- data/lib/ftp_paradise.rb +5 -0
- data/lib/ftp_paradise/base/cliner.rb +23 -0
- data/lib/ftp_paradise/base/colours.rb +83 -0
- data/lib/ftp_paradise/base/prototype.rb +171 -0
- data/lib/ftp_paradise/base/reset.rb +29 -0
- data/lib/ftp_paradise/colours/colours.rb +141 -0
- data/lib/ftp_paradise/colours/use_colours.rb +76 -0
- data/lib/ftp_paradise/configuration/configuration.rb +49 -0
- data/lib/ftp_paradise/connection/README.md +1 -0
- data/lib/ftp_paradise/connection/connection.rb +35 -0
- data/lib/ftp_paradise/connection/constants.rb +46 -0
- data/lib/ftp_paradise/connection/data.rb +164 -0
- data/lib/ftp_paradise/connection/debug.rb +78 -0
- data/lib/ftp_paradise/connection/directory_handling.rb +271 -0
- data/lib/ftp_paradise/connection/do_login.rb +108 -0
- data/lib/ftp_paradise/connection/download.rb +86 -0
- data/lib/ftp_paradise/connection/file_handling.rb +174 -0
- data/lib/ftp_paradise/connection/ftp_object.rb +21 -0
- data/lib/ftp_paradise/connection/initialize.rb +88 -0
- data/lib/ftp_paradise/connection/initialize_a_new_net_ftp_object_with_this_url.rb +20 -0
- data/lib/ftp_paradise/connection/is_connected.rb +46 -0
- data/lib/ftp_paradise/connection/misc.rb +474 -0
- data/lib/ftp_paradise/connection/notify.rb +71 -0
- data/lib/ftp_paradise/connection/password.rb +47 -0
- data/lib/ftp_paradise/connection/port.rb +33 -0
- data/lib/ftp_paradise/connection/remote_pwd.rb +72 -0
- data/lib/ftp_paradise/connection/remote_url.rb +164 -0
- data/lib/ftp_paradise/connection/remove.rb +143 -0
- data/lib/ftp_paradise/connection/reset.rb +78 -0
- data/lib/ftp_paradise/connection/run.rb +18 -0
- data/lib/ftp_paradise/connection/set_array_available_hosts.rb +27 -0
- data/lib/ftp_paradise/connection/set_input.rb +18 -0
- data/lib/ftp_paradise/connection/show.rb +153 -0
- data/lib/ftp_paradise/connection/sync_ftp_object_onto_the_main_namespace.rb +24 -0
- data/lib/ftp_paradise/connection/transfer_mode.rb +163 -0
- data/lib/ftp_paradise/connection/upload.rb +253 -0
- data/lib/ftp_paradise/connection/use_default_dataset.rb +40 -0
- data/lib/ftp_paradise/connection/username.rb +42 -0
- data/lib/ftp_paradise/constants/constants.rb +19 -0
- data/lib/ftp_paradise/constants/misc.rb +57 -0
- data/lib/ftp_paradise/constants/namespace.rb +14 -0
- data/lib/ftp_paradise/constants/newline.rb +14 -0
- data/lib/ftp_paradise/constants/roebe.rb +31 -0
- data/lib/ftp_paradise/constants/roebe_ftp_constants.rb +233 -0
- data/lib/ftp_paradise/entry/entry.rb +300 -0
- data/lib/ftp_paradise/gui/gtk2/ftp_paradise.rb +34 -0
- data/lib/ftp_paradise/gui/gtk3/ftp_paradise.rb +34 -0
- data/lib/ftp_paradise/gui/shared_code/ftp_paradise/ftp_paradise_module.rb +709 -0
- data/lib/ftp_paradise/images/connection_image.png +0 -0
- data/lib/ftp_paradise/interactive_ftp/constants.rb +103 -0
- data/lib/ftp_paradise/interactive_ftp/directory_handling.rb +216 -0
- data/lib/ftp_paradise/interactive_ftp/help.rb +50 -0
- data/lib/ftp_paradise/interactive_ftp/initialize.rb +27 -0
- data/lib/ftp_paradise/interactive_ftp/interactive_ftp.rb +998 -0
- data/lib/ftp_paradise/interactive_ftp/main_loop.rb +51 -0
- data/lib/ftp_paradise/interactive_ftp/menu.rb +786 -0
- data/lib/ftp_paradise/interactive_ftp/misc.rb +208 -0
- data/lib/ftp_paradise/interactive_ftp/mode.rb +124 -0
- data/lib/ftp_paradise/interactive_ftp/readline.rb +113 -0
- data/lib/ftp_paradise/interactive_ftp/remove.rb +97 -0
- data/lib/ftp_paradise/interactive_ftp/reset.rb +90 -0
- data/lib/ftp_paradise/interactive_ftp/run.rb +22 -0
- data/lib/ftp_paradise/interactive_ftp/show.rb +184 -0
- data/lib/ftp_paradise/interactive_ftp/upload.rb +90 -0
- data/lib/ftp_paradise/interactive_ftp/user_input.rb +53 -0
- data/lib/ftp_paradise/project/project.rb +64 -0
- data/lib/ftp_paradise/requires/common_basic_requires.rb +14 -0
- data/lib/ftp_paradise/requires/common_external_requires.rb +9 -0
- data/lib/ftp_paradise/requires/require_the_constants.rb +7 -0
- data/lib/ftp_paradise/requires/require_the_ftp_paradise_project.rb +18 -0
- data/lib/ftp_paradise/requires/require_the_ftp_paradise_project_with_the_GUI_bindings.rb +10 -0
- data/lib/ftp_paradise/requires/require_the_toplevel_methods.rb +24 -0
- data/lib/ftp_paradise/toplevel_methods/can_connect_to_remote_site.rb +28 -0
- data/lib/ftp_paradise/toplevel_methods/clear_user_dataset.rb +28 -0
- data/lib/ftp_paradise/toplevel_methods/connect.rb +50 -0
- data/lib/ftp_paradise/toplevel_methods/data.rb +31 -0
- data/lib/ftp_paradise/toplevel_methods/determine_user_dataset_from_this_hash.rb +37 -0
- data/lib/ftp_paradise/toplevel_methods/directory_related_actions.rb +33 -0
- data/lib/ftp_paradise/toplevel_methods/e.rb +16 -0
- data/lib/ftp_paradise/toplevel_methods/file_related_actions.rb +49 -0
- data/lib/ftp_paradise/toplevel_methods/ftp_object.rb +270 -0
- data/lib/ftp_paradise/toplevel_methods/is_on_roebe.rb +20 -0
- data/lib/ftp_paradise/toplevel_methods/login_name.rb +49 -0
- data/lib/ftp_paradise/toplevel_methods/misc.rb +16 -0
- data/lib/ftp_paradise/toplevel_methods/opn.rb +24 -0
- data/lib/ftp_paradise/toplevel_methods/password.rb +50 -0
- data/lib/ftp_paradise/toplevel_methods/port.rb +41 -0
- data/lib/ftp_paradise/toplevel_methods/rds.rb +18 -0
- data/lib/ftp_paradise/toplevel_methods/remote_url.rb +57 -0
- data/lib/ftp_paradise/toplevel_methods/time.rb +45 -0
- data/lib/ftp_paradise/toplevel_methods/upload_and_download.rb +108 -0
- data/lib/ftp_paradise/version/version.rb +19 -0
- data/lib/ftp_paradise/www/public/css/style.css +3 -0
- data/lib/ftp_paradise/www/sinatra_web_interface.rb +242 -0
- data/lib/ftp_paradise/www/views/index.slim +3 -0
- data/lib/ftp_paradise/www/views/layout.slim +11 -0
- data/lib/ftp_paradise/www/web_interface.cgi +34 -0
- data/lib/ftp_paradise/yaml/automatically_connect_on_startup_of_the_interactive_ftp_shell.yml +1 -0
- data/lib/ftp_paradise/yaml/debug.yml +1 -0
- data/lib/ftp_paradise/yaml/open_in_default_editor.yml +1 -0
- data/lib/ftp_paradise/yaml/show_full_names.yml +1 -0
- data/lib/ftp_paradise/yaml/use_colours.yml +1 -0
- data/test/testing_ftp_paradise.rb +94 -0
- data/test/testing_minimal_pure_net_ftp_example_to_connect.rb +28 -0
- data/test/testing_the_ftp_connection_component.rb +70 -0
- data/test/testing_upload_a_local_directory.rb +10 -0
- metadata +336 -0
@@ -0,0 +1,253 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'ftp_paradise/connection/upload.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module FtpParadise
|
8
|
+
|
9
|
+
class Connection
|
10
|
+
|
11
|
+
require 'ftp_paradise/connection/remote_pwd.rb'
|
12
|
+
require 'ftp_paradise/connection/is_connected.rb'
|
13
|
+
|
14
|
+
# ========================================================================= #
|
15
|
+
# === upload_binary_file
|
16
|
+
#
|
17
|
+
# Use this method to upload a binary file to a remote host.
|
18
|
+
#
|
19
|
+
# The first argument `i` is the file that we wish to upload.
|
20
|
+
#
|
21
|
+
# The method will make use of the method .putbinaryfile().
|
22
|
+
#
|
23
|
+
# Documentation for that file can be found here:
|
24
|
+
#
|
25
|
+
# https://ruby-doc.org/stdlib/libdoc/net/ftp/rdoc/Net/FTP.html#method-i-putbinaryfile
|
26
|
+
#
|
27
|
+
# ========================================================================= #
|
28
|
+
def upload_binary_file(
|
29
|
+
i,
|
30
|
+
be_verbose = be_verbose?
|
31
|
+
)
|
32
|
+
be_verbose = false if be_verbose == :be_silent
|
33
|
+
if i.is_a? Array
|
34
|
+
i.each {|entry| upload_binary_file(entry, be_verbose) }
|
35
|
+
else
|
36
|
+
i = i.strip.delete(N) # Added Feb 2014.
|
37
|
+
if be_verbose
|
38
|
+
notify_the_user_about(i, __method__)
|
39
|
+
end
|
40
|
+
begin
|
41
|
+
# =================================================================== #
|
42
|
+
# Next we will delegate towards the @ftp_object:
|
43
|
+
# =================================================================== #
|
44
|
+
ftp_object?.putbinaryfile(i) # We will use the method .putbinaryfile()
|
45
|
+
@internal_hash[:uploaded_these_files] << i
|
46
|
+
if be_verbose
|
47
|
+
remote_path = rds(remote_path?+'/'+File.basename(i))
|
48
|
+
e 'Done uploading! The remote path is: '
|
49
|
+
e " #{simp(remote_path)}"
|
50
|
+
report_finished_uploading_of_this_file(i)
|
51
|
+
end
|
52
|
+
rescue Exception => error
|
53
|
+
e 'An error happened as we tried to use the method '+simp('upload_binary()')+'.'
|
54
|
+
e 'The method we used was: '+simp('ftp?.putbinaryfile(i)')
|
55
|
+
e 'We will feedback this error now (of class '+sfancy(error.class.to_s)+'):'
|
56
|
+
pp error
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end; alias upload_binary upload_binary_file # === upload_binary
|
60
|
+
alias upload_this_binary_file upload_binary_file # === upload_this_binary_file()
|
61
|
+
|
62
|
+
# ========================================================================= #
|
63
|
+
# === upload_file
|
64
|
+
#
|
65
|
+
# This method will distinguish between a binary file or a text file,
|
66
|
+
# based on the transfer mode in use. The default is to work on a
|
67
|
+
# text file.
|
68
|
+
# ========================================================================= #
|
69
|
+
def upload_file(
|
70
|
+
i,
|
71
|
+
be_verbose = be_verbose?
|
72
|
+
)
|
73
|
+
if File.exist? i
|
74
|
+
case transfer_mode?
|
75
|
+
# ===================================================================== #
|
76
|
+
# === :ascii
|
77
|
+
# ===================================================================== #
|
78
|
+
when :ascii,
|
79
|
+
:text,
|
80
|
+
:default
|
81
|
+
upload_this_text_file(i, be_verbose)
|
82
|
+
# ===================================================================== #
|
83
|
+
# === :binary
|
84
|
+
# ===================================================================== #
|
85
|
+
when :binary
|
86
|
+
upload_this_binary_file(i, be_verbose)
|
87
|
+
end
|
88
|
+
update_raw_listing(:be_quiet)
|
89
|
+
else
|
90
|
+
opnn; e "No file called `#{sfile(i)}` appears to exist locally."
|
91
|
+
end
|
92
|
+
end; alias upload_this_file upload_file # === upload_this_file
|
93
|
+
|
94
|
+
# ========================================================================= #
|
95
|
+
# === upload (upload tag)
|
96
|
+
#
|
97
|
+
# This method can upload binary files, text files and whole directories.
|
98
|
+
# Based on that check, the method body will behave differently, and
|
99
|
+
# delegate to other methods such as upload_directory() or upload_file().
|
100
|
+
#
|
101
|
+
# A single file (as String) can be uploaded, or an Array of files. The
|
102
|
+
# upload activity will transfer the file or the files onto the remote host.
|
103
|
+
#
|
104
|
+
# The second argument specifies whether the method will be verbose and
|
105
|
+
# report back to the user, or whether the method will be quiet,
|
106
|
+
# defaulting to the return value of the method `be_verbose?`.
|
107
|
+
# ========================================================================= #
|
108
|
+
def upload(
|
109
|
+
i,
|
110
|
+
be_verbose = be_verbose?
|
111
|
+
)
|
112
|
+
be_verbose = false if be_verbose == :be_silent
|
113
|
+
if i.is_a? Array
|
114
|
+
i.each {|entry| upload(entry, be_verbose) }
|
115
|
+
else
|
116
|
+
if i == '*' # Here we want to upload all files.
|
117
|
+
i = get_all_local_files
|
118
|
+
upload(i, be_verbose)
|
119
|
+
else
|
120
|
+
# =================================================================== #
|
121
|
+
# === Handle upload of directories first
|
122
|
+
# =================================================================== #
|
123
|
+
if File.directory? i
|
124
|
+
upload_directory(i, be_verbose)
|
125
|
+
# =================================================================== #
|
126
|
+
# === Handle uploading of files next
|
127
|
+
# =================================================================== #
|
128
|
+
else
|
129
|
+
upload_file(i, be_verbose)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# ========================================================================= #
|
136
|
+
# === uploaded_these_files?
|
137
|
+
# ========================================================================= #
|
138
|
+
def uploaded_these_files?
|
139
|
+
@internal_hash[:uploaded_these_files]
|
140
|
+
end
|
141
|
+
|
142
|
+
# ========================================================================= #
|
143
|
+
# === report_finished_uploading_of_this_file
|
144
|
+
#
|
145
|
+
# Report that we have finished uploading a file.
|
146
|
+
#
|
147
|
+
# We should also denote the leading http part.
|
148
|
+
# ========================================================================= #
|
149
|
+
def report_finished_uploading_of_this_file(i)
|
150
|
+
if is_connected?
|
151
|
+
remote_path = "http://#{rds(remote_path?+File.basename(i))}"
|
152
|
+
opnn; e "Done uploading `#{sfile(i)}` to `"\
|
153
|
+
"#{sdir(remote_path)}`!"
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# ========================================================================= #
|
158
|
+
# === puttextfile
|
159
|
+
#
|
160
|
+
# This method will transfer a localfile to the remote server in
|
161
|
+
# ASCII (text) mode. The result will be stored in "remotefile".
|
162
|
+
#
|
163
|
+
# If a callback or an associated block is supplied, calls it, passing
|
164
|
+
# in the transmitted data one line at a time.
|
165
|
+
# ========================================================================= #
|
166
|
+
def puttextfile(
|
167
|
+
local_file, remotefile = File.basename(local_file)
|
168
|
+
)
|
169
|
+
begin
|
170
|
+
ftp_object?.puttextfile(local_file)
|
171
|
+
@internal_hash[:uploaded_these_files] << local_file
|
172
|
+
rescue Net::FTPPermError => error
|
173
|
+
opnn; e swarn('Can not upload `')+sfile(local_file)+swarn('`.')
|
174
|
+
opnn; e swarn('Reason provided to this method was:')
|
175
|
+
opnn; e " → #{sfancy(error.to_s)}"
|
176
|
+
rescue Exception => error
|
177
|
+
opnn; e "An error happened in the method #{__method__}"
|
178
|
+
pp error
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# ========================================================================= #
|
183
|
+
# === upload_this_text_file
|
184
|
+
#
|
185
|
+
# This method can be used to upload one or several text files.
|
186
|
+
#
|
187
|
+
# The first argument should be an Array or a String, denoting the
|
188
|
+
# name/path of the local text file that you wish to upload.
|
189
|
+
# ========================================================================= #
|
190
|
+
def upload_this_text_file(
|
191
|
+
i,
|
192
|
+
be_verbose = be_verbose?
|
193
|
+
)
|
194
|
+
be_verbose = false if be_verbose == :be_silent
|
195
|
+
if i.is_a? Array
|
196
|
+
i.each {|entry| upload_this_text_file(entry, be_verbose) }
|
197
|
+
else
|
198
|
+
i = i.strip.delete(N) # Added in February 2014.
|
199
|
+
case i
|
200
|
+
when :default
|
201
|
+
ENV['MISC'].to_s+'/SITEMAP.cgi' # <- Makes only sense for text-files anyway.
|
202
|
+
end
|
203
|
+
case be_verbose
|
204
|
+
when :be_quiet
|
205
|
+
be_verbose = false
|
206
|
+
end
|
207
|
+
if be_verbose
|
208
|
+
notify_the_user_about(i, __method__)
|
209
|
+
end
|
210
|
+
puttextfile(i) # <- Delegate towards the method puttextfile().
|
211
|
+
report_finished_uploading_of_this_file(i) if be_verbose
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
# ========================================================================= #
|
216
|
+
# === upload_this_directory
|
217
|
+
#
|
218
|
+
# This method can be used to upload a local directory to a remote host.
|
219
|
+
#
|
220
|
+
# If the first input argument is an Array, then the method will call
|
221
|
+
# itself recursively. This allows us to transfer several directories
|
222
|
+
# in one go.
|
223
|
+
#
|
224
|
+
# If the input is a (local and existing) directory, then this method
|
225
|
+
# will also have to create a remote directory, then chdir into it,
|
226
|
+
# and then upload the content of that local directory to the remote
|
227
|
+
# host.
|
228
|
+
# ========================================================================= #
|
229
|
+
def upload_this_directory(
|
230
|
+
i,
|
231
|
+
be_verbose = be_verbose?
|
232
|
+
)
|
233
|
+
if i.is_a? Array
|
234
|
+
i.each {|entry| upload_this_directory(i, be_verbose) }
|
235
|
+
else
|
236
|
+
if File.directory? i
|
237
|
+
unless this_remote_directory_exists?(i)
|
238
|
+
remote_create_directory(i, be_verbose)
|
239
|
+
end
|
240
|
+
change_local_directory(i)
|
241
|
+
change_remote_directory(i)
|
242
|
+
report_remote_directory
|
243
|
+
content = return_directory_content(i) # Last but not least, copy all files to that dir.
|
244
|
+
content.each {|this_file| upload(this_file) }
|
245
|
+
else
|
246
|
+
opnn; e "The given input `#{sfancy(i)}` is not a directory."
|
247
|
+
opnn; e 'This method can only upload directories.'
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end; alias upload_directory upload_this_directory # === upload_directory
|
251
|
+
alias upload_these_directories upload_this_directory # === upload_these_directories
|
252
|
+
|
253
|
+
end; end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'ftp_paradise/connection/use_default_dataset.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module FtpParadise
|
8
|
+
|
9
|
+
class Connection # === FtpParadise::Connection
|
10
|
+
|
11
|
+
require 'ftp_paradise/toplevel_methods/determine_user_dataset_from_this_hash.rb'
|
12
|
+
|
13
|
+
require 'ftp_paradise/connection/do_login.rb'
|
14
|
+
|
15
|
+
# ========================================================================= #
|
16
|
+
# === use_default_dataset
|
17
|
+
#
|
18
|
+
# This method will just take the default dataset for my FTP connections,
|
19
|
+
# hence the "File.exist?" check.
|
20
|
+
#
|
21
|
+
# Additionally we will initialize the default net-ftp object.
|
22
|
+
# ========================================================================= #
|
23
|
+
def use_default_dataset(
|
24
|
+
i = 'shevy' # ← This is the default.
|
25
|
+
)
|
26
|
+
if File.exist? FILE_ROEBE_FTP
|
27
|
+
dataset = YAML.load_file(FILE_ROEBE_FTP)
|
28
|
+
# ===================================================================== #
|
29
|
+
# Default to what the user provided to the method.
|
30
|
+
# ===================================================================== #
|
31
|
+
use_this_dataset = dataset[i]
|
32
|
+
# ===================================================================== #
|
33
|
+
# Set remote-url, username and password through the following method:
|
34
|
+
# ===================================================================== #
|
35
|
+
FtpParadise.determine_user_dataset_from_this_hash(use_this_dataset)
|
36
|
+
do_login
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end; end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'ftp_paradise/connection/username.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module FtpParadise
|
8
|
+
|
9
|
+
class Connection
|
10
|
+
|
11
|
+
require 'ftp_paradise/toplevel_methods/login_name.rb'
|
12
|
+
|
13
|
+
# ========================================================================= #
|
14
|
+
# === set_username
|
15
|
+
#
|
16
|
+
# Set the username that you wish to use here. If the input is nil, a
|
17
|
+
# default name will be used instead.
|
18
|
+
# ========================================================================= #
|
19
|
+
def set_username(
|
20
|
+
i = DEFAULT_USER_NAME
|
21
|
+
)
|
22
|
+
i = i.first if i.is_a? Array
|
23
|
+
i = DEFAULT_USER_NAME if i.nil?
|
24
|
+
# ======================================================================= #
|
25
|
+
# The username will be stored on the toplevel-module.
|
26
|
+
# ======================================================================= #
|
27
|
+
FtpParadise.set_username(i)
|
28
|
+
end; alias set_user_name set_username # === set_user_name
|
29
|
+
alias login_name= set_username # === login_name?
|
30
|
+
alias set_name set_username # === set_name
|
31
|
+
alias set_user set_username # === set_user
|
32
|
+
alias set_login_name set_username # === set_login_name
|
33
|
+
alias user_name= set_username # === user_name?
|
34
|
+
|
35
|
+
# ========================================================================= #
|
36
|
+
# === username?
|
37
|
+
# ========================================================================= #
|
38
|
+
def username?
|
39
|
+
FtpParadise.username?.to_s
|
40
|
+
end; alias user_name? username? # === user_name?
|
41
|
+
|
42
|
+
end; end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen-string-literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'ftp_paradise/constants/constants.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module FtpParadise
|
8
|
+
|
9
|
+
require 'ftp_paradise/project/project.rb'
|
10
|
+
require 'ftp_paradise/constants/misc.rb'
|
11
|
+
require 'ftp_paradise/constants/namespace.rb'
|
12
|
+
require 'ftp_paradise/constants/newline.rb'
|
13
|
+
require 'ftp_paradise/constants/roebe_ftp_constants.rb'
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
if __FILE__ == $PROGRAM_NAME
|
18
|
+
puts FtpParadise::FILE_AUTOMATICALLY_CONNECT_ON_STARTUP_OF_THE_INTERACTIVE_FTP_SHELL
|
19
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen-string-literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'ftp_paradise/constants/misc.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module FtpParadise
|
8
|
+
|
9
|
+
require 'ftp_paradise/project/project.rb'
|
10
|
+
|
11
|
+
# ========================================================================= #
|
12
|
+
# === SHALL_WE_DEBUG
|
13
|
+
# ========================================================================= #
|
14
|
+
SHALL_WE_DEBUG = false
|
15
|
+
|
16
|
+
# ========================================================================= #
|
17
|
+
# === ARRAY_HELP_OPTIONS
|
18
|
+
#
|
19
|
+
# This Array is only required in the interactive variant though.
|
20
|
+
# ========================================================================= #
|
21
|
+
ARRAY_HELP_OPTIONS = %w(
|
22
|
+
HELP --help help hel he h hlep
|
23
|
+
) # ,'?'
|
24
|
+
|
25
|
+
# ========================================================================= #
|
26
|
+
# === ARRAY_BINARY_FILES
|
27
|
+
#
|
28
|
+
# Just note down the extension names.
|
29
|
+
# ========================================================================= #
|
30
|
+
ARRAY_BINARY_FILES = %w(
|
31
|
+
pdf
|
32
|
+
docx
|
33
|
+
odt
|
34
|
+
doc
|
35
|
+
)
|
36
|
+
|
37
|
+
# ========================================================================= #
|
38
|
+
# === ARRAY_VALID_OPTIONS_FOR_EXITING_THE_SHELL
|
39
|
+
# ========================================================================= #
|
40
|
+
ARRAY_VALID_OPTIONS_FOR_EXITING_THE_SHELL = %w(
|
41
|
+
q
|
42
|
+
quit
|
43
|
+
exit
|
44
|
+
break
|
45
|
+
)
|
46
|
+
|
47
|
+
# ========================================================================= #
|
48
|
+
# === FtpParadise::FILE_AUTOMATICALLY_CONNECT_ON_STARTUP_OF_THE_INTERACTIVE_FTP_SHELL
|
49
|
+
# ========================================================================= #
|
50
|
+
FILE_AUTOMATICALLY_CONNECT_ON_STARTUP_OF_THE_INTERACTIVE_FTP_SHELL =
|
51
|
+
"#{PROJECT_YAML_DIRECTORY}automatically_connect_on_startup_of_the_interactive_ftp_shell.yml"
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
if __FILE__ == $PROGRAM_NAME
|
56
|
+
puts FtpParadise::FILE_AUTOMATICALLY_CONNECT_ON_STARTUP_OF_THE_INTERACTIVE_FTP_SHELL
|
57
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'ftp_paradise/constants/namespace.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module FtpParadise
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === NAMESPACE
|
11
|
+
# ========================================================================= #
|
12
|
+
NAMESPACE = inspect
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen-string-literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'ftp_paradise/constants/newline.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module FtpParadise
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === N
|
11
|
+
# ========================================================================= #
|
12
|
+
N = "\n"
|
13
|
+
|
14
|
+
end
|