rest-ftp-daemon 0.432.0 → 0.433.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
  SHA1:
3
- metadata.gz: 89e094d356f8271d07f64222768a60997ce50a88
4
- data.tar.gz: f3deb47de89bc54b1b5f807aa8ecfc868d0c1926
3
+ metadata.gz: 9e668f8f43effe91b3332111a2963abb1011343c
4
+ data.tar.gz: 79bc3e98795a91cdef80609096b15fc9606f4a6a
5
5
  SHA512:
6
- metadata.gz: ad21099fd7392bc545888394974d95c1e0ce8204e28de1682e3b93087d38c95f20e6594ec59ecc465f562625b9c1def500076aa7a8c3695b1edddea8bd0ff754
7
- data.tar.gz: 952ac92bf57af92ec2c99570d5fff30aefcf8b8bf9ba21f3f661b70c8af801757f55ed5c876fc3df590ec8ce708d1ed882bf0ab85cbd6ffbc68ccfc7f397a12a
6
+ metadata.gz: 0a06749631bb61dd15e9ef0556e8909fd6ca75ab32d944e70a854533a8caa9e50854fd13942b2fa11dda2dfea2f098dbf15c9fdd2e123c00971911f35f7ce396
7
+ data.tar.gz: c6ae3a6914a80a1c932947f63be90d8d9a722134411839cdfa6d0694e8c3555ac86dac8b9afdbc923561489c0993186c61811d49b375a981f8fa4dbae0b8513a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest-ftp-daemon (0.432.0)
4
+ rest-ftp-daemon (0.433.0)
5
5
  activesupport (~> 4.2)
6
6
  api-auth
7
7
  aws-sdk-resources (~> 2)
@@ -110,7 +110,7 @@ GEM
110
110
  jmespath (1.3.1)
111
111
  json (1.8.3)
112
112
  method_source (0.8.2)
113
- mime-types (2.99.2)
113
+ mime-types (2.99.3)
114
114
  minitest (5.9.0)
115
115
  multi_json (1.12.1)
116
116
  multi_xml (0.5.5)
@@ -42,7 +42,7 @@ module RestFtpDaemon
42
42
  # Ensure result does not contain tokens after replacement
43
43
  detected_tokens = detect_tokens(location_uri)
44
44
  unless detected_tokens.empty?
45
- raise RestFtpDaemon::JobUnresolvedTokens, detected_tokens.join(' ')
45
+ raise RestFtpDaemon::JobUnresolvedTokens, 'unresolved tokens: ' + detected_tokens.join(' ')
46
46
  end
47
47
 
48
48
  # Parse URL and do specific initializations
@@ -63,12 +63,17 @@ module RestFtpDaemon
63
63
 
64
64
  private
65
65
 
66
- def extract_parent path
66
+ def split_path path
67
67
  return unless path.is_a? String
68
- m = path.match(/^(.*)\/([^\/]+)\/?$/)
69
- return m[1], m[2] unless m.nil?
68
+ return File.dirname(path), File.basename(path)
70
69
  end
71
70
 
71
+ # def extract_parent path
72
+ # return unless path.is_a? String
73
+ # m = path.match(/^(.*)\/([^\/]+)\/?$/)
74
+ # return m[1], m[2] unless m.nil?
75
+ # end
76
+
72
77
  def myname
73
78
  self.class.to_s
74
79
  end
@@ -60,24 +60,29 @@ module RestFtpDaemon
60
60
  raise TargetPermissionError, ex.message
61
61
  end
62
62
 
63
- def chdir_or_create directory, mkdir = false
63
+ def chdir_or_create thedir, mkdir = true
64
64
  # Init, extract my parent name and my own name
65
- log_debug "RemoteFTP.chdir_or_create mkdir[#{mkdir}] dir[#{directory}]"
66
- parent, current = extract_parent(directory)
67
-
68
- #dirname, _current = extract_parent(directory)
69
-
65
+ parent, current = split_path(thedir)
66
+ log_debug "RemoteFTP.chdir_or_create mkdir[#{mkdir}] dir[#{thedir}] parent[#{parent}] current[#{current}]"
70
67
 
71
68
  # Access this directory
72
69
  begin
73
- @ftp.chdir "/#{directory}"
70
+ @ftp.chdir "/#{thedir}"
74
71
 
75
72
  rescue Net::FTPPermError => _e
73
+
76
74
  # If not allowed to create path, that's over, we're stuck
77
- return false unless mkdir
75
+ unless mkdir
76
+ log_debug " [#{thedir}] failed > no mkdir > over"
77
+ return false
78
+ end
79
+
80
+ # Try to go into my parent directory
81
+ log_debug " [#{thedir}] failed > chdir_or_create [#{parent}]"
78
82
  chdir_or_create parent, mkdir
79
83
 
80
84
  # Now I was able to chdir into my parent, create the current directory
85
+ log_debug " [#{thedir}] failed > mkdir [#{current}]"
81
86
  mkdir current
82
87
 
83
88
  # Finally retry the chdir
@@ -85,6 +90,7 @@ module RestFtpDaemon
85
90
  else
86
91
  return true
87
92
  end
93
+
88
94
  end
89
95
 
90
96
  def upload source, target, use_temp_name = false, &callback
@@ -61,11 +61,10 @@ module RestFtpDaemon
61
61
  def chdir_or_create directory, mkdir = false
62
62
  # Init, extract my parent name and my own name
63
63
  log_debug "RemoteSFTP.chdir_or_create mkdir[#{mkdir}] dir[#{directory}]"
64
- parent, _current = extract_parent(directory)
64
+ parent, _current = split_path(directory)
65
65
 
66
66
  # Access this directory
67
67
  begin
68
- #log_debug "chdir [/#{directory}]"
69
68
  @sftp.opendir! directory
70
69
 
71
70
  rescue Net::SFTP::StatusException => _e
@@ -159,11 +159,6 @@ body {
159
159
  }
160
160
 
161
161
  .transfer-type {
162
- width: 35px;
162
+ width: 40px;
163
163
  }
164
164
 
165
-
166
-
167
-
168
-
169
-
@@ -14,7 +14,7 @@
14
14
  %a{href: "http://refactorcop.com/bmedici/rest-ftp-daemon/", target: TARGET_BLANK} RefactorCop
15
15
 
16
16
  ·
17
- %a{href: MOUNT_SWAGGER_UI, target: TARGET_BLANK} API Documentation
17
+ %a{href: MOUNT_SWAGGER_UI, target: TARGET_BLANK} API
18
18
 
19
19
 
20
20
  .footer-indicators.indicators.pull-right
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |spec|
3
3
 
4
4
  # Project version
5
- spec.version = "0.432.0"
5
+ spec.version = "0.433.0"
6
6
 
7
7
  # Project description
8
8
  spec.name = "rest-ftp-daemon"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-ftp-daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.432.0
4
+ version: 0.433.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-09 00:00:00.000000000 Z
11
+ date: 2016-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler