ftp-ext 0.1.3 → 0.1.4

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.
Files changed (3) hide show
  1. data/ftp-ext.gemspec +2 -2
  2. data/lib/ftp-ext.rb +5 -3
  3. metadata +6 -6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ftp-ext}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Zach Pendleton"]
12
- s.date = %q{2010-12-30}
12
+ s.date = %q{2011-01-03}
13
13
  s.description = %q{FTPExt adds two methods (put_dir and rmrf_dir) to Net::FTP to copy, sync, and delete whole folders over FTP.}
14
14
  s.email = %q{zachpendleton@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -31,8 +31,8 @@ module Net
31
31
  fpath = File.join(file_segments[0..n])
32
32
 
33
33
  unless remote_file_exists?(fpath) || fpath == ""
34
- puts "mkdir #{fpath}" if options[:verbose] == true
35
34
  mkdir(fpath)
35
+ puts "mkdir #{fpath}" if options[:verbose] == true
36
36
  end
37
37
  end
38
38
  else
@@ -131,11 +131,13 @@ module Net
131
131
  else
132
132
  fname = fpath.pop
133
133
  fpath.map! { |v| v == "" ? File::SEPARATOR : v }
134
- fpath = fpath.join(File::SEPARATOR)
134
+ fpath = File.join(fpath)
135
135
 
136
136
  # Wrap return in begin..rescue because nlst errors on empty directory
137
137
  begin
138
- return nlst(fpath).include?(File.join(fpath, fname))
138
+ # Standardize output across Windows, Linux, OS X
139
+ dirlist = nlst(fpath).map { |f| f.match(/[^\/\\]+$/)[0] }
140
+ return dirlist.include?(fname)
139
141
  rescue Exception => e
140
142
  return false if e.message.match("450")
141
143
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftp-ext
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
4
+ hash: 19
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Zach Pendleton
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-30 00:00:00 -07:00
18
+ date: 2011-01-03 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  requirements: []
100
100
 
101
101
  rubyforge_project:
102
- rubygems_version: 1.3.7
102
+ rubygems_version: 1.4.1
103
103
  signing_key:
104
104
  specification_version: 3
105
105
  summary: Folder copying and deletion methods for Net::FTP