aruba 1.0.2 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -2
  3. data/CONTRIBUTING.md +18 -22
  4. data/README.md +7 -8
  5. data/exe/aruba +2 -2
  6. data/lib/aruba.rb +1 -1
  7. data/lib/aruba/api.rb +11 -12
  8. data/lib/aruba/api/bundler.rb +19 -3
  9. data/lib/aruba/api/commands.rb +11 -11
  10. data/lib/aruba/api/core.rb +21 -21
  11. data/lib/aruba/api/environment.rb +2 -2
  12. data/lib/aruba/api/filesystem.rb +41 -15
  13. data/lib/aruba/api/text.rb +4 -4
  14. data/lib/aruba/aruba_path.rb +3 -4
  15. data/lib/aruba/basic_configuration.rb +51 -69
  16. data/lib/aruba/cli.rb +7 -7
  17. data/lib/aruba/command.rb +4 -4
  18. data/lib/aruba/config/jruby.rb +9 -9
  19. data/lib/aruba/config_wrapper.rb +2 -2
  20. data/lib/aruba/configuration.rb +36 -46
  21. data/lib/aruba/console.rb +11 -11
  22. data/lib/aruba/console/help.rb +7 -7
  23. data/lib/aruba/contracts/absolute_path.rb +1 -1
  24. data/lib/aruba/contracts/enum.rb +1 -1
  25. data/lib/aruba/contracts/is_power_of_two.rb +1 -1
  26. data/lib/aruba/contracts/relative_path.rb +1 -1
  27. data/lib/aruba/cucumber.rb +7 -7
  28. data/lib/aruba/cucumber/command.rb +41 -49
  29. data/lib/aruba/cucumber/environment.rb +7 -7
  30. data/lib/aruba/cucumber/file.rb +7 -3
  31. data/lib/aruba/cucumber/hooks.rb +29 -29
  32. data/lib/aruba/cucumber/testing_frameworks.rb +18 -18
  33. data/lib/aruba/event_bus.rb +4 -4
  34. data/lib/aruba/event_bus/name_resolver.rb +4 -4
  35. data/lib/aruba/file_size.rb +1 -1
  36. data/lib/aruba/generators/script_file.rb +2 -2
  37. data/lib/aruba/in_config_wrapper.rb +1 -1
  38. data/lib/aruba/initializer.rb +10 -10
  39. data/lib/aruba/matchers/base/base_matcher.rb +1 -1
  40. data/lib/aruba/matchers/base/message_indenter.rb +2 -2
  41. data/lib/aruba/matchers/base/object_formatter.rb +2 -2
  42. data/lib/aruba/matchers/collection.rb +1 -1
  43. data/lib/aruba/matchers/collection/all.rb +1 -1
  44. data/lib/aruba/matchers/collection/include_an_object.rb +2 -2
  45. data/lib/aruba/matchers/command.rb +1 -1
  46. data/lib/aruba/matchers/command/be_successfully_executed.rb +4 -4
  47. data/lib/aruba/matchers/command/have_finished_in_time.rb +1 -1
  48. data/lib/aruba/matchers/command/have_output.rb +1 -1
  49. data/lib/aruba/matchers/directory.rb +1 -1
  50. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +2 -2
  51. data/lib/aruba/matchers/directory/have_sub_directory.rb +3 -3
  52. data/lib/aruba/matchers/environment.rb +1 -1
  53. data/lib/aruba/matchers/file.rb +1 -1
  54. data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +1 -1
  55. data/lib/aruba/matchers/file/be_an_existing_executable.rb +2 -2
  56. data/lib/aruba/matchers/file/be_an_existing_file.rb +2 -2
  57. data/lib/aruba/matchers/file/have_file_content.rb +1 -1
  58. data/lib/aruba/matchers/file/have_file_size.rb +1 -1
  59. data/lib/aruba/matchers/file/have_same_file_content.rb +2 -2
  60. data/lib/aruba/matchers/path.rb +1 -1
  61. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +1 -1
  62. data/lib/aruba/matchers/path/be_an_absolute_path.rb +1 -1
  63. data/lib/aruba/matchers/path/be_an_existing_path.rb +1 -1
  64. data/lib/aruba/matchers/path/have_permissions.rb +5 -4
  65. data/lib/aruba/matchers/string.rb +1 -1
  66. data/lib/aruba/matchers/string/include_output_string.rb +1 -1
  67. data/lib/aruba/matchers/string/match_output_string.rb +1 -1
  68. data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
  69. data/lib/aruba/platform.rb +2 -2
  70. data/lib/aruba/platforms/announcer.rb +15 -15
  71. data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
  72. data/lib/aruba/platforms/aruba_logger.rb +11 -10
  73. data/lib/aruba/platforms/command_monitor.rb +6 -8
  74. data/lib/aruba/platforms/determine_disk_usage.rb +2 -4
  75. data/lib/aruba/platforms/filesystem_status.rb +20 -14
  76. data/lib/aruba/platforms/simple_table.rb +1 -1
  77. data/lib/aruba/platforms/unix_command_string.rb +2 -2
  78. data/lib/aruba/platforms/unix_environment_variables.rb +1 -1
  79. data/lib/aruba/platforms/unix_platform.rb +23 -23
  80. data/lib/aruba/platforms/unix_which.rb +1 -1
  81. data/lib/aruba/platforms/windows_command_string.rb +2 -2
  82. data/lib/aruba/platforms/windows_environment_variables.rb +1 -1
  83. data/lib/aruba/platforms/windows_platform.rb +7 -7
  84. data/lib/aruba/platforms/windows_which.rb +5 -5
  85. data/lib/aruba/processes/basic_process.rb +4 -4
  86. data/lib/aruba/processes/debug_process.rb +5 -5
  87. data/lib/aruba/processes/in_process.rb +8 -8
  88. data/lib/aruba/processes/spawn_process.rb +18 -23
  89. data/lib/aruba/rspec.rb +6 -6
  90. data/lib/aruba/runtime.rb +6 -6
  91. data/lib/aruba/setup.rb +3 -3
  92. data/lib/aruba/version.rb +1 -1
  93. metadata +103 -88
  94. data/.cucumberproignore +0 -3
  95. data/.document +0 -5
  96. data/.github/ISSUE_TEMPLATE.md +0 -48
  97. data/.github/PULL_REQUEST_TEMPLATE.md +0 -41
  98. data/.gitignore +0 -38
  99. data/.rspec +0 -3
  100. data/.rubocop.yml +0 -52
  101. data/.rubocop_todo.yml +0 -216
  102. data/.simplecov +0 -36
  103. data/.travis.yml +0 -62
  104. data/.yardopts +0 -11
  105. data/Dockerfile +0 -67
  106. data/Gemfile +0 -14
  107. data/Rakefile +0 -82
  108. data/TODO.md +0 -13
  109. data/appveyor.yml +0 -28
  110. data/aruba.gemspec +0 -57
  111. data/bin/console +0 -7
  112. data/bin/test +0 -9
  113. data/config/.gitignore +0 -1
  114. data/cucumber.yml +0 -6
  115. data/docker-compose.yml +0 -26
  116. data/fixtures/cli-app/.gitignore +0 -9
  117. data/fixtures/cli-app/.rspec +0 -2
  118. data/fixtures/cli-app/README.md +0 -39
  119. data/fixtures/cli-app/Rakefile +0 -1
  120. data/fixtures/cli-app/bin/aruba-test-cli +0 -6
  121. data/fixtures/cli-app/cli-app.gemspec +0 -26
  122. data/fixtures/cli-app/features/support/aruba.rb +0 -1
  123. data/fixtures/cli-app/features/support/env.rb +0 -1
  124. data/fixtures/cli-app/lib/cli/app.rb +0 -9
  125. data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +0 -15
  126. data/fixtures/cli-app/lib/cli/app/version.rb +0 -5
  127. data/fixtures/cli-app/script/console +0 -14
  128. data/fixtures/cli-app/spec/spec_helper.rb +0 -8
  129. data/fixtures/cli-app/spec/support/aruba.rb +0 -1
  130. data/fixtures/copy/file.txt +0 -1
  131. data/fixtures/empty-app/.gitignore +0 -9
  132. data/fixtures/empty-app/.rspec +0 -2
  133. data/fixtures/empty-app/README.md +0 -24
  134. data/fixtures/empty-app/Rakefile +0 -1
  135. data/fixtures/empty-app/cli-app.gemspec +0 -26
  136. data/fixtures/empty-app/lib/cli/app.rb +0 -7
  137. data/fixtures/empty-app/lib/cli/app/version.rb +0 -5
  138. data/fixtures/getting-started-app/.gitignore +0 -4
  139. data/fixtures/getting-started-app/Gemfile +0 -4
  140. data/fixtures/getting-started-app/README.md +0 -3
  141. data/fixtures/getting-started-app/features/support/env.rb +0 -1
  142. data/lib/aruba/extensions/string/strip.rb +0 -25
  143. data/lib/aruba/tasks/docker_helpers.rb +0 -156
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f5a2c9af56d4b502edae4592455415530bd8077f5078608ac174fdd42828e84
4
- data.tar.gz: e057fc77eb5bf2680b08978f90d3d4bf5c166e3a400a3d691124f5d624e37e67
3
+ metadata.gz: 310ecfb205a45e39a9822c3d40272f5b1121eaa132ee597589c816b53b478ae2
4
+ data.tar.gz: 664722acb2e5e82421f25b1a9be77720af6b191935bdc3e177ee4c962697f0fe
5
5
  SHA512:
6
- metadata.gz: 41edd733387784f50d386c5fd718610a00970c5e2d1cb60cc87dae9e79a8883d2447136782c3e7e101e208b949f7451fe99ac8ebc91ab0547b529f097da04286
7
- data.tar.gz: f7c553b8fc220a0e1b49ddcbe92d8d1da179330c05dff80e70dbcac6ed9ef501ff27b2e663afdecaff18a471d718e249e0b3d7b704baafb80603c187045321b2
6
+ metadata.gz: ddc31e116d5d122e70e4cc95ad0596318ffcfb4955b02b54f64a3800ea6917c461ca0332108e586811931f31253e34cae5ca011f4a7094aa2686f724ff9141a4
7
+ data.tar.gz: f63cd42a52b764686866d0a9070429830979136927270cd704d47ab7cd5533e656a7fc2b055cbee9d14e3dd8ed27a3ab7c8727a446bee89da9f88ec8e130735a
data/CHANGELOG.md CHANGED
@@ -6,6 +6,44 @@ This project adheres to [Semantic Versioning][1].
6
6
 
7
7
  This document is formatted according to the principles of [Keep A CHANGELOG][2].
8
8
 
9
+ ## [Unreleased]
10
+
11
+ ## [1.1.2] / 2021-06-20
12
+
13
+ * Add Bundler as an explicit runtime dependency ([#810] by [luke-hill])
14
+
15
+ ## [1.1.1] / 2021-05-14
16
+
17
+ * Loosen dependency on the contracts gem ([#804] by [mvz])
18
+
19
+ ## [1.1.0] / 2021-04-14
20
+
21
+ * Add step and API to add whole lines to a file ([#780] by [mvz])
22
+ * Deprecate file creation when using `append_to_file` ([#781] by [mvz])
23
+ * Update dependencies to cucumber to allow working with incoming major versions
24
+ ([#801] by [mattwynne])
25
+
26
+ ## [1.0.4] / 2021-01-04
27
+
28
+ * Update rubocop and fix new offenses (various pull requests)
29
+ * Turn off Cucumber publish warning in CI ([#737] by [olleolleolle])
30
+ * Move CI from Travis CI to GitHub Actions ([#738] by [mvz])
31
+ * Remove superfluous :each from before hooks in RSpec-related cucumber
32
+ scenarios ([#748] by [mvz])
33
+ * Make disabling Bundler more robust ([#750] by [mvz])
34
+ * Officially support Ruby 3.0 ([#763] by [mvz])
35
+ * Clean up hook methods in configuration ([#751] by [mvz])
36
+ * Speed up RSpec suite ([#767] by [mvz])
37
+ * Speed up Cucumber suite ([#766] and [#771] by [mvz])
38
+ * Remove obsolete `String#strip_heredoc` monkey-patch ([#769] by [mvz])
39
+ * Simplify configuration option specification ([#772] by [mvz])
40
+
41
+ ## [1.0.3]
42
+
43
+ * Loosen Cucumber dependency to allow Cucumber 5.0 ([#727] by [mvz])
44
+ * Update rubocop and fix new offenses ([#719] and [#724] by [mvz])
45
+ * Rework gemspec to avoid dependency on git ([#721] by [utkarsh2102], [#725] by [mvz])
46
+
9
47
  ## [1.0.2]
10
48
 
11
49
  * Loosen childprocess dependency
@@ -936,12 +974,21 @@ Note: These are changes w.r.t. Aruba version 0.14.1.
936
974
  [scottj97]: https://github.com/scottj97
937
975
  [stamhankar999]: https://github.com/stamhankar999
938
976
  [taylor]: https://github.com/taylor
977
+ [utkarsh2102]: https://github.com/utkarsh2102
939
978
  [tdreyno]: https://github.com/tdreyno
940
979
  [xtrasimplicity]: https://github.com/xtrasimplicity
941
980
  [y-higuchi]: https://github.com/y-higuchi
942
981
 
943
982
  <!-- issues & pull requests -->
944
983
 
984
+ [#810]: https://github.com/cucumber/aruba/pull/810
985
+ [#804]: https://github.com/cucumber/aruba/pull/804
986
+ [#801]: https://github.com/cucumber/aruba/pull/801
987
+ [#727]: https://github.com/cucumber/aruba/pull/727
988
+ [#725]: https://github.com/cucumber/aruba/pull/725
989
+ [#724]: https://github.com/cucumber/aruba/pull/724
990
+ [#721]: https://github.com/cucumber/aruba/pull/721
991
+ [#719]: https://github.com/cucumber/aruba/pull/719
945
992
  [#717]: https://github.com/cucumber/aruba/pull/717
946
993
  [#715]: https://github.com/cucumber/aruba/pull/715
947
994
  [#712]: https://github.com/cucumber/aruba/pull/712
@@ -1215,7 +1262,12 @@ Note: These are changes w.r.t. Aruba version 0.14.1.
1215
1262
 
1216
1263
  <!-- Releases -->
1217
1264
 
1218
- [Unreleased]: https://github.com/cucumber/aruba/compare/v1.0.2...master
1265
+ [Unreleased]: https://github.com/cucumber/aruba/compare/v1.1.2...main
1266
+ [1.1.2]: https://github.com/cucumber/aruba/compare/v1.1.1...v1.1.2
1267
+ [1.1.1]: https://github.com/cucumber/aruba/compare/v1.1.0...v1.1.1
1268
+ [1.1.0]: https://github.com/cucumber/aruba/compare/v1.0.4...v1.1.0
1269
+ [1.0.4]: https://github.com/cucumber/aruba/compare/v1.0.3...v1.0.4
1270
+ [1.0.3]: https://github.com/cucumber/aruba/compare/v1.0.2...v1.0.3
1219
1271
  [1.0.2]: https://github.com/cucumber/aruba/compare/v1.0.1...v1.0.2
1220
1272
  [1.0.1]: https://github.com/cucumber/aruba/compare/v1.0.0...v1.0.1
1221
1273
  [1.0.0]: https://github.com/cucumber/aruba/compare/v1.0.0.pre.alpha.5...v1.0.0
@@ -1318,4 +1370,4 @@ Note: These are changes w.r.t. Aruba version 0.14.1.
1318
1370
 
1319
1371
  [1]: http://semver.org
1320
1372
  [2]: http://keepachangelog.com
1321
- [3]: https://github.com/cucumber/aruba/blob/master/CONTRIBUTING.md
1373
+ [3]: https://github.com/cucumber/aruba/blob/main/CONTRIBUTING.md
data/CONTRIBUTING.md CHANGED
@@ -73,7 +73,7 @@ Please...
73
73
 
74
74
  * Use pull requests for larger or controversial changes made by yourself or
75
75
  changes you might expected to break the build.
76
- * Commit smaller changes directly to master, e.g. fixing typos, adding tests or
76
+ * Commit smaller changes directly to `main`, e.g. fixing typos, adding tests or
77
77
  adding documentation.
78
78
  * Update [`CHANGELOG.md`][] when a pull request is merged.
79
79
  * Make sure all tests are green before merging a pull request.
@@ -118,22 +118,15 @@ bundle install
118
118
 
119
119
  Run the following command to run the test suite.
120
120
 
121
- ```bash
122
- # Run the test suite
123
- bin/test
124
- ```
125
-
126
- Or use these Rake tasks:
127
-
128
121
  ```bash
129
122
  # Run the whole test suite
130
- rake test
123
+ bundle exec rake
131
124
  # Run RSpec tests
132
- rake spec
125
+ bundle exec rake spec
133
126
  # Run Cucumber features
134
- rake cucumber
127
+ bundle exec rake cucumber
135
128
  # Run Cucumber features which are "WORK IN PROGRESS" and are allowed to fail
136
- rake cucumber:wip
129
+ bundle exec rake cucumber:wip
137
130
  ```
138
131
 
139
132
  If you have problems because our assumptions about your local setup are wrong,
@@ -142,19 +135,22 @@ installed on your local system.
142
135
 
143
136
  ```bash
144
137
  # Build the docker container
145
- bundle exec rake docker:build
138
+ docker build -t test-aruba .
146
139
 
147
- # Alternative: Build with disabled cache
148
- bundle exec rake 'docker:build[false]'
140
+ # Open a bash shell inside the container with attached volume so changes to the
141
+ # code will be picked up automatically.
142
+ docker run -v $PWD:/aruba --rm -it test-aruba:latest bash
149
143
 
150
- # Build image with version tag
151
- bundle exec rake 'docker:build[false, 0.1.0]'
144
+ # Run the test suite
145
+ bundle exec rake
146
+ ```
152
147
 
153
- # Run the whole test suite in "docker"-container
154
- RUN_IN_DOCKER=1 bin/test
148
+ If you want to run the test suite against specific versions of Aruba's
149
+ dependencies, you can use [appraisal](https://github.com/thoughtbot/appraisal):
155
150
 
156
- # Run only selected scenario
157
- RUN_IN_DOCKER=1 bin/test cucumber features/steps/command/shell.feature:14
151
+ ```bash
152
+ bundle exec appraisal cucumber_6 bundle install
153
+ bundle exec appraisal cucumber_6 bundle exec rake
158
154
  ```
159
155
 
160
156
  ### Installing your own gems used for development
@@ -218,7 +214,7 @@ Now release it:
218
214
  bundle update
219
215
 
220
216
  # Run test suite
221
- bin/test
217
+ bundle exec rake
222
218
 
223
219
  # Release gem
224
220
  git commit -m "Version bump"
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/cucumber/aruba/master/LICENSE)
1
+ [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/cucumber/aruba/main/LICENSE)
2
2
  [![Docs](https://img.shields.io/badge/cucumber.pro-aruba-3d10af.svg)](https://app.cucumber.pro/projects/aruba)
3
3
  [![Gem Version](https://badge.fury.io/rb/aruba.svg)](http://badge.fury.io/rb/aruba)
4
4
  [![Code Climate](https://codeclimate.com/github/cucumber/aruba.svg)](https://codeclimate.com/github/cucumber/aruba)
@@ -32,8 +32,7 @@ gem install aruba
32
32
  ### As a user getting started with Aruba
33
33
 
34
34
  Our most current documentation to get started with Aruba as a user can be
35
- found on [Cucumber Jam](https://app.cucumber.pro/projects/aruba).
36
- It is generated from our feature files describing the use of Aruba.
35
+ found in [./features/](https://github.com/cucumber/aruba/tree/main/features/).
37
36
 
38
37
  ### As a user getting started with a ruby testing framework
39
38
 
@@ -58,15 +57,15 @@ A full documentation of the API for developers can be found on
58
57
 
59
58
  ## Support
60
59
 
61
- ### Channels
62
-
63
60
  For support, please have a look at the [support website](https://cucumber.io/support)
64
61
  of Cucumber. You have different options to reach out for help: Recommended for
65
62
  Aruba are using the Slack channels &mdash; e.g. `committers-aruba` or `help-cucumber-ruby`
66
- &mdash; ([register account](https://cucumberbdd-slack-invite.herokuapp.com/)), and the
63
+ &mdash; ([register account](https://cucumberbdd-slack-invite.herokuapp.com/))
64
+
65
+ Concrete issues can be reported via the
67
66
  [Issues page on GitHub](https://github.com/cucumber/aruba/issues).
68
67
 
69
- ### Maintainers
68
+ ## Maintainers
70
69
 
71
70
  Currently, this gem is mainly maintained by this group of people:
72
71
 
@@ -92,7 +91,7 @@ Please see the [CONTRIBUTING](CONTRIBUTING.md) file.
92
91
 
93
92
  ## Code branches
94
93
 
95
- Development takes place in the `master` branch and currently targets the 1.x
94
+ Development takes place in the `main` branch and currently targets the 1.x
96
95
  releases. If necessary, maintenance of the old 0.14.x releases takes place in
97
96
  the `0-14-stable` branch. Stable branches will not be created until absolutely
98
97
  necessary.
data/exe/aruba CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $LOAD_PATH << File.expand_path('../lib', __dir__)
3
+ $LOAD_PATH << File.expand_path("../lib", __dir__)
4
4
 
5
- require 'aruba/cli'
5
+ require "aruba/cli"
6
6
 
7
7
  Aruba::Cli.start
data/lib/aruba.rb CHANGED
@@ -1 +1 @@
1
- require 'aruba/api'
1
+ require "aruba/api"
data/lib/aruba/api.rb CHANGED
@@ -1,19 +1,18 @@
1
- require 'rspec/expectations'
2
- require 'shellwords'
1
+ require "rspec/expectations"
2
+ require "shellwords"
3
3
 
4
- require 'aruba/version'
5
- require 'aruba/extensions/string/strip'
4
+ require "aruba/version"
6
5
 
7
- require 'aruba/platform'
8
- require 'aruba/api/core'
9
- require 'aruba/api/commands'
6
+ require "aruba/platform"
7
+ require "aruba/api/core"
8
+ require "aruba/api/commands"
10
9
 
11
- require 'aruba/api/environment'
12
- require 'aruba/api/filesystem'
13
- require 'aruba/api/text'
14
- require 'aruba/api/bundler'
10
+ require "aruba/api/environment"
11
+ require "aruba/api/filesystem"
12
+ require "aruba/api/text"
13
+ require "aruba/api/bundler"
15
14
 
16
- Aruba.platform.require_matching_files('../matchers/**/*.rb', __FILE__)
15
+ Aruba.platform.require_matching_files("../matchers/**/*.rb", __FILE__)
17
16
 
18
17
  # Aruba
19
18
  module Aruba
@@ -1,4 +1,5 @@
1
- require 'aruba/api/environment'
1
+ require "aruba/api/environment"
2
+ require "bundler"
2
3
 
3
4
  module Aruba
4
5
  module Api
@@ -7,8 +8,23 @@ module Aruba
7
8
 
8
9
  # Unset variables used by bundler
9
10
  def unset_bundler_env_vars
10
- %w(RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE).each do |key|
11
- delete_environment_variable(key)
11
+ empty_env = with_environment { with_unbundled_env { ENV.to_h } }
12
+ aruba_env = aruba.environment.to_h
13
+ (aruba_env.keys - empty_env.keys).each do |key|
14
+ delete_environment_variable key
15
+ end
16
+ empty_env.each do |k, v|
17
+ set_environment_variable k, v
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def with_unbundled_env(&block)
24
+ if ::Bundler.respond_to?(:with_unbundled_env)
25
+ ::Bundler.with_unbundled_env(&block)
26
+ else
27
+ ::Bundler.with_clean_env(&block)
12
28
  end
13
29
  end
14
30
  end
@@ -1,7 +1,7 @@
1
- require 'pathname'
1
+ require "pathname"
2
2
 
3
- require 'aruba/platform'
4
- require 'aruba/command'
3
+ require "aruba/platform"
4
+ require "aruba/command"
5
5
 
6
6
  # require 'win32/file' if File::ALT_SEPARATOR
7
7
 
@@ -22,7 +22,7 @@ module Aruba
22
22
  def which(program, path = nil)
23
23
  with_environment do
24
24
  # ENV is set within this block
25
- path = ENV['PATH'] if path.nil?
25
+ path = ENV["PATH"] if path.nil?
26
26
 
27
27
  Aruba.platform.which(program, path)
28
28
  end
@@ -35,7 +35,7 @@ module Aruba
35
35
  def pipe_in_file(file_name)
36
36
  file_name = expand_path(file_name)
37
37
 
38
- File.open(file_name, 'r').each_line do |line|
38
+ File.open(file_name, "r").each_line do |line|
39
39
  last_command_started.write(line)
40
40
  end
41
41
  end
@@ -64,7 +64,7 @@ module Aruba
64
64
  # If block is given use it to filter the commands which should be
65
65
  # stoppend.
66
66
  def stop_all_commands(&block)
67
- cmds = if block_given?
67
+ cmds = if block
68
68
  all_commands.select(&block)
69
69
  else
70
70
  all_commands
@@ -81,7 +81,7 @@ module Aruba
81
81
  # If block is given use it to filter the commands which should be
82
82
  # terminated.
83
83
  def terminate_all_commands(&block)
84
- cmds = if block_given?
84
+ cmds = if block
85
85
  all_commands.select(&block)
86
86
  else
87
87
  all_commands
@@ -152,7 +152,7 @@ module Aruba
152
152
 
153
153
  unless command.interactive?
154
154
  raise NotImplementedError,
155
- 'Running interactively is not supported with this process launcher.'
155
+ "Running interactively is not supported with this process launcher."
156
156
  end
157
157
 
158
158
  start_command(command)
@@ -232,7 +232,7 @@ module Aruba
232
232
  @commands << cmd
233
233
 
234
234
  environment = aruba.environment
235
- working_directory = expand_path('.')
235
+ working_directory = expand_path(".")
236
236
  event_bus = aruba.event_bus
237
237
 
238
238
  cmd = Aruba.platform.detect_ruby(cmd)
@@ -256,7 +256,7 @@ module Aruba
256
256
  end
257
257
 
258
258
  def start_command(command)
259
- aruba.config.before(:command, self, command)
259
+ aruba.config.run_before_hook(:command, self, command)
260
260
 
261
261
  in_current_directory do
262
262
  command.start
@@ -265,7 +265,7 @@ module Aruba
265
265
  stop_signal = command.stop_signal
266
266
  aruba.announcer.announce(:stop_signal, command.pid, stop_signal) if stop_signal
267
267
 
268
- aruba.config.after(:command, self, command)
268
+ aruba.config.run_after_hook(:command, self, command)
269
269
  end
270
270
  end
271
271
  end
@@ -1,7 +1,7 @@
1
- require 'rspec/expectations'
2
- require 'aruba/runtime'
3
- require 'aruba/errors'
4
- require 'aruba/setup'
1
+ require "rspec/expectations"
2
+ require "aruba/runtime"
3
+ require "aruba/errors"
4
+ require "aruba/setup"
5
5
 
6
6
  # Aruba
7
7
  module Aruba
@@ -38,8 +38,8 @@ module Aruba
38
38
  # @yield
39
39
  # The block which should be run in current directory
40
40
  def in_current_directory(&block)
41
- create_directory '.' unless directory?('.')
42
- cd('.', &block)
41
+ create_directory "." unless directory?(".")
42
+ cd(".", &block)
43
43
  end
44
44
 
45
45
  # Switch to directory
@@ -57,16 +57,16 @@ module Aruba
57
57
  # result = cd('some-dir') { Dir.getwd }
58
58
  #
59
59
  def cd(dir, &block)
60
- if block_given?
60
+ if block
61
61
  begin
62
62
  unless Aruba.platform.directory?(expand_path(dir))
63
63
  raise ArgumentError,
64
64
  "#{expand_path(dir)} is not a directory or does not exist."
65
65
  end
66
66
 
67
- old_directory = expand_path('.')
67
+ old_directory = expand_path(".")
68
68
  aruba.current_directory << dir
69
- new_directory = expand_path('.')
69
+ new_directory = expand_path(".")
70
70
 
71
71
  aruba.event_bus.notify Events::ChangedWorkingDirectory.new(old: old_directory,
72
72
  new: new_directory)
@@ -78,8 +78,8 @@ module Aruba
78
78
  Aruba.platform.chdir real_new_directory
79
79
 
80
80
  result = with_environment(
81
- 'OLDPWD' => old_dir,
82
- 'PWD' => real_new_directory,
81
+ "OLDPWD" => old_dir,
82
+ "PWD" => real_new_directory,
83
83
  &block
84
84
  )
85
85
  ensure
@@ -94,9 +94,9 @@ module Aruba
94
94
  raise ArgumentError, "#{expand_path(dir)} is not a directory or does not exist."
95
95
  end
96
96
 
97
- old_directory = expand_path('.')
97
+ old_directory = expand_path(".")
98
98
  aruba.current_directory << dir
99
- new_directory = expand_path('.')
99
+ new_directory = expand_path(".")
100
100
 
101
101
  aruba.event_bus.notify Events::ChangedWorkingDirectory.new(old: old_directory,
102
102
  new: new_directory)
@@ -143,7 +143,7 @@ module Aruba
143
143
  def expand_path(file_name, dir_string = nil)
144
144
  unless file_name.is_a?(String) && !file_name.empty?
145
145
  message = "Filename #{file_name} needs to be a string." \
146
- ' It cannot be nil or empty either. '\
146
+ " It cannot be nil or empty either. "\
147
147
  "Please use `expand_path('.')` if you want the current directory to be expanded."
148
148
 
149
149
  raise ArgumentError, message
@@ -152,7 +152,7 @@ module Aruba
152
152
  unless Aruba.platform.directory? File.join(aruba.config.root_directory,
153
153
  aruba.config.working_directory)
154
154
  raise "Aruba's working directory does not exist." \
155
- ' Maybe you forgot to run `setup_aruba` before using its API.'
155
+ " Maybe you forgot to run `setup_aruba` before using its API."
156
156
  end
157
157
 
158
158
  prefix = file_name[0]
@@ -162,22 +162,22 @@ module Aruba
162
162
  path = File.join(*[aruba.fixtures_directory, rest].compact)
163
163
  unless Aruba.platform.exist? path
164
164
  aruba_fixture_candidates = aruba.config.fixtures_directories
165
- .map { |p| format('"%s"', p) }.join(', ')
165
+ .map { |p| format('"%s"', p) }.join(", ")
166
166
 
167
167
  raise ArgumentError,
168
168
  "Fixture \"#{rest}\" does not exist" \
169
169
  " in fixtures directory \"#{aruba.fixtures_directory}\"." \
170
- ' This was the one we found first on your system from all possible' \
170
+ " This was the one we found first on your system from all possible" \
171
171
  " candidates: #{aruba_fixture_candidates}."
172
172
  end
173
173
 
174
174
  path
175
- elsif prefix == '~'
175
+ elsif prefix == "~"
176
176
  path = with_environment do
177
177
  File.expand_path(file_name)
178
178
  end
179
179
 
180
- raise ArgumentError, 'Expanding "~/" to "/" is not allowed' if path == '/'
180
+ raise ArgumentError, 'Expanding "~/" to "/" is not allowed' if path == "/"
181
181
 
182
182
  unless Aruba.platform.absolute_path? path
183
183
  raise ArgumentError,
@@ -192,8 +192,8 @@ module Aruba
192
192
  aruba.logger.warn \
193
193
  "Aruba's `expand_path` method was called with an absolute path" \
194
194
  " at #{caller_file_line}, which is not recommended." \
195
- ' Change the call to pass a relative path or set '\
196
- '`config.allow_absolute_paths = true` to silence this warning'
195
+ " Change the call to pass a relative path or set "\
196
+ "`config.allow_absolute_paths = true` to silence this warning"
197
197
  end
198
198
  file_name
199
199
  else