Sha256: 86d9c795b8679a4f30e69fc73d843ce5d6f5e2b8cfa3f6937dff99227c4136e4

Contents?: true

Size: 1.69 KB

Versions: 76

Compression:

Stored size: 1.69 KB

Contents

module RSpec
  module Core
    # @private
    module Invocations
      # @private
      class InitializeProject
        def call(*_args)
          RSpec::Support.require_rspec_core "project_initializer"
          ProjectInitializer.new.run
          0
        end
      end

      # @private
      class DRbWithFallback
        def call(options, err, out)
          require 'rspec/core/drb'
          begin
            return DRbRunner.new(options).run(err, out)
          rescue DRb::DRbConnError
            err.puts "No DRb server is running. Running in local process instead ..."
          end
          RSpec::Core::Runner.new(options).run(err, out)
        end
      end

      # @private
      class Bisect
        def call(options, _err, _out)
          RSpec::Support.require_rspec_core "bisect/coordinator"

          success = RSpec::Core::Bisect::Coordinator.bisect_with(
            options.args,
            RSpec.configuration,
            bisect_formatter_for(options.options[:bisect])
          )

          success ? 0 : 1
        end

        private

        def bisect_formatter_for(argument)
          return Formatters::BisectDebugFormatter if argument == "verbose"
          Formatters::BisectProgressFormatter
        end
      end

      # @private
      class PrintVersion
        def call(_options, _err, out)
          out.puts RSpec::Core::Version::STRING
          0
        end
      end

      # @private
      PrintHelp = Struct.new(:parser, :invalid_options) do
        def call(_options, _err, out)
          # Removing the blank invalid options from the output.
          out.puts parser.to_s.gsub(/^\s+(#{invalid_options.join('|')})\s*$\n/, '')
          0
        end
      end
    end
  end
end

Version data entries

76 entries across 68 versions & 16 rubygems

Version Path
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.5.4/lib/rspec/core/invocations.rb