geordi 2.10.1 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/.travis.yml +8 -2
- data/CHANGELOG.md +46 -0
- data/Gemfile +2 -5
- data/Gemfile.lock +10 -10
- data/README.md +11 -6
- data/Rakefile +6 -10
- data/{bin → exe}/b +0 -0
- data/{bin → exe}/cap-all +0 -0
- data/{bin → exe}/console-for +0 -0
- data/{bin → exe}/cuc +0 -0
- data/{bin → exe}/cuc-show +0 -0
- data/{bin → exe}/cuc-vnc-setup +0 -0
- data/{bin → exe}/deploy-to-production +0 -0
- data/{bin → exe}/dump-for +0 -0
- data/{bin → exe}/dumple +0 -0
- data/{bin → exe}/geordi +0 -0
- data/{bin → exe}/gitpt +0 -0
- data/{bin → exe}/launchy_browser +0 -0
- data/{bin → exe}/load-dump +0 -0
- data/{bin → exe}/migrate-all +0 -0
- data/{bin → exe}/rs +0 -0
- data/{bin → exe}/run_tests +0 -0
- data/{bin → exe}/shell-for +0 -0
- data/{bin → exe}/tests +0 -0
- data/geordi.gemspec +23 -20
- data/lib/geordi/COMMAND_TEMPLATE +4 -6
- data/lib/geordi/capistrano_config.rb +20 -17
- data/lib/geordi/chromedriver_updater.rb +9 -10
- data/lib/geordi/cli.rb +5 -2
- data/lib/geordi/commands/_setup_vnc.rb +23 -23
- data/lib/geordi/commands/apache_site.rb +3 -3
- data/lib/geordi/commands/bundle_install.rb +3 -3
- data/lib/geordi/commands/capistrano.rb +5 -6
- data/lib/geordi/commands/chromedriver_update.rb +0 -9
- data/lib/geordi/commands/clean.rb +5 -6
- data/lib/geordi/commands/commit.rb +0 -1
- data/lib/geordi/commands/console.rb +4 -4
- data/lib/geordi/commands/create_database_yml.rb +4 -4
- data/lib/geordi/commands/create_databases.rb +3 -3
- data/lib/geordi/commands/cucumber.rb +25 -25
- data/lib/geordi/commands/delete_dumps.rb +12 -12
- data/lib/geordi/commands/deploy.rb +27 -28
- data/lib/geordi/commands/drop_databases.rb +13 -15
- data/lib/geordi/commands/dump.rb +12 -13
- data/lib/geordi/commands/eurest.rb +2 -2
- data/lib/geordi/commands/firefox.rb +4 -4
- data/lib/geordi/commands/migrate.rb +3 -3
- data/lib/geordi/commands/png_optimize.rb +15 -14
- data/lib/geordi/commands/rake.rb +3 -3
- data/lib/geordi/commands/remove_executable_flags.rb +3 -3
- data/lib/geordi/commands/rspec.rb +11 -11
- data/lib/geordi/commands/security_update.rb +25 -25
- data/lib/geordi/commands/server.rb +6 -6
- data/lib/geordi/commands/setup.rb +8 -8
- data/lib/geordi/commands/shell.rb +3 -3
- data/lib/geordi/commands/tests.rb +1 -1
- data/lib/geordi/commands/unit.rb +3 -3
- data/lib/geordi/commands/update.rb +7 -7
- data/lib/geordi/commands/vnc.rb +1 -1
- data/lib/geordi/commands/with_rake.rb +3 -3
- data/lib/geordi/commands/yarn_install.rb +3 -3
- data/lib/geordi/cucumber.rb +35 -36
- data/lib/geordi/db_cleaner.rb +40 -41
- data/lib/geordi/dump_loader.rb +6 -5
- data/lib/geordi/firefox_for_selenium.rb +26 -29
- data/lib/geordi/gitpt.rb +14 -15
- data/lib/geordi/interaction.rb +2 -6
- data/lib/geordi/remote.rb +9 -10
- data/lib/geordi/util.rb +28 -25
- data/lib/geordi/version.rb +1 -1
- metadata +27 -39
- data/features/commit.feature +0 -17
- data/features/console.feature +0 -7
- data/features/cucumber.feature +0 -261
- data/features/deploy.feature +0 -66
- data/features/dump.feature +0 -34
- data/features/firefox.feature +0 -44
- data/features/server.feature +0 -31
- data/features/setup.feature +0 -11
- data/features/shell.feature +0 -78
- data/features/support/env.rb +0 -8
- data/features/support/step_definitions/aruba_backport_steps.rb +0 -5
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b149c149a52f1e02ca3573aa238d31d5a1fb9a018f2bdea2a19498d75282650e
|
4
|
+
data.tar.gz: 5bd2b8ddf0190307b93fab2081434fe05a7207c3b5105ec566eeb211d82532d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a607dcb1475b70f9053c4fe950f8ee6fa2d657b0c6771b514c3356ac28c8f2704be396cfc2f19b8990edd3dc67dfdc7dad1a92344947c23fa30e72cf7a4564c
|
7
|
+
data.tar.gz: d499c7936be74a6eb30f14287b0af2fd44dd89e6bc2dd4db772e6b7a0450f8013df200604027a95fd4808a32f3b860760876e40e0af5b7d9427c1c3cb8646e6f
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.0.0
|
data/.travis.yml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- '
|
5
|
-
- '2.
|
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}
|
data/CHANGELOG.md
CHANGED
@@ -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
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
geordi (
|
5
|
-
thor (
|
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.
|
38
|
-
faraday (0.17.
|
37
|
+
excon (0.73.0)
|
38
|
+
faraday (0.17.3)
|
39
39
|
multipart-post (>= 1.2, < 3)
|
40
|
-
faraday_middleware (0.
|
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.
|
49
|
-
mimemagic (0.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.
|
57
|
-
coderay (~> 1.1
|
58
|
-
method_source (~>
|
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
|
-
|
390
|
-
|
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 :
|
5
|
+
task default: :features
|
6
6
|
|
7
7
|
task :features do
|
8
|
-
|
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('
|
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 #{
|
47
|
-
geordi_section << "#{
|
48
|
-
geordi_section << "#{
|
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
|
data/{bin → exe}/b
RENAMED
File without changes
|
data/{bin → exe}/cap-all
RENAMED
File without changes
|
data/{bin → exe}/console-for
RENAMED
File without changes
|
data/{bin → exe}/cuc
RENAMED
File without changes
|
data/{bin → exe}/cuc-show
RENAMED
File without changes
|
data/{bin → exe}/cuc-vnc-setup
RENAMED
File without changes
|
File without changes
|
data/{bin → exe}/dump-for
RENAMED
File without changes
|
data/{bin → exe}/dumple
RENAMED
File without changes
|
data/{bin → exe}/geordi
RENAMED
File without changes
|
data/{bin → exe}/gitpt
RENAMED
File without changes
|
data/{bin → exe}/launchy_browser
RENAMED
File without changes
|
data/{bin → exe}/load-dump
RENAMED
File without changes
|
data/{bin → exe}/migrate-all
RENAMED
File without changes
|
data/{bin → exe}/rs
RENAMED
File without changes
|
data/{bin → exe}/run_tests
RENAMED
File without changes
|
data/{bin → exe}/shell-for
RENAMED
File without changes
|
data/{bin → exe}/tests
RENAMED
File without changes
|
data/geordi.gemspec
CHANGED
@@ -1,28 +1,31 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
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 |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
26
|
+
spec.add_runtime_dependency 'thor', '~> 1'
|
24
27
|
|
25
|
-
|
28
|
+
spec.post_install_message = <<-ATTENTION
|
26
29
|
* Binary `geordi` installed
|
27
30
|
ATTENTION
|
28
31
|
end
|
data/lib/geordi/COMMAND_TEMPLATE
CHANGED
@@ -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, :
|
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', :
|
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
|
-
|
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[
|
14
|
-
cap2user || deploy_info[
|
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[
|
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[
|
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
|
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
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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 =
|
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 =
|
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
|