diff --git a/lib/jekyll-compose/file_mover.rb b/lib/jekyll-compose/file_mover.rb index 749efd5..55460c1 100644 --- a/lib/jekyll-compose/file_mover.rb +++ b/lib/jekyll-compose/file_mover.rb @@ -53,7 +53,7 @@ def update_front_matter if content =~ Jekyll::Document::YAML_FRONT_MATTER_REGEXP content = $POSTMATCH match = Regexp.last_match[1] if Regexp.last_match - data = movement.front_matter(Psych.safe_load(match)) + data = movement.front_matter(Psych.safe_load(match, permitted_classes: [Date, Time])) File.write(from, "#{Psych.dump(data)}---\n#{content}") end rescue Psych::SyntaxError => e diff --git a/spec/compose_spec.rb b/spec/compose_spec.rb index 9526345..71b0d00 100644 --- a/spec/compose_spec.rb +++ b/spec/compose_spec.rb @@ -145,7 +145,7 @@ capture_stdout { described_class.process(args) } post = File.read(path) expect(post).to match(%r!description: my description!) - expect(post).to match(%r!category: !) + expect(post).to match(%r!category:!) end context "env variable EDITOR is set up" do @@ -332,7 +332,7 @@ capture_stdout { described_class.process(args, options) } post = File.read(path) expect(post).to match(%r!description: my description!) - expect(post).to match(%r!category: !) + expect(post).to match(%r!category:!) end context "env variable EDITOR is set up" do @@ -513,7 +513,7 @@ capture_stdout { described_class.process(args, options) } post = File.read(path) expect(post).to match(%r!description: my description!) - expect(post).to match(%r!category: !) + expect(post).to match(%r!category:!) end context "env variable EDITOR is set up" do diff --git a/spec/draft_spec.rb b/spec/draft_spec.rb index 8b7eae6..82708ba 100644 --- a/spec/draft_spec.rb +++ b/spec/draft_spec.rb @@ -118,7 +118,7 @@ capture_stdout { described_class.process(args) } post = File.read(path) expect(post).to match(%r!description: my description!) - expect(post).to match(%r!category: !) + expect(post).to match(%r!category:!) end context "env variable EDITOR is set up" do diff --git a/spec/post_spec.rb b/spec/post_spec.rb index f78d66c..31e0518 100644 --- a/spec/post_spec.rb +++ b/spec/post_spec.rb @@ -129,7 +129,7 @@ capture_stdout { described_class.process(args) } post = File.read(path) expect(post).to match(%r!description: my description!) - expect(post).to match(%r!category: !) + expect(post).to match(%r!category:!) end context "env variable EDITOR is set up" do