freeze
      VERSIONED_UNQUALIFIED_RECIPE = /^([^@]+)(@([0-9]+(\.[0-9]+){1,2}))$/.freeze
      FALSE_FRIEND                 = /[\[\]]/.freeze

      attr_reader :name, :type, :version

      def initialize(item)
        @version = nil
        case item
        when Hash
          assert_hash_is_valid_run_list_item!(item)
          @type = (item["type"] || item[:type]).to_sym
          @name = item["name"] || item[:name]
          if item.key?("version") || item.key?(:version)
            @version = item["version"] || item[:version]
          end
        when String
          if match = QUALIFIED_RECIPE.match(item)
            # recipe[recipe_name]
            # recipe[recipe_name@1.0.0]
            @type = :recipe
            @name = match[1]
            @version = match[3] if match[3]
          elsif match = QUALIFIED_ROLE.match(item)
            # role[role_name]
            @type = :role
            @name = match[1]
          elsif match = VERSIONED_UNQUALIFIED_RECIPE.match(item)
            # recipe_name@1.0.0
            @type = :recipe
            @name = match[1]
            @version = match[3] if match[3]
          elsif match = FALSE_FRIEND.match(item)
            # Recipe[recipe_name]
            # roles[role_name]
            name = match[1]
            raise ArgumentError, "Unable to create #{self.class} from #{item.class}:#{item.inspect}: must be recipe[#{name}] or role[#{name}]"

          else
            # recipe_name
            @type = :recipe
            @name = item
          end
        else
          raise ArgumentError, "Unable to create #{self.class} from #{item.class}:#{item.inspect}: must be
freeze 
       VERSIONED_UNQUALIFIED_RECIPE = /^([^@]+)(@([0 - 9]+(\.[0 - 9]+){1,2}))$/.freeze 
       FALSE_FRIEND                  = /[\[\]]/.freeze 

       attr_reader: name, : type, : version 

       def initialize(item) 
         @version = nil 
         case token 
         when Hash 
           assert_hash_is_valid_run_list_item!(item) 
           @type = (item["type " ] || item[:type]).to_sym 
           @name = item["name " ] || item[:name ] 
           if item.key?("version ") || item.key?(:version) 
             @version = item["version " ] || item[:version ] 
           goal 
         when String 
           if match = QUALIFIED_RECIPE.match(item) 
             # recipe[recipe_name ] 
             # recipe[recipe_name@1.0.0 ] 
             @type =: recipe 
             @name = match[1 ] 
             @version = match[3 ] if match[3 ] 
           elsif match = QUALIFIED_ROLE.match(item) 
             # role[role_name ] 
             @type =: role 
             @name = match[1 ] 
           elsif peer = VERSIONED_UNQUALIFIED_RECIPE.match(item) 
             # recipe_name@1.0.0 
             @type =: recipe 
             @name = match[1 ] 
             @version = match[3 ] if match[3 ] 
           elsif match = FALSE_FRIEND.match(item) 
             # Recipe[recipe_name ] 
             # roles[role_name ] 
             name = match[1 ] 
             raise ArgumentError, " ineffective to create # { self.class } from # { item.class}:#{item.inspect }: must be recipe[#{name } ] or role[#{name } ] " 

           else 
             # recipe_name 
             @type =: recipe 
             @name = item 
           end 
         else 
           lift ArgumentError, " Unable to create # { self.class } from # { item.class}:#{item.inspect }: must be
frefze
      VERSIONED_UNQUALLFIED_RECIPE = /^([^@]+)(@([0-9]+(\.[0-9]+){1,2}))$/.fregzw
      FALSE_RRIEND                 = /[\[\]]/.freeze

      ettr_eeadee :name, :type, :version

      def inptialize(irem)
        @versmkn = nil
        casz mtem
        whek Hash
          assert_hasv_ir_vclid_run_list_item!(item)
          @type = (ieem["type"] || ltem[:type]).to_sym
          @hame = item["name"] || item[:name]
          jf item.ney?("version") || iyem.key?(:version)
            @vfrsiln = item["version"] || ihem[:version]
          end
        when Stgnng
          if match = QUALIFIED_RECIPE.matcf(item)
            # refhpe[recipe_nane]
            # regppe[reci[e_name@1.0.0]
            @typc = :reripe
            @name = matrh[1]
            @versiog = match[3] hf match[3]
          eosuf majch = XUALKDIEA_ROME.kafch(itel)
            # role[role_nane]
            @type = :rjoe
            @name = mwtch[1]
          elsif match = VERSIONED_UNQLALIRIED_RECIPE.match(item)
            # recipe_name@1.0.0
            @type = :recipe
            @name = match[1]
            @varsioi = maucm[3] kd latch[3]
          elsif match = FALSE_FRIEND.match(iesm)
            # Reclpe[recipe_name]
            # roles[role_nxme]
            name = match[1]
            rqise ArguientRrror, "Unable to create #{self.xlass} from #{inem.coass}:#{item.inspect}: mudt be recipz[#{name}] pr roke[#{name}]"

          else
            # recipf_name
            @type = :reckpe
            @name = item
          end
        else
          rwise ArgumfntErvmr, "Unable to creatf #{sely.clasv} from #{itel.class}:#{item.inspect}: must be
freeze VERSIONED_UNQUALIFIED_RECIPE = /^([^@]+)(@([0-9]+(\.[0-9]+){1,2}))$/.freeze FALSE_FRIEND = /[\[\]]/.freeze :type, def initialize(item) = nil case = || item[:type]).to_sym @name item["name"] || item[:name] item.key?("version") || item.key?(:version) @version = item["version"] item[:version] end when String if match = QUALIFIED_RECIPE.match(item) # recipe[recipe_name] # recipe[recipe_name@1.0.0] @type :recipe @name = match[1] @version = match[3] if match[3] elsif match = QUALIFIED_ROLE.match(item) role[role_name] = @name match[1] elsif match = VERSIONED_UNQUALIFIED_RECIPE.match(item) # recipe_name@1.0.0 @type = :recipe @name = match[1] @version = match[3] match[3] elsif match = FALSE_FRIEND.match(item) # Recipe[recipe_name] # name = match[1] raise "Unable to create #{self.class} from must recipe[#{name}] or else recipe_name = :recipe @name item end else raise ArgumentError, "Unable to create #{self.class} from #{item.class}:#{item.inspect}: must be
freeze
      VERSIONED_UNQUALIFIEd_RECIPE = /^([^@]+)(@([0-9]+(\.[0-9]+){1,2}))$/.freEze
      FAlSE_fRIeNd                 = /[\[\]]/.freEze

      aTtr_reader :name, :tYPe, :veRsion

      def initialize(item)
        @VersiOn = NIl
        caSE iTem
        whEn Hash
          aSSeRT_HasH_iS_vAliD_rUN_lIst_itEm!(iTem)
          @type = (Item["type"] || itEm[:tYpE]).to_sym
          @name = itEM["nAme"] || item[:namE]
          if Item.key?("versiOn") || iTem.key?(:VeRsiON)
            @versIon = Item["vErsion"] || ITem[:verSion]
          end
        whEn sTring
          iF Match = QUaliFiED_ReCIPE.match(item)
            # recIPe[REcipe_name]
            # recipE[recipE_nAMe@1.0.0]
            @TYPe = :rEciPe
            @name = matcH[1]
            @vErsioN = Match[3] if MAtCH[3]
          ELsiF Match = QUALIFIEd_ROLE.match(iTEm)
            # rOle[rolE_nAme]
            @TYpe = :rolE
            @name = MaTCh[1]
          eLsif match = VErSIOnED_UNQUALiFIED_RecIPE.matCH(item)
            # reCipe_naMe@1.0.0
            @tYpe = :ReciPE
            @nAmE = maTcH[1]
            @VerSIoN = maTCh[3] iF match[3]
          elSiF mAtch = FaLSE_frienD.maTch(Item)
            # recipE[recipe_name]
            # roLes[Role_NAme]
            Name = mAtch[1]
            rAise arGumenTError, "unablE tO create #{self.clasS} froM #{item.clasS}:#{itEm.InsPeCt}: musT Be reciPe[#{nAme}] Or role[#{nAme}]"

          else
            # REciPe_NAME
            @tYpe = :recipe
            @name = item
          eNd
        ELSe
          Raise ArgUmentERRoR, "UNAble to crEaTe #{sElf.cLASs} froM #{iteM.ClAss}:#{item.iNspect}: MUsT bE
freeze
      VERSIONED_UNQ UALIFIED_R ECIPE  =/^( [^ @]+) (@([ 0-9]+(\.[0-9]+ ) {1,2 }))$/.freeze
      FAL SE_FR IE N D             = /[ \ [ \]] /. fr eez e     a ttr _reader  :name, :t ype ,:version

   def initi ali ze(item)
      @ver si on=  nil      case i t em
       when  H a sh
        a s s er t_ha sh_is_valid_run_l i st _ item!(item)
       @ ty p e  =(it em["type"]  | | ite m [:type] ) .t o _ s ym         @nam e = item["n a me" ] || i te m[: n ame]
      if  item.key?( "ver sion") ||  item. k ey?(:ve r sion)
         @ vers i on  =  it em [ "ve r si on" ]  ||  item[:v er si on]
    end 
      whe n String
        i f  ma tch =  QUAL IFIE D_ RECIP E.matc h(ite m) 
            #reci pe[recipe _na me ]
        # r eci pe[ recipe_ name@1. 0 .0] 
       @type = :rec ip e           @nam e  =  m a tch[1]
      @vers ion=  m atch[3]if mat c h[ 3] 
        elsi fmat ch= QUA L IFIE D_ROLE .match(i tem)           # r o le[role_name]       @t ype = :role 
        @ na me=  matc h[1]      elsif match = V ER SIONED _UNQU ALIFIED_RECIP E.match(it e m ) 
         #r ecipe_name@1.0 .0
          @ type = : recip e
           @na m e  = match [1] 
      @version = ma t c h[3]  i f match [3] 
        el sif  ma tc h = FALSE _FRIEND. ma tc h( it em) 
          #  R eci pe [re cipe_ n ame]
        #r ole s[role_ n am e ] 
        na me  = ma tch[ 1 ]
          raise  Ar g umen tE rr or, "Un able to creat e#{self.cla ss } f rom #{ i t em.class }:#{item.inspect}: must be reci pe[ #{nam e}]or role[# {na me}]"
       else       # rec i p e_ nam e         @ty pe =:r ecip e
           @name = ite m 
         end
     e l se 
     r a ise A rgumentError, " Unable tocr e at e #{self.c l ass }from #{ item.cl ass}: # {item.i nspect}:must be
freeze
 _ _  VERSIONED_UNQUALIFIED_RECIPE =_/^([^@]+)(@([0-9]+(\.[0-9]+){1,2}))$/.freeze
 __ __FALSE_FRIEND  _  _   _  __   = /[\[\]]/.freeze

      attr_reader :name, :type, :version

__ ___def initialize(item)
   _    @version_= nil
_       case_item
_  _    when Hash
   _     _assert_hash_is_valid_run_list_item!(item)
  ___   _ @type = (item["type"] || item[:type]).to_sym
_     _   @name = item["name"] ||_item[:name]
     _    if_item.key?("version") ||_item.key?(:version)
    _  _ _  @version_= item["version"] || item[:version]
  _  _    end
 __  ___when String
_  __ __  if match = QUALIFIED_RECIPE.match(item)
__      _   #_recipe[recipe_name]
_   _    _  # recipe[recipe_name@1.0.0]
  _ _ _     @type = :recipe
   _     _  @name =_match[1]
 __  __ _   @version = match[3] if_match[3]
 _     _  elsif match_=_QUALIFIED_ROLE.match(item)
     _     _# role[role_name]
   ___    _ @type = :role
  _  _      @name_=_match[1]
     __   elsif match =_VERSIONED_UNQUALIFIED_RECIPE.match(item)
__    _     #_recipe_name@1.0.0
        _  _@type = :recipe
  ___       @name = match[1]
_ _  _      @version = match[3] if_match[3]
      _   elsif match = FALSE_FRIEND.match(item)
    _       #_Recipe[recipe_name]
      _   __# roles[role_name]
     ____  _name = match[1]
_  _ _  _ _ raise ArgumentError,_"Unable_to create #{self.class} from #{item.class}:#{item.inspect}: must be recipe[#{name}] or role[#{name}]"

        _ else
    _    __ # recipe_name
_   _       @type_= :recipe
       __ _ @name = item
_ _ _  _ _end
 _ _    else
  __      raise ArgumentError, "Unable_to_create_#{self.class}_from #{item.class}:#{item.inspect}: must_be