Sha256: 24589f0ea698e3edc4a725b9dc340d23693dac6ba4556f1cb3d845f43e413642

Contents?: true

Size: 814 Bytes

Versions: 353

Compression:

Stored size: 814 Bytes

Contents

module Specinfra
  class Runner
    def self.method_missing(meth, *args)
      backend   = Specinfra.backend
      processor = Specinfra::Processor
      
      if ! os.include?(:family) || os[:family] != 'windows'
        if processor.respond_to?(meth)
          processor.send(meth, *args)
        elsif backend.respond_to?(meth)
          backend.send(meth, *args)
        else
          run(meth, *args)
        end
      else
        if backend.respond_to?(meth)
          backend.send(meth, *args)
        else
          run(meth, *args)
        end
      end
    end

    private
    def self.run(meth, *args)
      cmd = Specinfra.command.get(meth, *args)
      ret = Specinfra.backend.run_command(cmd)
      if meth.to_s =~ /^check/
        ret.success?
      else
        ret
      end
    end
  end
end

Version data entries

353 entries across 353 versions & 3 rubygems

Version Path
specinfra-2.91.0 lib/specinfra/runner.rb
specinfra-2.90.1 lib/specinfra/runner.rb
specinfra-2.90.0 lib/specinfra/runner.rb
specinfra-2.89.0 lib/specinfra/runner.rb
specinfra-2.88.2 lib/specinfra/runner.rb
specinfra-2.88.1 lib/specinfra/runner.rb
specinfra-2.88.0 lib/specinfra/runner.rb
specinfra-2.87.2 lib/specinfra/runner.rb
specinfra-2.87.1 lib/specinfra/runner.rb
specinfra-2.87.0 lib/specinfra/runner.rb
specinfra-2.86.0 lib/specinfra/runner.rb
specinfra-2.85.1 lib/specinfra/runner.rb
specinfra-2.85.0 lib/specinfra/runner.rb
specinfra-2.84.1 lib/specinfra/runner.rb
specinfra-2.84.0 lib/specinfra/runner.rb
specinfra-2.83.4 lib/specinfra/runner.rb
specinfra-2.83.3 lib/specinfra/runner.rb
specinfra-2.83.2 lib/specinfra/runner.rb
specinfra-2.83.1 lib/specinfra/runner.rb
specinfra-2.83.0 lib/specinfra/runner.rb