gitlab-development-kit 0.2.14 → 0.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gdk +12 -73
- data/lib/gitlab_development_kit.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99d51f37295622d92a07f02b2fb17187967fc293de906680af90b5ee70434bab
|
4
|
+
data.tar.gz: 7719b5ca965d7fa482d9dfe9a14c4866103ab0878bb26d53aaf123a2ae4b0e8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bb13c335d29f257aa763b61e59f2b36dc68dcd4b28b22e5a2fa5ef69b6644c8fc5aeac3e806e4af17c4fa2459327a8985e3ef5c52b6904ef1583a443aed383f
|
7
|
+
data.tar.gz: 954a35d82f3d03030eef5ec489a899c1576dbf71b52333d7e51cbd1e850cc38b78b792508a7a9c6eb4c1868b950b70316f4255f8459eee134c0494c57111985f
|
data/bin/gdk
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
|
5
5
|
require 'yaml'
|
6
|
+
require 'pathname'
|
6
7
|
|
7
8
|
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
8
9
|
require 'gitlab_development_kit'
|
@@ -25,10 +26,9 @@ module GDK
|
|
25
26
|
|
26
27
|
def run
|
27
28
|
return GDK::CommandBasic::Version.new.run if gdk_version?
|
28
|
-
return GDK::CommandBasic::Init.new(args[1..]).run if gdk_init?
|
29
29
|
|
30
|
-
if
|
31
|
-
require(
|
30
|
+
if gdk_root
|
31
|
+
require(gdk_root.join('lib/gdk.rb'))
|
32
32
|
GDK.main
|
33
33
|
else
|
34
34
|
warn_not_gdk_dir
|
@@ -44,38 +44,29 @@ module GDK
|
|
44
44
|
warn <<~NOT_A_GDK_DIR
|
45
45
|
|
46
46
|
The current working directory is not inside a gitlab-development-kit
|
47
|
-
installation. Use 'cd' to go to your gitlab-development-kit
|
48
|
-
a new one with 'gdk init'.
|
47
|
+
installation. Use 'cd' to go to your gitlab-development-kit.
|
49
48
|
|
50
|
-
|
49
|
+
# Default: #{DEFAULT_INIT_DIRECTORY}
|
51
50
|
|
52
51
|
NOT_A_GDK_DIR
|
53
52
|
end
|
54
53
|
|
55
54
|
def gdk_root
|
56
|
-
@gdk_root ||= find_root(
|
57
|
-
end
|
58
|
-
|
59
|
-
def gdk_dir?
|
60
|
-
!gdk_root.nil?
|
55
|
+
@gdk_root ||= find_root(Pathname.new(ENV['PWD']))
|
61
56
|
end
|
62
57
|
|
63
58
|
def gdk_version?
|
64
|
-
# If
|
65
|
-
%w[version --version].include?(args.first) && !
|
66
|
-
end
|
67
|
-
|
68
|
-
def gdk_init?
|
69
|
-
args.first == 'init'
|
59
|
+
# If gdk_root == true, fall through to allow lib/gdk.rb to handle
|
60
|
+
%w[version --version].include?(args.first) && !gdk_root
|
70
61
|
end
|
71
62
|
|
72
63
|
def find_root(current)
|
73
|
-
if
|
74
|
-
|
75
|
-
elsif
|
64
|
+
if current.join('GDK_ROOT').exist?
|
65
|
+
current.realpath
|
66
|
+
elsif current.realpath.to_s == '/'
|
76
67
|
nil
|
77
68
|
else
|
78
|
-
find_root(
|
69
|
+
find_root(current.join('..'))
|
79
70
|
end
|
80
71
|
end
|
81
72
|
end
|
@@ -86,58 +77,6 @@ module GDK
|
|
86
77
|
true
|
87
78
|
end
|
88
79
|
end
|
89
|
-
|
90
|
-
class Init
|
91
|
-
def initialize(args)
|
92
|
-
@args = args
|
93
|
-
end
|
94
|
-
|
95
|
-
def run
|
96
|
-
warn("INFO: 'gdk init' is deprecated and will be removed in a future update.")
|
97
|
-
|
98
|
-
if show_help?
|
99
|
-
puts('Usage: gdk init [DIR]')
|
100
|
-
|
101
|
-
return true
|
102
|
-
end
|
103
|
-
|
104
|
-
directory = new_gdk_directory
|
105
|
-
if new_gdk_directory_invalid?(directory)
|
106
|
-
warn("ERROR: The proposed new GDK directory '#{directory}' is invalid because it begins with a dash.")
|
107
|
-
|
108
|
-
return false
|
109
|
-
end
|
110
|
-
|
111
|
-
if clone_gdk(directory)
|
112
|
-
puts("INFO: Successfully git cloned the GDK into '#{directory}'.")
|
113
|
-
true
|
114
|
-
else
|
115
|
-
warn("ERROR: An error occurred while attempting to git clone the GDK into '#{directory}'.")
|
116
|
-
false
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
private
|
121
|
-
|
122
|
-
attr_reader :args
|
123
|
-
|
124
|
-
def show_help?
|
125
|
-
args.count > 1 || (args & %w[-help --help]).any?
|
126
|
-
end
|
127
|
-
|
128
|
-
def new_gdk_directory_invalid?(directory)
|
129
|
-
directory.start_with?('-')
|
130
|
-
end
|
131
|
-
|
132
|
-
def new_gdk_directory
|
133
|
-
args.count == 1 ? args.first : GDK::DEFAULT_INIT_DIRECTORY
|
134
|
-
end
|
135
|
-
|
136
|
-
def clone_gdk(directory)
|
137
|
-
cmd = "git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git #{directory}"
|
138
|
-
system(*cmd)
|
139
|
-
end
|
140
|
-
end
|
141
80
|
end
|
142
81
|
end
|
143
82
|
|
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.16
|
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:
|
12
|
+
date: 2022-12-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '13.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '13.0'
|
28
28
|
description: CLI for GitLab Development Kit.
|
29
29
|
email:
|
30
30
|
- gitlab_rubygems@gitlab.com
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
rubygems_version: 3.
|
57
|
+
rubygems_version: 3.3.26
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: CLI for GitLab Development Kit
|