Class: RSpec::Core::Bisect::ShellCommand
- Includes:
- ShellEscape
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb
Overview
Provides an API to generate shell commands to run the suite for a set of locations, using the given bisect server to capture the results.
Constant Summary
Constants included from ShellEscape
ShellEscape::SHELLS_ALLOWING_UNQUOTED_IDS
Instance Attribute Summary collapse
-
#original_cli_args ⇒ Object
readonly
Returns the value of attribute original_cli_args.
Instance Method Summary collapse
- #bisect_environment_hash ⇒ Object
- #command_for(locations, server) ⇒ Object
-
#initialize(original_cli_args) ⇒ ShellCommand
constructor
A new instance of ShellCommand.
- #original_locations ⇒ Object
- #repro_command_from(locations) ⇒ Object
- #spec_opts_without_bisect ⇒ Object
Methods included from ShellEscape
conditionally_quote, quote, shell_allows_unquoted_ids?
Constructor Details
#initialize(original_cli_args) ⇒ ShellCommand
Returns a new instance of ShellCommand.
13 14 15 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb', line 13 def initialize(original_cli_args) @original_cli_args = original_cli_args.reject { |arg| arg.start_with?("--bisect") } end |
Instance Attribute Details
#original_cli_args ⇒ Object (readonly)
Returns the value of attribute original_cli_args.
11 12 13 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb', line 11 def original_cli_args @original_cli_args end |
Instance Method Details
#bisect_environment_hash ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb', line 47 def bisect_environment_hash if ENV.key?('SPEC_OPTS') { 'SPEC_OPTS' => spec_opts_without_bisect } else {} end end |
#command_for(locations, server) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb', line 17 def command_for(locations, server) parts = [] parts << RUBY << load_path parts << open3_safe_escape(RSpec::Core.path_to_executable) parts << "--format" << "bisect-drb" parts << "--drb-port" << server.drb_port parts.concat() parts.concat(locations.map { |l| open3_safe_escape(l) }) parts.join(" ") end |
#original_locations ⇒ Object
43 44 45 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb', line 43 def original_locations .fetch(:files_or_directories_to_run) end |
#repro_command_from(locations) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb', line 32 def repro_command_from(locations) parts = [] parts.concat environment_repro_parts parts << "rspec" parts.concat Formatters::Helpers.organize_ids(locations) parts.concat original_cli_args_without_locations parts.join(" ") end |
#spec_opts_without_bisect ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb', line 55 def spec_opts_without_bisect Shellwords.join( Shellwords.split(ENV.fetch('SPEC_OPTS', '')).reject do |arg| arg =~ /^--bisect/ end ) end |