Deserializer in ruby
The name for this type of parsing is called the shunting yard algorithm.

Your code itself seems fine, as long as you don't intend to support strings with curly braces, e.g. deserialize("{a:{b:'{{{{{{{{'}}").  The biggest issue I see is that it's not very ruby-like in the naming or formatting.  I've made brief attempt at cleaning it up a little below.

def deserialize(input)
  hash = {}                 # avoid one letter variable names
  stack = [] 
  curr_string = ''          # use single quotes for uninterpolated strings

  input.chars.each do |c|   # This is a better was to loop through the characters
    case c 
      when '{' 
        curr_string = ''
                            # whitespace makes it easier to read the different cases
      when ':' 
        stack.push(curr_string)
        curr_string = ''

      when '}', ',' 
        stack.push(curr_string) unless curr_string.empty?  # unless is the same as "if not"
                                                           # also use one line statements when the logic is simple
        if stack.length &gt; 0
          val = stack.pop
          key = stack.pop
          stack.push({key =&gt; val})
        end  
        curr_string = ''

      else
        curr_string += c
    end
  end
  stack.each { |n| hash.merge!(n)}
  hash
end