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.82.25 lib/specinfra/runner.rb
specinfra-2.82.24 lib/specinfra/runner.rb
specinfra-2.82.23 lib/specinfra/runner.rb
specinfra-2.82.22 lib/specinfra/runner.rb
specinfra-2.82.21 lib/specinfra/runner.rb
specinfra-2.82.20 lib/specinfra/runner.rb
specinfra-2.82.19 lib/specinfra/runner.rb
specinfra-2.82.18 lib/specinfra/runner.rb
specinfra-2.82.17 lib/specinfra/runner.rb
specinfra-2.82.16 lib/specinfra/runner.rb
specinfra-2.82.15 lib/specinfra/runner.rb
specinfra-2.82.14 lib/specinfra/runner.rb
specinfra-2.82.13 lib/specinfra/runner.rb
specinfra-2.82.12 lib/specinfra/runner.rb
specinfra-2.82.11 lib/specinfra/runner.rb
specinfra-2.82.10 lib/specinfra/runner.rb
specinfra-2.82.9 lib/specinfra/runner.rb
specinfra-2.82.8 lib/specinfra/runner.rb
specinfra-2.82.7 lib/specinfra/runner.rb
specinfra-2.82.6 lib/specinfra/runner.rb