Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
colorize interpolated text in Jekyll.logger.info
  • Loading branch information
ashmaroli committed Aug 16, 2016
1 parent 9f8876a commit a9f9227
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/jekyll/commands/new.rb
Expand Up @@ -34,7 +34,7 @@ def process(args, options = {})
create_site new_blog_path
end

Jekyll.logger.info "New jekyll site installed in #{new_blog_path}."
Jekyll.logger.info "New jekyll site installed in #{new_blog_path.cyan}."
end

def create_blank_site(path)
Expand Down
6 changes: 4 additions & 2 deletions lib/jekyll/commands/new_theme.rb
Expand Up @@ -16,6 +16,7 @@ def init_with_program(prog)
end
end

# rubocop:disable Metrics/AbcSize
def process(args, opts)
if !args || args.empty?
raise Jekyll::Errors::InvalidThemeName, "You must specify a theme name."
Expand All @@ -28,9 +29,10 @@ def process(args, opts)
end

theme.create!
Jekyll.logger.info "Your new Jekyll theme, #{theme.name}," \
" is ready for you in #{theme.path}!"
Jekyll.logger.info "Your new Jekyll theme, #{theme.name.cyan}," \
" is ready for you in #{theme.path.to_s.cyan}!"
Jekyll.logger.info "For help getting started, read #{theme.path}/README.md."
end
# rubocop:enable Metrics/AbcSize
end
end
2 changes: 1 addition & 1 deletion test/test_new_command.rb
Expand Up @@ -41,7 +41,7 @@ def site_template
should "display a success message" do
Jekyll::Commands::New.process(@args)
output = Jekyll.logger.messages.last
success_message = "New jekyll site installed in #{@full_path}."
success_message = "New jekyll site installed in #{@full_path.cyan}."
assert_includes output, success_message
end

Expand Down

0 comments on commit a9f9227

Please sign in to comment.