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.24.0 lib/specinfra/runner.rb
specinfra-2.23.0 lib/specinfra/runner.rb
specinfra-2.22.0 lib/specinfra/runner.rb
specinfra-2.21.1 lib/specinfra/runner.rb
specinfra-2.21.0 lib/specinfra/runner.rb
specinfra-2.20.2 lib/specinfra/runner.rb
specinfra-2.20.1 lib/specinfra/runner.rb
specinfra-2.20.0 lib/specinfra/runner.rb
specinfra-2.19.6 lib/specinfra/runner.rb
specinfra-2.19.5 lib/specinfra/runner.rb
specinfra-2.19.4 lib/specinfra/runner.rb
specinfra-2.19.3 lib/specinfra/runner.rb
specinfra-2.19.2 lib/specinfra/runner.rb
specinfra-2.19.1 lib/specinfra/runner.rb
specinfra-2.19.0 lib/specinfra/runner.rb
specinfra-2.18.3 lib/specinfra/runner.rb
specinfra-2.18.2 lib/specinfra/runner.rb
specinfra-2.18.1 lib/specinfra/runner.rb
specinfra-2.18.0 lib/specinfra/runner.rb
specinfra-2.17.1 lib/specinfra/runner.rb