gitlab-development-kit 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gdk +2 -50
- data/lib/gitlab_development_kit.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fce4dd74b2f32c9cbf4519336c9b731158cb34c5570d83805fbeff74aab2c209
|
4
|
+
data.tar.gz: 3b86852c3e15145a1c5c4617a05827cb4b9b7159be8c684107e0e85f57a389a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 245d0650689fca386f65d623fce71c5a6884b65faddd731daedb622b39fa3e7c2677218be24709bebe7d9e091dc89263fe5f8b0b4fd82e46a1beb8e125bea12a
|
7
|
+
data.tar.gz: 14c63e2ab27736a16e7356f4b39b65f125949447f38cab27f90b99249a340f2ad876293b536d3d12544c6e56a380ebd15668bf8e727ccaea51fdd4a20fc2bfce
|
data/bin/gdk
CHANGED
@@ -13,12 +13,10 @@ require 'gitlab_development_kit'
|
|
13
13
|
# installed outside the gitlab-development-kit repository with 'gem
|
14
14
|
# install'. Edit lib/gdk.rb to define new commands.
|
15
15
|
module GDK
|
16
|
-
DOTFILE = File.expand_path('~/.gdk.yml')
|
17
|
-
TRUSTED_KEY = 'trusted_directories'
|
18
16
|
ROOT_CHECK_FILE = '.gdk-install-root'
|
19
17
|
DEFAULT_INIT_DIRECTORY = File.join(Dir.pwd, 'gitlab-development-kit')
|
20
18
|
|
21
|
-
def self.launcher_main
|
19
|
+
def self.launcher_main
|
22
20
|
case ARGV.first
|
23
21
|
when 'init'
|
24
22
|
if ARGV.count > 2 || (ARGV.count == 2 && (ARGV[1] == '-help' || ARGV[1] == '--help'))
|
@@ -36,14 +34,7 @@ module GDK
|
|
36
34
|
end
|
37
35
|
|
38
36
|
cmd = %W[git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git #{directory}]
|
39
|
-
system(*cmd) &&
|
40
|
-
when 'trust'
|
41
|
-
if ARGV.count != 2
|
42
|
-
puts 'Usage: gdk trust DIR'
|
43
|
-
return false
|
44
|
-
end
|
45
|
-
|
46
|
-
trust!(ARGV[1])
|
37
|
+
system(*cmd) && remember!(directory)
|
47
38
|
else
|
48
39
|
if print_version?
|
49
40
|
puts VERSION
|
@@ -57,12 +48,6 @@ module GDK
|
|
57
48
|
return false
|
58
49
|
end
|
59
50
|
|
60
|
-
unless trusted?
|
61
|
-
warn_not_trusted_dir
|
62
|
-
|
63
|
-
return false
|
64
|
-
end
|
65
|
-
|
66
51
|
load(File.join(gdk_root, 'lib/gdk.rb'))
|
67
52
|
GDK.main
|
68
53
|
end
|
@@ -80,17 +65,6 @@ module GDK
|
|
80
65
|
NOT_A_GDK_DIR
|
81
66
|
end
|
82
67
|
|
83
|
-
def self.warn_not_trusted_dir
|
84
|
-
warn <<~NOT_A_TRUSTED_GDK_DIR
|
85
|
-
|
86
|
-
This GitLab Development Kit root directory is not known to the "gdk"
|
87
|
-
command. To mark it as trusted run:
|
88
|
-
|
89
|
-
gdk trust #{gdk_root}
|
90
|
-
|
91
|
-
NOT_A_TRUSTED_GDK_DIR
|
92
|
-
end
|
93
|
-
|
94
68
|
def self.gdk_root
|
95
69
|
@gdk_root ||= find_root(Dir.pwd)
|
96
70
|
end
|
@@ -113,28 +87,6 @@ module GDK
|
|
113
87
|
end
|
114
88
|
end
|
115
89
|
|
116
|
-
def self.trusted?
|
117
|
-
trusted_directories = load_dotfile[TRUSTED_KEY] || []
|
118
|
-
!!trusted_directories.include?(File.realpath(gdk_root))
|
119
|
-
end
|
120
|
-
|
121
|
-
def self.trust!(directory)
|
122
|
-
directory = File.realpath(directory)
|
123
|
-
config = load_dotfile
|
124
|
-
config[TRUSTED_KEY] ||= []
|
125
|
-
|
126
|
-
if config[TRUSTED_KEY].include?(directory)
|
127
|
-
puts "#{directory} is already in #{TRUSTED_KEY} in #{DOTFILE}"
|
128
|
-
else
|
129
|
-
config[TRUSTED_KEY] << directory
|
130
|
-
config[TRUSTED_KEY].uniq!
|
131
|
-
puts "Adding #{directory} to #{TRUSTED_KEY} in #{DOTFILE}"
|
132
|
-
File.open(DOTFILE, 'w') { |f| YAML.dump(config, f) }
|
133
|
-
end
|
134
|
-
|
135
|
-
true
|
136
|
-
end
|
137
|
-
|
138
90
|
def self.load_dotfile
|
139
91
|
File.open(DOTFILE, File::RDONLY | File::CREAT) do |f|
|
140
92
|
YAML.safe_load(f)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-development-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Vosmaer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-04-
|
12
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|