From cca8f906383bcad273d7a7a70feae70da2c726c1 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Mon, 8 Oct 2018 14:18:16 +0530 Subject: [PATCH] Add some color to the success msg like jekyll new (#75) Merge pull request 75 --- lib/jekyll-compose/file_creator.rb | 2 +- spec/draft_spec.rb | 2 +- spec/page_spec.rb | 2 +- spec/post_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jekyll-compose/file_creator.rb b/lib/jekyll-compose/file_creator.rb index 6e2ed8f..2f1b4d4 100644 --- a/lib/jekyll-compose/file_creator.rb +++ b/lib/jekyll-compose/file_creator.rb @@ -37,7 +37,7 @@ def write_file f.puts(file.content) end - Jekyll.logger.info "New #{file.resource_type} created at #{file_path}." + Jekyll.logger.info "New #{file.resource_type} created at #{file_path.cyan}" end end end diff --git a/spec/draft_spec.rb b/spec/draft_spec.rb index 6135ac2..1d572ef 100644 --- a/spec/draft_spec.rb +++ b/spec/draft_spec.rb @@ -27,7 +27,7 @@ it "writes a helpful success message" do output = capture_stdout { described_class.process(args) } - expect(output).to include("New draft created at _drafts/a-test-post.md.") + expect(output).to include("New draft created at #{"_drafts/a-test-post.md".cyan}") end it "errors with no arguments" do diff --git a/spec/page_spec.rb b/spec/page_spec.rb index 485734d..fabb4bd 100644 --- a/spec/page_spec.rb +++ b/spec/page_spec.rb @@ -35,7 +35,7 @@ it "should write a helpful message when successful" do output = capture_stdout { described_class.process(args) } - expect(output).to include("New page created at #{filename}.") + expect(output).to include("New page created at #{filename.cyan}") end it "errors with no arguments" do diff --git a/spec/post_spec.rb b/spec/post_spec.rb index 977be38..a17383d 100644 --- a/spec/post_spec.rb +++ b/spec/post_spec.rb @@ -51,7 +51,7 @@ it "should write a helpful message when successful" do output = capture_stdout { described_class.process(args) } - expect(output).to include("New post created at _posts/#{filename}.") + expect(output).to include("New post created at #{File.join("_posts", filename).cyan}") end it "errors with no arguments" do