aruba 0.14.8 → 0.14.9

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.
@@ -16,7 +16,6 @@ require 'aruba/api/environment'
16
16
  require 'aruba/api/filesystem'
17
17
  require 'aruba/api/text'
18
18
  require 'aruba/api/bundler'
19
- require 'aruba/api/rvm'
20
19
 
21
20
  Aruba.platform.require_matching_files('../matchers/**/*.rb', __FILE__)
22
21
 
@@ -29,7 +28,6 @@ module Aruba
29
28
  include Aruba::Api::Environment
30
29
  include Aruba::Api::Filesystem
31
30
  include Aruba::Api::Bundler
32
- include Aruba::Api::Rvm
33
31
  include Aruba::Api::Deprecated
34
32
  include Aruba::Api::Text
35
33
  end
@@ -61,7 +61,7 @@ module Aruba
61
61
 
62
62
  Aruba.platform.chdir File.join(aruba.root_directory, aruba.current_directory)
63
63
 
64
- result = Aruba.platform.with_environment(
64
+ result = with_environment(
65
65
  'OLDPWD' => old_dir,
66
66
  'PWD' => File.expand_path(File.join(aruba.root_directory, aruba.current_directory)),
67
67
  &block
@@ -13,8 +13,13 @@ module Aruba
13
13
  # @return [Array]
14
14
  # The directory path: Each subdirectory is a member of an array
15
15
  def dirs
16
- Aruba.platform.deprecated('The use of "@dirs" is deprecated. Use "Aruba.configure { |c| c.current_directory = \'path/to/dir\' }" instead to set the "current_directory') if defined? @dirs
17
- Aruba.platform.deprecated('The use of "dirs" deprecated. Use "Aruba.configure { |c| c.current_directory = \'path/to/dir\' }" instead to set the "current_directory and "expand_path(".")" to get the current directory or use "#cd(\'.\') { # your code }" to run code in the current directory')
16
+ Aruba.platform.deprecated(
17
+ 'The use of "dirs" is deprecated.' \
18
+ ' Use "Aruba.configure { |c| c.current_directory = \'path/to/dir\' }"' \
19
+ ' instead to set the current directory and "expand_path(".")" to get' \
20
+ ' the current directory or use "#cd(\'.\') { # your code }" to run' \
21
+ ' code in the current directory'
22
+ )
18
23
 
19
24
  @dirs ||= aruba.current_directory
20
25
  end
@@ -25,7 +30,11 @@ module Aruba
25
30
  # @return
26
31
  # Current directory
27
32
  def current_directory
28
- Aruba.platform.deprecated(%(The use of "current_directory" deprecated. Use "expand_path(".")" to get the current directory or "#cd" to run code in the current directory. #{caller.first}))
33
+ Aruba.platform.deprecated(
34
+ 'The use of "current_directory" is deprecated.' \
35
+ ' Use "expand_path(".")" to get the current directory or "#cd" to run' \
36
+ ' code in the current directory.'
37
+ )
29
38
 
30
39
  aruba.current_directory.to_s
31
40
  end
@@ -33,7 +42,11 @@ module Aruba
33
42
  # @deprecated
34
43
  # Clean the current directory
35
44
  def clean_current_directory
36
- Aruba.platform.deprecated('The use of "clean_current_directory" is deprecated. Either use "#setup_aruba" or `#remove(\'.\') to clean up aruba\'s working directory before your tests are run')
45
+ Aruba.platform.deprecated(
46
+ 'The use of "clean_current_directory" is deprecated.' \
47
+ ' Either use "#setup_aruba" or "#remove(\'.\')" to clean up Aruba\'s' \
48
+ ' working directory before your tests are run'
49
+ )
37
50
 
38
51
  setup_aruba
39
52
  end
@@ -44,7 +57,11 @@ module Aruba
44
57
  # @yield
45
58
  # The block which should be run in current directory
46
59
  def in_current_directory(&block)
47
- Aruba.platform.deprecated('The use of "in_current_directory" deprecated. Use "#cd(\'.\') { # your code }" instead. But be aware, `cd` requires a previously created directory')
60
+ Aruba.platform.deprecated(
61
+ 'The use of "in_current_directory" is deprecated.' \
62
+ ' Use "#cd(\'.\') { # your code }" instead. But be aware,' \
63
+ ' "cd" requires a previously created directory'
64
+ )
48
65
 
49
66
  create_directory '.' unless directory?('.')
50
67
  cd('.', &block)
@@ -73,21 +90,31 @@ module Aruba
73
90
 
74
91
  # @deprecated
75
92
  def absolute_path(*args)
76
- Aruba.platform.deprecated('The use of "absolute_path" is deprecated. Use "expand_path" instead. But be aware that "expand_path" uses a different implementation')
93
+ Aruba.platform.deprecated(
94
+ 'The use of "absolute_path" is deprecated.' \
95
+ ' Use "expand_path" instead.' \
96
+ ' But be aware that "expand_path" uses a different implementation'
97
+ )
77
98
 
78
99
  File.expand_path File.join(*args), aruba.current_directory
79
100
  end
80
101
 
81
102
  # @deprecated
82
103
  def _read_interactive
83
- Aruba.platform.deprecated('The use of "#_read_interactive" is deprecated. Please use "last_command_started.stdout" instead')
104
+ Aruba.platform.deprecated(
105
+ 'The use of "#_read_interactive" is deprecated.' \
106
+ ' Use "last_command_started.stdout" instead'
107
+ )
84
108
 
85
109
  last_command_started.stdout
86
110
  end
87
111
 
88
112
  # @deprecated
89
113
  def announce_or_puts(msg)
90
- Aruba.platform.deprecated('The use of "#announce_or_puts" is deprecated. Please use "#announcer.mode = :kernel" or "#announcer.mode = :puts" instead')
114
+ Aruba.platform.deprecated(
115
+ 'The use of "#announce_or_puts" is deprecated.' \
116
+ ' Use "#announcer.mode = :kernel" or "#announcer.mode = :puts" instead'
117
+ )
91
118
 
92
119
  if(@puts)
93
120
  Kernel.puts(msg)
@@ -98,14 +125,20 @@ module Aruba
98
125
 
99
126
  # @deprecated
100
127
  def _write_interactive(input)
101
- Aruba.platform.deprecated('The use of "#_write_interactive" is deprecated. Please use "#last_command_started.write()" instead')
128
+ Aruba.platform.deprecated(
129
+ 'The use of "#_write_interactive" is deprecated.' \
130
+ ' Use "#last_command_started.write()" instead'
131
+ )
102
132
 
103
133
  last_command_started.write(input)
104
134
  end
105
135
 
106
136
  # @deprecated
107
137
  def eot
108
- Aruba.platform.deprecated(%{\e[35m The \"#eot\"-method is deprecated. It will be deleted with the next major version. Please use \"#close_input\"-method instead.\e[0m})
138
+ Aruba.platform.deprecated(
139
+ 'The use of "#eot" is deprecated.' \
140
+ ' Use "#close_input" instead.'
141
+ )
109
142
 
110
143
  close_input
111
144
  end
@@ -118,7 +151,10 @@ module Aruba
118
151
  # @see #cmd
119
152
  # @deprecated
120
153
  def run_interactive(cmd)
121
- Aruba.platform.deprecated('The use of "#run_interactive" is deprecated. You can simply use "run_command" instead')
154
+ Aruba.platform.deprecated(
155
+ 'The use of "#run_interactive" is deprecated.' \
156
+ ' Use "run_command" instead'
157
+ )
122
158
 
123
159
  run_command(cmd)
124
160
  end
@@ -150,7 +186,9 @@ module Aruba
150
186
  # @deprecated
151
187
  def run(*args)
152
188
  Aruba.platform.deprecated(
153
- 'The use of "#run" is deprecated. Use "run_command" instead')
189
+ 'The use of "#run" is deprecated.' \
190
+ ' Use "run_command" instead'
191
+ )
154
192
 
155
193
  run_command(*args)
156
194
  end
@@ -175,30 +213,35 @@ module Aruba
175
213
  # @option [Integer] io_wait_timeout
176
214
  # Timeout for IO - STDERR, STDOUT
177
215
  #
178
- # rubocop:disable Metrics/CyclomaticComplexity
179
- # rubocop:disable Metrics/MethodLength
180
216
  def run_simple(*args)
181
217
  Aruba.platform.deprecated(
182
- 'The use of "#run_simple" is deprecated. Use "run_command_and_stop" instead')
218
+ 'The use of "#run_simple" is deprecated.' \
219
+ ' Use "run_command_and_stop" instead'
220
+ )
183
221
 
184
222
  run_command_and_stop(*args)
185
223
  end
186
224
 
187
-
188
225
  # @deprecated
189
226
  # Create an empty file
190
227
  #
191
228
  # @param [String] file_name
192
229
  # The name of the file
193
230
  def touch_file(*args)
194
- Aruba.platform.deprecated('The use of "#touch_file" is deprecated. Use "#touch" instead')
231
+ Aruba.platform.deprecated(
232
+ 'The use of "#touch_file" is deprecated.' \
233
+ ' Use "#touch" instead'
234
+ )
195
235
 
196
236
  touch(*args)
197
237
  end
198
238
 
199
239
  # @deprecated
200
240
  def mod?(file, perms, &block)
201
- Aruba.platform.deprecated('The use of "#mod?" is deprecated. Use "expect().to have_permissions()" instead')
241
+ Aruba.platform.deprecated(
242
+ 'The use of "#mod?" is deprecated.' \
243
+ ' Use "expect(file).to have_permissions(perms)" instead'
244
+ )
202
245
 
203
246
  expect(Array(file)).to Aruba::Matchers.all have_permissions(perms)
204
247
  end
@@ -209,14 +252,20 @@ module Aruba
209
252
  # @param [String] file_name
210
253
  # The file which should be deleted in current directory
211
254
  def remove_file(*args)
212
- Aruba.platform.deprecated('The use of "#remove_file" is deprecated. Use "#remove" instead')
255
+ Aruba.platform.deprecated(
256
+ 'The use of "#remove_file" is deprecated.' \
257
+ ' Use "#remove" instead'
258
+ )
213
259
 
214
260
  remove(*args)
215
261
  end
216
262
 
217
263
  # @deprecated
218
264
  def create_dir(*args)
219
- Aruba.platform.deprecated('The use of "#create_dir" is deprecated. Use "#create_directory" instead')
265
+ Aruba.platform.deprecated(
266
+ 'The use of "#create_dir" is deprecated.' \
267
+ ' Use "#create_directory" instead'
268
+ )
220
269
  create_directory(*args)
221
270
  end
222
271
 
@@ -226,13 +275,19 @@ module Aruba
226
275
  # @param [String] directory_name
227
276
  # The name of the directory which should be removed
228
277
  def remove_directory(*args)
229
- Aruba.platform.deprecated('The use of "remove_directory" is deprecated. Use "remove" instead')
278
+ Aruba.platform.deprecated(
279
+ 'The use of "remove_directory" is deprecated.' \
280
+ ' Use "remove" instead'
281
+ )
230
282
  remove(*args)
231
283
  end
232
284
 
233
285
  # @deprecated
234
286
  def remove_dir(*args)
235
- Aruba.platform.deprecated('The use of "remove_dir" is deprecated. Use "remove" instead')
287
+ Aruba.platform.deprecated(
288
+ 'The use of "remove_dir" is deprecated.' \
289
+ ' Use "remove" instead'
290
+ )
236
291
  remove(*args)
237
292
  end
238
293
 
@@ -246,7 +301,11 @@ module Aruba
246
301
  # @param [true,false] expect_presence
247
302
  # Should the given paths be present (true) or absent (false)
248
303
  def check_file_presence(paths, expect_presence = true)
249
- Aruba.platform.deprecated('The use of "check_file_presence" is deprecated. Use "expect().to be_an_existing_file" or "expect(all_paths).to all match /pattern/" instead')
304
+ Aruba.platform.deprecated(
305
+ 'The use of "check_file_presence" is deprecated.' \
306
+ ' Use "expect(path).to be_an_existing_file" or' \
307
+ ' "expect(all_paths).to all match /pattern/" instead'
308
+ )
250
309
 
251
310
  stop_all_commands
252
311
 
@@ -282,7 +341,10 @@ module Aruba
282
341
  # check_file_size(paths_and_sizes)
283
342
  #
284
343
  def check_file_size(paths_and_sizes)
285
- Aruba.platform.deprecated('The use of "#check_file_size" is deprecated. Use "expect(file).to have_file_size(size)", "expect(all_files).to all have_file_size(1)", "expect(all_files).to include a_file_with_size(1)" instead')
344
+ Aruba.platform.deprecated(
345
+ 'The use of "#check_file_size" is deprecated.' \
346
+ ' Use "expect(file).to have_file_size(size)" instead'
347
+ )
286
348
 
287
349
  stop_all_commands
288
350
 
@@ -293,7 +355,10 @@ module Aruba
293
355
 
294
356
  # @deprecated
295
357
  def check_exact_file_content(file, exact_content, expect_match = true)
296
- Aruba.platform.deprecated('The use of "#check_exact_file_content" is deprecated. Use "expect(file).to have_file_content(content)" with a string')
358
+ Aruba.platform.deprecated(
359
+ 'The use of "#check_exact_file_content" is deprecated.' \
360
+ ' Use "expect(file).to have_file_content(content)" with a string'
361
+ )
297
362
 
298
363
  check_file_content(file, exact_content, expect_match)
299
364
  end
@@ -310,14 +375,17 @@ module Aruba
310
375
  # @param [true, false] expect_match
311
376
  # Must the content be in the file or not
312
377
  def check_binary_file_content(file, reference_file, expect_match = true)
313
- Aruba.platform.deprecated('The use of "#check_binary_file_content" is deprecated. Use "expect(file).to have_same_file_content_like(file)"')
378
+ Aruba.platform.deprecated(
379
+ 'The use of "#check_binary_file_content" is deprecated.' \
380
+ ' Use "expect(file).to have_same_file_content_as(file)"'
381
+ )
314
382
 
315
383
  stop_all_commands
316
384
 
317
385
  if expect_match
318
- expect(file).to have_same_file_content_like reference_file
386
+ expect(file).to have_same_file_content_as reference_file
319
387
  else
320
- expect(file).not_to have_same_file_content_like reference_file
388
+ expect(file).not_to have_same_file_content_as reference_file
321
389
  end
322
390
  end
323
391
 
@@ -330,7 +398,10 @@ module Aruba
330
398
  # @param [true, false] expect_presence
331
399
  # Should the directory be there or should the directory not be there
332
400
  def check_directory_presence(paths, expect_presence)
333
- Aruba.platform.deprecated('The use of "#check_directory_presence" is deprecated. Use "expect(directory).to be_an_existing_directory"')
401
+ Aruba.platform.deprecated(
402
+ 'The use of "#check_directory_presence" is deprecated.' \
403
+ ' Use "expect(directory).to be_an_existing_directory"'
404
+ )
334
405
 
335
406
  stop_all_commands
336
407
 
@@ -347,7 +418,10 @@ module Aruba
347
418
 
348
419
  # @deprecated
349
420
  def prep_for_fs_check(&block)
350
- Aruba.platform.deprecated('The use of "prep_for_fs_check" is deprecated. Use apropriate methods and the new rspec matchers instead')
421
+ Aruba.platform.deprecated(
422
+ 'The use of "prep_for_fs_check" is deprecated.' \
423
+ ' Use apropriate methods and the new rspec matchers instead'
424
+ )
351
425
 
352
426
  stop_all_commands
353
427
 
@@ -356,15 +430,19 @@ module Aruba
356
430
 
357
431
  # @deprecated
358
432
  def assert_exit_status_and_partial_output(expect_to_pass, expected)
359
- Aruba.platform.deprecated('The use of "assert_exit_status_and_partial_output" is deprecated. Use "#assert_success" and "#assert_partial_output" instead')
433
+ Aruba.platform.deprecated(
434
+ 'The use of "assert_exit_status_and_partial_output" is deprecated.' \
435
+ ' Use "expect(last_command_started).to be_successfully_executed"' \
436
+ ' and "expect(command).to have_output /partial/" instead.'
437
+ )
360
438
 
361
439
  assert_success(expect_to_pass)
362
440
  assert_partial_output(expected, all_output)
363
441
  end
364
442
 
365
- # TODO: Remove this. Call more methods elsewhere instead. Reveals more intent.
366
443
  # @deprecated
367
- def assert_exit_status_and_output(expect_to_pass, expected_output, expect_exact_output)
444
+ def assert_exit_status_and_output(expect_to_pass, expected_output,
445
+ expect_exact_output)
368
446
  assert_success(expect_to_pass)
369
447
  if expect_exact_output
370
448
  assert_exact_output(expected_output, all_output)
@@ -389,7 +467,11 @@ module Aruba
389
467
  # @param [true, false] expect_match
390
468
  # Must the content be in the file or not
391
469
  def check_file_content(file, content, expect_match = true)
392
- Aruba.platform.deprecated('The use of "#check_file_content" is deprecated. Use "expect(file).to have_file_content(content)" instead. For eq match use string, for partial match use /regex/')
470
+ Aruba.platform.deprecated(
471
+ 'The use of "#check_file_content" is deprecated.' \
472
+ ' Use "expect(file).to have_file_content(content)" instead.' \
473
+ ' For eq match use string, for partial match use /regex/'
474
+ )
393
475
 
394
476
  stop_all_commands
395
477
 
@@ -402,35 +484,49 @@ module Aruba
402
484
 
403
485
  # @deprecated
404
486
  def _mkdir(dir_name)
405
- Aruba.platform.deprecated('The use of "#_mkdir" is deprecated')
487
+ Aruba.platform.deprecated(
488
+ 'The use of "#_mkdir" is deprecated'
489
+ )
406
490
 
407
491
  Aruba.platform.mkdir(dir_name)
408
492
  end
409
493
 
410
494
  # @deprecated
411
495
  def _rm(dir_name)
412
- Aruba.platform.deprecated('The use of "#_rm_rf" is deprecated')
496
+ Aruba.platform.deprecated(
497
+ 'The use of "#_rm_rf" is deprecated'
498
+ )
413
499
 
414
500
  Aruba.platform.rm(dir_name)
415
501
  end
416
502
 
417
503
  # @deprecated
418
504
  def current_dir(*args, &block)
419
- Aruba.platform.deprecated('The use of "#current_dir" is deprecated. Use "#current_directory" instead')
505
+ Aruba.platform.deprecated(
506
+ 'The use of "#current_dir" is deprecated.' \
507
+ ' Use "#current_directory" instead'
508
+ )
420
509
 
421
510
  current_directory(*args, &block)
422
511
  end
423
512
 
424
513
  # @deprecated
425
514
  def clean_current_dir(*args, &block)
426
- Aruba.platform.deprecated('The use of "clean_current_dir" is deprecated. Either use "#setup_aruba" or `#remove(\'.\') to clean up aruba\'s working directory before your tests are run')
515
+ Aruba.platform.deprecated(
516
+ 'The use of "clean_current_dir" is deprecated.' \
517
+ ' Use "#setup_aruba" or `#remove(\'.\') to clean up Aruba\'s working' \
518
+ ' directory before your tests are run'
519
+ )
427
520
 
428
521
  setup_aruba
429
522
  end
430
523
 
431
524
  # @deprecated
432
525
  def in_current_dir(&block)
433
- Aruba.platform.deprecated('The use of "in_current_dir" is deprecated. Use "#cd(\'.\') { }" instead')
526
+ Aruba.platform.deprecated(
527
+ 'The use of "in_current_dir" is deprecated.' \
528
+ ' Use "#cd(\'.\') { }" instead'
529
+ )
434
530
 
435
531
  create_directory '.' unless directory?('.')
436
532
  cd('.', &block)
@@ -445,7 +541,11 @@ module Aruba
445
541
  # @yield
446
542
  # The block of code which should be run with the changed environment variables
447
543
  def with_env(env = {}, &block)
448
- Aruba.platform.deprecated('The use of "#with_env" is deprecated. Use "#with_environment {}" instead. But be careful this uses a different implementation')
544
+ Aruba.platform.deprecated(
545
+ 'The use of "#with_env" is deprecated.' \
546
+ ' Use "#with_environment {}" instead. But be careful this uses a' \
547
+ ' different implementation'
548
+ )
449
549
 
450
550
  env.each do |k,v|
451
551
  set_env k, v
@@ -457,9 +557,12 @@ module Aruba
457
557
  # @deprecated
458
558
  # Restore original process environment
459
559
  def restore_env
460
- # No output because we need to reset env on each scenario/spec run
461
- # Aruba.platform.deprecated('The use of "#restore_env" is deprecated. If you use "set_environment_variable" there\'s no need to restore the environment')
462
- #
560
+ Aruba.platform.deprecated(
561
+ 'The use of "#restore_env" is deprecated.' \
562
+ ' If you use "set_environment_variable" there\'s no need to restore' \
563
+ ' the environment'
564
+ )
565
+
463
566
  original_env.each do |key, value|
464
567
  if value
465
568
  ENV[key] = value
@@ -480,7 +583,11 @@ module Aruba
480
583
  # @param [String] value
481
584
  # The value of the environment variable. Needs to be a string.
482
585
  def set_env(key, value)
483
- Aruba.platform.deprecated('The use of "#set_env" is deprecated. Please use "set_environment_variable" instead. But be careful, this method uses a different kind of implementation')
586
+ Aruba.platform.deprecated(
587
+ 'The use of "#set_env" is deprecated.' \
588
+ ' Use "set_environment_variable" instead. ' \
589
+ ' But be careful, this method uses a different kind of implementation'
590
+ )
484
591
 
485
592
  aruba.announcer.announce(:environment, key, value)
486
593
  set_environment_variable key, value
@@ -491,14 +598,19 @@ module Aruba
491
598
 
492
599
  # @deprecated
493
600
  def original_env
494
- # Aruba.platform.deprecated('The use of "#original_env" is deprecated')
601
+ Aruba.platform.deprecated(
602
+ 'The use of "#original_env" is deprecated'
603
+ )
495
604
 
496
605
  @original_env ||= {}
497
606
  end
498
607
 
499
608
  # @deprecated
500
609
  def filesystem_permissions(*args)
501
- Aruba.platform.deprecated('The use of "#filesystem_permissions" is deprecated. Please use "#chmod" instead')
610
+ Aruba.platform.deprecated(
611
+ 'The use of "#filesystem_permissions" is deprecated.' \
612
+ ' Use "#chmod" instead'
613
+ )
502
614
 
503
615
  chmod(*args)
504
616
  end
@@ -512,7 +624,10 @@ module Aruba
512
624
  # @param [Boolean] expected_result
513
625
  # Are the permissions expected to be mode or are they expected not to be mode?
514
626
  def check_filesystem_permissions(*args)
515
- Aruba.platform.deprecated('The use of "#check_filesystem_permissions" is deprecated. Please use "expect().to have_permissions perms" instead')
627
+ Aruba.platform.deprecated(
628
+ 'The use of "#check_filesystem_permissions" is deprecated.' \
629
+ ' Use "expect(path).to have_permissions perms" instead'
630
+ )
516
631
 
517
632
  args = args.flatten
518
633
 
@@ -532,7 +647,9 @@ module Aruba
532
647
 
533
648
  # @deprecated
534
649
  def _create_file(name, content, check_presence)
535
- Aruba.platform.deprecated('The use of "#_create_file" is deprecated. It will be removed soon')
650
+ Aruba.platform.deprecated(
651
+ 'The use of "#_create_file" is deprecated.'
652
+ )
536
653
 
537
654
  ArubaFileCreator.new.write(expand_path(name), content, check_presence)
538
655
 
@@ -541,7 +658,9 @@ module Aruba
541
658
 
542
659
  # @deprecated
543
660
  def _create_fixed_size_file(file_name, file_size, check_presence)
544
- Aruba.platform.deprecated('The use of "#_create_fixed_size_file" is deprecated. It will be removed soon')
661
+ Aruba.platform.deprecated(
662
+ 'The use of "#_create_fixed_size_file" is deprecated.'
663
+ )
545
664
 
546
665
  ArubaFixedSizeFileCreator.new.write(expand_path(name), size, check_presence)
547
666
 
@@ -557,10 +676,17 @@ module Aruba
557
676
  # @return
558
677
  # The string stripped from escape sequences
559
678
  def unescape(string, keep_ansi = false)
560
- Aruba.platform.deprecated('The use of "#unescape" is deprecated. Please use "#sanitize_text" intead')
679
+ Aruba.platform.deprecated(
680
+ 'The use of "#unescape" is deprecated.' \
681
+ ' Use "#sanitize_text" intead'
682
+ )
561
683
 
562
684
  string = unescape_text(string)
563
- string = extract_text(string) if !keep_ansi || !aruba.config.keep_ansi || aruba.config.remove_ansi_escape_sequences
685
+ if !keep_ansi ||
686
+ !aruba.config.keep_ansi ||
687
+ aruba.config.remove_ansi_escape_sequences
688
+ string = extract_text(string)
689
+ end
564
690
 
565
691
  string
566
692
  end
@@ -568,7 +694,10 @@ module Aruba
568
694
  # @deprecated
569
695
  # The root directory of aruba
570
696
  def root_directory
571
- Aruba.platform.deprecated('The use of "#root_directory" is deprecated. Use "aruba.root_directory" instead')
697
+ Aruba.platform.deprecated(
698
+ 'The use of "#root_directory" is deprecated.' \
699
+ ' Use "aruba.root_directory" instead'
700
+ )
572
701
 
573
702
  aruba.root_directory
574
703
  end
@@ -579,7 +708,10 @@ module Aruba
579
708
  # @return [String]
580
709
  # The directory to where your fixtures are stored
581
710
  def fixtures_directory
582
- Aruba.platform.deprecated('The use of "#fixtures_directory" is deprecated. Use "aruba.fixtures_directory" instead')
711
+ Aruba.platform.deprecated(
712
+ 'The use of "#fixtures_directory" is deprecated.' \
713
+ ' Use "aruba.fixtures_directory" instead'
714
+ )
583
715
 
584
716
  aruba.fixtures_directory
585
717
  end
@@ -587,23 +719,36 @@ module Aruba
587
719
  # @deprecated
588
720
  def check_for_deprecated_variables
589
721
  if defined? @aruba_exit_timeout
590
- Aruba.platform.deprecated('The use of "@aruba_exit_timeout" is deprecated. Use "#aruba.config.exit_timeout = <numeric>" instead')
722
+ Aruba.platform.deprecated(
723
+ 'The use of "@aruba_exit_timeout" is deprecated.' \
724
+ ' Use "#aruba.config.exit_timeout = <numeric>" instead'
725
+ )
591
726
  aruba.config.exit_timeout = @aruba_exit_timeout
592
727
  end
593
728
 
594
729
  if defined? @aruba_io_wait_seconds
595
- Aruba.platform.deprecated('The use of "@aruba_io_wait_seconds" is deprecated. Use "#aruba.config.io_wait_timeout = <numeric>" instead')
730
+ Aruba.platform.deprecated(
731
+ 'The use of "@aruba_io_wait_seconds" is deprecated.' \
732
+ ' Use "#aruba.config.io_wait_timeout = <numeric>" instead'
733
+ )
596
734
  aruba.config.io_wait_timeout = @aruba_io_wait_seconds
597
735
  end
598
736
 
599
737
  if defined? @keep_ansi
600
- Aruba.platform.deprecated('The use of "@aruba_keep_ansi" is deprecated. Use "#aruba.config.remove_ansi_escape_sequences = <true|false>" instead. Be aware that it uses an inverted logic')
738
+ Aruba.platform.deprecated(
739
+ 'The use of "@aruba_keep_ansi" is deprecated.' \
740
+ ' Use "#aruba.config.remove_ansi_escape_sequences = <true|false>" instead.' \
741
+ ' Be aware that it uses an inverted logic'
742
+ )
601
743
 
602
744
  aruba.config.remove_ansi_escape_sequences = false
603
745
  end
604
746
 
605
747
  if defined? @aruba_root_directory
606
- Aruba.platform.deprecated('The use of "@aruba_root_directory" is deprecated. Use "#aruba.config.root_directory = <string>" instead')
748
+ Aruba.platform.deprecated(
749
+ 'The use of "@aruba_root_directory" is deprecated.' \
750
+ ' Use "#aruba.config.root_directory = <string>" instead'
751
+ )
607
752
 
608
753
  aruba.config.root_directory = @aruba_root_directory.to_s
609
754
  end
@@ -611,7 +756,10 @@ module Aruba
611
756
 
612
757
  # Last command started
613
758
  def last_command
614
- Aruba.platform.deprecated('The use of "#last_command" is deprecated. Use "#last_command_started"')
759
+ Aruba.platform.deprecated(
760
+ 'The use of "#last_command" is deprecated.' \
761
+ ' Use "#last_command_started"'
762
+ )
615
763
 
616
764
  process_monitor.last_command_started
617
765
  end
@@ -623,10 +771,15 @@ module Aruba
623
771
  # @return [TrueClass, FalseClass]
624
772
  # If arg1 is exactly the same as arg2 return true, otherwise false
625
773
  def assert_exact_output(expected, actual)
626
- Aruba.platform.deprecated('The use of "#assert_exact_output" is deprecated. Use "expect(command).to have_output \'exact\'" instead. There are also special matchers for "stdout" and "stderr"')
774
+ Aruba.platform.deprecated(
775
+ 'The use of "#assert_exact_output" is deprecated.' \
776
+ ' Use "expect(command).to have_output \'exact\'" instead.' \
777
+ ' There are also special matchers for "stdout" and "stderr"'
778
+ )
627
779
 
628
780
  actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
629
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).to eq Aruba.platform.unescape(expected, aruba.config.keep_ansi)
781
+ expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
782
+ to eq Aruba.platform.unescape(expected, aruba.config.keep_ansi)
630
783
  end
631
784
 
632
785
  # @deprecated
@@ -636,10 +789,15 @@ module Aruba
636
789
  # @return [TrueClass, FalseClass]
637
790
  # If arg2 contains arg1 return true, otherwise false
638
791
  def assert_partial_output(expected, actual)
639
- Aruba.platform.deprecated('The use of "#assert_partial_output" is deprecated. Use "expect(command).to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"')
792
+ Aruba.platform.deprecated(
793
+ 'The use of "#assert_partial_output" is deprecated.' \
794
+ ' Use "expect(command).to have_output /partial/" instead.' \
795
+ ' There are also special matchers for "stdout" and "stderr"'
796
+ )
640
797
 
641
798
  actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
642
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).to include(Aruba.platform.unescape(expected, aruba.config.keep_ansi))
799
+ expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
800
+ to include(Aruba.platform.unescape(expected, aruba.config.keep_ansi))
643
801
  end
644
802
 
645
803
  # @deprecated
@@ -649,10 +807,15 @@ module Aruba
649
807
  # @return [TrueClass, FalseClass]
650
808
  # If arg2 matches arg1 return true, otherwise false
651
809
  def assert_matching_output(expected, actual)
652
- Aruba.platform.deprecated('The use of "#assert_matching_output" is deprecated. Use "expect(command).to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"')
810
+ Aruba.platform.deprecated(
811
+ 'The use of "#assert_matching_output" is deprecated.' \
812
+ ' Use "expect(command).to have_output /partial/" instead.' \
813
+ ' There are also special matchers for "stdout" and "stderr"'
814
+ )
653
815
 
654
816
  actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
655
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m)
817
+ expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
818
+ to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m)
656
819
  end
657
820
 
658
821
  # @deprecated
@@ -662,10 +825,15 @@ module Aruba
662
825
  # @return [TrueClass, FalseClass]
663
826
  # If arg2 does not match arg1 return true, otherwise false
664
827
  def assert_not_matching_output(expected, actual)
665
- Aruba.platform.deprecated('The use of "#assert_not_matching_output" is deprecated. Use "expect(command).not_to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"')
828
+ Aruba.platform.deprecated(
829
+ 'The use of "#assert_not_matching_output" is deprecated.' \
830
+ ' Use "expect(command).not_to have_output /partial/" instead.' \
831
+ ' There are also special matchers for "stdout" and "stderr"'
832
+ )
666
833
 
667
834
  actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
668
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).not_to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m)
835
+ expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
836
+ not_to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m)
669
837
  end
670
838
 
671
839
  # @deprecated
@@ -675,13 +843,19 @@ module Aruba
675
843
  # @return [TrueClass, FalseClass]
676
844
  # If arg2 does not match/include arg1 return true, otherwise false
677
845
  def assert_no_partial_output(unexpected, actual)
678
- Aruba.platform.deprecated('The use of "#assert_no_partial_output" is deprecated. Use "expect(command).not_to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"')
846
+ Aruba.platform.deprecated(
847
+ 'The use of "#assert_no_partial_output" is deprecated.' \
848
+ ' Use "expect(command).not_to have_output /partial/" instead.' \
849
+ ' There are also special matchers for "stdout" and "stderr"'
850
+ )
679
851
 
680
852
  actual.force_encoding(unexpected.encoding) if RUBY_VERSION >= "1.9"
681
853
  if Regexp === unexpected
682
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).not_to match unexpected
854
+ expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
855
+ not_to match unexpected
683
856
  else
684
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).not_to include(unexpected)
857
+ expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
858
+ not_to include(unexpected)
685
859
  end
686
860
  end
687
861
 
@@ -692,9 +866,14 @@ module Aruba
692
866
  # @return [TrueClass, FalseClass]
693
867
  # If output of interactive command includes arg1 return true, otherwise false
694
868
  def assert_partial_output_interactive(expected)
695
- Aruba.platform.deprecated('The use of "#assert_partial_output_interactive" is deprecated. Use "expect(last_command_started).to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"')
869
+ Aruba.platform.deprecated(
870
+ 'The use of "#assert_partial_output_interactive" is deprecated.' \
871
+ ' Use "expect(last_command_started).to have_output /partial/" instead.' \
872
+ ' There are also special matchers for "stdout" and "stderr"'
873
+ )
696
874
 
697
- Aruba.platform.unescape(last_command_started.stdout, aruba.config.keep_ansi).include?(Aruba.platform.unescape(expected, aruba.config.keep_ansi)) ? true : false
875
+ Aruba.platform.unescape(last_command_started.stdout, aruba.config.keep_ansi).
876
+ include?(Aruba.platform.unescape(expected, aruba.config.keep_ansi))
698
877
  end
699
878
 
700
879
  # @deprecated
@@ -704,7 +883,13 @@ module Aruba
704
883
  # @return [TrueClass, FalseClass]
705
884
  # If exit status is 0 and arg1 is included in output return true, otherwise false
706
885
  def assert_passing_with(expected)
707
- Aruba.platform.deprecated('The use of "#assert_passing_with" is deprecated. Use "expect(all_commands).to all(be_successfully_executed).and include_an_object(have_output(/partial/))" or something similar instead. There are also special matchers for "stdout" and "stderr"')
886
+ Aruba.platform.deprecated(
887
+ 'The use of "#assert_passing_with" is deprecated.' \
888
+ ' Use "expect(last_command_started).to be_successfully_executed"' \
889
+ ' and expect(last_command_started).to have_output(/partial/)"' \
890
+ ' or something similar instead.' \
891
+ ' There are also special matchers for "stdout" and "stderr"'
892
+ )
708
893
 
709
894
  assert_success(true)
710
895
  assert_partial_output(expected, all_output)
@@ -715,9 +900,16 @@ module Aruba
715
900
  # Check if command failed and if arg1 is included in output
716
901
  #
717
902
  # @return [TrueClass, FalseClass]
718
- # If exit status is not equal 0 and arg1 is included in output return true, otherwise false
903
+ # If exit status is not equal 0 and arg1 is included in output return
904
+ # true, otherwise false
719
905
  def assert_failing_with(expected)
720
- Aruba.platform.deprecated('The use of "#assert_passing_with" is deprecated. Use "expect(all_commands).not_to include_an_object(be_successfully_executed).and include_an_object(have_output(/partial/))" or something similar instead. There are also special matchers for "stdout" and "stderr"')
906
+ Aruba.platform.deprecated(
907
+ 'The use of "#assert_passing_with" is deprecated.' \
908
+ ' Use "expect(last_command_started).not_to be_successfully_executed"' \
909
+ ' and "expect(last_command_started).to have_output(/partial/)"' \
910
+ ' or something similar instead.' \
911
+ ' There are also special matchers for "stdout" and "stderr"'
912
+ )
721
913
 
722
914
  assert_success(false)
723
915
  assert_partial_output(expected, all_output)
@@ -731,7 +923,12 @@ module Aruba
731
923
  # If arg1 is true, return true if command was successful
732
924
  # If arg1 is false, return true if command failed
733
925
  def assert_success(success)
734
- Aruba.platform.deprecated('The use of "#assert_success" is deprecated. Use "expect(last_command_started).to be_successfully_executed" or with "not_to" or the negative form "have_failed_running" (requires rspec >= 3.1)')
926
+ Aruba.platform.deprecated(
927
+ 'The use of "#assert_success" is deprecated.' \
928
+ ' Use "expect(last_command_started).to be_successfully_executed" or' \
929
+ ' with "not_to" or the negative form "have_failed_running"' \
930
+ ' (requires rspec >= 3.1)'
931
+ )
735
932
 
736
933
  if success
737
934
  expect(last_command_started).to be_successfully_executed
@@ -742,14 +939,20 @@ module Aruba
742
939
 
743
940
  # @deprecated
744
941
  def assert_exit_status(status)
745
- Aruba.platform.deprecated('The use of "#assert_success" is deprecated. Use "expect(last_command_started).to have_exit_status(status)"')
942
+ Aruba.platform.deprecated(
943
+ 'The use of "#assert_exit_status" is deprecated.' \
944
+ ' Use "expect(last_command_started).to have_exit_status(status)"'
945
+ )
746
946
 
747
947
  expect(last_command_started).to have_exit_status(status)
748
948
  end
749
949
 
750
950
  # @deprecated
751
951
  def assert_not_exit_status(status)
752
- Aruba.platform.deprecated('The use of "#assert_success" is deprecated. Use "expect(last_command_started).not_to have_exit_status(status)"')
952
+ Aruba.platform.deprecated(
953
+ 'The use of "#assert_not_exit_status" is deprecated.' \
954
+ ' Use "expect(last_command_started).not_to have_exit_status(status)"'
955
+ )
753
956
 
754
957
  expect(last_exit_status).not_to eq(status),
755
958
  append_output_to("Exit status was #{last_exit_status} which was not expected.")
@@ -757,21 +960,23 @@ module Aruba
757
960
 
758
961
  # @deprecated
759
962
  def append_output_to(message)
760
- Aruba.platform.deprecated('The use of "#append_output_to" is deprecated')
963
+ Aruba.platform.deprecated(
964
+ 'The use of "#append_output_to" is deprecated'
965
+ )
761
966
 
762
967
  "#{message} Output:\n\n#{all_output}\n"
763
968
  end
764
969
 
765
970
  # @deprecated
766
971
  def register_process(*args)
767
- # Aruba.platform.deprecated('The use of "#register_process" is deprecated')
972
+ Aruba.platform.deprecated('The use of "#register_process" is deprecated')
768
973
 
769
974
  process_monitor.register_process(*args)
770
975
  end
771
976
 
772
977
  # @deprecated
773
978
  def get_process(wanted)
774
- # Aruba.platform.deprecated('The use of "#get_process" is deprecated')
979
+ Aruba.platform.deprecated('The use of "#get_process" is deprecated')
775
980
 
776
981
  process_monitor.get_process(wanted)
777
982
  end
@@ -783,7 +988,7 @@ module Aruba
783
988
  # @param [String] cmd
784
989
  # The command
785
990
  def output_from(cmd)
786
- # Aruba.platform.deprecated('The use of "#output_from" is deprecated')
991
+ Aruba.platform.deprecated('The use of "#output_from" is deprecated')
787
992
 
788
993
  process_monitor.output_from(cmd)
789
994
  end
@@ -795,7 +1000,7 @@ module Aruba
795
1000
  # @param [String] cmd
796
1001
  # The command
797
1002
  def stdout_from(cmd)
798
- # Aruba.platform.deprecated('The use of "#stdout_from" is deprecated')
1003
+ Aruba.platform.deprecated('The use of "#stdout_from" is deprecated')
799
1004
 
800
1005
  process_monitor.stdout_from(cmd)
801
1006
  end
@@ -807,7 +1012,7 @@ module Aruba
807
1012
  # @param [String] cmd
808
1013
  # The command
809
1014
  def stderr_from(cmd)
810
- # Aruba.platform.deprecated('The use of "#stderr_from" is deprecated')
1015
+ Aruba.platform.deprecated('The use of "#stderr_from" is deprecated')
811
1016
 
812
1017
  process_monitor.stderr_from(cmd)
813
1018
  end
@@ -819,7 +1024,13 @@ module Aruba
819
1024
  # @return [String]
820
1025
  # The stdout of all process which have run before
821
1026
  def all_stdout
822
- Aruba.platform.deprecated('The use of "#all_stdout" is deprecated. Use `all_commands.map { |c| c.stdout }.join("\n") instead. If you need to check for some output use "expect(all_commands).to have_output_on_stdout /output/" instead')
1027
+ Aruba.platform.deprecated(
1028
+ 'The use of "#all_stdout" is deprecated.' \
1029
+ ' Use `all_commands.map { |c| c.stdout }.join("\n") instead.' \
1030
+ ' If you need to check for some output, use' \
1031
+ ' "expect(all_commands).to included_an_object have_output_on_stdout(/output/)"' \
1032
+ ' instead'
1033
+ )
823
1034
 
824
1035
  process_monitor.all_stdout
825
1036
  end
@@ -831,7 +1042,13 @@ module Aruba
831
1042
  # @return [String]
832
1043
  # The stderr of all process which have run before
833
1044
  def all_stderr
834
- Aruba.platform.deprecated('The use of "#all_stderr" is deprecated. Use `all_commands.map { |c| c.stderr }.join("\n") instead. If you need to check for some output use "expect(all_commands).to have_output_on_stderr /output/" instead')
1045
+ Aruba.platform.deprecated(
1046
+ 'The use of "#all_stderr" is deprecated.' \
1047
+ ' Use `all_commands.map { |c| c.stderr }.join("\n") instead.' \
1048
+ ' If you need to check for some output use' \
1049
+ ' "expect(all_commands).to included_an_object have_output_on_stderr /output/"' \
1050
+ ' instead'
1051
+ )
835
1052
 
836
1053
  process_monitor.all_stderr
837
1054
  end
@@ -843,7 +1060,13 @@ module Aruba
843
1060
  # @return [String]
844
1061
  # The stderr and stdout of all process which have run before
845
1062
  def all_output
846
- Aruba.platform.deprecated('The use of "#all_output" is deprecated. Use `all_commands.map { |c| c.output }.join("\n") instead. If you need to check for some output use "expect(all_commands).to have_output /output/" instead')
1063
+ Aruba.platform.deprecated(
1064
+ 'The use of "#all_output" is deprecated.' \
1065
+ ' Use `all_commands.map { |c| c.output }.join("\n") instead.' \
1066
+ ' If you need to check for some output use' \
1067
+ ' "expect(all_commands).to included_an_object have_output /output/"' \
1068
+ ' instead'
1069
+ )
847
1070
 
848
1071
  process_monitor.all_output
849
1072
  end
@@ -855,7 +1078,10 @@ module Aruba
855
1078
  # Overwrite this method if you want a different timeout or set
856
1079
  # `@aruba_timeout_seconds`.
857
1080
  def exit_timeout
858
- Aruba.platform.deprecated('The use of "#exit_timeout" is deprecated. Use "aruba.config.exit_timeout" instead.')
1081
+ Aruba.platform.deprecated(
1082
+ 'The use of "#exit_timeout" is deprecated.' \
1083
+ ' Use "aruba.config.exit_timeout" instead.'
1084
+ )
859
1085
 
860
1086
  aruba.config.exit_timeout
861
1087
  end
@@ -867,7 +1093,10 @@ module Aruba
867
1093
  # Overwrite this method if you want a different timeout or set
868
1094
  # `@aruba_io_wait_seconds
869
1095
  def io_wait
870
- Aruba.platform.deprecated('The use of "#io_wait" is deprecated. Use "aruba.config.io_wait_timeout" instead')
1096
+ Aruba.platform.deprecated(
1097
+ 'The use of "#io_wait" is deprecated.' \
1098
+ ' Use "aruba.config.io_wait_timeout" instead'
1099
+ )
871
1100
 
872
1101
  aruba.config.io_wait_timeout
873
1102
  end
@@ -875,35 +1104,50 @@ module Aruba
875
1104
  # @deprecated
876
1105
  # Only processes
877
1106
  def only_processes
878
- Aruba.platform.deprecated('The use of "#only_processes" is deprecated. Use "#all_commands" instead')
1107
+ Aruba.platform.deprecated(
1108
+ 'The use of "#only_processes" is deprecated.' \
1109
+ ' Use "#all_commands" instead'
1110
+ )
879
1111
 
880
1112
  process_monitor.only_processes
881
1113
  end
882
1114
 
883
1115
  # @deprecated
884
1116
  def last_exit_status
885
- Aruba.platform.deprecated('The use of "#last_exit_status" is deprecated. Use "#last_command_(started|stopped).exit_status" instead')
1117
+ Aruba.platform.deprecated(
1118
+ 'The use of "#last_exit_status" is deprecated.' \
1119
+ ' Use "#last_command_(started|stopped).exit_status" instead'
1120
+ )
886
1121
 
887
1122
  process_monitor.last_exit_status
888
1123
  end
889
1124
 
890
1125
  # @deprecated
891
1126
  def stop_process(process)
892
- # Aruba.platform.deprecated('The use of "#stop_process" is deprecated. Use "#last_command_(started|stopped).stop" instead')
1127
+ Aruba.platform.deprecated(
1128
+ 'The use of "#stop_process" is deprecated.' \
1129
+ ' Use "#last_command_(started|stopped).stop" instead'
1130
+ )
893
1131
 
894
1132
  @last_exit_status = process_monitor.stop_process(process)
895
1133
  end
896
1134
 
897
1135
  # @deprecated
898
1136
  def terminate_process(process)
899
- # Aruba.platform.deprecated('The use of "#terminate_process" is deprecated. Use "#last_command_(started|stopped).terminate" instead')
1137
+ Aruba.platform.deprecated(
1138
+ 'The use of "#terminate_process" is deprecated.' \
1139
+ ' Use "#last_command_(started|stopped).terminate" instead'
1140
+ )
900
1141
 
901
1142
  process_monitor.terminate_process(process)
902
1143
  end
903
1144
 
904
1145
  # @deprecated
905
1146
  def stop_processes!
906
- Aruba.platform.deprecated('The use of "#stop_processes!" is deprecated. Use "#stop_all_commands" instead')
1147
+ Aruba.platform.deprecated(
1148
+ 'The use of "#stop_processes!" is deprecated.' \
1149
+ ' Use "#stop_all_commands" instead'
1150
+ )
907
1151
 
908
1152
  stop_all_commands
909
1153
  end
@@ -912,7 +1156,10 @@ module Aruba
912
1156
  #
913
1157
  # Terminate all running processes
914
1158
  def terminate_processes!
915
- Aruba.platform.deprecated('The use of "#stop_processes!" is deprecated. Use "all_commands.each(&:terminate)" instead')
1159
+ Aruba.platform.deprecated(
1160
+ 'The use of "#stop_processes!" is deprecated.' \
1161
+ ' Use "all_commands.each(&:terminate)" instead'
1162
+ )
916
1163
 
917
1164
  all_commands.each(&:terminate)
918
1165
  end
@@ -921,7 +1168,10 @@ module Aruba
921
1168
  #
922
1169
  # Access to announcer
923
1170
  def announcer
924
- Aruba.platform.deprecated('The use of "#announcer" is deprecated. Use "aruba.announcer" instead')
1171
+ Aruba.platform.deprecated(
1172
+ 'The use of "#announcer" is deprecated.' \
1173
+ ' Use "aruba.announcer" instead'
1174
+ )
925
1175
 
926
1176
  @announcer ||= Platforms::Announcer.new(
927
1177
  self,
@@ -935,6 +1185,32 @@ module Aruba
935
1185
  @announcer
936
1186
  end
937
1187
 
1188
+ # @deprecated
1189
+ # Use a clean rvm gemset
1190
+ #
1191
+ # Please make sure that you've got [rvm](http://rvm.io/) installed.
1192
+ #
1193
+ # @param [String] gemset
1194
+ # The name of the gemset to be used
1195
+ def use_clean_gemset(gemset)
1196
+ Aruba.platform.deprecated('The use of "#use_clean_gemset" is deprecated.')
1197
+ run_simple(%{rvm gemset create "#{gemset}"}, true)
1198
+ if all_stdout =~ /'#{gemset}' gemset created \((.*)\)\./
1199
+ gem_home = Regexp.last_match[1]
1200
+ set_environment_variable('GEM_HOME', gem_home)
1201
+ set_environment_variable('GEM_PATH', gem_home)
1202
+ set_environment_variable('BUNDLE_PATH', gem_home)
1203
+
1204
+ paths = (ENV['PATH'] || "").split(File::PATH_SEPARATOR)
1205
+ paths.unshift(File.join(gem_home, 'bin'))
1206
+ set_environment_variable('PATH', paths.uniq.join(File::PATH_SEPARATOR))
1207
+
1208
+ run_simple("gem install bundler", true)
1209
+ else
1210
+ raise "I didn't understand rvm's output: #{all_stdout}"
1211
+ end
1212
+ end
1213
+
938
1214
  # @private
939
1215
  # @deprecated
940
1216
  def process_monitor
@@ -946,7 +1222,10 @@ module Aruba
946
1222
  # @private
947
1223
  # @deprecated
948
1224
  def processes
949
- Aruba.platform.deprecated('The use of "#process_monitor" is deprecated. Please use "#all_commands" instead.')
1225
+ Aruba.platform.deprecated(
1226
+ 'The use of "#process_monitor" is deprecated.' \
1227
+ ' Use "#all_commands" instead.'
1228
+ )
950
1229
 
951
1230
  aruba.command_monitor.send(:processes)
952
1231
  end