lib/vanagon/platform/dsl.rb
def platform(name, &block)
        @platform = case name
                    when /^aix-/
                      Vanagon::Platform::RPM::AIX.new(@name)
                    when /^(cisco-wrlinux|el|fedora)-/
                      Vanagon::Platform::RPM.new(@name)
                    when /^sles-/
                      Vanagon::Platform::RPM::SLES.new(@name)
                    when /^(cumulus|debian|huaweios|ubuntu)-/
                      Vanagon::Platform::DEB.new(@name)
                    when /^eos-/
                      Vanagon::Platform::RPM::EOS.new(@name)
                    when /^osx-/
                      Vanagon::Platform::OSX.new(@name)
                    when /^solaris-10/
                      Vanagon::Platform::Solaris10.new(@name)
                    when /^solaris-11/
                      Vanagon::Platform::Solaris11.new(@name)
                    when /^windows-/
                      Vanagon::Platform::Windows.new(@name)
                    else
                      fail "Platform not implemented for '#{@name}' yet. Please go do so..."
                    end

        block.call(self)
        @platform
      end
# Primary way of interacting with the DSL. Also a simple factory to get the right platform object.
#
# @param name [String] name of the platform
# @param block [Proc] DSL definition of the platform to call
Primary way of interacting with the DSL. Also a simple factory to get the right platform object.
Primary way of interacting with the DSL . Also a simple factory to get the right platform object .
def platform(name, &block)
        @platform = case name
                    when /^aix-/
                      Vanagon::Platform::RPM::AIX.new(@name)
                    when /^(cisco-wrlinux|el|fedora)-/
                      Vanagon::Platform::RPM.new(@name)
                    when /^sles-/
                      Vanagon::Platform::RPM::SLES.new(@name)
                    when /^(cumulus|debian|huaweios|ubuntu)-/
                      Vanagon::Platform::DEB.new(@name)
                    when /^eos-/
                      Vanagon::Platform::RPM::EOS.new(@name)
                    when /^osx-/
                      Vanagon::Platform::OSX.new(@name)
                    when /^solaris-10/
                      Vanagon::Platform::Solaris10.new(@name)
                    when /^solaris-11/
                      Vanagon::Platform::Solaris11.new(@name)
                    when /^windows-/
                      Vanagon::Platform::Windows.new(@name)
                    else
                      fail "Platform not implemented for '#{@name}' yet. Please go do so..."
                    end
        block.call(self)
        @platform
      end
def platform ( name , & block ) @platform = case name when / ^aix- / Vanagon :: Platform :: RPM :: AIX . new ( @name ) when / ^(cisco-wrlinux|el|fedora)- / Vanagon :: Platform :: RPM . new ( @name ) when / ^sles- / Vanagon :: Platform :: RPM :: SLES . new ( @name ) when / ^(cumulus|debian|huaweios|ubuntu)- / Vanagon :: Platform :: DEB . new ( @name ) when / ^eos- / Vanagon :: Platform :: RPM :: EOS . new ( @name ) when / ^osx- / Vanagon :: Platform :: OSX . new ( @name ) when / ^solaris-10 / Vanagon :: Platform :: Solaris10 . new ( @name ) when / ^solaris-11 / Vanagon :: Platform :: Solaris11 . new ( @name ) when / ^windows- / Vanagon :: Platform :: Windows . new ( @name ) else fail "Platform not implemented for '#{@name}' yet. Please go do so..." end block . call ( self ) @platform end
Primary way of interacting with the DSL.
Primary way of interacting with the DSL .
name
name of the platform
name of the platform
block
DSL definition of the platform to call
DSL definition of the platform to call