monster_remote 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,7 +41,7 @@ module Monster
41
41
  end
42
42
 
43
43
  def copy_file(wrapper, local_file, remote_file)
44
- out("coping file to #{remote_file}")
44
+ out("copying file to #{remote_file}")
45
45
  wrapper.copy_file(local_file, remote_file)
46
46
  end
47
47
 
@@ -15,6 +15,7 @@ module Monster
15
15
  ftp.connect(host, port)
16
16
  ftp.login(user, password)
17
17
  if block
18
+ ftp.passive = true
18
19
  block.call(NetFTPHandler.new(ftp), ftp)
19
20
  end
20
21
  ftp.close
@@ -110,7 +111,7 @@ module Monster
110
111
 
111
112
  def create_and_chdir(dir)
112
113
  create_dir_if_not_exists(dir)
113
- @ftp.chdir(dir)
114
+ dir && @ftp.chdir(dir)
114
115
  end
115
116
 
116
117
  def dirs_in_path(dir)
@@ -121,7 +122,7 @@ module Monster
121
122
  is_new_dir = true
122
123
  begin
123
124
  is_new_dir = @ftp.nlst(dir).empty?
124
- rescue Net::FTPTempError => e
125
+ rescue Net::FTPPermError => e
125
126
  is_unexpected_error = !e.message.include?("450")
126
127
  if is_unexpected_error
127
128
  raise(e, e.message, caller)
@@ -136,6 +137,13 @@ module Monster
136
137
  @ftp.mkdir(dir)
137
138
  end
138
139
  end
140
+
141
+ def create_dir_if_not_exists_hold(dir)
142
+ begin
143
+ dir && @ftp.mkdir(dir)
144
+ rescue Net::FTPPermError
145
+ end
146
+ end
139
147
  end# NetFTPHandler
140
148
 
141
149
  end# Wrappers
@@ -1,6 +1,6 @@
1
1
  module Monster
2
2
  module Remote
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  NAME = File.basename(__FILE__)
5
5
  end
6
6
  end
@@ -5,7 +5,7 @@ $:.unshift lib unless $:.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "monster_remote"
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Ricardo Valeriano"]
11
11
  s.email = ["ricardo.valeriano@gmail.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monster_remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70145766743680 !ruby/object:Gem::Requirement
16
+ requirement: &70146086768640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70145766743680
24
+ version_requirements: *70146086768640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fakefs
27
- requirement: &70145766743220 !ruby/object:Gem::Requirement
27
+ requirement: &70146086768180 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70145766743220
35
+ version_requirements: *70146086768180
36
36
  description: This gem allow you publish your jekyll static site via FTP, easy as pie.
37
37
  email:
38
38
  - ricardo.valeriano@gmail.com