geordi 5.2.3 → 5.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 601c58f6344b5fb02e2514749e216e60a6f6f1cc656d2a37eabb891cc013edfa
4
- data.tar.gz: 07b06fa74266f0ba5506b8218e10c78b4156c854cef9bb8bca3fd77ba5b6d30a
3
+ metadata.gz: 559fa220792042ae1d84411772b63a5f4526df68f5ac4eefbb008ac63705d72d
4
+ data.tar.gz: e43a552812daed79454864bed854720537ee2e9d8d303212b5dde4d8ef0b1694
5
5
  SHA512:
6
- metadata.gz: 533ceae3f15d374526bafa76278914212de5b930250c8375c8f4cde1661e56d4c22093a4266c48b3646b023c4925599e2c46e0f93f38b52430a9748ce1778e7c
7
- data.tar.gz: edf3b697d11b5ec5c932ccd6a60311325ea0d8ed50e3d0650aae3f63b8cd514374dfd465212aae82e6585daee7f7466113cf6b1dacbf430a2b7c95269c9b0dc2
6
+ metadata.gz: '0193eed8c9af5cadd36498a4b0eb5b6364a58e20e93ef3619af3dc934b16f61652b9b703e00049109592e6b324c7854d3d56cfe5aa14ca8948e5d6ed1320a548'
7
+ data.tar.gz: d7afc3e6ac2b5c3255fedd1f6e2a3f8fa1469c822c64f1ed1471a46ab0208c1f1f6084ee17b0edee79f07d0bce1d64d7768dcfaddffed61dfdd6664863851a49
@@ -10,6 +10,12 @@ 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.4 2021-01-29
14
+
15
+ ### Compatible changes
16
+ * Fix and improve delete-dumps command (now supporting multiple arguments)
17
+
18
+
13
19
  ## 5.2.3 2021-01-27
14
20
 
15
21
  ### Compatible changes
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (5.2.3)
4
+ geordi (5.2.4)
5
5
  thor (~> 1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -111,13 +111,13 @@ in `.geordi.yml` in the project root.
111
111
  ### `geordi delete-dumps [DIRECTORY]`
112
112
  Delete database dump files (*.dump).
113
113
 
114
- Example: `geordi delete_dumps` or `geordi delete_dumps ~/tmp/dumps`
114
+ Example: `geordi delete-dumps` or `geordi delete-dumps ~/tmp/dumps`
115
115
 
116
- Recursively search for files ending in `*.dump` and offer to delete those. When
116
+ Recursively searches for files ending in `.dump` and offers to delete them. When
117
117
  no argument is given, two default directories are searched for dump files: the
118
118
  current working directory and `~/dumps` (for dumps created with geordi).
119
119
 
120
- Geordi will ask for confirmation before actually deleting files.
120
+ Will ask for confirmation before actually deleting files.
121
121
 
122
122
 
123
123
  ### `geordi deploy [STAGE]`
@@ -169,9 +169,11 @@ There are three subcommands:
169
169
 
170
170
  - `geordi docker setup`
171
171
  Fetches all docker containers.
172
+
172
173
  - `geordi docker shell`
173
174
  Runs the docker service named 'main'.
174
- Append `--secondary` to open a second shell in a already running container.
175
+ Append `--secondary` to open a second shell in an already running container.
176
+
175
177
  - `geordi docker vnc`
176
178
  Opens a VNC viewer to connect to the VNC server in the container.
177
179
 
@@ -424,11 +426,9 @@ Once you have completed your modifications, please update CHANGELOG and README
424
426
  as needed. Use `rake readme` to regenerate the Geordi section of the README from
425
427
  the command documentations.
426
428
 
427
- Make sure tests are green in the default Ruby *plus* in the oldest Ruby > 1.8
428
- that you have installed on your system (1.8.7 support has been dropped).
429
-
430
- Before releasing your changes, wait for the Travis results to see that tests
431
- passed in all Ruby versions.
429
+ Make sure tests are green in the oldest supported Ruby version. Before releasing
430
+ a new gem version, wait for the CI results to see that tests are green in all
431
+ Ruby versions.
432
432
 
433
433
 
434
434
  Adding a new command
@@ -1,43 +1,41 @@
1
1
  desc 'delete-dumps [DIRECTORY]', 'Delete database dump files (*.dump)'
2
2
  long_desc <<-LONGDESC
3
- Example: `geordi delete_dumps` or `geordi delete_dumps ~/tmp/dumps`
3
+ Example: `geordi delete-dumps` or `geordi delete-dumps ~/tmp/dumps`
4
4
 
5
- Recursively search for files ending in `*.dump` and offer to delete those. When
5
+ Recursively searches for files ending in `.dump` and offers to delete them. When
6
6
  no argument is given, two default directories are searched for dump files: the
7
7
  current working directory and `~/dumps` (for dumps created with geordi).
8
8
 
9
- Geordi will ask for confirmation before actually deleting files.
9
+ Will ask for confirmation before actually deleting files.
10
10
  LONGDESC
11
11
 
12
- def delete_dumps(dump_directory = nil)
13
- deletable_dumps = []
14
- dump_directories = if dump_directory.nil?
15
- [
16
- File.join(Dir.home, 'dumps'),
17
- Dir.pwd,
18
- ]
19
- else
20
- [dump_directory]
12
+ def delete_dumps(*locations)
13
+ Interaction.announce 'Retrieving dump files'
14
+
15
+ dump_files = []
16
+ if locations.empty?
17
+ locations = [ File.join(Dir.home, 'dumps'), Dir.pwd ]
21
18
  end
22
- Interaction.announce 'Looking for *.dump in ' << dump_directories.join(',')
23
- dump_directories.each do |d|
24
- d_2 = File.expand_path(d)
25
- unless File.directory? File.realdirpath(d_2)
26
- Interaction.warn "Directory #{d_2} does not exist"
19
+ locations.map! &File.method(:expand_path)
20
+
21
+ Interaction.note "Looking in #{locations.join(', ')}"
22
+ locations.each do |dir|
23
+ directory = File.expand_path(dir)
24
+ unless File.directory? File.realdirpath(directory)
25
+ Interaction.warn "Directory #{directory} does not exist. Skipping."
27
26
  next
28
27
  end
29
- deletable_dumps.concat(Dir.glob("#{d_2}/**/*.dump"))
28
+ dump_files.concat Dir.glob("#{directory}/**/*.dump")
30
29
  end
30
+ deletable_dumps = dump_files.flatten.uniq.sort.select &File.method(:file?)
31
+
31
32
  if deletable_dumps.empty?
32
- Interaction.success 'No dumps to delete' if deletable_dumps.empty?
33
- exit 0
34
- end
35
- deletable_dumps.uniq!.sort!
36
- Interaction.note 'The following dumps can be deleted:'
37
- puts
38
- puts deletable_dumps
39
- Interaction.prompt('Delete those dumps', 'n', /y|yes/) || raise('Cancelled.')
40
- deletable_dumps.each do |dump|
41
- File.delete dump unless File.directory? dump
33
+ Interaction.note 'No dump files found'
34
+ else
35
+ puts deletable_dumps
36
+ Interaction.prompt('Delete these files?', 'n', /y|yes/) || Interaction.fail('Cancelled.')
37
+
38
+ deletable_dumps.each &File.method(:delete)
39
+ Interaction.success 'Done.'
42
40
  end
43
41
  end
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '5.2.3'.freeze
2
+ VERSION = '5.2.4'.freeze
3
3
  end
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.2.3
4
+ version: 5.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-27 00:00:00.000000000 Z
11
+ date: 2021-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -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.3
121
+ rubygems_version: 3.1.4
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