curb 1.2.1 → 1.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48135be870a425c76338a773b41dc9438883b30cab622cc8c2d81394b860047d
4
- data.tar.gz: e7a439c010c1bdbd3ab26b92f2126a4d518a2c7808d7acc6af2e57a03ec07376
3
+ metadata.gz: 886abdbc88d51f4d214de43f3a4d12029bfa010bd419ac89e60d0d18a8be3e21
4
+ data.tar.gz: 0a574a8d8f70daf2e28f4d0900075a67158ce12187ddb10d4da7700e6eea7ecb
5
5
  SHA512:
6
- metadata.gz: b5c61d835a10a80211b625dd3ef8cf949fdcf30be9584d2a6793d69e309e3cb283097c2502a8912801ab9ee13679f1e71344034a197c54c88872157e66df74a0
7
- data.tar.gz: 20fbde1832dc7338dba7f78c08556eceab4532247f41f0bb1c0c15ba11fc0cd2f07aabeaef62525eba24afc95b5e9854dbb3d71f6d6f493097d614ae913818f8
6
+ metadata.gz: 10438303d75fb75a75cfc2b42d9ff0bfcb92fa87cf4f1eea893f51556dfeab29639b9d30c635721224898ddc712fd62c2f46ca3d70c6622889da3821de9e2b19
7
+ data.tar.gz: af1a29be7253c4b0c73e593e238f7e49b1c456994559eedd9ae170678b6ac1ecb9fb80982dce1cd9eb3bba422b282fc5c83336e1bc1a1a48c88b3845cc95c424
data/README.md CHANGED
@@ -105,6 +105,39 @@ puts list.body
105
105
 
106
106
  If you need a full `LIST` output instead of just names, omit `dirlistonly` and parse the server response accordingly. The key is to let libcurl initiate the data connection (PASV/EPSV) instead of trying to drive it via `ftp_commands`.
107
107
 
108
+ #### Full LIST directory listing
109
+ To retrieve the full `LIST` output (permissions, owner, size, timestamp, name), simply do not set `dirlistonly`:
110
+
111
+ ```ruby
112
+ list = Curl::Easy.new('ftp://ftp.example.com/remote/directory/')
113
+ list.username = 'user'
114
+ list.password = 'password'
115
+
116
+ # Explicitly ensure names+metadata (LIST) rather than NLST
117
+ # list.set(:dirlistonly, 0) # optional; default is LIST for directory URLs
118
+
119
+ list.perform
120
+ puts list.body # multi-line LIST output
121
+ ```
122
+
123
+ Through an HTTP proxy tunnel, the same considerations apply as the NLST example above — just omit `dirlistonly` and keep the optional EPSV/EPRT/PASV tweaks if needed:
124
+
125
+ ```ruby
126
+ list = Curl::Easy.new('ftp://ftp.example.com/remote/directory/')
127
+ list.username = 'user'
128
+ list.password = 'password'
129
+ list.proxy_url = 'http://proxy.example.com:80'
130
+ list.proxy_tunnel = true
131
+
132
+ # Optional tweaks if the proxy/server combination struggles
133
+ # list.set(:ftp_use_epsv, 0)
134
+ # list.set(:ftp_use_eprt, 0)
135
+ # list.set(:ftp_skip_pasv_ip, 1)
136
+
137
+ list.perform
138
+ puts list.body
139
+ ```
140
+
108
141
  ### Advanced FTP Usage with Various Options
109
142
  ```
110
143
  puts "\n=== Advanced FTP Example ==="
data/Rakefile CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'rake/clean'
4
4
  require 'rake/testtask'
5
5
  require "ruby_memcheck"
6
+ require 'shellwords'
6
7
  begin
7
8
  require 'mixlib/shellout'
8
9
  rescue LoadError
@@ -88,6 +89,16 @@ task :rmpid do
88
89
  FileUtils.rm_rf Dir.glob("tests/server_lock-*")
89
90
  end
90
91
 
92
+ at_exit do
93
+ next unless defined?(Rake.application)
94
+
95
+ top_level_tasks = Rake.application.top_level_tasks
96
+ test_tasks = %w[default test ta tu alltests unittests bugtests test:valgrind]
97
+ should_cleanup = top_level_tasks.empty? || top_level_tasks.any? { |task| test_tasks.include?(task) }
98
+
99
+ FileUtils.rm_rf Dir.glob("tests/server_lock-*") if should_cleanup
100
+ end
101
+
91
102
  if ENV['RELTEST']
92
103
  announce "Release task testing - not running regression tests on alltests"
93
104
  task :alltests => [:unittests]
@@ -101,6 +112,17 @@ namespace :test do
101
112
  t.test_files = FileList['tests/tc_*.rb']
102
113
  t.verbose = false
103
114
  end
115
+
116
+ desc 'Run the standalone leak trace helper'
117
+ task :leak_trace => :compile do
118
+ ruby_opts = Shellwords.split(ENV['LEAK_TRACE_OPTS'].to_s)
119
+ sh RbConfig.ruby, '-Ilib', '-Iext', 'tests/leak_trace.rb', *ruby_opts
120
+ end
121
+ end
122
+
123
+ Rake::Task['test:valgrind'].enhance([:rmpid]) do
124
+ Rake::Task[:rmpid].reenable
125
+ Rake::Task[:rmpid].invoke
104
126
  end
105
127
 
106
128
  Rake::TestTask.new(:unittests) do |t|