geordi 2.12.3 → 3.0.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.
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
data/lib/geordi/cli.rb CHANGED
@@ -5,11 +5,6 @@ require 'geordi/util'
5
5
 
6
6
  module Geordi
7
7
  class CLI < Thor
8
-
9
- if Geordi::Util.ruby_version <= Gem::Version.new('2.0.0')
10
- warn "Deprecation warning: Ruby 1.8.7 and 1.9.3 support will be dropped in Geordi 3.x."
11
- end
12
-
13
8
  include Geordi::Interaction
14
9
 
15
10
  def self.exit_on_failure?
@@ -17,7 +12,7 @@ module Geordi
17
12
  end
18
13
 
19
14
  # load all tasks defined in lib/geordi/commands
20
- Dir[File.expand_path '../commands/*.rb', __FILE__].each do |file|
15
+ Dir[File.expand_path 'commands/*.rb', __dir__].each do |file|
21
16
  class_eval File.read(file), file
22
17
  end
23
18
 
@@ -1,4 +1,4 @@
1
- desc '-setup-vnc', 'Setup VNC for running Selenium tests there', :hide => true
1
+ desc '-setup-vnc', 'Setup VNC for running Selenium tests there', hide: true
2
2
  def _setup_vnc
3
3
  `clear`
4
4
 
@@ -10,13 +10,13 @@ def apache_site(*args)
10
10
  puts 'Please call: apache-site my-site'
11
11
  puts
12
12
  puts 'Available sites:'
13
- Dir.new(".").each do |file|
13
+ Dir.new('.').each do |file|
14
14
  puts "- #{file}" if file != '.' && file != '..'
15
15
  end
16
16
  exit
17
17
  end
18
18
 
19
- has_default = File.exists?('default')
20
- exec "sudo a2dissite \*; sudo a2ensite #{"default " if has_default}#{site} && sudo apache2ctl restart"
19
+ has_default = File.exist?('default')
20
+ exec "sudo a2dissite \*; sudo a2ensite #{'default ' if has_default}#{site} && sudo apache2ctl restart"
21
21
  Dir.chdir old_cwd
22
22
  end
@@ -1,6 +1,6 @@
1
- desc 'bundle-install', 'Run bundle install if required', :hide => true
1
+ desc 'bundle-install', 'Run bundle install if required', hide: true
2
2
  def bundle_install
3
- if File.exists?('Gemfile') and !system('bundle check > /dev/null 2>&1')
3
+ if File.exist?('Gemfile') && !system('bundle check > /dev/null 2>&1')
4
4
  announce 'Bundling'
5
5
  Util.system! 'bundle install'
6
6
  end
@@ -8,7 +8,7 @@ def capistrano(*args)
8
8
 
9
9
  note 'Found the following deploy targets:'
10
10
  puts targets
11
- prompt('Continue?', 'n', /y|yes/) or fail 'Cancelled.'
11
+ prompt('Continue?', 'n', /y|yes/) || raise('Cancelled.')
12
12
 
13
13
  targets << nil if targets.empty? # default target
14
14
  targets.each do |stage|
@@ -17,7 +17,6 @@ def capistrano(*args)
17
17
  command = "bundle exec cap #{stage} " + args.join(' ')
18
18
  note_cmd command
19
19
 
20
- Util.system!(command, :fail_message => 'Capistrano failed. Have a look!')
20
+ Util.system!(command, fail_message: 'Capistrano failed. Have a look!')
21
21
  end
22
-
23
22
  end
@@ -9,14 +9,5 @@ LONGDESC
9
9
  def chromedriver_update
10
10
  require 'geordi/chromedriver_updater'
11
11
 
12
- # Ruby 1.9.3 introduces #capture3 in open3
13
- supported_ruby_version = '1.9.2'
14
-
15
- # We do not want to backport this command to Ruby 1.8.7, a user can just use a newer Ruby version to run it. For all
16
- # other commands it still is necessary to have a proper Ruby 1.8.7 support.
17
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new(supported_ruby_version)
18
- raise("Unsupported ruby version #{RUBY_VERSION}, please use at least #{supported_ruby_version} to run this command!")
19
- end
20
-
21
12
  ChromedriverUpdater.new.run
22
13
  end
@@ -1,16 +1,14 @@
1
1
  desc 'clean', 'Remove unneeded files from the current directory'
2
2
  def clean
3
-
4
3
  announce 'Removing tempfiles'
5
- for pattern in %w[ webrat-* capybara-* tmp/webrat-* tmp/capybara-* tmp/rtex/* log/*.log ]
4
+ %w[webrat-* capybara-* tmp/webrat-* tmp/capybara-* tmp/rtex/* log/*.log].each do |pattern|
6
5
  note pattern
7
6
  puts `rm -vfR #{pattern}`
8
7
  end
9
8
 
10
9
  announce 'Finding recursively and removing backup files'
11
- for pattern in %w[ *~ ]
10
+ %w[*~].each do |pattern|
12
11
  note pattern
13
12
  `find . -name #{pattern} -exec rm {} ';'`
14
13
  end
15
-
16
14
  end
@@ -21,4 +21,3 @@ Unsupported Ruby Version #{RUBY_VERSION}. `geordi commit` requires Ruby 2.1+.
21
21
 
22
22
  Gitpt.new.run(git_args)
23
23
  end
24
-
@@ -6,9 +6,9 @@ Open a Rails console on `staging`: `geordi console staging`
6
6
  LONGDESC
7
7
 
8
8
 
9
- option :select_server, :default => false, :type => :boolean, :aliases => '-s'
9
+ option :select_server, default: false, type: :boolean, aliases: '-s'
10
10
 
11
- def console(target = 'development', *args)
11
+ def console(target = 'development', *_args)
12
12
  require 'geordi/remote'
13
13
 
14
14
  if target == 'development'
@@ -1,9 +1,9 @@
1
- desc 'create-database-yml', '[sic]', :hide => true
1
+ desc 'create-database-yml', '[sic]', hide: true
2
2
  def create_database_yml
3
3
  real_yml = 'config/database.yml'
4
4
  sample_yml = 'config/database.sample.yml'
5
5
 
6
- if File.exists?(sample_yml) and not File.exists?(real_yml)
6
+ if File.exist?(sample_yml) && !File.exist?(real_yml)
7
7
  announce 'Creating ' + real_yml
8
8
 
9
9
  sample = File.read(sample_yml)
@@ -1,11 +1,11 @@
1
- desc 'create-databases', 'Create all databases', :hide => true
1
+ desc 'create-databases', 'Create all databases', hide: true
2
2
  def create_databases
3
3
  invoke_cmd 'create_database_yml'
4
4
  invoke_cmd 'bundle_install'
5
5
 
6
6
  announce 'Creating databases'
7
7
 
8
- if File.exists?('config/database.yml')
8
+ if File.exist?('config/database.yml')
9
9
  command = 'bundle exec rake db:create:all'
10
10
  command << ' parallel:create' if Util.file_containing?('Gemfile', /parallel_tests/)
11
11
 
@@ -17,30 +17,30 @@ or `-d`.
17
17
  e.g. `--format pretty`.
18
18
  LONGDESC
19
19
 
20
- option :modified, :aliases => '-m', :type => :boolean,
21
- :desc => 'Run all modified features'
22
- option :containing, :aliases => '-c', :banner => 'STRING',
23
- :desc => 'Run all features that contain STRING'
24
- option :verbose, :aliases => '-v', :type => :boolean,
25
- :desc => 'Print the testrun command'
26
- option :debug, :aliases => '-d', :type => :boolean,
27
- :desc => 'Run with `-f pretty -b` which helps hunting down bugs'
28
- option :rerun, :aliases => '-r', :type => :numeric, :default => 0,
29
- :desc => 'Rerun features up to N times while failing'
20
+ option :modified, aliases: '-m', type: :boolean,
21
+ desc: 'Run all modified features'
22
+ option :containing, aliases: '-c', banner: 'STRING',
23
+ desc: 'Run all features that contain STRING'
24
+ option :verbose, aliases: '-v', type: :boolean,
25
+ desc: 'Print the testrun command'
26
+ option :debug, aliases: '-d', type: :boolean,
27
+ desc: 'Run with `-f pretty -b` which helps hunting down bugs'
28
+ option :rerun, aliases: '-r', type: :numeric, default: 0,
29
+ desc: 'Rerun features up to N times while failing'
30
30
 
31
31
  def cucumber(*args)
32
32
  if args.empty?
33
33
  # This is not testable as there is no way to stub `git` :(
34
34
  if options.modified?
35
- modified_features = `git status --short`.split($/).map do |line|
35
+ modified_features = `git status --short`.split($INPUT_RECORD_SEPARATOR).map do |line|
36
36
  indicators = line.slice!(0..2) # Remove leading indicators
37
- line if line.include?('.feature') and not indicators.include?('D')
37
+ line if line.include?('.feature') && indicators.exclude?('D')
38
38
  end.compact
39
39
  args = modified_features
40
40
  end
41
41
 
42
42
  if options.containing
43
- matching_features = `grep -lri '#{options.containing}' --include=*.feature features/`.split($/)
43
+ matching_features = `grep -lri '#{options.containing}' --include=*.feature features/`.split($INPUT_RECORD_SEPARATOR)
44
44
  args = matching_features.uniq
45
45
  end
46
46
  end
@@ -64,31 +64,31 @@ def cucumber(*args)
64
64
  files.join(' ')
65
65
  end
66
66
 
67
- solo_tag_usages = `grep -r '@solo' #{ solo_files }`.split("\n")
67
+ solo_tag_usages = `grep -r '@solo' #{solo_files}`.split("\n")
68
68
 
69
69
  if solo_tag_usages.any?
70
70
  solo_cmd_opts = cmd_opts.dup
71
71
  solo_cmd_opts << '--tags' << '@solo'
72
72
 
73
73
  announce 'Running @solo features'
74
- solo_success = Geordi::Cucumber.new.run files, solo_cmd_opts, :verbose => options.verbose, :parallel => false
75
- solo_success or fail 'Features failed.'
74
+ solo_success = Geordi::Cucumber.new.run files, solo_cmd_opts, verbose: options.verbose, parallel: false
75
+ solo_success || raise('Features failed.')
76
76
  end
77
77
  end
78
78
 
79
79
  # Parallel run of all given features + reruns ##############################
80
80
  announce 'Running features'
81
- normal_run_successful = Geordi::Cucumber.new.run(files, cmd_opts, :verbose => options.verbose)
81
+ normal_run_successful = Geordi::Cucumber.new.run(files, cmd_opts, verbose: options.verbose)
82
82
 
83
83
  unless normal_run_successful
84
84
  cmd_opts << '--profile' << 'rerun'
85
85
 
86
86
  # Reruns
87
87
  (options.rerun + 1).times do |i|
88
- fail 'Features failed.' if (i == options.rerun) # All reruns done?
88
+ raise 'Features failed.' if i == options.rerun # All reruns done?
89
89
 
90
- announce "Rerun ##{ i + 1 } of #{ options.rerun }"
91
- break if Geordi::Cucumber.new.run([], cmd_opts, :verbose => options.verbose, :parallel => false)
90
+ announce "Rerun ##{i + 1} of #{options.rerun}"
91
+ break if Geordi::Cucumber.new.run([], cmd_opts, verbose: options.verbose, parallel: false)
92
92
  end
93
93
  end
94
94
 
@@ -12,22 +12,22 @@ LONGDESC
12
12
 
13
13
  def delete_dumps(dump_directory = nil)
14
14
  deletable_dumps = []
15
- if dump_directory.nil?
16
- dump_directories = [
15
+ dump_directories = if dump_directory.nil?
16
+ [
17
17
  File.join(Dir.home, 'dumps'),
18
- Dir.pwd
18
+ Dir.pwd,
19
19
  ]
20
20
  else
21
- dump_directories = [dump_directory]
21
+ [dump_directory]
22
22
  end
23
23
  announce 'Looking for *.dump in ' << dump_directories.join(',')
24
24
  dump_directories.each do |d|
25
- d2 = File.expand_path(d)
26
- unless File.directory? File.realdirpath(d2)
27
- warn "Directory #{d2} does not exist"
25
+ d_2 = File.expand_path(d)
26
+ unless File.directory? File.realdirpath(d_2)
27
+ warn "Directory #{d_2} does not exist"
28
28
  next
29
29
  end
30
- deletable_dumps.concat(Dir.glob("#{d2}/**/*.dump"))
30
+ deletable_dumps.concat(Dir.glob("#{d_2}/**/*.dump"))
31
31
  end
32
32
  if deletable_dumps.empty?
33
33
  success 'No dumps to delete' if deletable_dumps.empty?
@@ -37,7 +37,7 @@ def delete_dumps(dump_directory = nil)
37
37
  note 'The following dumps can be deleted:'
38
38
  puts
39
39
  puts deletable_dumps
40
- prompt 'Delete those dumps', 'n', /y|yes/ or fail 'Cancelled.'
40
+ prompt('Delete those dumps', 'n', /y|yes/) || raise('Cancelled.')
41
41
  deletable_dumps.each do |dump|
42
42
  File.delete dump unless File.directory? dump
43
43
  end
@@ -30,15 +30,15 @@ instead of `cap deploy:migrations`. You can force using `deploy` by passing the
30
30
  -M option: `geordi deploy -M staging`.
31
31
  LONGDESC
32
32
 
33
- option :no_migrations, :aliases => '-M', :type => :boolean,
34
- :desc => 'Run cap deploy instead of cap deploy:migrations'
35
- option :current_branch, :aliases => '-c', :type => :boolean,
36
- :desc => 'Set DEPLOY_BRANCH to the current branch during deploy'
33
+ option :no_migrations, aliases: '-M', type: :boolean,
34
+ desc: 'Run cap deploy instead of cap deploy:migrations'
35
+ option :current_branch, aliases: '-c', type: :boolean,
36
+ desc: 'Set DEPLOY_BRANCH to the current branch during deploy'
37
37
 
38
38
  def deploy(target_stage = nil)
39
39
  # Set/Infer default values
40
- branch_stage_map = { 'master' => 'staging', 'production' => 'production'}
41
- if target_stage and not Util.deploy_targets.include? target_stage
40
+ branch_stage_map = { 'master' => 'staging', 'production' => 'production' }
41
+ if target_stage && (Util.deploy_targets.exclude? target_stage)
42
42
  # Target stage autocompletion from available stages
43
43
  target_stage = Util.deploy_targets.find { |t| t.start_with? target_stage }
44
44
  target_stage || warn('Given deployment stage not found')
@@ -48,7 +48,7 @@ def deploy(target_stage = nil)
48
48
  target_stage ||= prompt 'Deployment stage:', branch_stage_map.fetch(Util.current_branch, 'staging')
49
49
  if options.current_branch
50
50
  stage_file = "config/deploy/#{target_stage}.rb"
51
- Util.file_containing? stage_file, 'DEPLOY_BRANCH' or fail <<-ERROR
51
+ Util.file_containing?(stage_file, 'DEPLOY_BRANCH') || raise(<<-ERROR)
52
52
  To deploy from the current branch, configure #{stage_file} to respect the
53
53
  environment variable DEPLOY_BRANCH. Example:
54
54
 
@@ -67,9 +67,9 @@ set :branch, ENV['DEPLOY_BRANCH'] || 'master'
67
67
 
68
68
  announce "Checking whether your #{source_branch} branch is ready" ############
69
69
  Util.system! "git checkout #{source_branch}"
70
- if `git status -s | wc -l`.strip != '0' and not Util.testing?
70
+ if (`git status -s | wc -l`.strip != '0') && !Util.testing?
71
71
  warn "Your #{source_branch} branch holds uncommitted changes."
72
- prompt('Continue anyway?', 'n', /y|yes/) or fail 'Cancelled.'
72
+ prompt('Continue anyway?', 'n', /y|yes/) || raise('Cancelled.')
73
73
  else
74
74
  note 'All good.'
75
75
  end
@@ -100,17 +100,16 @@ set :branch, ENV['DEPLOY_BRANCH'] || 'master'
100
100
  capistrano_call = "DEPLOY_BRANCH=#{source_branch} #{capistrano_call}" if options.current_branch
101
101
 
102
102
  if git_call.any?
103
- Util.system! git_call.join(' && '), :show_cmd => true
103
+ Util.system! git_call.join(' && '), show_cmd: true
104
104
  end
105
105
 
106
106
  invoke_cmd 'bundle_install'
107
107
 
108
- Util.system! capistrano_call, :show_cmd => true
108
+ Util.system! capistrano_call, show_cmd: true
109
109
 
110
110
  success 'Deployment complete.'
111
111
  else
112
112
  Util.system! "git checkout #{source_branch}"
113
- fail 'Deployment cancelled.'
113
+ raise 'Deployment cancelled.'
114
114
  end
115
-
116
115
  end
@@ -17,18 +17,18 @@ Geordi will ask for confirmation before actually dropping databases and will
17
17
  offer to edit the whitelist instead.
18
18
  LONGDESC
19
19
 
20
- option :postgres_only, :aliases => '-P', :type => :boolean,
21
- :desc => 'Only clean Postgres', :default => false
22
- option :mysql_only, :aliases => '-M', :type => :boolean,
23
- :desc => 'Only clean MySQL/MariaDB', :default => false
24
- option :postgres, :banner => 'PORT_OR_SOCKET',
25
- :desc => 'Use Postgres port or socket'
26
- option :mysql, :banner => 'PORT_OR_SOCKET',
27
- :desc => 'Use MySQL/MariaDB port or socket'
20
+ option :postgres_only, aliases: '-P', type: :boolean,
21
+ desc: 'Only clean Postgres', default: false
22
+ option :mysql_only, aliases: '-M', type: :boolean,
23
+ desc: 'Only clean MySQL/MariaDB', default: false
24
+ option :postgres, banner: 'PORT_OR_SOCKET',
25
+ desc: 'Use Postgres port or socket'
26
+ option :mysql, banner: 'PORT_OR_SOCKET',
27
+ desc: 'Use MySQL/MariaDB port or socket'
28
28
 
29
29
  def drop_databases
30
30
  require 'geordi/db_cleaner'
31
- fail '-P and -M are mutually exclusive' if options.postgres_only and options.mysql_only
31
+ raise '-P and -M are mutually exclusive' if options.postgres_only && options.mysql_only
32
32
  mysql_flags = nil
33
33
  postgres_flags = nil
34
34
 
@@ -38,7 +38,7 @@ def drop_databases
38
38
  mysql_flags = "--port=#{mysql_port} --protocol=TCP"
39
39
  rescue AttributeError
40
40
  unless File.exist? options.mysql
41
- fail "Path #{options.mysql} is not a valid MySQL socket"
41
+ raise "Path #{options.mysql} is not a valid MySQL socket"
42
42
  end
43
43
  mysql_flags = "--socket=#{options.mysql}"
44
44
  end
@@ -48,13 +48,11 @@ def drop_databases
48
48
  postgres_flags = "--port=#{options.postgres}"
49
49
  end
50
50
 
51
- extra_flags = {'mysql' => mysql_flags,
52
- 'postgres' => postgres_flags
53
- }
51
+ extra_flags = { 'mysql' => mysql_flags,
52
+ 'postgres' => postgres_flags }
54
53
  cleaner = DBCleaner.new(extra_flags)
55
54
  cleaner.clean_mysql unless options.postgres_only
56
55
  cleaner.clean_postgres unless options.mysql_only
57
56
 
58
57
  success 'Done.'
59
58
  end
60
-
@@ -20,18 +20,18 @@ dump into the development database after downloading it.
20
20
  geordi dump staging -l
21
21
  DESC
22
22
 
23
- option :load, :aliases => ['-l'], :type => :string, :desc => 'Load a dump'
24
- option :select_server, :default => false, :type => :boolean, :aliases => '-s'
23
+ option :load, aliases: ['-l'], type: :string, desc: 'Load a dump'
24
+ option :select_server, default: false, type: :boolean, aliases: '-s'
25
25
 
26
- def dump(target = nil, *args)
26
+ def dump(target = nil, *_args)
27
27
  require 'geordi/dump_loader'
28
28
  require 'geordi/remote'
29
29
 
30
30
  if target.nil?
31
31
  if options.load
32
32
  # validate load option
33
- fail 'Missing a dump file.' if options.load == 'load'
34
- File.exists?(options.load) or fail 'Could not find the given dump file: ' + options.load
33
+ raise 'Missing a dump file.' if options.load == 'load'
34
+ File.exist?(options.load) || raise('Could not find the given dump file: ' + options.load)
35
35
 
36
36
  loader = DumpLoader.new(options.load)
37
37
 
@@ -59,5 +59,4 @@ def dump(target = nil, *args)
59
59
  success "Your #{loader.config['database']} database has now the data of #{target}."
60
60
  end
61
61
  end
62
-
63
62
  end
@@ -1,4 +1,4 @@
1
- desc 'eurest', 'Open the current Eurest cantina menu', :hide => true
1
+ desc 'eurest', 'Open the current Eurest cantina menu', hide: true
2
2
  def eurest
3
- Util.system! %{file="Speiseplan_KW`date +%V`.pdf" && wget -O/tmp/$file http://www.eurest-extranet.de/eurest/export/sites/default/sigma-technopark/de/downloads/$file && xdg-open /tmp/$file}
3
+ Util.system! %(file="Speiseplan_KW`date +%V`.pdf" && wget -O/tmp/$file http://www.eurest-extranet.de/eurest/export/sites/default/sigma-technopark/de/downloads/$file && xdg-open /tmp/$file)
4
4
  end
@@ -10,12 +10,12 @@ Useful when you need Firefox for Selenium or the VNC set up, but can't use the
10
10
  This command is aliased `chrome` for users running Selenium in Chrome.
11
11
  LONGDESC
12
12
 
13
- option :setup, :banner => 'FIREFOX_VERSION',
14
- :desc => 'Install a special test runner Firefox with the given version'
13
+ option :setup, banner: 'FIREFOX_VERSION',
14
+ desc: 'Install a special test runner Firefox with the given version'
15
15
 
16
16
  def firefox(*command)
17
17
  if options.setup
18
- fail 'Firefox version required (e.g. --setup 24.0)' if options.setup == 'setup'
18
+ raise 'Firefox version required (e.g. --setup 24.0)' if options.setup == 'setup'
19
19
 
20
20
  require 'geordi/firefox_for_selenium'
21
21
  Geordi::FirefoxForSelenium.install(options.setup)