From d238e45e64f7bb3c646453a9fdad44d1b7690ed2 Mon Sep 17 00:00:00 2001 From: Michael Swiger Date: Sun, 16 Apr 2023 21:48:45 -0700 Subject: [PATCH 1/2] Fix tests --- spec/compose_spec.rb | 6 +++--- spec/draft_spec.rb | 2 +- spec/post_spec.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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 From a6468f5c1a022f5ea0e4549d71a37b29af6ac239 Mon Sep 17 00:00:00 2001 From: Michael Swiger Date: Sun, 16 Apr 2023 22:45:19 -0700 Subject: [PATCH 2/2] Fix warning when running publish/unpublish with date in frontmatter --- lib/jekyll-compose/file_mover.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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