akamai 0.0.4 → 0.0.5
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.
- data/VERSION +1 -1
- data/lib/akamai.rb +17 -18
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/akamai.rb
CHANGED
@@ -51,28 +51,27 @@ module Akamai
|
|
51
51
|
tempfile.close
|
52
52
|
puts "Generated file deleted from tmp."
|
53
53
|
|
54
|
-
|
55
54
|
end
|
55
|
+
end
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
57
|
+
def self.put_file(local_path, location, filename)
|
58
|
+
ftp = Net::FTP::new(self.configuration.netstorage_ftp_host)
|
59
|
+
ftp.passive = true
|
60
|
+
|
61
|
+
ftp.login(self.configuration.netstorage_username, self.configuration.netstorage_password)
|
62
|
+
ftp.chdir(self.configuration.netstorage_basedir) if self.configuration.netstorage_basedir
|
63
|
+
ftp.chdir(location)
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
ftp.put(local_path, "#{filename}.new")
|
66
|
+
ftp.delete(filename) unless ftp.ls(filename)
|
67
|
+
ftp.rename("#{filename}.new", filename)
|
68
|
+
ftp.close
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
end
|
70
|
+
puts "Akamai upload completed for #{filename}."
|
71
|
+
|
72
|
+
puts "Sending purge request"
|
73
|
+
purge_result = purge("http://#{self.configuration.netstorage_public_host}/#{location}/#{filename}")
|
74
|
+
puts "Purge request #{ purge_result ? 'was successful' : 'failed' }."
|
76
75
|
end
|
77
76
|
|
78
77
|
end
|