alchemy_cms 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 32cd97a2d51613e7b97f0a369d52fdcea5390b1f
4
- data.tar.gz: aa26582f94ed95c780a07773ce7f40c1cca1e391
2
+ SHA256:
3
+ metadata.gz: a705fbfafc88c6d704d135683860121e0ba587c27e3730db0b99690c39301e4f
4
+ data.tar.gz: 5e3bd59a9808f2c707570c534304243ea96f1e3f0e5cf3d4403261c00e64aab5
5
5
  SHA512:
6
- metadata.gz: b95d61495b2bce7683cecbdea814c08673e8688da61f3a690c9fbb6a1ba6560c031e1980377ef7f7e5fff785d334d9c0c7380f6951d4d214c5e4714ceec86f39
7
- data.tar.gz: 67022c61db2f6163f64bed4daf2cb5b51001ac424f18581cdf983b5e922db7dfb1c1184a61f819948e9fb8a1643178f1183d8101fda392c7c6db643bd476aede
6
+ metadata.gz: 95501e7b26788f436d965110aa6c050c5f6b390cf788941411014b3d146f81fd2c75b5ac239dc936b6f07318e8773199476b5b8c4e8c0c9d80a78b0ed47c801d
7
+ data.tar.gz: ec08999acc7c276fdf275379477977241e24413754a62972d81132ed319b3a1cd58ee5d3e61856a35fc430a88949eb0195a4860410457cd88d70d9b888142a83
@@ -58,7 +58,7 @@ module Alchemy
58
58
  private
59
59
 
60
60
  def read_yml_file
61
- ::YAML.safe_load(ERB.new(File.read(yml_file_path)).result, [], [], true) || []
61
+ ::YAML.safe_load(ERB.new(File.read(yml_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
62
62
  end
63
63
 
64
64
  def yml_file_path
@@ -28,7 +28,7 @@ module Alchemy
28
28
  #
29
29
  def read_definitions_file
30
30
  if ::File.exist?(definitions_file_path)
31
- ::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, [Date, Regexp, Symbol], [], true) || []
31
+ ::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
32
32
  else
33
33
  raise LoadError, "Could not find elements.yml file! Please run `rails generate alchemy:scaffold`"
34
34
  end
@@ -48,7 +48,8 @@ module Alchemy
48
48
  # If it does not exist, or its empty, it returns an empty Hash.
49
49
  #
50
50
  def read_file(file)
51
- return YAML.load_file(file) || {} if File.exist?(file) # YAML.load_file returns false if file is empty.
51
+ YAML.safe_load(ERB.new(File.read(file)).result, YAML_WHITELIST_CLASSES, [], true) || {}
52
+ rescue Errno::ENOENT
52
53
  {}
53
54
  end
54
55
 
@@ -159,7 +159,7 @@ module Alchemy
159
159
  #
160
160
  def read_definitions_file
161
161
  if File.exist?(layouts_file_path)
162
- YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, [Date, Symbol], [], true) || []
162
+ YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
163
163
  else
164
164
  raise LoadError, "Could not find page_layouts.yml file! Please run `rails generate alchemy:scaffold`"
165
165
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "4.0.0"
4
+ VERSION = "4.0.1"
5
5
 
6
6
  def self.version
7
7
  VERSION
@@ -1,5 +1,6 @@
1
1
  # Instantiate the global Alchemy namespace
2
2
  module Alchemy
3
+ Alchemy::YAML_WHITELIST_CLASSES = %w(Symbol Date Regexp)
3
4
  end
4
5
 
5
6
  # Require globally used external libraries
@@ -32,9 +32,9 @@ module Alchemy
32
32
  end
33
33
 
34
34
  def load_alchemy_yaml(name)
35
- YAML.safe_load(ERB.new(File.read("#{Rails.root}/config/alchemy/#{name}")).result, [Regexp], [], true)
35
+ YAML.safe_load(ERB.new(File.read("#{Rails.root}/config/alchemy/#{name}")).result, YAML_WHITELIST_CLASSES, [], true)
36
36
  rescue Errno::ENOENT
37
- puts "\nERROR: Could not read config/alchemy/#{name} file. Please run: rails generate alchemy:scaffold"
37
+ puts "\nERROR: Could not read config/alchemy/#{name} file. Please run: `rails generate alchemy:install`"
38
38
  end
39
39
  end
40
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2017-11-06 00:00:00.000000000 Z
16
+ date: 2018-04-23 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -1002,7 +1002,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1002
1002
  requirements:
1003
1003
  - ImageMagick (libmagick), v6.6 or greater.
1004
1004
  rubyforge_project:
1005
- rubygems_version: 2.6.13
1005
+ rubygems_version: 2.7.6
1006
1006
  signing_key:
1007
1007
  specification_version: 4
1008
1008
  summary: A powerful, userfriendly and flexible CMS for Rails 4