Merge pull request #1560 from mauro-oto/remove_active_support_json

Drop active_support's JSON in favor of native JSON implementation
v3-stable
Eliott Appleford 2015-07-15 12:03:06 +01:00
commit a855b634e6
4 changed files with 5 additions and 9 deletions

View File

@ -6,7 +6,7 @@ gem 'yard', '~> 0.8', require: false
# Test tools
gem 'pry', '~> 0.10', group: :development
gem 'aruba', '~> 0.6'
gem 'aruba', '~> 0.7.4'
gem 'rspec', '~> 3.0'
gem 'fivemat', '~> 1.3'
gem 'cucumber', '~> 1.3'

View File

@ -8,10 +8,6 @@ require 'i18n'
# users expect.
::I18n.enforce_available_locales = false
# Use ActiveSupport JSON
require 'active_support/json'
require 'active_support/core_ext/integer/inflections'
# Simple callback library
require 'hooks'

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