rake_git_crypt 0.1.0.pre.15 → 0.1.0.pre.16

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: e426a2d4bc292264074ac8e12c0ac21ebdfd3c834de262bf8afd889f3365e66d
4
- data.tar.gz: f043f33c2f71f991b54a972b1bb6683730f75c54bfaa1375c878253a8b81f2bd
3
+ metadata.gz: caaa2017705d66365774aa73e514d7337a8d6e88961520707aa2fbd5950f93ab
4
+ data.tar.gz: da842a211625edfc228dd8f5abf14ea1785f6bf49fedb93281b1dc182a04d1cc
5
5
  SHA512:
6
- metadata.gz: 263ca6021195915bceb150d3c3921377b2547a9b25850388e08766bc02d4037e126f3e27a4d402fc949d849a6ac82f9099e25555a938a2fc8cb735f518d4d85b
7
- data.tar.gz: 2fac6b967672f0dfd2bc307b64591d85b998b4eccddb41fba867c23a88dce24f95e2b2911db412fd39a2f51ea69efc38e47b2ef8d6a031936af9be597033790a
6
+ metadata.gz: 4017fa057ae94518b7fe882e1fd532424cd236000ed79f61a712b56faf5fa21919c869114d2e7b982e9d82fa501d3f4babaa88716621e75f82db9e8beecfcb9f
7
+ data.tar.gz: dca95c4e1e6029544b28cfecfeeac994850df59f0a88e5159ec861c9d9f985b31f80b2f028506019878cea44f38b0a7c06b48d55db5acc6820f010072e7d53d3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_git_crypt (0.1.0.pre.15)
4
+ rake_git_crypt (0.1.0.pre.16)
5
5
  colored2 (~> 3.1)
6
6
  rake_factory (= 0.32.0.pre.2)
7
7
  ruby_git_crypt (= 0.1.0.pre.2)
@@ -120,7 +120,7 @@ GEM
120
120
  simplecov-html (0.12.3)
121
121
  simplecov_json_formatter (0.1.4)
122
122
  sshkey (2.0.0)
123
- tzinfo (2.0.5)
123
+ tzinfo (2.0.6)
124
124
  concurrent-ruby (~> 1.0)
125
125
  unicode-display_width (2.4.2)
126
126
 
@@ -148,4 +148,4 @@ DEPENDENCIES
148
148
  simplecov
149
149
 
150
150
  BUNDLED WITH
151
- 2.4.5
151
+ 2.4.6
@@ -6,6 +6,7 @@ require_relative '../mixins/support'
6
6
 
7
7
  module RakeGitCrypt
8
8
  module Tasks
9
+ # rubocop:disable Metrics/ClassLength
9
10
  class AddUsers < RakeFactory::Task
10
11
  include Mixins::Support
11
12
 
@@ -34,6 +35,30 @@ module RakeGitCrypt
34
35
 
35
36
  private
36
37
 
38
+ def gpg_user_key_paths
39
+ return nil if @gpg_user_key_paths.nil?
40
+
41
+ resolve_key_paths(@gpg_user_key_paths)
42
+ end
43
+
44
+ def resolve_key_paths(paths)
45
+ paths.inject([]) do |acc, key_path|
46
+ [*acc, *resolve_key_path(key_path)]
47
+ end
48
+ end
49
+
50
+ def resolve_key_path(path)
51
+ if File.file?(path)
52
+ [path]
53
+ elsif File.directory?(path)
54
+ resolve_key_paths(
55
+ Dir.entries(path).reject { |entry| %w[. ..].include?(entry) }
56
+ )
57
+ else
58
+ []
59
+ end
60
+ end
61
+
37
62
  def ensure_users_provided
38
63
  if gpg_user_details_present?(:key_path) ||
39
64
  gpg_user_details_present?(:id)
@@ -124,5 +149,6 @@ module RakeGitCrypt
124
149
  )
125
150
  end
126
151
  end
152
+ # rubocop:enable Metrics/ClassLength
127
153
  end
128
154
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RakeGitCrypt
4
- VERSION = '0.1.0.pre.15'
4
+ VERSION = '0.1.0.pre.16'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_git_crypt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.15
4
+ version: 0.1.0.pre.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers