samus 3.0.1 → 3.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5e4c0c8742f2d9b76ee61f0a4bd4fc5562ece09a7799f797f981cdd78a5c7b6
4
- data.tar.gz: 809fe2cf19a8ac7d1829944563a2c5bf4834abe2a1073255d90980d58a1d6c33
3
+ metadata.gz: 6f02a949de04a9a4ce8c6d63f3e80c1b44636e341f1de08b5f036ff5e996967b
4
+ data.tar.gz: c700b3fe01b015074707f261f70c4627549f57de1a424c391ea58dc4d4dbcd85
5
5
  SHA512:
6
- metadata.gz: a6a21d0b2b25fd6bc60617938215fe41ffafc0ae2e24e5cfddba5288635f5d29769123209e24cf78e17ed7d7b88682893a588567b8cead5dbaacb28749507384
7
- data.tar.gz: 9d4c7bdc835246c423b5f555beb3b58f66ce5826909de4054845a2f14c16c4cbb13069563d04c27bcf203fc5cfc2847691cc3e4b0de526f6b16fb4a3260b2db5
6
+ metadata.gz: 543d72731d76b7585660fb77a7c4d32ddcdfc5e2c99627964f7ee1a5ba518f2dcb95f12e5835c210916dca02e15834e4467b3e1f67a4d6adc2429498bda926dd
7
+ data.tar.gz: 60f25e20948cd58ead46211f88e3fa74abdf3262481b46a777862e8bf489a3b57e1cd17146a5656f02aec529796b7e925f19be8778333fec4b4234d910ab4bf8
@@ -1,3 +1,7 @@
1
+ # 3.0.2 - April 1st, 2019
2
+
3
+ - Add `chmod-files` command to fix file permissions on globs.
4
+
1
5
  # 3.0.1 - March 30th, 2019
2
6
 
3
7
  - Fix bug in `publish/github-release` command due to invalid tag handling.
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ dir_mask = ENV['_DIR_MASK'] || "775"
4
+ entries = {}
5
+
6
+ ARGV.each do |arg|
7
+ wildcard, want_fmode = *arg.split(',')
8
+ Dir.glob(wildcard).each do |entry|
9
+ stat = File.stat(entry)
10
+ real_mode = stat.mode.to_s(8)[-3..-1]
11
+ want_mode = stat.directory? ? dir_mask : want_fmode
12
+
13
+ if real_mode != want_mode
14
+ entries[entry] = { want: want_mode, real: real_mode }
15
+ else
16
+ entries.delete(entry)
17
+ end
18
+ end
19
+ end
20
+
21
+ entries.each do |f, mode|
22
+ File.chmod(mode[:want].to_i(8), f)
23
+ puts "Fix permissions: #{mode[:real]} -> #{mode[:want]} for #{f}"
24
+ end
@@ -0,0 +1,19 @@
1
+ Corrects permissions for a set of globs. Pass arguments in files
2
+ with comma separating glob from permission bits. This command
3
+ auto-corrects directories to 775. Set dir_mask to override the
4
+ default mask value.
5
+
6
+ Example:
7
+
8
+ ```json
9
+ "files": "bin/**/*,755 lib/**/*.rb,644"
10
+ ```
11
+
12
+ Files:
13
+
14
+ - A list of globs and permissions separated by a comma, ex:
15
+ `**/*.rb,644 **/*.sh,755`
16
+
17
+ Arguments:
18
+
19
+ - dir_mask: (optional) the directory umask to set. Defaults to 775.
@@ -1,3 +1,3 @@
1
1
  module Samus
2
- VERSION = '3.0.1'.freeze
2
+ VERSION = '3.0.2'.freeze
3
3
  end
data/samus.json CHANGED
@@ -8,6 +8,15 @@
8
8
  "replace": "VERSION = '$version'"
9
9
  }
10
10
  },
11
+ {
12
+ "action": "chmod-files",
13
+ "files": [
14
+ "**/*,644",
15
+ "bin/*,755",
16
+ "commands/**/*,755",
17
+ "commands/**/*.md,644"
18
+ ]
19
+ },
11
20
  {
12
21
  "action": "git-commit",
13
22
  "files": ["lib/*/version.rb"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samus
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-30 00:00:00.000000000 Z
11
+ date: 2019-04-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lsegal@soen.ca
@@ -31,6 +31,8 @@ files:
31
31
  - commands/build/archive-zip.help.md
32
32
  - commands/build/changelog-parse
33
33
  - commands/build/changelog-parse.help.md
34
+ - commands/build/chmod-files
35
+ - commands/build/chmod-files.help.md
34
36
  - commands/build/fs-copy
35
37
  - commands/build/fs-copy.help.md
36
38
  - commands/build/fs-mkdir