rake-remote-file 0.1.1 → 0.1.2

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: 49328423d4c33c821307cb5ba9adaced57632f2aede21bc8acde432974deada0
4
- data.tar.gz: f7d2dac67847f701784e44fe4a97016c12dcd3042ed4b21b8e5dacdf83f90882
3
+ metadata.gz: 1b9236fdb06bc2db71f39800d3d84e8006755539658ce887229e41aded93a9f0
4
+ data.tar.gz: cee7fe5159113c1f1fb1e94a613d5d62cb57c916381458af4e21df7fc2211c6c
5
5
  SHA512:
6
- metadata.gz: f7dd87f0dda03075afeaf0ad533c4b3efa11c5bfe30a4f4f6b3dd01a30ae65f24a13bb670c4f70c7fb1a475b526602cb669abdd9e5e05bbf09d39e7acb16d94a
7
- data.tar.gz: 45bdeb3c985c478267b83bcc7f0f849e66cf267294856fd48d12de7651b3d39f468e65f892a38b4cd4076162167cf8b711968e878e0b9546bac06332e1ef353c
6
+ metadata.gz: 18c34854e20e0c198c2f7752d6d1ec727d49a4dd63a87c751258cebfcf70ea4fe4d279ee7716066744b45f18c57755c15ca3986c30e1caee94cc0929b41c6607
7
+ data.tar.gz: 10fbda6e7f3ccbee8520a0a50cf824515bb93d33793f38a939974d339365b5b76440a27b0023842193fca582f91ae31c053f30128408f945510a5bf753f4a3e4
data/CODE_OF_CONDUCT.md CHANGED
@@ -5,9 +5,9 @@
5
5
  In the interest of fostering an open and welcoming environment, we as
6
6
  contributors and maintainers pledge to making participation in our project and
7
7
  our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
11
 
12
12
  ## Our Standards
13
13
 
@@ -23,7 +23,7 @@ include:
23
23
  Examples of unacceptable behavior by participants include:
24
24
 
25
25
  * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
26
+ advances
27
27
  * Trolling, insulting/derogatory comments, and personal or political attacks
28
28
  * Public or private harassment
29
29
  * Publishing others' private information, such as a physical or electronic
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at 85322+mattmassicotte@users.noreply.github.com. All
58
+ reported by contacting the project team. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -68,7 +68,9 @@ members of the project's leadership.
68
68
  ## Attribution
69
69
 
70
70
  This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
72
 
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
data/Gemfile CHANGED
@@ -1,8 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in rake-remote-file.gemspec
4
- gemspec
5
-
6
3
  gem "rake", "~> 12.0"
7
4
  gem "minitest", "~> 5.0"
8
5
  gem "mime-types"
data/Gemfile.lock CHANGED
@@ -1,31 +1,6 @@
1
- PATH
2
- remote: .
3
- specs:
4
- rake-remote-file (0.1.1)
5
- aws-sdk-s3
6
- mime-types
7
- rake
8
-
9
1
  GEM
10
2
  remote: https://rubygems.org/
11
3
  specs:
12
- aws-eventstream (1.1.0)
13
- aws-partitions (1.399.0)
14
- aws-sdk-core (3.109.3)
15
- aws-eventstream (~> 1, >= 1.0.2)
16
- aws-partitions (~> 1, >= 1.239.0)
17
- aws-sigv4 (~> 1.1)
18
- jmespath (~> 1.0)
19
- aws-sdk-kms (1.39.0)
20
- aws-sdk-core (~> 3, >= 3.109.0)
21
- aws-sigv4 (~> 1.1)
22
- aws-sdk-s3 (1.85.0)
23
- aws-sdk-core (~> 3, >= 3.109.0)
24
- aws-sdk-kms (~> 1)
25
- aws-sigv4 (~> 1.1)
26
- aws-sigv4 (1.2.2)
27
- aws-eventstream (~> 1, >= 1.0.2)
28
- jmespath (1.4.0)
29
4
  mime-types (3.3.1)
30
5
  mime-types-data (~> 3.2015)
31
6
  mime-types-data (3.2020.1104)
@@ -39,7 +14,6 @@ DEPENDENCIES
39
14
  mime-types
40
15
  minitest (~> 5.0)
41
16
  rake (~> 12.0)
42
- rake-remote-file!
43
17
 
44
18
  BUNDLED WITH
45
- 2.1.4
19
+ 2.2.22
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # Rake::Remote::File
1
+ # rake-remote-file
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rake/remote/file`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This is a simple gem that adds capabilities to rake to emulate the `file` task, but for files that reside on a remote server. Currently.
4
+ S3 is supported.
6
5
 
7
6
  ## Installation
8
7
 
@@ -22,7 +21,10 @@ Or install it yourself as:
22
21
 
23
22
  ## Usage
24
23
 
25
- TODO: Write usage instructions here
24
+ This DSL extension creates two tasks. First, a `file "/path/to/local/file"`, and then a remote task named `https://s3.amazonaws.com/#{bucket}/#{key}`
25
+ which behaves functionally like a `file` task.
26
+
27
+ remote_file '/path/to/local/file', 'https://s3.amazonaws.com/#{bucket}/#{key}'
26
28
 
27
29
  ## Development
28
30
 
@@ -32,9 +34,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
34
 
33
35
  ## Contributing
34
36
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rake-remote-file. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/rake-remote-file/blob/master/CODE_OF_CONDUCT.md).
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rake-remote-file. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/mattmassicotte/rake-remote-file/blob/master/CODE_OF_CONDUCT.md).
36
38
 
37
39
 
38
40
  ## Code of Conduct
39
41
 
40
- Everyone interacting in the Rake::Remote::File project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/rake-remote-file/blob/master/CODE_OF_CONDUCT.md).
42
+ Everyone interacting in the rake-remote-file project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mattmassicotte/rake-remote-file/blob/master/CODE_OF_CONDUCT.md).
@@ -1,25 +1,23 @@
1
1
  module RakeRemoteFile
2
2
  module DSL
3
-
4
3
  include Rake::DSL
5
4
 
6
5
  def remote_file(src_file, *args, &block)
7
6
  file src_file
8
-
7
+
9
8
  remote_task = RakeRemoteFile::Task.define_task(*args, &block)
10
-
9
+
11
10
  remote_task.enhance([src_file])
12
-
11
+
13
12
  remote_task.source_file = src_file
14
-
13
+
15
14
  remote_task.enhance do
16
15
  remote_task.upload
17
16
  end
18
-
17
+
19
18
  remote_task
20
19
  end
21
-
22
20
  end
23
21
  end
24
22
 
25
- self.extend RakeRemoteFile::DSL
23
+ extend RakeRemoteFile::DSL
@@ -6,7 +6,7 @@ module RakeRemoteFile
6
6
  attr_accessor :source_file
7
7
 
8
8
  def initialize(task_name, app)
9
- @s3 = Aws::S3::Resource.new()
9
+ @s3 = Aws::S3::Resource.new
10
10
  super(task_name, app)
11
11
  end
12
12
 
@@ -16,36 +16,40 @@ module RakeRemoteFile
16
16
 
17
17
  def timestamp
18
18
  s3_object.last_modified
19
- rescue
19
+ rescue StandardError
20
20
  # if we cannot read last_modified, assume the file
21
21
  # is extremely old
22
22
  Rake::EARLY
23
23
  end
24
24
 
25
+ def content_hash
26
+ s3_object.etag
27
+ end
28
+
25
29
  def s3_object
26
30
  @s3.bucket(bucket_name).object(remote_path)
27
31
  end
28
-
32
+
29
33
  def bucket_name
30
- name[/s3\.amazonaws\.com\/(.*?)\/(.*)/, 1]
34
+ name[%r{s3\.amazonaws\.com/(.*?)/(.*)}, 1]
31
35
  end
32
-
36
+
33
37
  def remote_path
34
- name[/s3\.amazonaws\.com\/(.*?)\/(.*)/, 2]
38
+ name[%r{s3\.amazonaws\.com/(.*?)/(.*)}, 2]
35
39
  end
36
-
40
+
37
41
  def extname
38
42
  File.extname(source_file)
39
43
  end
40
-
44
+
41
45
  def mime_type
42
46
  ext = extname.strip.downcase[1..-1]
43
47
  MIME::Types.type_for(ext).first.to_s
44
48
  end
45
-
46
- def upload(options={})
49
+
50
+ def upload(options = {})
47
51
  options[:content_type] ||= mime_type
48
-
52
+
49
53
  s3_object.upload_file(source_file, options)
50
54
  end
51
55
  end
@@ -1,3 +1,3 @@
1
1
  module RakeRemoteFile
2
- VERSION = "0.1.1"
2
+ VERSION = '0.1.2'
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Massicotte
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-28 00:00:00.000000000 Z
11
+ date: 2022-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Rake DSL extensions for managing a file at a remote location
84
- email:
84
+ email:
85
85
  executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files: []
@@ -105,7 +105,7 @@ metadata:
105
105
  allowed_push_host: https://rubygems.org
106
106
  homepage_uri: https://github.com/mattmassicotte/rake-remote-file
107
107
  source_code_uri: https://github.com/mattmassicotte/rake-remote-file
108
- post_install_message:
108
+ post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths:
111
111
  - lib
@@ -120,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.1.2
124
- signing_key:
123
+ rubygems_version: 3.2.22
124
+ signing_key:
125
125
  specification_version: 4
126
126
  summary: Rake DSL extensions for managing a file at a remote location
127
127
  test_files: []