geordi 4.1.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +48 -0
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +49 -0
  5. data/Gemfile +2 -1
  6. data/Gemfile.lock +46 -28
  7. data/README.md +21 -4
  8. data/Rakefile +1 -1
  9. data/exe/dumple +9 -4
  10. data/geordi.gemspec +4 -4
  11. data/lib/geordi/COMMAND_TEMPLATE +1 -1
  12. data/lib/geordi/chromedriver_updater.rb +2 -2
  13. data/lib/geordi/cli.rb +1 -1
  14. data/lib/geordi/commands/_setup_vnc.rb +8 -10
  15. data/lib/geordi/commands/bundle_install.rb +1 -1
  16. data/lib/geordi/commands/capistrano.rb +1 -1
  17. data/lib/geordi/commands/chromedriver_update.rb +8 -1
  18. data/lib/geordi/commands/commit.rb +0 -4
  19. data/lib/geordi/commands/console.rb +4 -3
  20. data/lib/geordi/commands/create_database_yml.rb +1 -1
  21. data/lib/geordi/commands/create_databases.rb +7 -6
  22. data/lib/geordi/commands/cucumber.rb +9 -4
  23. data/lib/geordi/commands/deploy.rb +7 -7
  24. data/lib/geordi/commands/dump.rb +14 -4
  25. data/lib/geordi/commands/firefox.rb +1 -1
  26. data/lib/geordi/commands/migrate.rb +4 -4
  27. data/lib/geordi/commands/rake.rb +6 -4
  28. data/lib/geordi/commands/rspec.rb +5 -5
  29. data/lib/geordi/commands/security_update.rb +10 -10
  30. data/lib/geordi/commands/server.rb +3 -3
  31. data/lib/geordi/commands/setup.rb +5 -5
  32. data/lib/geordi/commands/shell.rb +1 -1
  33. data/lib/geordi/commands/tests.rb +4 -4
  34. data/lib/geordi/commands/unit.rb +3 -3
  35. data/lib/geordi/commands/update.rb +4 -4
  36. data/lib/geordi/commands/vnc.rb +1 -1
  37. data/lib/geordi/commands/with_rake.rb +3 -3
  38. data/lib/geordi/commands/yarn_install.rb +1 -1
  39. data/lib/geordi/cucumber.rb +5 -4
  40. data/lib/geordi/dump_loader.rb +1 -1
  41. data/lib/geordi/gitpt.rb +1 -1
  42. data/lib/geordi/interaction.rb +1 -1
  43. data/lib/geordi/remote.rb +5 -4
  44. data/lib/geordi/settings.rb +11 -2
  45. data/lib/geordi/util.rb +33 -21
  46. data/lib/geordi/version.rb +1 -1
  47. metadata +6 -6
  48. data/.travis.yml +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e69ce9156f933f0ae381e109b7359fe4da6243036028093ab9ce0f79408bfaad
4
- data.tar.gz: d6d16d8a1aca0fecc4669aa0b28251c508574f7d4d5ba3fae5d82d92385894fd
3
+ metadata.gz: 7807d5539f7a89704caedcb84cbbe86fdf249f0d118419a208bc6de5a56d163d
4
+ data.tar.gz: 3e3ab52311d9148bb515d373e1404bf84a112111ab49935fb30e3694b04d2365
5
5
  SHA512:
6
- metadata.gz: 8d514a744b90c1d637a91db63ca3c58a36262e3493844a268eea48c920779f98ead441eeff42a9d544e0b0feb6baeb0d9314906531c1b9c3955bbb0758b2e316
7
- data.tar.gz: c75477cfb8ffb09895f1b6214ef762218e85b831adb4348ea58ed4cae6dd70a213feb7e2df3dc0740a97b0e70394be4878abeff57fb4aefd47a50eed7af5f10d
6
+ metadata.gz: '09e3ced6e1773f894560ec79ac6625ebc61af0e6eb0592785a5e273c6fb3df514691803072719854534d311cc6e8c8b1d62e9f4d184b31ca6b9e7bd74f5ad102'
7
+ data.tar.gz: 8d74f8a681f19d9f8d5d08ee95a4d4e2a30074d97021692f0734a40a14821ed6a204b435ffa615de57b5925994a65f00294f8492eafbe59baddc81daa5bfb034
@@ -0,0 +1,48 @@
1
+ name: Tests
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-18.04
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ include:
16
+ - ruby: 2.2.10
17
+ gemfile: Gemfile
18
+ - ruby: 2.3.8
19
+ gemfile: Gemfile
20
+ - ruby: 2.4.10
21
+ gemfile: Gemfile
22
+ - ruby: 2.5.8
23
+ gemfile: Gemfile
24
+ - ruby: 2.6.6
25
+ gemfile: Gemfile
26
+ - ruby: 2.7.2
27
+ gemfile: Gemfile
28
+ env:
29
+ BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
30
+ steps:
31
+ - uses: actions/checkout@v2
32
+ - name: Install ruby
33
+ uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: "${{ matrix.ruby }}"
36
+ - name: Install vncserver
37
+ run: |
38
+ sudo apt-get update
39
+ sudo apt-get install -y tightvncserver
40
+ # Fake required password for vncserver
41
+ mkdir ~/.vnc && touch ~/.vnc/passwd && chmod 700 ~/.vnc/passwd
42
+ - name: Bundle
43
+ run: |
44
+ gem install bundler:1.17.3
45
+ bundle install --no-deployment
46
+ - name: Run tests
47
+ run: bundle exec rake
48
+
@@ -1 +1 @@
1
- 2.5
1
+ 2.5.8
@@ -5,10 +5,59 @@ All notable changes to this project will be documented in this file.
5
5
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## Unreleased
8
+
8
9
  ### Compatible changes
10
+ * Switch to tightvncserver to be compatible with Ubuntu 20.04. vnc4server is still supported.
11
+
9
12
  ### Breaking changes
10
13
 
11
14
 
15
+ ## 5.0.0 2020-11-25
16
+
17
+ ### Breaking changes
18
+ * Remove support for Ruby 2.0 and 2.1
19
+
20
+
21
+ ## 4.2.0 2020-10-02
22
+
23
+ ### Compatible changes
24
+ * Add `auto_update_chromedriver` as global setting option to automatically update chromedriver before cucumber
25
+ tests, if Chrome and chromedriver versions don't match.
26
+ * Dump command: Add support for multiple databases (#103 by @kajatiger)
27
+ * Add Ruby 2.7 to list of supported Ruby versions
28
+ * Fix #115: `geordi cucumber --modified` command, that corrupted filenames like:
29
+ ```
30
+ No such file or directory tures/pages.feature
31
+ ```
32
+ * Avoid writing an instance of HighLine::String to Geordi config files (closes #114)
33
+
34
+
35
+ ## 4.1.1 2020-08-28
36
+ ### Compatible changes
37
+
38
+ * Fixed: System calls are not executed properly if no bin stub is present. This resulted in errors like:
39
+
40
+ ```
41
+ % geordi rspec
42
+
43
+ # Running specs
44
+ > All specs at once (using parallel_tests)
45
+
46
+ x Specs failed.
47
+ ```
48
+
49
+ or
50
+
51
+ ```
52
+ % geordi migrate
53
+
54
+ # Migrating
55
+ > Development and parallel test databases
56
+
57
+ x Something went wrong.
58
+ ```
59
+
60
+
12
61
  ## 4.1.0 2020-08-18
13
62
 
14
63
  ### Compatible changes
data/Gemfile CHANGED
@@ -3,7 +3,8 @@ source 'http://rubygems.org'
3
3
  # Specify your gem's dependencies in geordi.gemspec
4
4
  gemspec
5
5
 
6
- gem 'aruba'
6
+ gem 'aruba', '< 1' # Drops support for Ruby 2.2-
7
+ gem 'rake', '< 13' # Drops support for Ruby 2.1
7
8
  gem 'rspec-mocks'
8
9
  gem 'highline'
9
10
  gem 'parallel_tests'
@@ -1,76 +1,93 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (4.1.0)
4
+ geordi (5.0.0)
5
5
  thor (~> 1)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- addressable (2.3.8)
11
- aruba (0.6.2)
12
- childprocess (>= 0.3.6)
13
- cucumber (>= 1.1.1)
14
- rspec-expectations (>= 2.7.0)
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ aruba (0.14.14)
13
+ childprocess (>= 0.6.3, < 4.0.0)
14
+ contracts (~> 0.9)
15
+ cucumber (>= 1.3.19)
16
+ ffi (~> 1.9)
17
+ rspec-expectations (>= 2.99)
18
+ thor (>= 0.19, < 2.0)
15
19
  axiom-types (0.1.1)
16
20
  descendants_tracker (~> 0.0.4)
17
21
  ice_nine (~> 0.11.0)
18
22
  thread_safe (~> 0.3, >= 0.3.1)
19
- builder (3.2.3)
23
+ backports (3.18.2)
24
+ builder (3.2.4)
20
25
  childprocess (1.0.1)
21
26
  rake (< 13.0)
22
- coderay (1.1.2)
27
+ coderay (1.1.3)
23
28
  coercible (1.0.0)
24
29
  descendants_tracker (~> 0.0.1)
25
- cucumber (1.3.20)
30
+ contracts (0.16.0)
31
+ cucumber (3.2.0)
26
32
  builder (>= 2.1.2)
27
- diff-lcs (>= 1.1.3)
28
- gherkin (~> 2.12)
33
+ cucumber-core (~> 3.2.0)
34
+ cucumber-expressions (~> 6.0.1)
35
+ cucumber-wire (~> 0.0.1)
36
+ diff-lcs (~> 1.3)
37
+ gherkin (~> 5.1.0)
29
38
  multi_json (>= 1.7.5, < 2.0)
30
39
  multi_test (>= 0.1.2)
40
+ cucumber-core (3.2.1)
41
+ backports (>= 3.8.0)
42
+ cucumber-tag_expressions (~> 1.1.0)
43
+ gherkin (~> 5.0)
44
+ cucumber-expressions (6.0.1)
45
+ cucumber-tag_expressions (1.1.1)
46
+ cucumber-wire (0.0.1)
31
47
  declarative (0.0.10)
32
48
  declarative-option (0.1.0)
33
49
  descendants_tracker (0.0.4)
34
50
  thread_safe (~> 0.3, >= 0.3.1)
35
- diff-lcs (1.2.5)
51
+ diff-lcs (1.4.4)
36
52
  equalizer (0.0.11)
37
- excon (0.73.0)
53
+ excon (0.78.0)
38
54
  faraday (0.17.3)
39
55
  multipart-post (>= 1.2, < 3)
40
56
  faraday_middleware (0.14.0)
41
57
  faraday (>= 0.7.4, < 1.0)
42
- gherkin (2.12.2)
43
- multi_json (~> 1.3)
44
- highline (1.6.21)
58
+ ffi (1.12.2)
59
+ gherkin (5.1.0)
60
+ highline (2.0.3)
45
61
  ice_nine (0.11.2)
46
62
  launchy (2.4.3)
47
63
  addressable (~> 2.3)
48
64
  method_source (1.0.0)
49
- mimemagic (0.3.4)
50
- multi_json (1.13.1)
65
+ mimemagic (0.3.5)
66
+ multi_json (1.15.0)
51
67
  multi_test (0.1.2)
52
68
  multipart-post (2.1.1)
53
- parallel (0.5.16)
54
- parallel_tests (0.6.18)
69
+ parallel (1.19.2)
70
+ parallel_tests (2.32.0)
55
71
  parallel
56
72
  pry (0.13.1)
57
73
  coderay (~> 1.1)
58
74
  method_source (~> 1.0)
59
- rake (10.5.0)
75
+ public_suffix (3.1.1)
76
+ rake (12.3.3)
60
77
  representable (3.0.4)
61
78
  declarative (< 0.1.0)
62
79
  declarative-option (< 0.2.0)
63
80
  uber (< 0.2.0)
64
- rspec-expectations (3.4.0)
81
+ rspec-expectations (3.10.0)
65
82
  diff-lcs (>= 1.2.0, < 2.0)
66
- rspec-support (~> 3.4.0)
67
- rspec-mocks (3.4.1)
83
+ rspec-support (~> 3.10.0)
84
+ rspec-mocks (3.10.0)
68
85
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.4.0)
70
- rspec-support (3.4.1)
86
+ rspec-support (~> 3.10.0)
87
+ rspec-support (3.10.0)
71
88
  thor (1.0.1)
72
89
  thread_safe (0.3.6)
73
- tracker_api (1.10.0)
90
+ tracker_api (1.11.0)
74
91
  addressable
75
92
  equalizer
76
93
  excon
@@ -91,12 +108,13 @@ PLATFORMS
91
108
  ruby
92
109
 
93
110
  DEPENDENCIES
94
- aruba
111
+ aruba (< 1)
95
112
  geordi!
96
113
  highline
97
114
  launchy
98
115
  parallel_tests
99
116
  pry
117
+ rake (< 13)
100
118
  rspec-mocks
101
119
  tracker_api
102
120
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Geordi [![Build Status](https://travis-ci.org/makandra/geordi.svg?branch=master)](https://travis-ci.org/makandra/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
@@ -39,6 +39,13 @@ Example: `geordi chromedriver_update`
39
39
  This command will find and install the matching chromedriver for the currently
40
40
  installed Chrome.
41
41
 
42
+ Setting `auto_update_chromedriver` to `true` in your global Geordi config file
43
+ (`~/.config/geordi/global.yml`), will automatically update chromedriver before
44
+ cucumber tests, in case Chrome and chromedriver versions don't match
45
+
46
+ **Options**
47
+ - `[--quiet-if-matching], [--no-quiet-if-matching]`: Suppress notification if chromedriver and chrome versions match
48
+
42
49
 
43
50
  ### `geordi clean`
44
51
  Remove unneeded files from the current directory.
@@ -169,10 +176,18 @@ offer to edit the whitelist instead.
169
176
  - `[--postgres=PORT_OR_SOCKET]`: Use Postgres port or socket
170
177
  - `[--mysql=PORT_OR_SOCKET]`: Use MySQL/MariaDB port or socket
171
178
 
172
-
173
179
  ### `geordi dump [TARGET]`
174
180
  Handle (remote) database dumps.
175
181
 
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
+
176
191
  `geordi dump` (without arguments) dumps the development database with `dumple`.
177
192
 
178
193
  `geordi dump -l tmp/staging.dump` (with the `--load` option) sources the
@@ -369,7 +384,9 @@ Stores a timestamped database dump for the given Rails environment in `~/dumps`:
369
384
 
370
385
  dumple development
371
386
 
372
- See http://makandracards.com/makandra/1008-dump-your-database-with-dumple
387
+ **Options**
388
+ - `-i`: Print disk usage of `~/dumps`
389
+ - `--compress`: After dumping, run gzip to compress the dump in place
373
390
 
374
391
 
375
392
  launchy_browser
@@ -407,7 +424,7 @@ To try Geordi locally, call it like this:
407
424
 
408
425
  # -I means "add the following directory to load path"
409
426
  ruby -Ilib exe/geordi
410
-
427
+
411
428
  # From another directory
412
429
  ruby -I ../geordi/lib ../geordi/exe/geordi
413
430
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ desc 'Default: Run all tests'
5
5
  task default: :features
6
6
 
7
7
  task :features do
8
- system 'bundle exec cucumber'
8
+ exec 'bundle exec cucumber'
9
9
  end
10
10
 
11
11
  task :readme do
data/exe/dumple CHANGED
@@ -45,9 +45,13 @@ begin
45
45
  end
46
46
 
47
47
  config = YAML::load(ERB.new(File.read(config_path)).result)
48
+ environment, database = ARGV.reject{ |arg| arg[0].chr == '-' }
49
+ environment ||= 'production'
50
+ config = config[environment] or raise "No #{environment} database found.\nUsage: dumple ENVIRONMENT [DATABASE]"
48
51
 
49
- environment = ARGV.reject{ |arg| arg[0].chr == '-' }.first || 'production'
50
- config = config[environment] or raise "No #{environment} database found.\nUsage: dumple ENVIRONMENT"
52
+ if database
53
+ config = config[database] or raise %(Unknown #{environment} database "#{database}")
54
+ end
51
55
 
52
56
  dump_dir = "#{ENV['HOME']}/dumps"
53
57
  unless File.directory?(dump_dir)
@@ -61,7 +65,8 @@ begin
61
65
  dump_path = "#{dump_dir}/#{config['database']}_#{Time.now.strftime("%Y%m%d_%H%M%S")}.dump"
62
66
  end
63
67
 
64
- puts "> Dumping database for \"#{environment}\" environment ..."
68
+ given_database = database ? %(#{database} ) : ""
69
+ puts "> Dumping #{given_database}database for \"#{environment}\" environment ..."
65
70
 
66
71
  host = config['host']
67
72
  port = config['port']
@@ -90,7 +95,7 @@ begin
90
95
  command << " --port=#{port}" if port
91
96
  command
92
97
  else
93
- raise "Adapter \"#{config['adapter']} is not supported"
98
+ raise "Adapter \"#{config['adapter']}\" is not supported"
94
99
  end
95
100
  success = system(dump_command)
96
101
  success or raise "Creating the dump failed"
@@ -5,19 +5,19 @@ require 'geordi/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'geordi'
7
7
  spec.version = Geordi::VERSION
8
- spec.required_ruby_version = '>= 2.0.0'
8
+ spec.required_ruby_version = '>= 2.2.0'
9
9
  spec.authors = ['Henning Koch']
10
10
  spec.email = ['henning.koch@makandra.de']
11
11
 
12
12
  spec.summary = 'Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.'
13
13
  spec.description = 'Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.'
14
- spec.homepage = 'http://makandra.com'
14
+ spec.homepage = 'https://makandra.com'
15
15
  spec.license = 'MIT'
16
16
 
17
17
  # Specify which files should be added to the gem when it is released.
18
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
19
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|features)/}) }
21
21
  end
22
22
  spec.bindir = 'exe'
23
23
  spec.executables = spec.files.grep(%r(^exe/)) { |f| File.basename(f) }
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.post_install_message = <<-ATTENTION
29
29
  * Binary `geordi` installed
30
- * Geordi 4.0.0 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
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
31
  ATTENTION
32
32
  end
@@ -21,7 +21,7 @@ option :opt, type: :boolean, aliases: '-o', banner: 'VALUE_NAME', desc: 'If set,
21
21
 
22
22
  def example
23
23
  # Invoke other commands like this:
24
- invoke_cmd 'other_command', 'argument', an: 'option'
24
+ invoke_geordi 'other_command', 'argument', an: 'option'
25
25
 
26
26
  Interaction.fail 'Option missing' unless options.opt?
27
27
 
@@ -5,12 +5,12 @@ require 'tempfile'
5
5
  module Geordi
6
6
  class ChromedriverUpdater
7
7
 
8
- def run
8
+ def run(options)
9
9
  chrome_version = determine_chrome_version
10
10
  chromedriver_version = determine_chromedriver_version
11
11
 
12
12
  if skip_update?(chrome_version, chromedriver_version)
13
- Interaction.warn("No update required, you are using for both executables the same version #{chrome_version}!")
13
+ Interaction.note("No update required, you are using for both executables the same version #{chrome_version}!") unless options[:quiet_if_matching]
14
14
  else
15
15
  chromedriver_zip = download_chromedriver(chrome_version)
16
16
  unzip(chromedriver_zip, File.expand_path('~/bin'))
@@ -18,7 +18,7 @@ module Geordi
18
18
  private
19
19
 
20
20
  # fix weird implementation of #invoke
21
- def invoke_cmd(name, *args)
21
+ def invoke_geordi(name, *args)
22
22
  options = args.last.is_a?(Hash) ? args.pop : {}
23
23
  invoke(name, args, options)
24
24
  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 vnc4server'
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, you will not actually need this
33
- password, and there is no security risk. However, if you start a vncserver
34
- without our cucumber script, a user with your password can connect to
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 'vncserver :20'
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'