rake-remote-file 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rake-remote-file/task.rb +11 -7
- data/lib/rake-remote-file/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49328423d4c33c821307cb5ba9adaced57632f2aede21bc8acde432974deada0
|
4
|
+
data.tar.gz: f7d2dac67847f701784e44fe4a97016c12dcd3042ed4b21b8e5dacdf83f90882
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7dd87f0dda03075afeaf0ad533c4b3efa11c5bfe30a4f4f6b3dd01a30ae65f24a13bb670c4f70c7fb1a475b526602cb669abdd9e5e05bbf09d39e7acb16d94a
|
7
|
+
data.tar.gz: 45bdeb3c985c478267b83bcc7f0f849e66cf267294856fd48d12de7651b3d39f468e65f892a38b4cd4076162167cf8b711968e878e0b9546bac06332e1ef353c
|
data/Gemfile.lock
CHANGED
@@ -4,21 +4,26 @@ require 'mime-types'
|
|
4
4
|
module RakeRemoteFile
|
5
5
|
class Task < Rake::FileTask
|
6
6
|
attr_accessor :source_file
|
7
|
-
|
7
|
+
|
8
|
+
def initialize(task_name, app)
|
9
|
+
@s3 = Aws::S3::Resource.new()
|
10
|
+
super(task_name, app)
|
11
|
+
end
|
12
|
+
|
8
13
|
def needed?
|
9
14
|
@application.options.build_all || out_of_date?(timestamp)
|
10
15
|
end
|
11
|
-
|
16
|
+
|
12
17
|
def timestamp
|
13
18
|
s3_object.last_modified
|
14
19
|
rescue
|
20
|
+
# if we cannot read last_modified, assume the file
|
21
|
+
# is extremely old
|
15
22
|
Rake::EARLY
|
16
23
|
end
|
17
|
-
|
24
|
+
|
18
25
|
def s3_object
|
19
|
-
s3
|
20
|
-
|
21
|
-
s3.bucket(bucket_name).object(remote_path)
|
26
|
+
@s3.bucket(bucket_name).object(remote_path)
|
22
27
|
end
|
23
28
|
|
24
29
|
def bucket_name
|
@@ -41,7 +46,6 @@ module RakeRemoteFile
|
|
41
46
|
def upload(options={})
|
42
47
|
options[:content_type] ||= mime_type
|
43
48
|
|
44
|
-
puts("actually uploading")
|
45
49
|
s3_object.upload_file(source_file, options)
|
46
50
|
end
|
47
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-remote-file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Massicotte
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|