Use native Ruby JSON implementation instead of ActiveSupport's.

v3-stable
Mauro Otonelli 2015-07-14 19:30:17 -03:00
parent c14fd72d04
commit 63d6a00ed9
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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