Sha256: 2fe8a049661d770658504372230712fd2b3b9955306118c61746ba97aae16e59

Contents?: true

Size: 373 Bytes

Versions: 14

Compression:

Stored size: 373 Bytes

Contents

require 'crack/json'

module Crack
  class JSON

    def self.parse_with_tumblr(json)
      cleaned_json = json.gsub(/^var\s+.+\s+=\s+/, '').gsub(/;$/, '')
      parse_without_tumblr(cleaned_json)
    rescue ArgumentError => e
      raise ParseError, "Invalid JSON string #{e.inspect}"
    end

    class << self
      alias_method_chain :parse, :tumblr
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 lib/locomotive/httparty/patches.rb
locomotive_cms-1.0.0.beta lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta12 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta11 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta10 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta9 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta8 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta7 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta5 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta4 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta3 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta2 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4.beta1 lib/locomotive/httparty/patches.rb
locomotive_cms-0.0.4 lib/locomotive/httparty/patches.rb