geordi 3.2.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +5 -0
- data/CHANGELOG.md +69 -1
- data/Gemfile +2 -1
- data/Gemfile.lock +46 -28
- data/README.md +132 -140
- data/Rakefile +19 -9
- data/exe/dumple +19 -4
- data/geordi.gemspec +3 -2
- data/lib/geordi/COMMAND_TEMPLATE +4 -2
- data/lib/geordi/chromedriver_updater.rb +2 -2
- data/lib/geordi/cli.rb +1 -1
- data/lib/geordi/commands/bundle_install.rb +1 -1
- data/lib/geordi/commands/capistrano.rb +1 -1
- data/lib/geordi/commands/chromedriver_update.rb +10 -3
- data/lib/geordi/commands/commit.rb +0 -5
- data/lib/geordi/commands/console.rb +11 -13
- data/lib/geordi/commands/create_databases.rb +7 -5
- data/lib/geordi/commands/cucumber.rb +22 -19
- data/lib/geordi/commands/delete_dumps.rb +0 -1
- data/lib/geordi/commands/deploy.rb +17 -17
- data/lib/geordi/commands/drop_databases.rb +0 -6
- data/lib/geordi/commands/dump.rb +20 -18
- data/lib/geordi/commands/firefox.rb +3 -6
- data/lib/geordi/commands/migrate.rb +4 -4
- data/lib/geordi/commands/rake.rb +7 -3
- data/lib/geordi/commands/rspec.rb +8 -12
- data/lib/geordi/commands/security_update.rb +24 -25
- data/lib/geordi/commands/server.rb +4 -4
- data/lib/geordi/commands/setup.rb +7 -16
- data/lib/geordi/commands/shell.rb +7 -8
- data/lib/geordi/commands/tests.rb +4 -4
- data/lib/geordi/commands/unit.rb +3 -3
- data/lib/geordi/commands/update.rb +4 -15
- data/lib/geordi/commands/vnc.rb +2 -4
- data/lib/geordi/commands/with_rake.rb +3 -3
- data/lib/geordi/commands/yarn_install.rb +1 -1
- data/lib/geordi/cucumber.rb +3 -3
- data/lib/geordi/dump_loader.rb +1 -1
- data/lib/geordi/gitpt.rb +1 -1
- data/lib/geordi/interaction.rb +1 -1
- data/lib/geordi/remote.rb +5 -4
- data/lib/geordi/settings.rb +11 -2
- data/lib/geordi/util.rb +35 -17
- data/lib/geordi/version.rb +1 -1
- metadata +7 -34
- data/exe/cap-all +0 -4
- data/exe/console-for +0 -4
- data/exe/cuc +0 -4
- data/exe/cuc-show +0 -4
- data/exe/cuc-vnc-setup +0 -4
- data/exe/deploy-to-production +0 -4
- data/exe/dump-for +0 -8
- data/exe/gitpt +0 -4
- data/exe/load-dump +0 -4
- data/exe/migrate-all +0 -4
- data/exe/rs +0 -4
- data/exe/run_tests +0 -4
- data/exe/shell-for +0 -4
- data/exe/tests +0 -4
- data/lib/geordi/commands/eurest.rb +0 -4
data/lib/geordi/commands/vnc.rb
CHANGED
@@ -4,15 +4,13 @@ Example: `geordi vnc` or `geordi vnc --setup`
|
|
4
4
|
|
5
5
|
Launch a VNC session to the hidden screen where `geordi cucumber` runs Selenium
|
6
6
|
tests.
|
7
|
-
|
8
|
-
When called with `--setup`, will guide through the setup of VNC.
|
9
7
|
LONGDESC
|
10
8
|
|
11
|
-
option :setup, type: :boolean
|
9
|
+
option :setup, type: :boolean, desc: 'Guide through the setup of VNC'
|
12
10
|
|
13
11
|
def vnc
|
14
12
|
if options.setup
|
15
|
-
|
13
|
+
invoke_geordi :_setup_vnc
|
16
14
|
else
|
17
15
|
require 'geordi/cucumber'
|
18
16
|
Geordi::Cucumber.new.launch_vnc_viewer
|
@@ -1,11 +1,11 @@
|
|
1
1
|
desc 'with-rake', 'Run tests with `rake`', hide: true
|
2
2
|
def with_rake
|
3
3
|
if Util.file_containing?('Rakefile', /^task.+default.+(spec|test|feature)/)
|
4
|
-
|
5
|
-
|
4
|
+
invoke_geordi 'bundle_install'
|
5
|
+
invoke_geordi 'yarn_install'
|
6
6
|
|
7
7
|
Interaction.announce 'Running tests with `rake`'
|
8
|
-
Util.
|
8
|
+
Util.run!(Util.binstub_or_fallback('rake'))
|
9
9
|
else
|
10
10
|
Interaction.note '`rake` does not run tests.'
|
11
11
|
:did_not_perform
|
@@ -3,6 +3,6 @@ desc 'yarn-install', 'Runs yarn install if required', hide: true
|
|
3
3
|
def yarn_install
|
4
4
|
if File.exist?('package.json') && !system('yarn check --integrity > /dev/null 2>&1')
|
5
5
|
Interaction.announce 'Yarn install'
|
6
|
-
Util.
|
6
|
+
Util.run!('yarn install')
|
7
7
|
end
|
8
8
|
end
|
data/lib/geordi/cucumber.rb
CHANGED
@@ -27,7 +27,7 @@ module Geordi
|
|
27
27
|
Interaction.note_cmd(command) if options[:verbose]
|
28
28
|
|
29
29
|
puts # Make newline
|
30
|
-
system command # Util.
|
30
|
+
system command # Util.run! would reset the Firefox PATH
|
31
31
|
end
|
32
32
|
|
33
33
|
def launch_vnc_viewer
|
@@ -74,7 +74,7 @@ module Geordi
|
|
74
74
|
unless argv.include?('--format') || argv.include?('-f')
|
75
75
|
format_args = spinner_available? ? ['--format', 'CucumberSpinner::CuriousProgressBarFormatter'] : ['--format', 'progress']
|
76
76
|
end
|
77
|
-
[use_firefox_for_selenium, '
|
77
|
+
[use_firefox_for_selenium, Util.binstub_or_fallback('cucumber'), format_args, escape_shell_args(argv)].flatten.compact.join(' ')
|
78
78
|
end
|
79
79
|
|
80
80
|
def parallel_execution_command
|
@@ -87,7 +87,7 @@ module Geordi
|
|
87
87
|
|
88
88
|
[
|
89
89
|
use_firefox_for_selenium,
|
90
|
-
'
|
90
|
+
'bundle exec parallel_test -t ' + type_arg,
|
91
91
|
%(-o '#{command_line_options.join(' ')} --tags "#{not_tag('@solo')}"'),
|
92
92
|
"-- #{features.join(' ')}",
|
93
93
|
].compact.join(' ')
|
data/lib/geordi/dump_loader.rb
CHANGED
@@ -57,7 +57,7 @@ module Geordi
|
|
57
57
|
Interaction.note 'Source file: ' + dump_file
|
58
58
|
|
59
59
|
source_command = send("#{config['adapter']}_command")
|
60
|
-
Util.
|
60
|
+
Util.run! source_command, fail_message: "An error occured loading #{File.basename(dump_file)}"
|
61
61
|
end
|
62
62
|
|
63
63
|
end
|
data/lib/geordi/gitpt.rb
CHANGED
@@ -89,7 +89,7 @@ No staged changes. Will create an empty commit.
|
|
89
89
|
extra = highline.ask("\nAdd an optional message").strip
|
90
90
|
message << ' - ' << extra if extra != ''
|
91
91
|
|
92
|
-
Geordi::Util.
|
92
|
+
Geordi::Util.run!(['git', 'commit', '--allow-empty', '-m', message, *git_args])
|
93
93
|
end
|
94
94
|
|
95
95
|
def bold(string)
|
data/lib/geordi/interaction.rb
CHANGED
data/lib/geordi/remote.rb
CHANGED
@@ -31,9 +31,10 @@ module Geordi
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def dump(options = {})
|
34
|
+
database = options[:database] ? " #{options[:database]}" : ''
|
34
35
|
# Generate dump on the server
|
35
36
|
shell options.merge({
|
36
|
-
remote_command: "dumple #{@config.env} --for_download",
|
37
|
+
remote_command: "dumple #{@config.env}#{database} --for_download",
|
37
38
|
})
|
38
39
|
|
39
40
|
destination_directory = File.join(@config.root, 'tmp')
|
@@ -43,9 +44,9 @@ module Geordi
|
|
43
44
|
|
44
45
|
Interaction.note "Downloading remote dump to #{relative_destination} ..."
|
45
46
|
server = @config.primary_server
|
46
|
-
Util.
|
47
|
+
Util.run!("scp -C #{@config.user(server)}@#{server}:#{REMOTE_DUMP_PATH} #{destination_path}")
|
47
48
|
|
48
|
-
Interaction.success "Dumped the #{@stage} database to #{relative_destination}."
|
49
|
+
Interaction.success "Dumped the#{database} #{@stage} database to #{relative_destination}."
|
49
50
|
|
50
51
|
destination_path
|
51
52
|
end
|
@@ -74,7 +75,7 @@ module Geordi
|
|
74
75
|
remote_command << " -c '#{options[:remote_command]}'" if options[:remote_command]
|
75
76
|
|
76
77
|
Interaction.note 'Connecting to ' + server.to_s
|
77
|
-
Util.
|
78
|
+
Util.run!(['ssh', "#{@config.user(server)}@#{server}", '-t', remote_command])
|
78
79
|
end
|
79
80
|
|
80
81
|
end
|
data/lib/geordi/settings.rb
CHANGED
@@ -8,7 +8,7 @@ module Geordi
|
|
8
8
|
GLOBAL_SETTINGS_FILE_NAME = Util.testing? ? './tmp/global_settings.yml'.freeze : File.join(ENV['HOME'], '.config/geordi/global.yml').freeze
|
9
9
|
LOCAL_SETTINGS_FILE_NAME = Util.testing? ? './tmp/local_settings.yml'.freeze : './.geordi.yml'.freeze
|
10
10
|
|
11
|
-
ALLOWED_GLOBAL_SETTINGS = %w[ pivotal_tracker_api_key ].freeze
|
11
|
+
ALLOWED_GLOBAL_SETTINGS = %w[ pivotal_tracker_api_key auto_update_chromedriver ].freeze
|
12
12
|
ALLOWED_LOCAL_SETTINGS = %w[ use_vnc pivotal_tracker_project_ids ].freeze
|
13
13
|
|
14
14
|
def initialize
|
@@ -25,6 +25,15 @@ module Geordi
|
|
25
25
|
save_global_settings
|
26
26
|
end
|
27
27
|
|
28
|
+
def auto_update_chromedriver
|
29
|
+
@global_settings["auto_update_chromedriver"] || false
|
30
|
+
end
|
31
|
+
|
32
|
+
def auto_update_chromedriver=(value)
|
33
|
+
@global_settings['auto_update_chromedriver'] = value
|
34
|
+
save_global_settings
|
35
|
+
end
|
36
|
+
|
28
37
|
# Local settings
|
29
38
|
# They should not be changed by geordi to avoid unexpected diffs, therefore
|
30
39
|
# there are no setters for these settings
|
@@ -129,7 +138,7 @@ module Geordi
|
|
129
138
|
def inquire_pt_api_key
|
130
139
|
Geordi::Interaction.warn 'Your settings are missing or invalid.'
|
131
140
|
Geordi::Interaction.warn "Please configure your Pivotal Tracker access."
|
132
|
-
token = Geordi::Interaction.prompt
|
141
|
+
token = Geordi::Interaction.prompt('Your API key:').to_s # Just be sure
|
133
142
|
self.pivotal_tracker_api_key = token
|
134
143
|
puts
|
135
144
|
|
data/lib/geordi/util.rb
CHANGED
@@ -21,7 +21,7 @@ module Geordi
|
|
21
21
|
# install missing gem
|
22
22
|
Interaction.warn 'Probably missing gem: ' + gem_name
|
23
23
|
Interaction.prompt('Install it now?', 'y', /y|yes/) || Interaction.fail('Missing Gems.')
|
24
|
-
|
24
|
+
Util.run!(install_command, show_cmd: true)
|
25
25
|
|
26
26
|
# retry
|
27
27
|
Gem.clear_paths
|
@@ -33,42 +33,60 @@ module Geordi
|
|
33
33
|
# Run a command with a clean environment.
|
34
34
|
# Print an error message and exit if the command fails.
|
35
35
|
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
def
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
if
|
36
|
+
# show_cmd: Whether to print the command
|
37
|
+
# confirm: Whether to ask for confirmation before running it
|
38
|
+
# fail_message: The text to print on command failure
|
39
|
+
def run!(command, show_cmd: false, confirm: false, fail_message: 'Something went wrong.')
|
40
|
+
# Disable shell features for arrays https://stackoverflow.com/questions/13338147/ruby-system-method-arguments
|
41
|
+
# Conversion: ['ls *', 'some arg'] => ['ls', '*', 'some arg']
|
42
|
+
# If you need shell features, you need to pass in a String instead of an array.
|
43
|
+
if command.is_a?(Array)
|
44
|
+
real_command, *arguments = *command
|
45
|
+
command = [real_command.split(' '), arguments].flatten
|
46
|
+
printable_command = command.join(', ')
|
47
|
+
else
|
48
|
+
printable_command = command
|
49
|
+
end
|
50
|
+
|
51
|
+
if show_cmd
|
52
|
+
Interaction.note_cmd printable_command
|
53
|
+
end
|
54
|
+
|
55
|
+
if confirm
|
44
56
|
Interaction.prompt('Run this now?', 'n', /y|yes/) or Interaction.fail('Cancelled.')
|
45
57
|
end
|
46
58
|
|
47
59
|
if testing?
|
48
|
-
puts "Util.
|
60
|
+
puts "Util.run! #{printable_command}"
|
49
61
|
else
|
50
62
|
# Remove Geordi's Bundler environment when running commands.
|
51
63
|
success = if !defined?(Bundler)
|
52
|
-
system(*
|
64
|
+
system(*command)
|
53
65
|
elsif Gem::Version.new(Bundler::VERSION) >= Gem::Version.new('2.1.2')
|
54
66
|
Bundler.with_original_env do
|
55
|
-
system(*
|
67
|
+
system(*command)
|
56
68
|
end
|
57
69
|
else
|
58
|
-
Bundler.clean_system(*
|
70
|
+
Bundler.clean_system(*command)
|
59
71
|
end
|
60
72
|
|
61
|
-
success || Interaction.fail(
|
73
|
+
success || Interaction.fail(fail_message)
|
62
74
|
end
|
63
75
|
end
|
64
76
|
|
77
|
+
def binstub_or_fallback(executable)
|
78
|
+
binstub_file = "bin/#{executable}"
|
79
|
+
|
80
|
+
File.exists?(binstub_file) ? binstub_file : "bundle exec #{executable}"
|
81
|
+
end
|
82
|
+
|
65
83
|
def console_command(environment)
|
66
84
|
if gem_major_version('rails') == 2
|
67
85
|
'script/console ' + environment
|
68
86
|
elsif gem_major_version('rails') == 3
|
69
|
-
'
|
87
|
+
"#{binstub_or_fallback('rails')} console #{environment}"
|
70
88
|
else
|
71
|
-
"
|
89
|
+
"#{binstub_or_fallback('rails')} console -e #{environment}"
|
72
90
|
end
|
73
91
|
end
|
74
92
|
|
@@ -76,7 +94,7 @@ module Geordi
|
|
76
94
|
if gem_major_version('rails') == 2
|
77
95
|
'script/server ""'
|
78
96
|
else
|
79
|
-
'
|
97
|
+
"#{binstub_or_fallback('rails')} server"
|
80
98
|
end
|
81
99
|
end
|
82
100
|
|
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:
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,23 +30,9 @@ email:
|
|
30
30
|
- henning.koch@makandra.de
|
31
31
|
executables:
|
32
32
|
- b
|
33
|
-
- cap-all
|
34
|
-
- console-for
|
35
|
-
- cuc
|
36
|
-
- cuc-show
|
37
|
-
- cuc-vnc-setup
|
38
|
-
- deploy-to-production
|
39
|
-
- dump-for
|
40
33
|
- dumple
|
41
34
|
- geordi
|
42
|
-
- gitpt
|
43
35
|
- launchy_browser
|
44
|
-
- load-dump
|
45
|
-
- migrate-all
|
46
|
-
- rs
|
47
|
-
- run_tests
|
48
|
-
- shell-for
|
49
|
-
- tests
|
50
36
|
extensions: []
|
51
37
|
extra_rdoc_files: []
|
52
38
|
files:
|
@@ -60,23 +46,9 @@ files:
|
|
60
46
|
- README.md
|
61
47
|
- Rakefile
|
62
48
|
- exe/b
|
63
|
-
- exe/cap-all
|
64
|
-
- exe/console-for
|
65
|
-
- exe/cuc
|
66
|
-
- exe/cuc-show
|
67
|
-
- exe/cuc-vnc-setup
|
68
|
-
- exe/deploy-to-production
|
69
|
-
- exe/dump-for
|
70
49
|
- exe/dumple
|
71
50
|
- exe/geordi
|
72
|
-
- exe/gitpt
|
73
51
|
- exe/launchy_browser
|
74
|
-
- exe/load-dump
|
75
|
-
- exe/migrate-all
|
76
|
-
- exe/rs
|
77
|
-
- exe/run_tests
|
78
|
-
- exe/shell-for
|
79
|
-
- exe/tests
|
80
52
|
- geordi.gemspec
|
81
53
|
- lib/geordi.rb
|
82
54
|
- lib/geordi/COMMAND_TEMPLATE
|
@@ -98,7 +70,6 @@ files:
|
|
98
70
|
- lib/geordi/commands/deploy.rb
|
99
71
|
- lib/geordi/commands/drop_databases.rb
|
100
72
|
- lib/geordi/commands/dump.rb
|
101
|
-
- lib/geordi/commands/eurest.rb
|
102
73
|
- lib/geordi/commands/firefox.rb
|
103
74
|
- lib/geordi/commands/migrate.rb
|
104
75
|
- lib/geordi/commands/png_optimize.rb
|
@@ -126,11 +97,13 @@ files:
|
|
126
97
|
- lib/geordi/settings.rb
|
127
98
|
- lib/geordi/util.rb
|
128
99
|
- lib/geordi/version.rb
|
129
|
-
homepage:
|
100
|
+
homepage: https://makandra.com
|
130
101
|
licenses:
|
131
102
|
- MIT
|
132
103
|
metadata: {}
|
133
|
-
post_install_message:
|
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
|
134
107
|
rdoc_options: []
|
135
108
|
require_paths:
|
136
109
|
- lib
|
@@ -145,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
118
|
- !ruby/object:Gem::Version
|
146
119
|
version: '0'
|
147
120
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.1.4
|
149
122
|
signing_key:
|
150
123
|
specification_version: 4
|
151
124
|
summary: Collection of command line tools we use in our daily work with Ruby, Rails
|
data/exe/cap-all
DELETED
data/exe/console-for
DELETED
data/exe/cuc
DELETED
data/exe/cuc-show
DELETED
data/exe/cuc-vnc-setup
DELETED
data/exe/deploy-to-production
DELETED
data/exe/dump-for
DELETED
data/exe/gitpt
DELETED
data/exe/load-dump
DELETED
data/exe/migrate-all
DELETED
data/exe/rs
DELETED
data/exe/run_tests
DELETED
data/exe/shell-for
DELETED
data/exe/tests
DELETED