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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1edb5295b67ce49495403522d587c9e307e4aabb2f7ce4a6de22a752cd43648
4
- data.tar.gz: 393e81e7a57a42055a81d24a2f5bce536199ec9d44b693a5b0ba1aad2daf3c6f
3
+ metadata.gz: 49328423d4c33c821307cb5ba9adaced57632f2aede21bc8acde432974deada0
4
+ data.tar.gz: f7d2dac67847f701784e44fe4a97016c12dcd3042ed4b21b8e5dacdf83f90882
5
5
  SHA512:
6
- metadata.gz: 1190a752fc61a4bb1ebf92a3b076cc6964d4519674b2562171587f852bb9ba5233d8bf6eaa729a65a33a8c62bc0ffadc6ebc74e2a6ba3322e045045141a3c0b1
7
- data.tar.gz: 4f23d57b4e50104e302a709762f3fcbc399fa4374f975caa8e5511efe9ec34bac24b41adc1fbb369c7aba8f6ee54274028b8af525b836c8b148ec6e9a8082494
6
+ metadata.gz: f7dd87f0dda03075afeaf0ad533c4b3efa11c5bfe30a4f4f6b3dd01a30ae65f24a13bb670c4f70c7fb1a475b526602cb669abdd9e5e05bbf09d39e7acb16d94a
7
+ data.tar.gz: 45bdeb3c985c478267b83bcc7f0f849e66cf267294856fd48d12de7651b3d39f468e65f892a38b4cd4076162167cf8b711968e878e0b9546bac06332e1ef353c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake-remote-file (0.1.0)
4
+ rake-remote-file (0.1.1)
5
5
  aws-sdk-s3
6
6
  mime-types
7
7
  rake
@@ -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 = Aws::S3::Resource.new()
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
@@ -1,3 +1,3 @@
1
1
  module RakeRemoteFile
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  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.0
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-27 00:00:00.000000000 Z
11
+ date: 2020-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake