geordi 4.0.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +47 -0
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +55 -1
  5. data/Gemfile +2 -1
  6. data/Gemfile.lock +46 -28
  7. data/README.md +20 -3
  8. data/Rakefile +1 -1
  9. data/exe/dumple +19 -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/bundle_install.rb +1 -1
  15. data/lib/geordi/commands/capistrano.rb +1 -1
  16. data/lib/geordi/commands/chromedriver_update.rb +8 -1
  17. data/lib/geordi/commands/commit.rb +0 -4
  18. data/lib/geordi/commands/console.rb +4 -3
  19. data/lib/geordi/commands/create_database_yml.rb +1 -1
  20. data/lib/geordi/commands/create_databases.rb +7 -6
  21. data/lib/geordi/commands/cucumber.rb +9 -4
  22. data/lib/geordi/commands/deploy.rb +7 -7
  23. data/lib/geordi/commands/dump.rb +14 -4
  24. data/lib/geordi/commands/firefox.rb +1 -1
  25. data/lib/geordi/commands/migrate.rb +4 -4
  26. data/lib/geordi/commands/rake.rb +6 -4
  27. data/lib/geordi/commands/rspec.rb +5 -5
  28. data/lib/geordi/commands/security_update.rb +10 -10
  29. data/lib/geordi/commands/server.rb +3 -3
  30. data/lib/geordi/commands/setup.rb +5 -5
  31. data/lib/geordi/commands/shell.rb +1 -1
  32. data/lib/geordi/commands/tests.rb +4 -4
  33. data/lib/geordi/commands/unit.rb +3 -3
  34. data/lib/geordi/commands/update.rb +4 -4
  35. data/lib/geordi/commands/vnc.rb +1 -1
  36. data/lib/geordi/commands/with_rake.rb +3 -3
  37. data/lib/geordi/commands/yarn_install.rb +1 -1
  38. data/lib/geordi/cucumber.rb +2 -2
  39. data/lib/geordi/dump_loader.rb +1 -1
  40. data/lib/geordi/gitpt.rb +1 -1
  41. data/lib/geordi/interaction.rb +1 -1
  42. data/lib/geordi/remote.rb +5 -4
  43. data/lib/geordi/settings.rb +11 -2
  44. data/lib/geordi/util.rb +33 -21
  45. data/lib/geordi/version.rb +1 -1
  46. metadata +6 -6
  47. data/.travis.yml +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e713daa0ffee8f9a861ebdc77dcfb4bffe177f2342b05ae7fc442494d4384c18
4
- data.tar.gz: 36b09dd4952b71a1f3851b6cbcb9e5f823d575a707b6ebae9bdd4e459d366a68
3
+ metadata.gz: 785901e0e49997506cc80f2df64338acc50a9605b42816cce92f56c5dba834b7
4
+ data.tar.gz: 9ec7abce9fd67cdff30584c236ba4454c3cbfe276091b277ffbec95221da9e04
5
5
  SHA512:
6
- metadata.gz: c1f9c002b9035c57ccef219eae0a1f51b64b22ef74ed37ec2a18257b6c230ab3dd1d2f457f93a60df0bf409b5c4ab69b02af9bf2f43ea8c9ba0fe44799616b57
7
- data.tar.gz: 6c74ac5333a1a44b3c5ecd8522829e3984b7e1c2fdd2c37d29c99fe5e450a95945a6d8de6c8103ab5b3d58f09ef83f137f2b95bc8c3ea68163cf8c2fba0451f8
6
+ metadata.gz: d8fd6738e768cd5e0ae9b9ccfc0c3bdb781e00abf000c596d408fd62b408f6b46069447d4f8acb98d02b4e2b8ed04faec72af700f18f0d7b8364e42a5dce6ac9
7
+ data.tar.gz: 78ec1bae91f5b3b8ca9fa7dc696021ae78d820250ee62596647283388070e5731b780c4f166f6ecaf4471051c11f340b7d33a8d36ae3c902855fa92c1a8a5f48
@@ -0,0 +1,47 @@
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 install -y vnc4server
39
+ # Fake required password for vncserver
40
+ mkdir ~/.vnc && touch ~/.vnc/passwd && chmod 700 ~/.vnc/passwd
41
+ - name: Bundle
42
+ run: |
43
+ gem install bundler:1.17.3
44
+ bundle install --no-deployment
45
+ - name: Run tests
46
+ run: bundle exec rake
47
+
@@ -1 +1 @@
1
- 2.5
1
+ 2.5.8
@@ -5,14 +5,68 @@ 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
9
10
  ### Breaking changes
10
11
 
11
12
 
13
+ ## 5.0.0 2020-11-25
14
+
15
+ ### Breaking changes
16
+ * Remove support for Ruby 2.0 and 2.1
17
+
18
+
19
+ ## 4.2.0 2020-10-02
20
+
21
+ ### Compatible changes
22
+ * Add `auto_update_chromedriver` as global setting option to automatically update chromedriver before cucumber
23
+ tests, if Chrome and chromedriver versions don't match.
24
+ * Dump command: Add support for multiple databases (#103 by @kajatiger)
25
+ * Add Ruby 2.7 to list of supported Ruby versions
26
+ * Fix #115: `geordi cucumber --modified` command, that corrupted filenames like:
27
+ ```
28
+ No such file or directory tures/pages.feature
29
+ ```
30
+ * Avoid writing an instance of HighLine::String to Geordi config files (closes #114)
31
+
32
+
33
+ ## 4.1.1 2020-08-28
34
+ ### Compatible changes
35
+
36
+ * Fixed: System calls are not executed properly if no bin stub is present. This resulted in errors like:
37
+
38
+ ```
39
+ % geordi rspec
40
+
41
+ # Running specs
42
+ > All specs at once (using parallel_tests)
43
+
44
+ x Specs failed.
45
+ ```
46
+
47
+ or
48
+
49
+ ```
50
+ % geordi migrate
51
+
52
+ # Migrating
53
+ > Development and parallel test databases
54
+
55
+ x Something went wrong.
56
+ ```
57
+
58
+
59
+ ## 4.1.0 2020-08-18
60
+
61
+ ### Compatible changes
62
+
63
+ - Added dumple option `--compress` to compress after dumping
64
+
12
65
  ## 4.0.1 2020-08-11
66
+
13
67
  ### Compatible changes
14
68
 
15
- * Fix `geordi migrate` command, that fails with:
69
+ - Fix `geordi migrate` command, that fails with:
16
70
 
17
71
  ```
18
72
  Don't know how to build task 'db:migrate parallel:prepare'
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.0.1)
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
@@ -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
@@ -3,6 +3,7 @@
3
3
  require 'erb'
4
4
 
5
5
  fail_gently = ARGV.include?("--fail-gently")
6
+ compress = ARGV.include?("--compress")
6
7
 
7
8
  if ARGV.include?("-i")
8
9
  puts "*******************************************************"
@@ -44,9 +45,13 @@ begin
44
45
  end
45
46
 
46
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]"
47
51
 
48
- environment = ARGV.reject{ |arg| arg[0].chr == '-' }.first || 'production'
49
- 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
50
55
 
51
56
  dump_dir = "#{ENV['HOME']}/dumps"
52
57
  unless File.directory?(dump_dir)
@@ -60,7 +65,8 @@ begin
60
65
  dump_path = "#{dump_dir}/#{config['database']}_#{Time.now.strftime("%Y%m%d_%H%M%S")}.dump"
61
66
  end
62
67
 
63
- puts "> Dumping database for \"#{environment}\" environment ..."
68
+ given_database = database ? %(#{database} ) : ""
69
+ puts "> Dumping #{given_database}database for \"#{environment}\" environment ..."
64
70
 
65
71
  host = config['host']
66
72
  port = config['port']
@@ -89,13 +95,22 @@ begin
89
95
  command << " --port=#{port}" if port
90
96
  command
91
97
  else
92
- raise "Adapter \"#{config['adapter']} is not supported"
98
+ raise "Adapter \"#{config['adapter']}\" is not supported"
93
99
  end
94
100
  success = system(dump_command)
95
101
  success or raise "Creating the dump failed"
96
102
 
97
103
  system "chmod 600 #{dump_path}"
98
104
 
105
+ if compress
106
+ puts "> Compressing the dump ..."
107
+
108
+ # gzip compresses in place
109
+ compress_success = system("gzip #{dump_path}")
110
+ compress_success or raise "Compressing the dump failed"
111
+ dump_path << ".gz"
112
+ end
113
+
99
114
  dump_size_kb = (File.size(dump_path) / 1024).round
100
115
 
101
116
  puts "> Dumped to #{dump_path} (#{dump_size_kb} KB)"
@@ -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'))