Use native Ruby JSON implementation instead of ActiveSupport's.
This commit is contained in:
parent
c14fd72d04
commit
63d6a00ed9
|
@ -9,7 +9,7 @@ module Middleman
|
|||
def registered(app)
|
||||
# Data formats
|
||||
require 'yaml'
|
||||
require 'active_support/json'
|
||||
require 'json'
|
||||
|
||||
app.config.define_setting :data_dir, 'data', 'The directory data files are stored in'
|
||||
app.send :include, InstanceMethods
|
||||
|
@ -98,7 +98,7 @@ module Middleman
|
|||
if %w(.yaml .yml).include?(extension)
|
||||
data = YAML.load_file(full_path)
|
||||
elsif extension == '.json'
|
||||
data = ActiveSupport::JSON.decode(full_path.read)
|
||||
data = JSON.parse(full_path.read)
|
||||
else
|
||||
return
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ require 'pathname'
|
|||
require 'yaml'
|
||||
|
||||
# Parsing JSON frontmatter
|
||||
require 'active_support/json'
|
||||
require 'json'
|
||||
|
||||
# Extensions namespace
|
||||
module Middleman::CoreExtensions
|
||||
|
@ -154,7 +154,7 @@ module Middleman::CoreExtensions
|
|||
|
||||
begin
|
||||
json = ($1 + $2).sub(';;;', '{').sub(';;;', '}')
|
||||
data = ActiveSupport::JSON.decode(json).symbolize_keys
|
||||
data = JSON.parse(json).symbolize_keys
|
||||
rescue => e
|
||||
app.logger.error "JSON Exception parsing #{full_path}: #{e.message}"
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue