rake_git_crypt 0.1.0.pre.15 → 0.1.0.pre.16
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 +4 -4
- data/Gemfile.lock +3 -3
- data/lib/rake_git_crypt/tasks/add_users.rb +26 -0
- data/lib/rake_git_crypt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caaa2017705d66365774aa73e514d7337a8d6e88961520707aa2fbd5950f93ab
|
4
|
+
data.tar.gz: da842a211625edfc228dd8f5abf14ea1785f6bf49fedb93281b1dc182a04d1cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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.
|
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
|