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.
- data/lib/monster/remote/sync.rb +1 -1
- data/lib/monster/remote/wrappers/net_ftp.rb +10 -2
- data/lib/monster_remote.rb +1 -1
- data/monster_remote.gemspec +1 -1
- metadata +5 -5
data/lib/monster/remote/sync.rb
CHANGED
@@ -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::
|
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
|
data/lib/monster_remote.rb
CHANGED
data/monster_remote.gemspec
CHANGED
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.
|
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: &
|
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: *
|
24
|
+
version_requirements: *70146086768640
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: fakefs
|
27
|
-
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: *
|
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
|