ftp_paradise 1.3.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ftp_paradise might be problematic. Click here for more details.

Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +309 -0
  3. data/bin/create_remote_directory +9 -0
  4. data/bin/ftp_get +17 -0
  5. data/bin/ftp_upload +42 -0
  6. data/bin/ftp_upload_binary +18 -0
  7. data/bin/iftp +7 -0
  8. data/bin/remote_remove +28 -0
  9. data/doc/README.gen +292 -0
  10. data/doc/TODO_FOR_FTP_PARADISE_PROJECT.md +79 -0
  11. data/ftp_paradise.gemspec +114 -0
  12. data/lib/ftp_paradise.rb +5 -0
  13. data/lib/ftp_paradise/base/cliner.rb +21 -0
  14. data/lib/ftp_paradise/base/colours.rb +83 -0
  15. data/lib/ftp_paradise/base/prototype.rb +169 -0
  16. data/lib/ftp_paradise/base/reset.rb +29 -0
  17. data/lib/ftp_paradise/colours/colours.rb +141 -0
  18. data/lib/ftp_paradise/colours/use_colours.rb +74 -0
  19. data/lib/ftp_paradise/configuration/configuration.rb +49 -0
  20. data/lib/ftp_paradise/connection/README.md +1 -0
  21. data/lib/ftp_paradise/connection/connection.rb +35 -0
  22. data/lib/ftp_paradise/connection/constants.rb +46 -0
  23. data/lib/ftp_paradise/connection/data.rb +148 -0
  24. data/lib/ftp_paradise/connection/debug.rb +80 -0
  25. data/lib/ftp_paradise/connection/directory_handling.rb +271 -0
  26. data/lib/ftp_paradise/connection/do_login.rb +108 -0
  27. data/lib/ftp_paradise/connection/download.rb +86 -0
  28. data/lib/ftp_paradise/connection/file_handling.rb +172 -0
  29. data/lib/ftp_paradise/connection/ftp_object.rb +21 -0
  30. data/lib/ftp_paradise/connection/initialize.rb +86 -0
  31. data/lib/ftp_paradise/connection/initialize_a_new_net_ftp_object_with_this_url.rb +20 -0
  32. data/lib/ftp_paradise/connection/is_connected.rb +46 -0
  33. data/lib/ftp_paradise/connection/misc.rb +472 -0
  34. data/lib/ftp_paradise/connection/notify.rb +71 -0
  35. data/lib/ftp_paradise/connection/password.rb +47 -0
  36. data/lib/ftp_paradise/connection/port.rb +33 -0
  37. data/lib/ftp_paradise/connection/remote_pwd.rb +72 -0
  38. data/lib/ftp_paradise/connection/remote_url.rb +163 -0
  39. data/lib/ftp_paradise/connection/remove.rb +143 -0
  40. data/lib/ftp_paradise/connection/reset.rb +75 -0
  41. data/lib/ftp_paradise/connection/run.rb +18 -0
  42. data/lib/ftp_paradise/connection/set_array_available_hosts.rb +27 -0
  43. data/lib/ftp_paradise/connection/set_input.rb +18 -0
  44. data/lib/ftp_paradise/connection/show.rb +153 -0
  45. data/lib/ftp_paradise/connection/sync_ftp_object_onto_the_main_namespace.rb +24 -0
  46. data/lib/ftp_paradise/connection/transfer_mode.rb +162 -0
  47. data/lib/ftp_paradise/connection/upload.rb +253 -0
  48. data/lib/ftp_paradise/connection/use_default_dataset.rb +41 -0
  49. data/lib/ftp_paradise/connection/username.rb +42 -0
  50. data/lib/ftp_paradise/constants/constants.rb +19 -0
  51. data/lib/ftp_paradise/constants/misc.rb +57 -0
  52. data/lib/ftp_paradise/constants/namespace.rb +14 -0
  53. data/lib/ftp_paradise/constants/newline.rb +14 -0
  54. data/lib/ftp_paradise/constants/roebe.rb +27 -0
  55. data/lib/ftp_paradise/constants/roebe_ftp_constants.rb +219 -0
  56. data/lib/ftp_paradise/entry/entry.rb +293 -0
  57. data/lib/ftp_paradise/gui/gtk/constants.rb +58 -0
  58. data/lib/ftp_paradise/gui/gtk/ftp_bindings.rb +1149 -0
  59. data/lib/ftp_paradise/interactive_ftp/constants.rb +103 -0
  60. data/lib/ftp_paradise/interactive_ftp/directory_handling.rb +215 -0
  61. data/lib/ftp_paradise/interactive_ftp/help.rb +50 -0
  62. data/lib/ftp_paradise/interactive_ftp/initialize.rb +27 -0
  63. data/lib/ftp_paradise/interactive_ftp/interactive_ftp.rb +995 -0
  64. data/lib/ftp_paradise/interactive_ftp/main_loop.rb +50 -0
  65. data/lib/ftp_paradise/interactive_ftp/menu.rb +788 -0
  66. data/lib/ftp_paradise/interactive_ftp/misc.rb +208 -0
  67. data/lib/ftp_paradise/interactive_ftp/mode.rb +124 -0
  68. data/lib/ftp_paradise/interactive_ftp/readline.rb +115 -0
  69. data/lib/ftp_paradise/interactive_ftp/remove.rb +97 -0
  70. data/lib/ftp_paradise/interactive_ftp/reset.rb +90 -0
  71. data/lib/ftp_paradise/interactive_ftp/run.rb +22 -0
  72. data/lib/ftp_paradise/interactive_ftp/show.rb +184 -0
  73. data/lib/ftp_paradise/interactive_ftp/upload.rb +90 -0
  74. data/lib/ftp_paradise/interactive_ftp/user_input.rb +53 -0
  75. data/lib/ftp_paradise/project/project.rb +62 -0
  76. data/lib/ftp_paradise/requires/common_basic_requires.rb +13 -0
  77. data/lib/ftp_paradise/requires/common_external_requires.rb +9 -0
  78. data/lib/ftp_paradise/requires/require_the_constants.rb +7 -0
  79. data/lib/ftp_paradise/requires/require_the_ftp_paradise_project.rb +18 -0
  80. data/lib/ftp_paradise/requires/require_the_ftp_paradise_project_with_the_GUI_bindings.rb +10 -0
  81. data/lib/ftp_paradise/requires/require_the_toplevel_methods.rb +24 -0
  82. data/lib/ftp_paradise/toplevel_methods/can_connect_to_remote_site.rb +29 -0
  83. data/lib/ftp_paradise/toplevel_methods/clear_user_dataset.rb +28 -0
  84. data/lib/ftp_paradise/toplevel_methods/connect.rb +49 -0
  85. data/lib/ftp_paradise/toplevel_methods/create_file.rb +18 -0
  86. data/lib/ftp_paradise/toplevel_methods/data.rb +31 -0
  87. data/lib/ftp_paradise/toplevel_methods/delete.rb +23 -0
  88. data/lib/ftp_paradise/toplevel_methods/determine_user_dataset_from_this_hash.rb +37 -0
  89. data/lib/ftp_paradise/toplevel_methods/e.rb +16 -0
  90. data/lib/ftp_paradise/toplevel_methods/ftp_object.rb +270 -0
  91. data/lib/ftp_paradise/toplevel_methods/get_files.rb +24 -0
  92. data/lib/ftp_paradise/toplevel_methods/is_directory.rb +33 -0
  93. data/lib/ftp_paradise/toplevel_methods/is_on_roebe.rb +20 -0
  94. data/lib/ftp_paradise/toplevel_methods/login_name.rb +49 -0
  95. data/lib/ftp_paradise/toplevel_methods/opn.rb +24 -0
  96. data/lib/ftp_paradise/toplevel_methods/password.rb +48 -0
  97. data/lib/ftp_paradise/toplevel_methods/port.rb +41 -0
  98. data/lib/ftp_paradise/toplevel_methods/rds.rb +18 -0
  99. data/lib/ftp_paradise/toplevel_methods/remote_url.rb +57 -0
  100. data/lib/ftp_paradise/toplevel_methods/time.rb +45 -0
  101. data/lib/ftp_paradise/toplevel_methods/upload.rb +29 -0
  102. data/lib/ftp_paradise/toplevel_methods/upload_this_binary_file.rb +58 -0
  103. data/lib/ftp_paradise/version/version.rb +19 -0
  104. data/lib/ftp_paradise/www/public/css/style.css +3 -0
  105. data/lib/ftp_paradise/www/sinatra_web_interface.rb +242 -0
  106. data/lib/ftp_paradise/www/views/index.slim +3 -0
  107. data/lib/ftp_paradise/www/views/layout.slim +11 -0
  108. data/lib/ftp_paradise/www/web_interface.cgi +35 -0
  109. data/lib/ftp_paradise/yaml/automatically_connect_on_startup_of_the_interactive_ftp_shell.yml +1 -0
  110. data/lib/ftp_paradise/yaml/debug.yml +1 -0
  111. data/lib/ftp_paradise/yaml/open_in_default_editor.yml +1 -0
  112. data/lib/ftp_paradise/yaml/show_full_names.yml +1 -0
  113. data/lib/ftp_paradise/yaml/use_colours.yml +1 -0
  114. data/test/testing_ftp_paradise.rb +94 -0
  115. data/test/testing_minimal_pure_net_ftp_example_to_connect.rb +28 -0
  116. data/test/testing_the_ftp_connection_component.rb +70 -0
  117. data/test/testing_upload_a_local_directory.rb +10 -0
  118. metadata +315 -0
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen-string-literal: true
4
+ # =========================================================================== #
5
+ # require 'ftp_paradise/version/version.rb'
6
+ # =========================================================================== #
7
+ module FtpParadise
8
+
9
+ # ========================================================================= #
10
+ # === FptParadise::VERSION
11
+ # ========================================================================= #
12
+ VERSION = '1.3.8'
13
+
14
+ end
15
+
16
+ if __FILE__ == $PROGRAM_NAME
17
+ p FtpParadise::VERSION
18
+ p FtpParadise::VERSION.frozen?
19
+ end
@@ -0,0 +1,3 @@
1
+ .red {
2
+ color: red;
3
+ }
@@ -0,0 +1,242 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === FtpWebApp
6
+ #
7
+ # This file requires these projects:
8
+ #
9
+ # sinatra
10
+ # html_tags
11
+ # colours
12
+ # ftp_paradise
13
+ #
14
+ # =========================================================================== #
15
+ require 'sinatra'
16
+ require 'html_tags'
17
+ require 'colours/autoinclude'
18
+ require 'ftp_paradise'
19
+ require 'cliner'
20
+
21
+ # =========================================================================== #
22
+ # We must remove method :body first before continuing.
23
+ # =========================================================================== #
24
+ HtmlTags.class_eval { remove_method(:body) }
25
+
26
+ class FtpWebApp < Sinatra::Base
27
+
28
+ include HtmlTags
29
+
30
+ set :port, USE_THIS_PORT
31
+ set :logging, true
32
+
33
+ USE_THIS_PORT = 81
34
+ WHERE_TO = :SHEVY
35
+
36
+ # ========================================================================= #
37
+ # Initialize the Ftp-Connection here.
38
+ # ========================================================================= #
39
+ FTP = FtpParadise::Connection.new(:dont_run)
40
+
41
+ # ========================================================================= #
42
+ # The various constants for the URL actions.
43
+ # ========================================================================= #
44
+ ROOT = '/'
45
+ ABOUT = '/about/?'
46
+ CONNECT = '/connect/?'
47
+ CONNECT_TO = '/connect_to/?'
48
+ STATUS = '/status/?'
49
+ LISTING = '/listing/?'
50
+
51
+ # ========================================================================= #
52
+ # === initialize
53
+ # ========================================================================= #
54
+ def initialize(
55
+ run_already = true
56
+ )
57
+ super
58
+ run if run_already
59
+ end
60
+
61
+ # ========================================================================= #
62
+ # === link_to_everything (everything tag, all tag)
63
+ # ========================================================================= #
64
+ def link_to_everything
65
+ div(
66
+ :id => 'intralink',
67
+ :css_style => 'margin: 0.55em;
68
+ margin-top:1.05em;
69
+ margin-left:0.45em;
70
+ margin-right:0.45em;
71
+ padding-top: 2px;
72
+ padding:5px;
73
+ border:1px dotted black;'
74
+ ) {
75
+ h2('Available actions for the www-ftp part:','','',
76
+ 'margin-top:1px; margin-bottom:1px;padding:0.2em')+
77
+ link_to(:connect,'margin-left:1em')+
78
+ link_to(:status)+
79
+ link_to(:root)+
80
+ link_to(:listing)
81
+ }
82
+ end
83
+
84
+ # ========================================================================= #
85
+ # === link_to
86
+ # ========================================================================= #
87
+ def link_to(i, optional_css = '')
88
+ case i.to_s
89
+ when 'root'
90
+ i = '/'
91
+ end
92
+ a(i.to_s, :make_newline,'','padding-left:1.2em;'+optional_css)
93
+ end
94
+
95
+ # ========================================================================= #
96
+ # === do_connect
97
+ # ========================================================================= #
98
+ def do_connect(
99
+ where_to = WHERE_TO
100
+ )
101
+ FTP.connect :to => where_to
102
+ end
103
+
104
+ # ========================================================================= #
105
+ # localhost:81/halt
106
+ # ========================================================================= #
107
+ get '/halt' do
108
+ halt 403, 'Halting everything.'
109
+ end
110
+
111
+ # ========================================================================= #
112
+ # === /about
113
+ #
114
+ # localhost:81/about
115
+ # About tag
116
+ # ========================================================================= #
117
+ get ABOUT do
118
+ _ = h2 'This is the Web Interface for the FtpParadise project.'
119
+ _ << 'If you wish to connect to a remote site, try:'+br
120
+ _ << h4(' connect SERVER_URL_HERE','','',
121
+ 'color:slateblue; margin-left:1em')
122
+ return _
123
+ end
124
+
125
+ # ========================================================================= #
126
+ # /listing (listing tag)
127
+ # ========================================================================= #
128
+ get LISTING do
129
+ do_connect
130
+ _ = h2('Remote File listing (of <b>'+WHERE_TO.to_s+'</b>):','','',
131
+ 'text-decoration: underline')
132
+ FTP.array_remote_files.
133
+ reject {|entry| entry[0,1] == '.'}.
134
+ each_with_index {|entry, index|
135
+ _ << (index+1).to_s+' <b>'+link(
136
+ 'http://'+FTP.connected_to?+'/'+entry.to_s
137
+ )+'</b>'+br+"\n"
138
+ }
139
+ _+link_to_everything
140
+ end
141
+
142
+ # ========================================================================= #
143
+ # === status tag
144
+ #
145
+ # localhost:81/status
146
+ # ========================================================================= #
147
+ get STATUS do
148
+ do_connect
149
+ show_status
150
+ end
151
+
152
+ # ========================================================================= #
153
+ # localhost:81/status
154
+ # ========================================================================= #
155
+ get CONNECT do
156
+ h2('Please give us an argument to use.','red')+
157
+ h3('If you are unsure what kind of argument, simply append the login '+
158
+ 'host you wish to connect to, such as /SHEVY.')+br+
159
+ 'Example: /connect_to/SHEVY'+
160
+ a('connect/SHEVY', :make_newline)
161
+ end
162
+
163
+ # ========================================================================= #
164
+ # === show_status
165
+ # ========================================================================= #
166
+ def show_status
167
+ _ = h2 'The status is as follows:'+br
168
+ _ << 'We are connected to: '+b(FTP.connected_to?,
169
+ '','','text-decoration: underline')+br+br
170
+ _ << FTP.status?+br
171
+ _ << link_to_everything
172
+ end
173
+
174
+ # ========================================================================= #
175
+ # localhost:81/connect
176
+ # ========================================================================= #
177
+ [
178
+ CONNECT+'/:connect',
179
+ CONNECT_TO+'/:connect'
180
+ ].each {|entry|
181
+ get(entry) do
182
+ FTP.connect :to => params[:connect]
183
+ _ = 'Now connecting to ...'+params[:connect].to_s+
184
+ show_status+br+link_to(:root)
185
+ return _
186
+ end
187
+ }
188
+
189
+ # ========================================================================= #
190
+ # The root at / is shown here.
191
+ # localhost:81/
192
+ # ========================================================================= #
193
+ get ROOT do
194
+ h1('Welcome to the web-interface of the FtpParadise project. ',
195
+ '','','margin-top:0.5em')+
196
+ h2('We will now show which actions are possible:','','',
197
+ 'margin-bottom:1px; margin-left:1em')+
198
+ link_to_everything
199
+ end
200
+
201
+ # ========================================================================= #
202
+ # === report_port
203
+ # ========================================================================= #
204
+ def report_port
205
+ cliner {
206
+ e 'We will use the port '+sfancy(port?)+' ( http://localhost:'+port?+'/ ).'
207
+ }
208
+ end
209
+
210
+ # ========================================================================= #
211
+ # === port?
212
+ # ========================================================================= #
213
+ def port?
214
+ USE_THIS_PORT.to_s
215
+ end
216
+
217
+ # ========================================================================= #
218
+ # === not_found
219
+ #
220
+ # In case the action was not found, continue here.
221
+ #
222
+ # localhost:81/not_existing
223
+ # ========================================================================= #
224
+ not_found do
225
+ status 404
226
+ h1('The action '+request.path_info+' was not found.')+
227
+ link_to_everything
228
+ end
229
+
230
+ # ========================================================================= #
231
+ # === run
232
+ # ========================================================================= #
233
+ def run
234
+ report_port
235
+ self.class.run!
236
+ end
237
+
238
+ end
239
+
240
+ if __FILE__ == $PROGRAM_NAME
241
+ FtpWebApp.new
242
+ end # rb sinatra_web_interface.rb
@@ -0,0 +1,3 @@
1
+ h2 My Tasks
2
+ ul.tasks
3
+ li Get Milk
@@ -0,0 +1,11 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta charset="utf-8"
5
+ title Just Do It
6
+ link rel="stylesheet" media="screen, projection" href="/styles.css"
7
+ /[if lt IE 9]
8
+ script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"
9
+ body
10
+ h1 Just Do It
11
+ == yield
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # http://localhost/DATA/PROGRAMMING_LANGUAGES/RUBY/src/ftp_paradise/lib/ftp_paradise/www/web_interface.cgi
6
+ # =========================================================================== #
7
+ require 'web_object/autoinclude'
8
+ require 'ftp_paradise'
9
+
10
+ w {
11
+ title 'Ftp Paradise Web Interface'
12
+ english_trinity
13
+
14
+ doc {
15
+ h2 sg(:ausrufungszeichen2,'marr8px')+'Welcome to Web-based FTP','ud'
16
+ p {
17
+ e 'You will be able to connect to a remote FTP
18
+ site with this cgi script.'
19
+ }
20
+ FTP_LIBRARY = FtpParadise::Connection.new(:dont_run)
21
+ div('pad1em wid50','','border: 1px inset crimson;') {
22
+ form('self','post','form_name') {
23
+ ee 'Connect to:'
24
+ input_field
25
+ ee '<select size="1" name="foobar">'
26
+ ee '<option value="aa">Choose a Host:</option>'
27
+ FTP_LIBRARY.array_available_hosts.each {|entry|
28
+ ee '<option value="aa">'+entry+'</option>'
29
+ }
30
+ cselect
31
+ br
32
+ submit
33
+ }
34
+ }
35
+ }}
@@ -0,0 +1 @@
1
+ --- false
@@ -0,0 +1 @@
1
+ --- false
@@ -0,0 +1 @@
1
+ --- true
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'verbose_truth'
6
+ require 'colours/colours_e_autoinclude.rb'
7
+ require 'cliner'
8
+ require 'ftp_paradise'
9
+
10
+ @counter = 0
11
+
12
+ # =========================================================================== #
13
+ # === fancy_colour
14
+ #
15
+ # Through a Konsole-colour.
16
+ # =========================================================================== #
17
+ def fancy_colour(i)
18
+ ::Colours.springgreen(i)
19
+ end; alias main_colour fancy_colour # === main_colour
20
+
21
+ # =========================================================================== #
22
+ # === counter
23
+ #
24
+ # We return a colourized-counter here.
25
+ # =========================================================================== #
26
+ def counter
27
+ @counter += 1
28
+ return ::Colours.peachpuff('('+@counter.to_s+') ')
29
+ end
30
+
31
+ e 'Now testing the project called '+sfancy('ftp_paradise')+'.'
32
+ e 'Will we use colours?'
33
+ e VerboseTruth[FtpParadise.use_colours?]
34
+ e
35
+ e 'Next, we will instantiate a new FtpParadise::Connection object.'
36
+ connection = FtpParadise::Connection.new { :default_dataset }
37
+ # library.set_data :shevy # <-- This is not necessary.
38
+ pp connection
39
+ cliner
40
+ # =========================================================================== #
41
+ # === Feedback the configuration object
42
+ # =========================================================================== #
43
+ e 'The configuration object is:'
44
+ pp FtpParadise.config?
45
+ pp FtpParadise::CONFIGURATION
46
+ e '^^^ should be the same'
47
+ cliner
48
+ e 'Next, we will test some colours:'
49
+ FtpParadise.testing_colours # Making some colour-tests next.
50
+ cliner
51
+ e 'Next, we will show the user name, port and password:'
52
+ connection.show_host_user_name_port_and_password
53
+ cliner
54
+ e counter+'Now testing the '+fancy_colour('class FtpParadise::Connection')
55
+ connection = FtpParadise::Connection.new(:default)
56
+ e 'Will we debug? '+VerboseTruth[connection.debug?]
57
+ e 'The user name is: '+::Colours.orchid(connection.user_name?)
58
+ e 'Next showing the FtpParadise::Connection object:'
59
+ pp connection # test_ftp
60
+ connection.set_passive
61
+ connection.set_mode
62
+ connection.cd 'ZEUGNISSE'
63
+ e 'Next testing the method '+main_colour('.nlst()')
64
+ connection.nlst
65
+ e 'Debugging next:'
66
+ connection.debug
67
+ e 'We are connected to?'
68
+ e ' '+::Colours.deepskyblue(connection.connected_to?)
69
+ connection.report_remote_directory
70
+ # connection.upload 'LPC_CODE_SHEET'
71
+ e 'Is CSS/ a directory? '+connection.is_directory?('CSS').to_s
72
+ e 'The last response was: `'+connection.last_response?.chomp+'`'
73
+ e 'open_timeout? '+connection.open_timeout?.to_s # ftplib
74
+ e 'Next testing '+main_colour('FtpParadise.connect')+' functionality'
75
+ FtpParadise.connect to: :shevy
76
+ # =========================================================================== #
77
+ # Testing whether we will transfer in binary mode:
78
+ # =========================================================================== #
79
+ cliner
80
+ e 'Will we transfer in binary mode? '+VerboseTruth[connection.binary?].to_s
81
+ cliner
82
+ e 'Next, we will test '+simp('FtpParadise.mlsd()')+' but only the first entry there:'
83
+ e FtpParadise.mlsd.first
84
+ e FtpParadise.mlsd.first.class
85
+ # =========================================================================== #
86
+ # Ok, done testing FtpParadise::Connection.
87
+ # =========================================================================== #
88
+
89
+ # =========================================================================== #
90
+ # Now we can test interactive FTP. This must come last because it will
91
+ # start up the interactive variant.
92
+ # =========================================================================== #
93
+ interactive = FtpParadise.interactive(:no_main_loop)
94
+ interactive.run
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # This small .rb file will just show how to quickly connect to a default
6
+ # host that I use. I have the login information stored in a yaml file.
7
+ # =========================================================================== #
8
+ require 'yaml'
9
+ require 'colours/colours_e_autoinclude.rb'
10
+ require 'net/ftp'
11
+
12
+ e Colours.rev+'Now testing a minimal FTP example.'
13
+
14
+ _ = '/home/x/DATA/PC/OS/LINUX/FTP/YAML/roebe_ftp.yml'
15
+ dataset = YAML.load_file(_)['bytehost']
16
+ url = dataset.fetch 'url'
17
+ _port = dataset.fetch 'port'
18
+ user_name = dataset.fetch 'user_name'
19
+ password = dataset.fetch 'password'
20
+
21
+ e 'We will use this url: '+sfancy(url)
22
+ e 'We will use this user name: '+sfancy(user_name)
23
+ e 'We will use this password: '+sfancy(password)
24
+ ftp = Net::FTP.new(url)
25
+ ftp.login(user_name, password) # First the user's name, then the password
26
+ pp ftp
27
+ pp ftp.list
28
+ ftp.close