geordi 5.0.0 → 5.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +34 -0
- data/Gemfile.lock +1 -1
- data/README.md +28 -10
- data/exe/geordi +2 -0
- data/geordi.gemspec +2 -4
- data/lib/geordi/commands/_setup_vnc.rb +8 -10
- data/lib/geordi/commands/console.rb +1 -1
- data/lib/geordi/commands/docker.rb +46 -0
- data/lib/geordi/commands/shell.rb +0 -2
- data/lib/geordi/commands/update.rb +15 -4
- data/lib/geordi/cucumber.rb +7 -5
- data/lib/geordi/docker.rb +116 -0
- data/lib/geordi/dump_loader.rb +1 -1
- data/lib/geordi/util.rb +5 -15
- data/lib/geordi/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 601c58f6344b5fb02e2514749e216e60a6f6f1cc656d2a37eabb891cc013edfa
|
4
|
+
data.tar.gz: 07b06fa74266f0ba5506b8218e10c78b4156c854cef9bb8bca3fd77ba5b6d30a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 533ceae3f15d374526bafa76278914212de5b930250c8375c8f4cde1661e56d4c22093a4266c48b3646b023c4925599e2c46e0f93f38b52430a9748ce1778e7c
|
7
|
+
data.tar.gz: edf3b697d11b5ec5c932ccd6a60311325ea0d8ed50e3d0650aae3f63b8cd514374dfd465212aae82e6585daee7f7466113cf6b1dacbf430a2b7c95269c9b0dc2
|
data/.github/workflows/test.yml
CHANGED
@@ -35,7 +35,8 @@ jobs:
|
|
35
35
|
ruby-version: "${{ matrix.ruby }}"
|
36
36
|
- name: Install vncserver
|
37
37
|
run: |
|
38
|
-
sudo apt-get
|
38
|
+
sudo apt-get update
|
39
|
+
sudo apt-get install -y tightvncserver
|
39
40
|
# Fake required password for vncserver
|
40
41
|
mkdir ~/.vnc && touch ~/.vnc/passwd && chmod 700 ~/.vnc/passwd
|
41
42
|
- name: Bundle
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,37 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
10
10
|
### Breaking changes
|
11
11
|
|
12
12
|
|
13
|
+
## 5.2.3 2021-01-27
|
14
|
+
|
15
|
+
### Compatible changes
|
16
|
+
* Remove auto-bundling from `geordi shell` and remote `geordi console`
|
17
|
+
|
18
|
+
|
19
|
+
## 5.2.2 2020-12-17
|
20
|
+
|
21
|
+
### Compatible changes
|
22
|
+
* Ignore ACL settings when loading a PostgreSQL dump
|
23
|
+
|
24
|
+
|
25
|
+
## 5.2.1 2020-12-15
|
26
|
+
|
27
|
+
### Compatible changes
|
28
|
+
* Fix a bug regarding `geordi vnc` which was introduced in 5.1.0
|
29
|
+
|
30
|
+
|
31
|
+
## 5.2.0 2020-12-14
|
32
|
+
|
33
|
+
### Compatible changes
|
34
|
+
* Geordi update will exit with a warning when Ruby version changes during pull.
|
35
|
+
* Add `geordi docker` command with support for opening a shell for dockerized dev environments.
|
36
|
+
|
37
|
+
|
38
|
+
## 5.1.0 2020-12-04
|
39
|
+
|
40
|
+
### Compatible changes
|
41
|
+
* Switch to tightvncserver to be compatible with Ubuntu 20.04. vnc4server is still supported.
|
42
|
+
|
43
|
+
|
13
44
|
## 5.0.0 2020-11-25
|
14
45
|
|
15
46
|
### Breaking changes
|
@@ -126,6 +157,9 @@ Don't know how to build task 'db:migrate parallel:prepare'
|
|
126
157
|
### Breaking changes
|
127
158
|
- Remove support for Ruby 1.8.7 and Ruby 1.9.3. Bug fixes might still be backported to 2.x, but we will not add any features to 2.x anymore. Please consider to upgrade the Ruby version of your project.
|
128
159
|
|
160
|
+
## 2.12.3
|
161
|
+
|
162
|
+
* Add `geordi docker` command with support for opening a shell for dockerized dev environments.
|
129
163
|
|
130
164
|
## 2.11.0 2020-05-04
|
131
165
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Geordi [![
|
1
|
+
Geordi [![Tests](https://github.com/makandra/geordi/workflows/Tests/badge.svg)](https://github.com/makandra/geordi/actions)
|
2
2
|
======
|
3
3
|
|
4
4
|
Geordi is a collection of command line tools we use in our daily work with
|
@@ -157,6 +157,25 @@ instead of `cap deploy:migrations`. You can force using `deploy` by passing the
|
|
157
157
|
- `-c, [--current-branch], [--no-current-branch]`: Set DEPLOY_BRANCH to the current branch during deploy
|
158
158
|
|
159
159
|
|
160
|
+
### `geordi docker`
|
161
|
+
Manage docker containers for the current project.
|
162
|
+
|
163
|
+
Manage docker containers to run your project dockerized.
|
164
|
+
|
165
|
+
It expects a `docker-compose.yml` file that specifies all services, and a service
|
166
|
+
named "main" that opens a shell for the project.
|
167
|
+
|
168
|
+
There are three subcommands:
|
169
|
+
|
170
|
+
- `geordi docker setup`
|
171
|
+
Fetches all docker containers.
|
172
|
+
- `geordi docker shell`
|
173
|
+
Runs the docker service named 'main'.
|
174
|
+
Append `--secondary` to open a second shell in a already running container.
|
175
|
+
- `geordi docker vnc`
|
176
|
+
Opens a VNC viewer to connect to the VNC server in the container.
|
177
|
+
|
178
|
+
|
160
179
|
### `geordi drop-databases`
|
161
180
|
Interactively delete local databases.
|
162
181
|
|
@@ -176,18 +195,10 @@ offer to edit the whitelist instead.
|
|
176
195
|
- `[--postgres=PORT_OR_SOCKET]`: Use Postgres port or socket
|
177
196
|
- `[--mysql=PORT_OR_SOCKET]`: Use MySQL/MariaDB port or socket
|
178
197
|
|
198
|
+
|
179
199
|
### `geordi dump [TARGET]`
|
180
200
|
Handle (remote) database dumps.
|
181
201
|
|
182
|
-
If you are using multiple databases per environment, pass the database name like this:
|
183
|
-
|
184
|
-
geordi dump -d primary
|
185
|
-
|
186
|
-
Loading a dump into one of multiple local databases is not supported yet.
|
187
|
-
|
188
|
-
When called with the `--load` option, sources the specified dump into the
|
189
|
-
development database.
|
190
|
-
|
191
202
|
`geordi dump` (without arguments) dumps the development database with `dumple`.
|
192
203
|
|
193
204
|
`geordi dump -l tmp/staging.dump` (with the `--load` option) sources the
|
@@ -199,8 +210,15 @@ specified target's database and downloads it to `tmp/`.
|
|
199
210
|
`geordi dump staging -l` (with a Capistrano deploy target and the `--load`
|
200
211
|
option) sources the dump into the development database after downloading it.
|
201
212
|
|
213
|
+
If you are using multiple databases per environment, pass the database name like this:
|
214
|
+
|
215
|
+
geordi dump -d primary
|
216
|
+
|
217
|
+
Loading a dump into one of multiple local databases is not supported yet.
|
218
|
+
|
202
219
|
**Options**
|
203
220
|
- `-l, [--load=[DUMP_FILE]]`: Load a dump
|
221
|
+
- `-d, [--database=NAME]`: Database name, if there are multiple databases
|
204
222
|
|
205
223
|
|
206
224
|
### `geordi firefox COMMAND`
|
data/exe/geordi
CHANGED
data/geordi.gemspec
CHANGED
@@ -25,8 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'thor', '~> 1'
|
27
27
|
|
28
|
-
spec.post_install_message = <<-ATTENTION
|
29
|
-
|
30
|
-
* Geordi 4 has removed its deprecated executables. If you want to invoke these commands like before, you may create aliases on your machine. For the alias mapping, please refer to https://github.com/makandra/geordi/commit/68fa92acb146ebde3acb92d7b9556bd4eaa2b4ff
|
31
|
-
ATTENTION
|
28
|
+
#spec.post_install_message = <<-ATTENTION
|
29
|
+
#ATTENTION
|
32
30
|
end
|
@@ -23,26 +23,24 @@ def _setup_vnc
|
|
23
23
|
Interaction.success 'It appears you already have a VNC server installed. Good job!'
|
24
24
|
else
|
25
25
|
puts 'Please run:'
|
26
|
-
Interaction.note_cmd 'sudo apt-get install
|
26
|
+
Interaction.note_cmd 'sudo apt-get install tightvncserver'
|
27
|
+
puts 'In case this package is not available, you may try vnc4server instead.'
|
27
28
|
Interaction.prompt 'Continue ...'
|
28
29
|
|
29
30
|
puts
|
31
|
+
|
30
32
|
Interaction.note 'We will now set a password for your VNC server.'
|
31
33
|
puts Util.strip_heredoc <<-TEXT
|
32
|
-
When running our cucumber script,
|
33
|
-
|
34
|
-
without our cucumber script, a user with
|
35
|
-
your machine.
|
34
|
+
When running our cucumber script, this password will be used while also
|
35
|
+
restricting access to the local machine. However, if you start a vncserver
|
36
|
+
without our cucumber script, keep in mind that a user with this password
|
37
|
+
can connect to your machine.
|
36
38
|
|
37
39
|
TEXT
|
38
40
|
puts 'Please run:'
|
39
|
-
Interaction.note_cmd '
|
41
|
+
Interaction.note_cmd 'vncpasswd'
|
40
42
|
Interaction.warn 'Enter a secure password!'
|
41
43
|
Interaction.prompt 'Continue ...'
|
42
|
-
|
43
|
-
puts 'Now stop the server again. Please run:'
|
44
|
-
Interaction.note_cmd 'vncserver -kill :20'
|
45
|
-
Interaction.prompt 'Continue ...'
|
46
44
|
end
|
47
45
|
|
48
46
|
Interaction.announce 'Setup VNC viewer'
|
@@ -14,9 +14,9 @@ option :select_server, type: :string, aliases: '-s', banner: '[SERVER_NUMBER]',
|
|
14
14
|
|
15
15
|
def console(target = 'development', *_args)
|
16
16
|
require 'geordi/remote'
|
17
|
-
invoke_geordi 'bundle_install'
|
18
17
|
|
19
18
|
if target == 'development'
|
19
|
+
invoke_geordi 'bundle_install'
|
20
20
|
invoke_geordi 'yarn_install'
|
21
21
|
|
22
22
|
Interaction.announce 'Opening a local Rails console'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class DockerCLI < Thor
|
2
|
+
desc 'setup', 'Setup docker and fetch required docker-container for the current project'
|
3
|
+
def setup
|
4
|
+
docker.setup
|
5
|
+
end
|
6
|
+
|
7
|
+
desc 'shell', 'Open a shell in the main docker container for the current project'
|
8
|
+
option :secondary, default: false, type: :boolean
|
9
|
+
map 'shell' => '_shell'
|
10
|
+
def _shell
|
11
|
+
docker.shell(:secondary => options[:secondary])
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'vnc', 'Open a vnc viewer connecting to the docker container'
|
15
|
+
def vnc
|
16
|
+
docker.vnc
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def docker
|
22
|
+
require 'geordi/docker'
|
23
|
+
Geordi::Docker.new
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'docker', 'Manage docker containers for the current project'
|
28
|
+
long_desc <<-LONGDESC
|
29
|
+
Manage docker containers to run your project dockerized.
|
30
|
+
|
31
|
+
It expects a `docker-compose.yml` file that specifies all services, and a service
|
32
|
+
named "main" that opens a shell for the project.
|
33
|
+
|
34
|
+
There are three subcommands:
|
35
|
+
|
36
|
+
- `geordi docker setup`
|
37
|
+
Fetches all docker containers.
|
38
|
+
|
39
|
+
- `geordi docker shell`
|
40
|
+
Runs the docker service named 'main'.
|
41
|
+
Append `--secondary` to open a second shell in an already running container.
|
42
|
+
|
43
|
+
- `geordi docker vnc`
|
44
|
+
Opens a VNC viewer to connect to the VNC server in the container.
|
45
|
+
LONGDESC
|
46
|
+
subcommand 'docker', DockerCLI
|
@@ -15,8 +15,6 @@ option :select_server, type: :string, aliases: '-s', banner: '[SERVER_NUMBER]',
|
|
15
15
|
def shelll(target, *_args)
|
16
16
|
require 'geordi/remote'
|
17
17
|
|
18
|
-
invoke_geordi 'bundle_install'
|
19
|
-
|
20
18
|
Interaction.announce 'Opening a shell on ' + target
|
21
19
|
Geordi::Remote.new(target).shell(options)
|
22
20
|
end
|
@@ -10,13 +10,24 @@ option :dump, type: :string, aliases: '-d', banner: 'TARGET',
|
|
10
10
|
option :test, type: :boolean, aliases: '-t', desc: 'After updating, run tests'
|
11
11
|
|
12
12
|
def update
|
13
|
+
old_ruby_version = File.read('.ruby-version').chomp
|
14
|
+
|
13
15
|
Interaction.announce 'Updating repository'
|
14
16
|
Util.run!('git pull', show_cmd: true)
|
15
17
|
|
16
|
-
|
18
|
+
ruby_version = File.read('.ruby-version').chomp
|
19
|
+
ruby_version_changed = !ruby_version.empty? && (ruby_version != old_ruby_version)
|
20
|
+
|
21
|
+
if ruby_version_changed
|
22
|
+
puts
|
23
|
+
Interaction.warn 'Ruby version changed during git pull. Please run again to use the new version.'
|
24
|
+
exit(1)
|
25
|
+
else
|
26
|
+
invoke_geordi 'migrate'
|
17
27
|
|
18
|
-
|
28
|
+
Interaction.success 'Successfully updated the project.'
|
19
29
|
|
20
|
-
|
21
|
-
|
30
|
+
invoke_geordi 'dump', options.dump, load: true if options.dump
|
31
|
+
invoke_geordi 'tests' if options.test
|
32
|
+
end
|
22
33
|
end
|
data/lib/geordi/cucumber.rb
CHANGED
@@ -11,8 +11,10 @@ module Geordi
|
|
11
11
|
class Cucumber
|
12
12
|
|
13
13
|
VNC_DISPLAY = ':17'.freeze
|
14
|
-
|
15
|
-
|
14
|
+
VNC_PASSWORD_FILE = File.expand_path('~/.vnc/passwd').freeze # default for "vncpasswd"
|
15
|
+
VNC_SERVER_DEFAULT_OPTIONS = "-localhost -nolisten tcp -geometry 1280x1024 -rfbauth #{VNC_PASSWORD_FILE}".freeze
|
16
|
+
VNC_SERVER_COMMAND = "vncserver #{VNC_DISPLAY} #{ENV.fetch('GEORDI_VNC_OPTIONS', VNC_SERVER_DEFAULT_OPTIONS)}".freeze
|
17
|
+
VNC_VIEWER_COMMAND = "vncviewer -passwd #{VNC_PASSWORD_FILE}".freeze
|
16
18
|
VNC_ENV_VARIABLES = %w[DISPLAY BROWSER LAUNCHY_BROWSER].freeze
|
17
19
|
|
18
20
|
def run(files, cucumber_options, options = {})
|
@@ -30,10 +32,10 @@ module Geordi
|
|
30
32
|
system command # Util.run! would reset the Firefox PATH
|
31
33
|
end
|
32
34
|
|
33
|
-
def launch_vnc_viewer
|
35
|
+
def launch_vnc_viewer(source = VNC_DISPLAY)
|
34
36
|
fork do
|
35
37
|
error = capture_stderr do
|
36
|
-
system(VNC_VIEWER_COMMAND)
|
38
|
+
system("#{VNC_VIEWER_COMMAND} #{source}")
|
37
39
|
end
|
38
40
|
unless $?.success?
|
39
41
|
if $?.exitstatus == 127
|
@@ -58,7 +60,7 @@ module Geordi
|
|
58
60
|
VNC_ENV_VARIABLES.each do |variable|
|
59
61
|
ENV["OUTER_#{variable}"] = ENV[variable] if ENV[variable]
|
60
62
|
end
|
61
|
-
ENV['BROWSER'] = ENV['LAUNCHY_BROWSER'] = File.expand_path('../../
|
63
|
+
ENV['BROWSER'] = ENV['LAUNCHY_BROWSER'] = File.expand_path('../../exe/launchy_browser', __dir__)
|
62
64
|
ENV['DISPLAY'] = VNC_DISPLAY
|
63
65
|
|
64
66
|
Interaction.note 'Run `geordi vnc` to view the Selenium test browsers'
|
@@ -0,0 +1,116 @@
|
|
1
|
+
require 'geordi/interaction'
|
2
|
+
require 'geordi/cucumber'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module Geordi
|
6
|
+
class Docker
|
7
|
+
DOCKER_COMPOSE_FILE = 'docker-compose.yml'.freeze
|
8
|
+
|
9
|
+
include Interaction
|
10
|
+
|
11
|
+
def setup
|
12
|
+
check_installation_and_config
|
13
|
+
announce('Fetching containers...')
|
14
|
+
if execute(:system, 'docker-compose', 'pull')
|
15
|
+
success('Fetch successful.')
|
16
|
+
else
|
17
|
+
fail('Fetch failed.')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def shell(options = {})
|
22
|
+
check_installation_and_config
|
23
|
+
if options[:secondary]
|
24
|
+
attach_to_running_shell
|
25
|
+
else
|
26
|
+
run_shell
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def vnc
|
31
|
+
Cucumber.new.launch_vnc_viewer('::5967')
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def attach_to_running_shell
|
37
|
+
running_containers = execute(:`, 'docker-compose ps').split("\n")
|
38
|
+
if (main_container_line = running_containers.grep(/_main_run/).first)
|
39
|
+
container_name = main_container_line.split(' ').first
|
40
|
+
execute(:exec, 'docker', 'exec', '-it', container_name, 'bash')
|
41
|
+
else
|
42
|
+
fail('Could not find a running shell. Start without --secondary first.')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def run_shell
|
47
|
+
command = [:system, 'docker-compose', 'run', '--service-ports']
|
48
|
+
command += ssh_agent_forward
|
49
|
+
command += ['main']
|
50
|
+
execute(*command)
|
51
|
+
execute(:system, 'docker-compose', 'stop')
|
52
|
+
end
|
53
|
+
|
54
|
+
def execute(kind, *args)
|
55
|
+
if ENV['GEORDI_TESTING']
|
56
|
+
puts "Stubbed run #{args.join(' ')}"
|
57
|
+
if kind == :`
|
58
|
+
mock_parse(*args)
|
59
|
+
else
|
60
|
+
mock_run(*args)
|
61
|
+
end
|
62
|
+
else
|
63
|
+
send(kind, *args)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def mock_run(*args)
|
68
|
+
# exists just to be stubbed in tests
|
69
|
+
true
|
70
|
+
end
|
71
|
+
|
72
|
+
def mock_parse(*args)
|
73
|
+
# exists just to be stubbed in tests
|
74
|
+
'command output'
|
75
|
+
end
|
76
|
+
|
77
|
+
def check_installation_and_config
|
78
|
+
unless command_exists?('docker')
|
79
|
+
fail('You need to install docker first with `sudo apt install docker`. After installation please log out and back in to your system once.')
|
80
|
+
end
|
81
|
+
|
82
|
+
unless command_exists?('docker-compose')
|
83
|
+
fail('You need to install docker-compose first with `sudo apt install docker-compose`.')
|
84
|
+
end
|
85
|
+
|
86
|
+
unless docker_compose_config && (services = docker_compose_config['services']) && services.key?('main')
|
87
|
+
fail('Your project does not seem to be properly set up. Expected to find a docker-compose.yml which defines a service named "main".')
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def command_exists?(command)
|
92
|
+
execute(:system, "which #{command} > /dev/null")
|
93
|
+
end
|
94
|
+
|
95
|
+
def docker_compose_config
|
96
|
+
@docker_compose_config ||= if File.exists?(DOCKER_COMPOSE_FILE)
|
97
|
+
if YAML.respond_to?(:safe_load)
|
98
|
+
YAML.safe_load(File.read(DOCKER_COMPOSE_FILE))
|
99
|
+
else
|
100
|
+
YAML.load(File.read(DOCKER_COMPOSE_FILE))
|
101
|
+
end
|
102
|
+
end
|
103
|
+
rescue
|
104
|
+
false
|
105
|
+
end
|
106
|
+
|
107
|
+
def ssh_agent_forward
|
108
|
+
if (auth_sock = ENV['SSH_AUTH_SOCK'])
|
109
|
+
dirname = File.dirname(auth_sock)
|
110
|
+
['-v', "#{dirname}:#{dirname}", '-e', "SSH_AUTH_SOCK=#{auth_sock}"]
|
111
|
+
else
|
112
|
+
[]
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
data/lib/geordi/dump_loader.rb
CHANGED
@@ -34,7 +34,7 @@ module Geordi
|
|
34
34
|
|
35
35
|
def postgresql_command
|
36
36
|
ENV['PGPASSWORD'] = config['password']
|
37
|
-
command = 'pg_restore --no-owner --clean'
|
37
|
+
command = 'pg_restore --no-owner --clean --no-acl'
|
38
38
|
command << ' --username=' << config['username'].to_s if config['username']
|
39
39
|
command << ' --port=' << config['port'].to_s if config['port']
|
40
40
|
command << ' --host=' << config['host'].to_s if config['host']
|
data/lib/geordi/util.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'geordi/interaction'
|
2
2
|
require 'socket'
|
3
|
+
require 'bundler'
|
3
4
|
|
4
5
|
module Geordi
|
5
6
|
class Util
|
@@ -64,7 +65,7 @@ module Geordi
|
|
64
65
|
# Remove Geordi's Bundler environment when running commands.
|
65
66
|
success = if !defined?(Bundler)
|
66
67
|
system(*command)
|
67
|
-
elsif Gem::Version.new(Bundler::VERSION) >= Gem::Version.new('
|
68
|
+
elsif Gem::Version.new(Bundler::VERSION) >= Gem::Version.new('1.17.3')
|
68
69
|
Bundler.with_original_env do
|
69
70
|
system(*command)
|
70
71
|
end
|
@@ -167,15 +168,10 @@ module Geordi
|
|
167
168
|
# Get the version for the given gem by parsing Gemfile.lock.
|
168
169
|
# Returns nil if the gem is not used.
|
169
170
|
def gem_version(gem)
|
170
|
-
|
171
|
-
|
172
|
-
matches = line.match(/\* #{gem} \(([\d\.]+)/)
|
173
|
-
next if matches.nil? || matches[1].nil?
|
171
|
+
lock_file = Bundler::LockfileParser.new(Bundler.read_file(Bundler.default_lockfile))
|
172
|
+
spec = lock_file.specs.detect { |spec| spec.name == gem }
|
174
173
|
|
175
|
-
|
176
|
-
end
|
177
|
-
|
178
|
-
nil
|
174
|
+
spec && spec.version
|
179
175
|
end
|
180
176
|
|
181
177
|
def file_containing?(file, regex)
|
@@ -192,12 +188,6 @@ module Geordi
|
|
192
188
|
string
|
193
189
|
end
|
194
190
|
|
195
|
-
private
|
196
|
-
|
197
|
-
def bundle_list
|
198
|
-
@bundle_list ||= `bundle list`
|
199
|
-
end
|
200
|
-
|
201
191
|
end
|
202
192
|
end
|
203
193
|
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/geordi/commands/cucumber.rb
|
69
69
|
- lib/geordi/commands/delete_dumps.rb
|
70
70
|
- lib/geordi/commands/deploy.rb
|
71
|
+
- lib/geordi/commands/docker.rb
|
71
72
|
- lib/geordi/commands/drop_databases.rb
|
72
73
|
- lib/geordi/commands/dump.rb
|
73
74
|
- lib/geordi/commands/firefox.rb
|
@@ -89,6 +90,7 @@ files:
|
|
89
90
|
- lib/geordi/commands/yarn_install.rb
|
90
91
|
- lib/geordi/cucumber.rb
|
91
92
|
- lib/geordi/db_cleaner.rb
|
93
|
+
- lib/geordi/docker.rb
|
92
94
|
- lib/geordi/dump_loader.rb
|
93
95
|
- lib/geordi/firefox_for_selenium.rb
|
94
96
|
- lib/geordi/gitpt.rb
|
@@ -101,9 +103,7 @@ homepage: https://makandra.com
|
|
101
103
|
licenses:
|
102
104
|
- MIT
|
103
105
|
metadata: {}
|
104
|
-
post_install_message:
|
105
|
-
* Binary `geordi` installed
|
106
|
-
* Geordi 4 has removed its deprecated executables. If you want to invoke these commands like before, you may create aliases on your machine. For the alias mapping, please refer to https://github.com/makandra/geordi/commit/68fa92acb146ebde3acb92d7b9556bd4eaa2b4ff
|
106
|
+
post_install_message:
|
107
107
|
rdoc_options: []
|
108
108
|
require_paths:
|
109
109
|
- lib
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.0.
|
121
|
+
rubygems_version: 3.0.3
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Collection of command line tools we use in our daily work with Ruby, Rails
|