Module: Postwave::DisplayHelper
- Included in:
- BlogBuilder, BlogCreator, PostCreator
- Defined in:
- lib/postwave/display_helper.rb
Instance Method Summary collapse
- #output_blog_created ⇒ Object
- #output_blog_description_prompt ⇒ Object
- #output_blog_name_prompt ⇒ Object
- #output_blog_posts_path_prompt ⇒ Object
- #output_blog_url_prompt ⇒ Object
- #output_build_completed(build_time) ⇒ Object
-
#output_building ⇒ Object
build.
- #output_config_message ⇒ Object
-
#output_creating_blog ⇒ Object
new.
-
#output_creating_post ⇒ Object
post.
- #output_drafts_skipped(drafts) ⇒ Object
-
#output_exising_setup ⇒ Object
errors.
- #output_general_error ⇒ Object
- #output_missing_setup ⇒ Object
- #output_post_created(post_path) ⇒ Object
- #output_post_processed(posts) ⇒ Object
- #output_tags_created(tags) ⇒ Object
Instance Method Details
#output_blog_created ⇒ Object
30 31 32 |
# File 'lib/postwave/display_helper.rb', line 30 def output_blog_created puts "New blog set up.".green end |
#output_blog_description_prompt ⇒ Object
22 23 24 |
# File 'lib/postwave/display_helper.rb', line 22 def output_blog_description_prompt puts "Enter a short description of this blog (leave blank to skip): " end |
#output_blog_name_prompt ⇒ Object
10 11 12 |
# File 'lib/postwave/display_helper.rb', line 10 def output_blog_name_prompt puts "Enter the name of this blog (leave blank to skip): " end |
#output_blog_posts_path_prompt ⇒ Object
18 19 20 |
# File 'lib/postwave/display_helper.rb', line 18 def output_blog_posts_path_prompt puts "Enter the directory for the blog posts (if a post will be at http://example.com/blog/posts/post-title put blog/posts):" end |
#output_blog_url_prompt ⇒ Object
14 15 16 |
# File 'lib/postwave/display_helper.rb', line 14 def output_blog_url_prompt puts "Enter the url of this blog (leave blank to skip): " end |
#output_build_completed(build_time) ⇒ Object
67 68 69 |
# File 'lib/postwave/display_helper.rb', line 67 def output_build_completed(build_time) puts "Built succesfully in #{build_time} seconds.".green end |
#output_building ⇒ Object
build
46 47 48 |
# File 'lib/postwave/display_helper.rb', line 46 def output_building puts "🌊 Building..." end |
#output_config_message ⇒ Object
26 27 28 |
# File 'lib/postwave/display_helper.rb', line 26 def puts "All configuration values can be changed at any time by editing the postwave.yaml file." end |
#output_creating_blog ⇒ Object
new
6 7 8 |
# File 'lib/postwave/display_helper.rb', line 6 def output_creating_blog puts "🌊 Creating new blog..." end |
#output_creating_post ⇒ Object
post
36 37 38 |
# File 'lib/postwave/display_helper.rb', line 36 def output_creating_post puts "🌊 Creating new post..." end |
#output_drafts_skipped(drafts) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/postwave/display_helper.rb', line 55 def output_drafts_skipped(drafts) if drafts.any? count = drafts.count puts "Skipped #{count} #{simple_pluralizer("draft", count)}." end end |
#output_exising_setup ⇒ Object
errors
73 74 75 |
# File 'lib/postwave/display_helper.rb', line 73 def output_exising_setup puts "A blog already exists in this location.".red end |
#output_general_error ⇒ Object
81 82 83 |
# File 'lib/postwave/display_helper.rb', line 81 def output_general_error puts "Something went wrong.".red end |
#output_missing_setup ⇒ Object
77 78 79 |
# File 'lib/postwave/display_helper.rb', line 77 def output_missing_setup puts "You need to set up a blog first.".red end |
#output_post_created(post_path) ⇒ Object
40 41 42 |
# File 'lib/postwave/display_helper.rb', line 40 def output_post_created(post_path) puts "New post created at: #{post_path}".green end |
#output_post_processed(posts) ⇒ Object
50 51 52 53 |
# File 'lib/postwave/display_helper.rb', line 50 def output_post_processed(posts) count = posts.count puts "Processed #{count} #{simple_pluralizer("post", count)}." end |
#output_tags_created(tags) ⇒ Object
62 63 64 65 |
# File 'lib/postwave/display_helper.rb', line 62 def () count = .count puts "Built tag files for #{count} #{simple_pluralizer("tag", count)}." end |