geordi 2.10.1 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +8 -2
  5. data/CHANGELOG.md +46 -0
  6. data/Gemfile +2 -5
  7. data/Gemfile.lock +10 -10
  8. data/README.md +11 -6
  9. data/Rakefile +6 -10
  10. data/{bin → exe}/b +0 -0
  11. data/{bin → exe}/cap-all +0 -0
  12. data/{bin → exe}/console-for +0 -0
  13. data/{bin → exe}/cuc +0 -0
  14. data/{bin → exe}/cuc-show +0 -0
  15. data/{bin → exe}/cuc-vnc-setup +0 -0
  16. data/{bin → exe}/deploy-to-production +0 -0
  17. data/{bin → exe}/dump-for +0 -0
  18. data/{bin → exe}/dumple +0 -0
  19. data/{bin → exe}/geordi +0 -0
  20. data/{bin → exe}/gitpt +0 -0
  21. data/{bin → exe}/launchy_browser +0 -0
  22. data/{bin → exe}/load-dump +0 -0
  23. data/{bin → exe}/migrate-all +0 -0
  24. data/{bin → exe}/rs +0 -0
  25. data/{bin → exe}/run_tests +0 -0
  26. data/{bin → exe}/shell-for +0 -0
  27. data/{bin → exe}/tests +0 -0
  28. data/geordi.gemspec +23 -20
  29. data/lib/geordi/COMMAND_TEMPLATE +4 -6
  30. data/lib/geordi/capistrano_config.rb +20 -17
  31. data/lib/geordi/chromedriver_updater.rb +9 -10
  32. data/lib/geordi/cli.rb +5 -2
  33. data/lib/geordi/commands/_setup_vnc.rb +23 -23
  34. data/lib/geordi/commands/apache_site.rb +3 -3
  35. data/lib/geordi/commands/bundle_install.rb +3 -3
  36. data/lib/geordi/commands/capistrano.rb +5 -6
  37. data/lib/geordi/commands/chromedriver_update.rb +0 -9
  38. data/lib/geordi/commands/clean.rb +5 -6
  39. data/lib/geordi/commands/commit.rb +0 -1
  40. data/lib/geordi/commands/console.rb +4 -4
  41. data/lib/geordi/commands/create_database_yml.rb +4 -4
  42. data/lib/geordi/commands/create_databases.rb +3 -3
  43. data/lib/geordi/commands/cucumber.rb +25 -25
  44. data/lib/geordi/commands/delete_dumps.rb +12 -12
  45. data/lib/geordi/commands/deploy.rb +27 -28
  46. data/lib/geordi/commands/drop_databases.rb +13 -15
  47. data/lib/geordi/commands/dump.rb +12 -13
  48. data/lib/geordi/commands/eurest.rb +2 -2
  49. data/lib/geordi/commands/firefox.rb +4 -4
  50. data/lib/geordi/commands/migrate.rb +3 -3
  51. data/lib/geordi/commands/png_optimize.rb +15 -14
  52. data/lib/geordi/commands/rake.rb +3 -3
  53. data/lib/geordi/commands/remove_executable_flags.rb +3 -3
  54. data/lib/geordi/commands/rspec.rb +11 -11
  55. data/lib/geordi/commands/security_update.rb +25 -25
  56. data/lib/geordi/commands/server.rb +6 -6
  57. data/lib/geordi/commands/setup.rb +8 -8
  58. data/lib/geordi/commands/shell.rb +3 -3
  59. data/lib/geordi/commands/tests.rb +1 -1
  60. data/lib/geordi/commands/unit.rb +3 -3
  61. data/lib/geordi/commands/update.rb +7 -7
  62. data/lib/geordi/commands/vnc.rb +1 -1
  63. data/lib/geordi/commands/with_rake.rb +3 -3
  64. data/lib/geordi/commands/yarn_install.rb +3 -3
  65. data/lib/geordi/cucumber.rb +35 -36
  66. data/lib/geordi/db_cleaner.rb +40 -41
  67. data/lib/geordi/dump_loader.rb +6 -5
  68. data/lib/geordi/firefox_for_selenium.rb +26 -29
  69. data/lib/geordi/gitpt.rb +14 -15
  70. data/lib/geordi/interaction.rb +2 -6
  71. data/lib/geordi/remote.rb +9 -10
  72. data/lib/geordi/util.rb +28 -25
  73. data/lib/geordi/version.rb +1 -1
  74. metadata +27 -39
  75. data/features/commit.feature +0 -17
  76. data/features/console.feature +0 -7
  77. data/features/cucumber.feature +0 -261
  78. data/features/deploy.feature +0 -66
  79. data/features/dump.feature +0 -34
  80. data/features/firefox.feature +0 -44
  81. data/features/server.feature +0 -31
  82. data/features/setup.feature +0 -11
  83. data/features/shell.feature +0 -78
  84. data/features/support/env.rb +0 -8
  85. data/features/support/step_definitions/aruba_backport_steps.rb +0 -5
  86. data/features/support/step_definitions/miscellaneous_steps.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e80ce0bcf572c2bcd331b2127371b3969c1b6ac02be617cdb6abb05686e6730
4
- data.tar.gz: 270104330ccc177602ce0190508fb8079e166720e91d7c39e75e16cab880db60
3
+ metadata.gz: b149c149a52f1e02ca3573aa238d31d5a1fb9a018f2bdea2a19498d75282650e
4
+ data.tar.gz: 5bd2b8ddf0190307b93fab2081434fe05a7207c3b5105ec566eeb211d82532d0
5
5
  SHA512:
6
- metadata.gz: f40138a830731675086cea816f8f21dfb0db4a4d93456def9077cf74d4297be5503af8698739ba9add26529308805cc560e0bf55d0fa5d9c064dabc42d60a98d
7
- data.tar.gz: 8c139434e23cc7ef57a8779f2a3dfab60e3d42991e11c221672b26964003d84e7b3bf41d08332a3992ebf0512e00888584b87355f225e4f5e882d3599cb5665d
6
+ metadata.gz: 6a607dcb1475b70f9053c4fe950f8ee6fa2d657b0c6771b514c3356ac28c8f2704be396cfc2f19b8990edd3dc67dfdc7dad1a92344947c23fa30e72cf7a4564c
7
+ data.tar.gz: d499c7936be74a6eb30f14287b0af2fd44dd89e6bc2dd4db772e6b7a0450f8013df200604027a95fd4808a32f3b860760876e40e0af5b7d9427c1c3cb8646e6f
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ pkg/*
5
5
  .DS_Store
6
6
  .pt_project_id
7
7
  tmp
8
+ .byebug_history
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.0.0
@@ -1,8 +1,13 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - '1.8.7'
5
- - '2.6.3'
4
+ - '2.0.0'
5
+ - '2.1.10'
6
+ - '2.2.10'
7
+ - '2.3.8'
8
+ - '2.4.10'
9
+ - '2.5.8'
10
+ - '2.6.6'
6
11
 
7
12
  gemfile:
8
13
  - 'Gemfile'
@@ -10,6 +15,7 @@ gemfile:
10
15
  dist: trusty
11
16
 
12
17
  install:
18
+ - gem install bundler:1.17.3
13
19
  # Replace default Travis CI bundler script with a version that doesn't
14
20
  # explode when lockfile doesn't match recently bumped version
15
21
  - bundle install --no-deployment --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
@@ -5,7 +5,53 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
5
5
 
6
6
 
7
7
  ## Unreleased
8
+
9
+ ### Compatible changes
10
+
11
+ ### Breaking changes
12
+
13
+
14
+ ## 3.0.3 2020-05-27
15
+
16
+ ### Compatible changes
17
+
18
+ - Fix #98: Changing the `config/database.yml` reader from `YAML.load` to `YAML.safe_load` dropped the support for aliases. We now allow aliases and the classes `Time` and `Symbol`. If we encounter further issues with this approach a revert to `YAML.load` would be an option, too.
19
+
20
+
21
+ ## 3.0.2 2020-05-18
22
+
23
+ ### Compatible changes
24
+
25
+ - Fix #95: Method change from `! *.include?` to `*.exclude?` was not valid as we do not have active support in Geordi. Affected commands where `geordi cucumber` and `geordi deploy`.
26
+
27
+ ### Breaking changes
28
+
29
+
30
+ ## 3.0.1 2020-05-13
31
+
32
+ ### Compatible changes
33
+ - Fix #93: Using `$CHILDSTATUS` instead of `$?` did not work properly. This affected commands like `geordi drop-databases` to fail.
34
+ - Fix #92: Geordi fail messages were converted to exceptions by accident. Now they are printed as red error message without the backtrace again.
35
+
36
+
37
+ ## 3.0.0 2020-05-04
38
+
8
39
  ### Compatible changes
40
+
41
+ ### Breaking changes
42
+ - 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.
43
+
44
+
45
+ ## 2.11.0 2020-05-04
46
+
47
+ ### Compatible changes
48
+ - Added the possibility to change the Rails root for the capistrano config via the environment variable `RAILS_ROOT`. This allows you as a gem developer to run a command like `RAILS_ROOT=~/Projects/my-blog geordi console staging` whereas `geordi` uses the capistrano config from `my-blog`. Otherwise you would need to follow the instructions of [this card](https://makandracards.com/makandra/46617-how-to-use-a-local-gem-in-your-gemfile) to test changes in the gem locally.
49
+ - Bug fix for "no staged changes" even if there are changes present (#83).
50
+ - Fixed deprecation warning for `Thor exit with status 0 on errors` (#84).
51
+ - Replaced `Bundler.with_unbundled_env` with `Bundler.with_original_env` (#77). This is a better replacement than 42cd1c4.
52
+ - Add deprecation warning `Deprecation warning: Ruby 1.8.7 and 1.9.3 support will be dropped in Geordi 3.x.` to Geordi 2.
53
+ - Fix error `thor requires Ruby version >= 2.0.0` for Ruby 1.8.7 and 1.9.3 (https://github.com/makandra/geordi/issues/79#issuecomment-598664191).
54
+
9
55
  ### Breaking changes
10
56
 
11
57
 
data/Gemfile CHANGED
@@ -8,8 +8,5 @@ gem 'rspec-mocks'
8
8
  gem 'highline'
9
9
  gem 'parallel_tests'
10
10
  gem 'launchy'
11
-
12
- if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.8.7')
13
- gem 'pry'
14
- gem 'tracker_api'
15
- end
11
+ gem 'pry'
12
+ gem 'tracker_api'
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (2.10.1)
5
- thor (>= 0.18.0)
4
+ geordi (3.0.3)
5
+ thor (~> 1)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
@@ -34,10 +34,10 @@ GEM
34
34
  thread_safe (~> 0.3, >= 0.3.1)
35
35
  diff-lcs (1.2.5)
36
36
  equalizer (0.0.11)
37
- excon (0.67.0)
38
- faraday (0.17.0)
37
+ excon (0.73.0)
38
+ faraday (0.17.3)
39
39
  multipart-post (>= 1.2, < 3)
40
- faraday_middleware (0.13.1)
40
+ faraday_middleware (0.14.0)
41
41
  faraday (>= 0.7.4, < 1.0)
42
42
  gherkin (2.12.2)
43
43
  multi_json (~> 1.3)
@@ -45,17 +45,17 @@ GEM
45
45
  ice_nine (0.11.2)
46
46
  launchy (2.4.3)
47
47
  addressable (~> 2.3)
48
- method_source (0.9.2)
49
- mimemagic (0.3.3)
48
+ method_source (1.0.0)
49
+ mimemagic (0.3.4)
50
50
  multi_json (1.13.1)
51
51
  multi_test (0.1.2)
52
52
  multipart-post (2.1.1)
53
53
  parallel (0.5.16)
54
54
  parallel_tests (0.6.18)
55
55
  parallel
56
- pry (0.12.2)
57
- coderay (~> 1.1.0)
58
- method_source (~> 0.9.0)
56
+ pry (0.13.1)
57
+ coderay (~> 1.1)
58
+ method_source (~> 1.0)
59
59
  rake (10.5.0)
60
60
  representable (3.0.4)
61
61
  declarative (< 0.1.0)
data/README.md CHANGED
@@ -378,6 +378,14 @@ browser, as opposed to opening it within the VNC window.
378
378
  Contributing
379
379
  ============
380
380
 
381
+ * Run the tests for the oldest supported ruby version with `bundle exec rake`. Ensure that all other ruby versions in the `travis.yml` pass as well after pushing your feature branch and triggering the travis build.
382
+ * Update this `README`. The whole `geordi` section is auto-generated
383
+ by `rake readme`.
384
+ * Document your changes in the `CHANGELOG.md` file.
385
+
386
+ Adding a new command
387
+ ---------------
388
+
381
389
  Copy `lib/geordi/COMMAND_TEMPLATE` to `lib/geordi/commands/your_command` and
382
390
  edit it to do what you need it to do. Usually, it is hard to automatedly test
383
391
  Geordi commands, so make sure you've manually tested it. You can do so by
@@ -385,9 +393,6 @@ calling your local geordi like so (adjust paths to your needs):
385
393
 
386
394
  # @option -I: add directory to load path
387
395
  ruby -I ../geordi/lib ../geordi/bin/geordi <command>
388
-
389
- Don't forget to update this README. The whole `geordi` section is auto-generated
390
- by `rake readme`. Also remember to add your changes to the CHANGELOG.
391
-
392
- Geordi is (partially) tested with Cucumber and Aruba. Run `bundle exec rake` to test the gem against you current Ruby
393
- version. The `travis.yml` contains all Ruby versions the gem is and needs to be tested with.
396
+
397
+ # with debugger
398
+ ruby -r byebug -I ../geordi/lib ../geordi/bin/geordi <command>
data/Rakefile CHANGED
@@ -2,18 +2,14 @@ require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
3
 
4
4
  desc 'Default: Run all tests'
5
- task :default => :features
5
+ task default: :features
6
6
 
7
7
  task :features do
8
- if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.8.7')
9
- system 'bundle exec cucumber'
10
- else
11
- system 'bundle exec cucumber --tags "~@ruby>=1.9"'
12
- end
8
+ system 'bundle exec cucumber'
13
9
  end
14
10
 
15
11
  task :readme do
16
- require File.expand_path('../lib/geordi/cli', __FILE__)
12
+ require File.expand_path('lib/geordi/cli', __dir__)
17
13
 
18
14
  readme = File.read('README.md')
19
15
  geordi_section_regex = /
@@ -43,9 +39,9 @@ For details on commands, e.g. supported options, you may always run
43
39
 
44
40
  Geordi::CLI.all_commands.sort.each do |_, command|
45
41
  unless command.hidden?
46
- geordi_section << "### `geordi #{ command.usage }`\n\n"
47
- geordi_section << "#{ command.description.sub /(\.)?$/, '.' }\n\n"
48
- geordi_section << "#{ command.long_description.strip }\n\n" if command.long_description
42
+ geordi_section << "### `geordi #{command.usage}`\n\n"
43
+ geordi_section << "#{command.description.sub /(\.)?$/, '.'}\n\n"
44
+ geordi_section << "#{command.long_description.strip}\n\n" if command.long_description
49
45
  geordi_section << "\n"
50
46
  end
51
47
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,28 +1,31 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "geordi/version"
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'geordi/version'
4
4
 
5
- Gem::Specification.new do |s|
6
- s.name = "geordi"
7
- s.version = Geordi::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Henning Koch"]
10
- s.email = ["henning.koch@makandra.de"]
11
- s.homepage = "http://makandra.com"
12
- s.summary = 'Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.'
13
- s.description = 'Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.'
14
- s.license = 'MIT'
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'geordi'
7
+ spec.version = Geordi::VERSION
8
+ spec.required_ruby_version = '>= 2.0.0'
9
+ spec.authors = ['Henning Koch']
10
+ spec.email = ['henning.koch@makandra.de']
15
11
 
16
- s.rubyforge_project = "geordi"
12
+ spec.summary = 'Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.'
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'
15
+ spec.license = 'MIT'
17
16
 
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
- s.require_paths = ["lib"]
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
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)/}) }
21
+ end
22
+ spec.bindir = 'exe'
23
+ spec.executables = spec.files.grep(%r(^exe/)) { |f| File.basename(f) }
24
+ spec.require_paths = ['lib']
22
25
 
23
- s.add_runtime_dependency 'thor', '>= 0.18.0'
26
+ spec.add_runtime_dependency 'thor', '~> 1'
24
27
 
25
- s.post_install_message = <<-ATTENTION
28
+ spec.post_install_message = <<-ATTENTION
26
29
  * Binary `geordi` installed
27
30
  ATTENTION
28
31
  end
@@ -15,17 +15,15 @@ by `rake update_readme`. Thus, please format descriptions in a way that's reader
15
15
  friendly both in Markdown and the console.
16
16
  LONGDESC
17
17
 
18
- option :opt, :type => :boolean, :aliases => '-o', :banner => 'VALUE_NAME',
19
- :desc => 'If set, VALUE_NAME will be used for something'
18
+ option :opt, type: :boolean, aliases: '-o', banner: 'VALUE_NAME', desc: 'If set, VALUE_NAME will be used for something'
20
19
 
21
20
  def example
22
21
  # Invoke other commands like this:
23
- invoke_cmd 'other_command', 'argument', :an => 'option'
22
+ invoke_cmd 'other_command', 'argument', an: 'option'
24
23
 
25
- fail 'Option missing' unless options.opt?
24
+ Interaction.fail 'Option missing' unless options.opt?
26
25
 
27
- # For formatted output, see geordi/interaction.rb
28
- success 'Done.'
26
+ Interaction.success 'Done.'
29
27
  end
30
28
 
31
29
  # Command mappings, usually not needed
@@ -10,8 +10,8 @@ module Geordi
10
10
  end
11
11
 
12
12
  def user(server)
13
- cap2user = deploy_info[ /^\s*set\s*:user,\s*['"](.*?)['"]/, 1 ]
14
- cap2user || deploy_info[ /^\s*server\s*['"]#{ server }['"],.*user.{1,4}['"](.*?)['"]/m, 1 ]
13
+ cap2user = deploy_info[/^\s*set\s*:user,\s*['"](.*?)['"]/, 1]
14
+ cap2user || deploy_info[/^\s*server\s*['"]#{server}['"],.*user.{1,4}['"](.*?)['"]/m, 1]
15
15
  end
16
16
 
17
17
  def servers
@@ -26,11 +26,11 @@ module Geordi
26
26
  end
27
27
 
28
28
  def remote_root
29
- File.join deploy_info[ /^\s*set\s*:deploy_to,\s*['"](.*?)['"]/, 1 ], 'current'
29
+ File.join deploy_info[/^\s*set\s*:deploy_to,\s*['"](.*?)['"]/, 1], 'current'
30
30
  end
31
31
 
32
32
  def env
33
- deploy_info[ /^\s*set\s*:rails_env,\s*['"](.*?)['"]/, 1 ]
33
+ deploy_info[/^\s*set\s*:rails_env,\s*['"](.*?)['"]/, 1]
34
34
  end
35
35
 
36
36
  def shell
@@ -45,26 +45,29 @@ module Geordi
45
45
  self.deploy_info = ''
46
46
 
47
47
  if stage
48
- deploy_info << File.read(File.join root, "config/deploy/#{ stage }.rb")
48
+ deploy_info << File.read(File.join(root, "config/deploy/#{stage}.rb"))
49
49
  deploy_info << "\n"
50
50
  end
51
51
 
52
- deploy_info << File.read(File.join root, 'config/deploy.rb')
52
+ deploy_info << File.read(File.join(root, 'config/deploy.rb'))
53
53
  end
54
54
 
55
55
  def find_project_root!
56
- current = Dir.pwd
57
- until File.exists?('Capfile')
58
- Dir.chdir '..'
59
- raise <<-ERROR if current == Dir.pwd
60
- Could not locate Capfile.
61
-
62
- Are you calling me from within a Rails project?
63
- Maybe Capistrano is not installed in this project.
64
- ERROR
65
-
66
- current = Dir.pwd
56
+ current = ENV['RAILS_ROOT'] || Dir.pwd
57
+
58
+ until File.exist?(File.join(current, 'Capfile'))
59
+ if current == '/' || current == '/home' || !File.directory?(current)
60
+ raise <<-ERROR
61
+ Could not locate Capfile.
62
+
63
+ Are you calling me from within a Rails project?
64
+ Maybe Capistrano is not installed in this project.
65
+ ERROR
66
+ else
67
+ current = File.dirname(current)
68
+ end
67
69
  end
70
+
68
71
  current
69
72
  end
70
73
 
@@ -4,14 +4,13 @@ require 'tempfile'
4
4
 
5
5
  module Geordi
6
6
  class ChromedriverUpdater
7
- include Geordi::Interaction
8
7
 
9
8
  def run
10
9
  chrome_version = determine_chrome_version
11
10
  chromedriver_version = determine_chromedriver_version
12
11
 
13
12
  if skip_update?(chrome_version, chromedriver_version)
14
- warn("No update required, you are using for both executables the same version #{chrome_version}!")
13
+ Interaction.warn("No update required, you are using for both executables the same version #{chrome_version}!")
15
14
  else
16
15
  chromedriver_zip = download_chromedriver(chrome_version)
17
16
  unzip(chromedriver_zip, File.expand_path('~/bin'))
@@ -19,7 +18,7 @@ module Geordi
19
18
  chromedriver_zip.unlink
20
19
 
21
20
  # We need to determine the version again, as it could be nil in case no chromedriver was installed before
22
- note "Chromedriver updated to version #{determine_chromedriver_version}"
21
+ Interaction.note "Chromedriver updated to version #{determine_chromedriver_version}"
23
22
  end
24
23
  end
25
24
 
@@ -27,12 +26,12 @@ module Geordi
27
26
 
28
27
  def determine_chrome_version
29
28
  stdout_str, _error_str, status = Open3.capture3('google-chrome', '--version')
30
- chrome_version = if !stdout_str.nil?
29
+ chrome_version = unless stdout_str.nil?
31
30
  stdout_str[/\AGoogle Chrome (\d+)/, 1]
32
31
  end
33
32
 
34
33
  if !status.success? || chrome_version.nil?
35
- fail('Could not determine the current Google Chrome version')
34
+ Interaction.fail('Could not determine the current Google Chrome version')
36
35
  else
37
36
  chrome_version.to_i
38
37
  end
@@ -42,12 +41,12 @@ module Geordi
42
41
  return unless Open3.capture2('which chromedriver')[1].success?
43
42
 
44
43
  stdout_str, _error_str, status = Open3.capture3('chromedriver', '-v')
45
- chromedriver_version = if !stdout_str.nil?
44
+ chromedriver_version = unless stdout_str.nil?
46
45
  stdout_str[/\AChromeDriver (\d+)/, 1]
47
46
  end
48
47
 
49
48
  if !status.success? || chromedriver_version.nil?
50
- fail('Could not determine the current chromedriver version')
49
+ Interaction.fail('Could not determine the current chromedriver version')
51
50
  else
52
51
  chromedriver_version.to_i
53
52
  end
@@ -69,7 +68,7 @@ module Geordi
69
68
 
70
69
  file
71
70
  else
72
- fail("Could not download chromedriver version #{latest_version}")
71
+ Interaction.fail("Could not download chromedriver version #{latest_version}")
73
72
  end
74
73
  end
75
74
 
@@ -80,7 +79,7 @@ module Geordi
80
79
  if response.is_a?(Net::HTTPSuccess)
81
80
  response.body.to_s
82
81
  else
83
- fail("Could not find the latest version for Google Chrome version #{chrome_version}")
82
+ Interaction.fail("Could not find the latest version for Google Chrome version #{chrome_version}")
84
83
  end
85
84
  end
86
85
 
@@ -88,7 +87,7 @@ module Geordi
88
87
  _stdout_str, _error_str, status = Open3.capture3('unzip', '-d', output_dir, '-o', zip.path)
89
88
 
90
89
  unless status.success?
91
- fail("Could not unzip #{zip.path}")
90
+ Interaction.fail("Could not unzip #{zip.path}")
92
91
  end
93
92
  end
94
93
  end