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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/gdk +12 -73
  3. data/lib/gitlab_development_kit.rb +1 -1
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ea455a9185d9a48272280448034af98ee051740756dea1ed6545cec557fc957
4
- data.tar.gz: 520cd43ae500977adade2d5bcf7d10ee09326c3ac56e8ec7a9b510ef8f0ef94b
3
+ metadata.gz: 99d51f37295622d92a07f02b2fb17187967fc293de906680af90b5ee70434bab
4
+ data.tar.gz: 7719b5ca965d7fa482d9dfe9a14c4866103ab0878bb26d53aaf123a2ae4b0e8f
5
5
  SHA512:
6
- metadata.gz: 8c98398310d0c1eeda0d851dfded10ec22745e156b1550d7ad9a888eef399f37eede40f3e2a2f88963f756e2eac27fcc2af078959d27f7d93f43f92bb96c0245
7
- data.tar.gz: 27c139a2d76cd03446c11e3c7bf0d071cfc5216ec28bb41d79faeef9e97acbc3b5ecb23a964480948f7fe0bf64622ae273a5683cfc35d344383d3947f0aefe0d
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 gdk_dir?
31
- require(File.join(gdk_root, 'lib/gdk.rb'))
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 or create
48
- a new one with 'gdk init'.
47
+ installation. Use 'cd' to go to your gitlab-development-kit.
49
48
 
50
- gdk init [DIRECTORY] # Default: #{DEFAULT_INIT_DIRECTORY}
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(Dir.pwd)
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 gdk_dir? == true, fall through to allow lib/gdk.rb to handle
65
- %w[version --version].include?(args.first) && !gdk_dir?
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 File.exist?(File.join(current, 'GDK_ROOT'))
74
- File.realpath(current)
75
- elsif File.realpath(current) == '/'
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(File.join(current, '..'))
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
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GDK
4
- GEM_VERSION = '0.2.14'
4
+ GEM_VERSION = '0.2.16'
5
5
  VERSION = "GitLab Development Kit #{GEM_VERSION}"
6
6
  end
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.14
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: 2021-06-03 00:00:00.000000000 Z
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: '12.0'
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: '12.0'
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.1.4
57
+ rubygems_version: 3.3.26
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: CLI for GitLab Development Kit