geordi 2.12.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +8 -2
  4. data/CHANGELOG.md +8 -0
  5. data/Gemfile +2 -6
  6. data/Gemfile.lock +20 -25
  7. data/README.md +8 -28
  8. data/Rakefile +6 -10
  9. data/{bin → exe}/b +0 -0
  10. data/{bin → exe}/cap-all +0 -0
  11. data/{bin → exe}/console-for +0 -0
  12. data/{bin → exe}/cuc +0 -0
  13. data/{bin → exe}/cuc-show +0 -0
  14. data/{bin → exe}/cuc-vnc-setup +0 -0
  15. data/{bin → exe}/deploy-to-production +0 -0
  16. data/{bin → exe}/dump-for +0 -0
  17. data/{bin → exe}/dumple +0 -0
  18. data/{bin → exe}/geordi +0 -2
  19. data/{bin → exe}/gitpt +0 -0
  20. data/{bin → exe}/launchy_browser +0 -0
  21. data/{bin → exe}/load-dump +0 -0
  22. data/{bin → exe}/migrate-all +0 -0
  23. data/{bin → exe}/rs +0 -0
  24. data/{bin → exe}/run_tests +0 -0
  25. data/{bin → exe}/shell-for +0 -0
  26. data/{bin → exe}/tests +0 -0
  27. data/geordi.gemspec +23 -20
  28. data/lib/geordi/COMMAND_TEMPLATE +2 -3
  29. data/lib/geordi/capistrano_config.rb +7 -7
  30. data/lib/geordi/chromedriver_updater.rb +7 -7
  31. data/lib/geordi/cli.rb +1 -6
  32. data/lib/geordi/commands/_setup_vnc.rb +1 -1
  33. data/lib/geordi/commands/apache_site.rb +3 -3
  34. data/lib/geordi/commands/bundle_install.rb +2 -2
  35. data/lib/geordi/commands/capistrano.rb +2 -3
  36. data/lib/geordi/commands/chromedriver_update.rb +0 -9
  37. data/lib/geordi/commands/clean.rb +2 -4
  38. data/lib/geordi/commands/commit.rb +0 -1
  39. data/lib/geordi/commands/console.rb +2 -2
  40. data/lib/geordi/commands/create_database_yml.rb +2 -2
  41. data/lib/geordi/commands/create_databases.rb +2 -2
  42. data/lib/geordi/commands/cucumber.rb +20 -20
  43. data/lib/geordi/commands/delete_dumps.rb +9 -9
  44. data/lib/geordi/commands/deploy.rb +12 -13
  45. data/lib/geordi/commands/drop_databases.rb +12 -14
  46. data/lib/geordi/commands/dump.rb +5 -6
  47. data/lib/geordi/commands/eurest.rb +2 -2
  48. data/lib/geordi/commands/firefox.rb +3 -3
  49. data/lib/geordi/commands/png_optimize.rb +13 -12
  50. data/lib/geordi/commands/rake.rb +2 -2
  51. data/lib/geordi/commands/remove_executable_flags.rb +1 -1
  52. data/lib/geordi/commands/rspec.rb +6 -6
  53. data/lib/geordi/commands/security_update.rb +12 -12
  54. data/lib/geordi/commands/server.rb +5 -5
  55. data/lib/geordi/commands/setup.rb +5 -5
  56. data/lib/geordi/commands/shell.rb +2 -2
  57. data/lib/geordi/commands/unit.rb +1 -1
  58. data/lib/geordi/commands/update.rb +5 -5
  59. data/lib/geordi/commands/vnc.rb +1 -1
  60. data/lib/geordi/commands/with_rake.rb +1 -1
  61. data/lib/geordi/commands/yarn_install.rb +2 -2
  62. data/lib/geordi/cucumber.rb +28 -29
  63. data/lib/geordi/db_cleaner.rb +28 -28
  64. data/lib/geordi/dump_loader.rb +3 -3
  65. data/lib/geordi/firefox_for_selenium.rb +11 -12
  66. data/lib/geordi/gitpt.rb +13 -13
  67. data/lib/geordi/remote.rb +6 -6
  68. data/lib/geordi/util.rb +18 -24
  69. data/lib/geordi/version.rb +1 -1
  70. metadata +25 -42
  71. data/features/commit.feature +0 -17
  72. data/features/console.feature +0 -7
  73. data/features/cucumber.feature +0 -261
  74. data/features/deploy.feature +0 -66
  75. data/features/docker.feature +0 -86
  76. data/features/dump.feature +0 -34
  77. data/features/firefox.feature +0 -44
  78. data/features/server.feature +0 -31
  79. data/features/setup.feature +0 -11
  80. data/features/shell.feature +0 -78
  81. data/features/step_definitions/docker_command_steps.rb +0 -21
  82. data/features/step_definitions/miscellaneous_steps.rb +0 -11
  83. data/features/support/aruba.rb +0 -60
  84. data/features/support/env.rb +0 -9
  85. data/features/support/step_definitions/aruba_backport_steps.rb +0 -5
  86. data/lib/geordi/commands/docker.rb +0 -42
  87. data/lib/geordi/docker.rb +0 -116
@@ -13,7 +13,7 @@ def png_optimize(path)
13
13
  announce 'Optimizing .png files'
14
14
 
15
15
  if `which pngcrush`.strip.empty?
16
- fail 'Please install pngcrush first (sudo apt-get install pngcrush)'
16
+ raise 'Please install pngcrush first (sudo apt-get install pngcrush)'
17
17
  end
18
18
 
19
19
  po = PngOptimizer.new
@@ -22,7 +22,7 @@ def png_optimize(path)
22
22
  elsif File.file?(path)
23
23
  po.optimize_inplace(path)
24
24
  else
25
- fail 'Neither directory nor file: ' + path
25
+ raise 'Neither directory nor file: ' + path
26
26
  end
27
27
 
28
28
  success 'PNG optimization completed.'
@@ -35,10 +35,10 @@ class PngOptimizer
35
35
  end
36
36
 
37
37
  def optimization_default_args
38
- args = ""
39
- args << "-rem alla " # remove everything except transparency
40
- args << "-rem text " # remove text chunks
41
- args << "-reduce " # eliminate unused colors and reduce bit-depth (if possible)
38
+ args = ''
39
+ args << '-rem alla ' # remove everything except transparency
40
+ args << '-rem text ' # remove text chunks
41
+ args << '-reduce ' # eliminate unused colors and reduce bit-depth (if possible)
42
42
  args
43
43
  end
44
44
 
@@ -50,10 +50,11 @@ class PngOptimizer
50
50
  dirname = File.dirname(original)
51
51
  basename = File.basename(original)
52
52
  count = 0
53
- begin
53
+
54
+ loop do
54
55
  tmp_name = "#{dirname}/#{basename}_temp_#{count += 1}.png"
55
- end while File.exists?(tmp_name)
56
- tmp_name
56
+ break tmp_name unless File.exist?(tmp_name)
57
+ end
57
58
  end
58
59
 
59
60
  def optimize_inplace(input_file)
@@ -61,9 +62,9 @@ class PngOptimizer
61
62
  result = optimize_file(input_file, temp_file)
62
63
  if result
63
64
  FileUtils.rm(input_file)
64
- FileUtils.mv("#{temp_file}", "#{input_file}")
65
+ FileUtils.mv(temp_file.to_s, input_file.to_s)
65
66
  else
66
- fail 'Error:' + $?
67
+ raise 'Error:' + $CHILD_STATUS
67
68
  end
68
69
  end
69
70
 
@@ -71,7 +72,7 @@ class PngOptimizer
71
72
  # Dir[".png"] works case sensitive, so to catch all funky .png extensions we have to go the following way:
72
73
  png_relative_paths = []
73
74
  Dir["#{path}/*.*"].each do |file_name|
74
- png_relative_paths << file_name if ends_with?(File.basename(file_name.downcase), ".png")
75
+ png_relative_paths << file_name if ends_with?(File.basename(file_name.downcase), '.png')
75
76
  end
76
77
  png_relative_paths.each do |png_relative_path|
77
78
  optimize_inplace(png_relative_path)
@@ -10,8 +10,8 @@ Example: `geordi rake db:migrate`
10
10
  LONGDESC
11
11
 
12
12
  def rake(*args)
13
- for env in %w(development test cucumber) # update long_desc when changing this
14
- if File.exists? "config/environments/#{env}.rb"
13
+ %w[development test cucumber].each do |env| # update long_desc when changing this
14
+ if File.exist? "config/environments/#{env}.rb"
15
15
  call = %w[bundle exec rake] + args + ["RAILS_ENV=#{env}"]
16
16
  note_cmd call.join(' ')
17
17
 
@@ -6,7 +6,7 @@ def remove_executable_flags
6
6
  *.rb *.html *.erb *.haml *.yml *.css *.sass *.rake *.png *.jpg
7
7
  *.gif *.pdf *.txt *.rdoc *.feature Rakefile VERSION README Capfile
8
8
  ]
9
- for pattern in patterns
9
+ patterns.each do |pattern|
10
10
  note pattern
11
11
  `find . -name "#{pattern}" -exec chmod -x {} ';'`
12
12
  end
@@ -7,15 +7,15 @@ detection, etc.
7
7
  LONGDESC
8
8
 
9
9
  def rspec(*files)
10
- if File.exists?('spec/spec_helper.rb')
10
+ if File.exist?('spec/spec_helper.rb')
11
11
  invoke_cmd 'bundle_install'
12
12
  invoke_cmd 'yarn_install'
13
13
 
14
14
  announce 'Running specs'
15
15
 
16
- if Util.file_containing?('Gemfile', /parallel_tests/) and files.empty?
16
+ if Util.file_containing?('Gemfile', /parallel_tests/) && files.empty?
17
17
  note 'All specs at once (using parallel_tests)'
18
- Util.system! 'bundle exec rake parallel:spec', :fail_message => 'Specs failed.'
18
+ Util.system! 'bundle exec rake parallel:spec', fail_message: 'Specs failed.'
19
19
 
20
20
  else
21
21
  # tell which specs will be run
@@ -27,9 +27,9 @@ def rspec(*files)
27
27
  end
28
28
 
29
29
  command = ['bundle exec']
30
- command << if File.exists?('script/spec')
30
+ command << if File.exist?('script/spec')
31
31
  'spec -c' # RSpec 1
32
- elsif File.exists?('bin/rspec')
32
+ elsif File.exist?('bin/rspec')
33
33
  'bin/rspec'
34
34
  else
35
35
  'rspec'
@@ -38,7 +38,7 @@ def rspec(*files)
38
38
  command << files.join(' ')
39
39
 
40
40
  puts
41
- Util.system! command.join(' '), :fail_message => 'Specs failed.'
41
+ Util.system! command.join(' '), fail_message: 'Specs failed.'
42
42
  end
43
43
  else
44
44
  note 'RSpec not employed.'
@@ -8,16 +8,16 @@ Switches branches, pulls, pushes and deploys as required by our workflow. Tells
8
8
  what it will do before it does it.
9
9
  LONGDESC
10
10
 
11
- def security_update(step='prepare')
11
+ def security_update(step = 'prepare')
12
12
  case step
13
13
  when 'prepare'
14
14
  announce 'Preparing for security update'
15
15
  warn 'Please read https://makandracards.com/makandra/1587 before applying security updates!'
16
16
  note 'About to checkout production and pull'
17
- prompt('Continue?', 'y', /y|yes/) or fail 'Cancelled.'
17
+ prompt('Continue?', 'y', /y|yes/) || raise('Cancelled.')
18
18
 
19
- Util.system! 'git checkout production', :show_cmd => true
20
- Util.system! 'git pull', :show_cmd => true
19
+ Util.system! 'git checkout production', show_cmd: true
20
+ Util.system! 'git pull', show_cmd: true
21
21
 
22
22
  success 'Successfully prepared for security update'
23
23
  puts
@@ -27,20 +27,20 @@ def security_update(step='prepare')
27
27
 
28
28
  when 'f', 'finish'
29
29
  # ensure everything is committed
30
- `git status --porcelain`.empty? or fail('Please commit your changes before finishing the update.')
30
+ `git status --porcelain`.empty? || raise('Please commit your changes before finishing the update.')
31
31
 
32
32
  announce 'Finishing security update'
33
33
  note 'Working directory clean.'
34
- prompt('Have you successfully run all tests?', 'n', /y|yes/) or fail 'Please run tests first.'
34
+ prompt('Have you successfully run all tests?', 'n', /y|yes/) || raise('Please run tests first.')
35
35
 
36
36
  note 'About to: push production, checkout & pull master, merge production, push master'
37
- prompt('Continue?', 'n', /y|yes/) or fail 'Cancelled.'
37
+ prompt('Continue?', 'n', /y|yes/) || raise('Cancelled.')
38
38
 
39
- Util.system! 'git push', :show_cmd => true
40
- Util.system! 'git checkout master', :show_cmd => true
41
- Util.system! 'git pull', :show_cmd => true
42
- Util.system! 'git merge production', :show_cmd => true
43
- Util.system! 'git push', :show_cmd => true
39
+ Util.system! 'git push', show_cmd: true
40
+ Util.system! 'git checkout master', show_cmd: true
41
+ Util.system! 'git pull', show_cmd: true
42
+ Util.system! 'git merge production', show_cmd: true
43
+ Util.system! 'git push', show_cmd: true
44
44
 
45
45
  announce 'Deploying all targets'
46
46
  deploy = (Util.gem_major_version('capistrano') == 3) ? 'deploy' : 'deploy:migrations'
@@ -1,9 +1,9 @@
1
1
  desc 'server [PORT]', 'Start a development server'
2
2
 
3
- option :port, :aliases => '-p', :default => '3000',
4
- :desc => 'Choose a port'
5
- option :public, :aliases => '-P', :type => :boolean,
6
- :desc => 'Make the server accessible in the local network'
3
+ option :port, aliases: '-p', default: '3000',
4
+ desc: 'Choose a port'
5
+ option :public, aliases: '-P', type: :boolean,
6
+ desc: 'Make the server accessible in the local network'
7
7
 
8
8
  def server(port = nil)
9
9
  invoke_cmd 'bundle_install'
@@ -12,7 +12,7 @@ def server(port = nil)
12
12
 
13
13
  announce 'Booting a development server'
14
14
  port ||= options.port
15
- note "URL: http://#{ File.basename(Dir.pwd) }.vcap.me:#{port}"
15
+ note "URL: http://#{File.basename(Dir.pwd)}.vcap.me:#{port}"
16
16
  puts
17
17
 
18
18
  command = Util.server_command
@@ -19,12 +19,12 @@ After setting up, runs all tests when called with the `--test` option:
19
19
  geordi setup -t
20
20
  LONGDESC
21
21
 
22
- option :dump, :type => :string, :aliases => '-d', :banner => 'TARGET',
23
- :desc => 'After setup, dump the TARGET db and source it into the development db'
24
- option :test, :type => :boolean, :aliases => '-t', :desc => 'After setup, run tests'
22
+ option :dump, type: :string, aliases: '-d', banner: 'TARGET',
23
+ desc: 'After setup, dump the TARGET db and source it into the development db'
24
+ option :test, type: :boolean, aliases: '-t', desc: 'After setup, run tests'
25
25
 
26
26
  def setup
27
- if File.exists? 'bin/setup'
27
+ if File.exist? 'bin/setup'
28
28
  announce 'Running bin/setup'
29
29
  note "Geordi's own setup routine is skipped"
30
30
 
@@ -36,6 +36,6 @@ def setup
36
36
 
37
37
  success 'Successfully set up the project.'
38
38
 
39
- invoke_cmd 'dump', options.dump, :load => true if options.dump
39
+ invoke_cmd 'dump', options.dump, load: true if options.dump
40
40
  invoke_cmd 'tests' if options.test
41
41
  end
@@ -7,11 +7,11 @@ Lets you select the server to connect to when called with `--select-server`:
7
7
  geordi shell production -s
8
8
  LONGDESC
9
9
 
10
- option :select_server, :default => false, :type => :boolean, :aliases => '-s'
10
+ option :select_server, default: false, type: :boolean, aliases: '-s'
11
11
 
12
12
  # This method has a triple 'l' because :shell is a Thor reserved word. However,
13
13
  # it can still be called with `geordi shell` :)
14
- def shelll(target, *args)
14
+ def shelll(target, *_args)
15
15
  require 'geordi/remote'
16
16
 
17
17
  announce 'Opening a shell on ' + target
@@ -1,6 +1,6 @@
1
1
  desc 'unit', 'Run Test::Unit'
2
2
  def unit
3
- if File.exists?('test/test_helper.rb')
3
+ if File.exist?('test/test_helper.rb')
4
4
  invoke_cmd 'bundle_install'
5
5
  invoke_cmd 'yarn_install'
6
6
 
@@ -16,18 +16,18 @@ After updating, runs all tests when called with the `--test` option:
16
16
  See `geordi help update` for details.
17
17
  LONGDESC
18
18
 
19
- option :dump, :type => :string, :aliases => '-d', :banner => 'TARGET',
20
- :desc => 'After updating, dump the TARGET db and source it into the development db'
21
- option :test, :type => :boolean, :aliases => '-t', :desc => 'After updating, run tests'
19
+ option :dump, type: :string, aliases: '-d', banner: 'TARGET',
20
+ desc: 'After updating, dump the TARGET db and source it into the development db'
21
+ option :test, type: :boolean, aliases: '-t', desc: 'After updating, run tests'
22
22
 
23
23
  def update
24
24
  announce 'Updating repository'
25
- Util.system! 'git pull', :show_cmd => true
25
+ Util.system! 'git pull', show_cmd: true
26
26
 
27
27
  invoke_cmd 'migrate'
28
28
 
29
29
  success 'Successfully updated the project.'
30
30
 
31
- invoke_cmd 'dump', options.dump, :load => true if options.dump
31
+ invoke_cmd 'dump', options.dump, load: true if options.dump
32
32
  invoke_cmd 'tests' if options.test
33
33
  end
@@ -8,7 +8,7 @@ tests.
8
8
  When called with `--setup`, will guide through the setup of VNC.
9
9
  LONGDESC
10
10
 
11
- option :setup, :type => :boolean
11
+ option :setup, type: :boolean
12
12
 
13
13
  def vnc
14
14
  if options.setup
@@ -1,4 +1,4 @@
1
- desc 'with-rake', 'Run tests with `rake`', :hide => true
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
4
  invoke_cmd 'bundle_install'
@@ -1,7 +1,7 @@
1
- desc 'yarn-install', 'Runs yarn install if required', :hide => true
1
+ desc 'yarn-install', 'Runs yarn install if required', hide: true
2
2
 
3
3
  def yarn_install
4
- if File.exists?('package.json') and !system('yarn check --integrity > /dev/null 2>&1')
4
+ if File.exist?('package.json') && !system('yarn check --integrity > /dev/null 2>&1')
5
5
  announce 'Yarn install'
6
6
  Util.system! 'yarn install'
7
7
  end
@@ -3,18 +3,17 @@ require 'tempfile'
3
3
 
4
4
  # This require-style is to prevent Ruby from loading files of a different
5
5
  # version of Geordi.
6
- require File.expand_path('../interaction', __FILE__)
7
- require File.expand_path('../firefox_for_selenium', __FILE__)
6
+ require File.expand_path('interaction', __dir__)
7
+ require File.expand_path('firefox_for_selenium', __dir__)
8
8
 
9
9
  module Geordi
10
10
  class Cucumber
11
11
  include Geordi::Interaction
12
12
 
13
- VNC_DISPLAY = ':17'
14
- VNC_SERVER_DEFAULT_OPTIONS = '-localhost -nolisten tcp -SecurityTypes None -geometry 1280x1024'
15
- VNC_SERVER_COMMAND = "vncserver #{VNC_DISPLAY} #{ENV.fetch('GEORDI_VNC_OPTIONS', VNC_SERVER_DEFAULT_OPTIONS)}"
16
- VNC_VIEWER_COMMAND = "vncviewer"
17
- VNC_ENV_VARIABLES = %w[DISPLAY BROWSER LAUNCHY_BROWSER]
13
+ VNC_DISPLAY = ':17'.freeze
14
+ VNC_SERVER_COMMAND = "vncserver #{VNC_DISPLAY} -localhost -nolisten tcp -SecurityTypes None -geometry 1280x1024".freeze
15
+ VNC_VIEWER_COMMAND = "vncviewer #{VNC_DISPLAY}".freeze
16
+ VNC_ENV_VARIABLES = %w[DISPLAY BROWSER LAUNCHY_BROWSER].freeze
18
17
 
19
18
  def run(files, cucumber_options, options = {})
20
19
  self.argv = files + cucumber_options.map { |option| option.split('=') }.flatten
@@ -30,21 +29,21 @@ module Geordi
30
29
  system command # Util.system! would reset the Firefox PATH
31
30
  end
32
31
 
33
- def launch_vnc_viewer(source = VNC_DISPLAY)
34
- fork {
32
+ def launch_vnc_viewer
33
+ fork do
35
34
  error = capture_stderr do
36
- system(VNC_VIEWER_COMMAND, source)
35
+ system(VNC_VIEWER_COMMAND)
37
36
  end
38
- unless $?.success?
39
- if $?.exitstatus == 127
40
- fail 'VNC viewer not found. Install it with `geordi vnc --setup`.'
37
+ unless $CHILD_STATUS.success?
38
+ if $CHILD_STATUS.exitstatus == 127
39
+ raise 'VNC viewer not found. Install it with `geordi vnc --setup`.'
41
40
  else
42
41
  note 'VNC viewer could not be opened:'
43
42
  puts error
44
43
  puts
45
44
  end
46
45
  end
47
- }
46
+ end
48
47
  end
49
48
 
50
49
  def restore_env
@@ -58,8 +57,8 @@ module Geordi
58
57
  VNC_ENV_VARIABLES.each do |variable|
59
58
  ENV["OUTER_#{variable}"] = ENV[variable] if ENV[variable]
60
59
  end
61
- ENV["BROWSER"] = ENV["LAUNCHY_BROWSER"] = File.expand_path('../../../bin/launchy_browser', __FILE__)
62
- ENV["DISPLAY"] = VNC_DISPLAY
60
+ ENV['BROWSER'] = ENV['LAUNCHY_BROWSER'] = File.expand_path('../../bin/launchy_browser', __dir__)
61
+ ENV['DISPLAY'] = VNC_DISPLAY
63
62
 
64
63
  note 'Run `geordi vnc` to view the Selenium test browsers'
65
64
  end
@@ -74,7 +73,7 @@ module Geordi
74
73
  unless argv.include?('--format') || argv.include?('-f')
75
74
  format_args = spinner_available? ? ['--format', 'CucumberSpinner::CuriousProgressBarFormatter'] : ['--format', 'progress']
76
75
  end
77
- [use_firefox_for_selenium, "b", "cucumber", format_args, escape_shell_args(argv)].flatten.compact.join(" ")
76
+ [use_firefox_for_selenium, 'b', 'cucumber', format_args, escape_shell_args(argv)].flatten.compact.join(' ')
78
77
  end
79
78
 
80
79
  def parallel_execution_command
@@ -88,8 +87,8 @@ module Geordi
88
87
  [
89
88
  use_firefox_for_selenium,
90
89
  'b parallel_test -t ' + type_arg,
91
- %(-o '#{ command_line_options.join(' ') } --tags "#{not_tag('@solo')}"'),
92
- "-- #{ features.join(' ') }"
90
+ %(-o '#{command_line_options.join(' ')} --tags "#{not_tag('@solo')}"'),
91
+ "-- #{features.join(' ')}",
93
92
  ].compact.join(' ')
94
93
  end
95
94
 
@@ -110,7 +109,7 @@ module Geordi
110
109
 
111
110
  def escape_shell_args(*args)
112
111
  args.flatten.collect do |arg|
113
- arg.gsub(/([\\ "])/) { |match| "\\#{$1}" }
112
+ arg.gsub(/([\\ "])/) { |_match| "\\#{Regexp.last_match(1)}" }
114
113
  end
115
114
  end
116
115
 
@@ -138,8 +137,8 @@ module Geordi
138
137
 
139
138
  def rerun_txt_features
140
139
  @rerun_txt_features ||= begin
141
- if File.exists?("rerun.txt")
142
- IO.read("rerun.txt").to_s.strip.split(/\s+/)
140
+ if File.exist?('rerun.txt')
141
+ IO.read('rerun.txt').to_s.strip.split(/\s+/)
143
142
  else
144
143
  []
145
144
  end
@@ -151,7 +150,7 @@ module Geordi
151
150
  end
152
151
 
153
152
  def command_line_options
154
- @command_line_options ||= Array.new.tap do |args|
153
+ @command_line_options ||= [].tap do |args|
155
154
  # Sorry for this mess. Option parsing doesn't get much prettier.
156
155
  argv.each_cons(2) do |a, b|
157
156
  break if a == '--' # This is the common no-options-beyond marker
@@ -172,7 +171,7 @@ module Geordi
172
171
  end
173
172
 
174
173
  def consolidate_rerun_txt_files
175
- parallel_rerun_files = Dir.glob("parallel_rerun*.txt")
174
+ parallel_rerun_files = Dir.glob('parallel_rerun*.txt')
176
175
  unless parallel_rerun_files.empty?
177
176
  note 'Consolidating parallel_rerun.txt files ...'
178
177
 
@@ -182,8 +181,8 @@ module Geordi
182
181
  File.unlink(filename)
183
182
  end
184
183
 
185
- File.open("rerun.txt", "w") do |f|
186
- f.puts(rerun_content.join(" "))
184
+ File.open('rerun.txt', 'w') do |f|
185
+ f.puts(rerun_content.join(' '))
187
186
  end
188
187
  end
189
188
  end
@@ -191,14 +190,14 @@ module Geordi
191
190
  def find_all_features_recursively(files_or_dirs)
192
191
  Array(files_or_dirs).map do |file_or_dir|
193
192
  if File.directory?(file_or_dir)
194
- file_or_dir = Dir.glob(File.join(file_or_dir, "**", "*.feature"))
193
+ file_or_dir = Dir.glob(File.join(file_or_dir, '**', '*.feature'))
195
194
  end
196
195
  file_or_dir
197
196
  end.flatten.uniq.compact
198
197
  end
199
198
 
200
199
  def spinner_available?
201
- @spinner_available ||= File.exists?('Gemfile') && File.open('Gemfile').read.scan(/cucumber_spinner/).any?
200
+ @spinner_available ||= File.exist?('Gemfile') && File.open('Gemfile').read.scan(/cucumber_spinner/).any?
202
201
  end
203
202
 
204
203
  def use_parallel_tests?(options)
@@ -210,7 +209,7 @@ module Geordi
210
209
 
211
210
  def try_and_start_vnc
212
211
  # check if vnc is already running
213
- #return true if vnc_server_running?
212
+ # return true if vnc_server_running?
214
213
  error = capture_stderr do
215
214
  system(VNC_SERVER_COMMAND)
216
215
  end