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.11.9 lib/specinfra/runner.rb
specinfra-2.11.8 lib/specinfra/runner.rb
specinfra-2.11.7 lib/specinfra/runner.rb
specinfra-2.11.6 lib/specinfra/runner.rb
specinfra-2.11.5 lib/specinfra/runner.rb
specinfra-2.11.4 lib/specinfra/runner.rb
specinfra-2.11.3 lib/specinfra/runner.rb
specinfra-2.11.2 lib/specinfra/runner.rb
specinfra-2.11.1 lib/specinfra/runner.rb
specinfra-2.11.0 lib/specinfra/runner.rb
specinfra-2.10.4 lib/specinfra/runner.rb
specinfra-2.10.3 lib/specinfra/runner.rb
specinfra-2.10.2 lib/specinfra/runner.rb
specinfra-2.10.1 lib/specinfra/runner.rb
specinfra-2.10.0 lib/specinfra/runner.rb
specinfra-2.9.3 lib/specinfra/runner.rb
specinfra-2.9.2 lib/specinfra/runner.rb
specinfra-2.9.1 lib/specinfra/runner.rb
specinfra-2.9.0 lib/specinfra/runner.rb
specinfra-2.8.0 lib/specinfra/runner.rb