Sha256: ef4870c73ef22732c48e2fafb50a515de7e58eb1ce41827434fc65dece921775
Contents?: true
Size: 869 Bytes
Versions: 3
Compression:
Stored size: 869 Bytes
Contents
module SpecInfra module Helper ['Exec', 'Ssh', 'Cmd', 'WinRM', 'ShellScript'].each do |backend| eval <<-EOF module #{backend} def backend(commands_object=nil) if ! respond_to?(:commands) commands_object = SpecInfra::Command::Base.new end instance = SpecInfra::Backend::#{backend}.instance instance.set_commands(commands_object || commands) instance end end EOF end module Backend def backend_for(type) if ! respond_to?(:commands) commands_object = SpecInfra::Command::Base.new end instance = self.class.const_get('SpecInfra').const_get('Backend').const_get(type.to_s.capitalize).instance instance.set_commands(commands_object || commands) instance end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
specinfra-0.0.8 | lib/specinfra/helper/backend.rb |
specinfra-0.0.7 | lib/specinfra/helper/backend.rb |
specinfra-0.0.6 | lib/specinfra/helper/backend.rb |