class MessageWriter
Constants
- PASTEL
Public Class Methods
new(title)
click to toggle source
# File lib/ez_gen/message_writer.rb, line 5 def initialize(title) @title = title @message = {} end
Public Instance Methods
write()
click to toggle source
# File lib/ez_gen/message_writer.rb, line 10 def write stylize confirmation end
Private Instance Methods
confirmation()
click to toggle source
# File lib/ez_gen/message_writer.rb, line 17 def confirmation puts "\n" * 4 puts spacing[:spacing1] + @message[:repo] + @message[:title],"" puts spacing[:spacing1] + @message[:branch] + @message[:dev],"" puts spacing[:spacing2] + @message[:instructions],"" puts spacing[:spacing1] + @message[:run] + @message[:cd],"" puts spacing[:spacing1] + @message[:then],"" puts spacing[:spacing1] + @message[:run] + @message[:rake] + @message[:options],"" puts "\n" * 4 end
cyan_bold()
click to toggle source
# File lib/ez_gen/message_writer.rb, line 54 def cyan_bold { instructions: "INSTRUCTIONS:" } end
cyan_italic()
click to toggle source
# File lib/ez_gen/message_writer.rb, line 35 def cyan_italic { repo: "Created new repository: ", branch: "Switched to new branch: ", run: "Run: ", options: "to see available rake tasks", then: "then..." } end
magenta_bold()
click to toggle source
# File lib/ez_gen/message_writer.rb, line 45 def magenta_bold { title: @title, dev: "dev", cd: "cd #{@title}", rake: "rake --tasks " } end
spacing()
click to toggle source
# File lib/ez_gen/message_writer.rb, line 28 def spacing { spacing1: " " * 10, spacing2: " " * 15, } end
stylize()
click to toggle source
# File lib/ez_gen/message_writer.rb, line 60 def stylize cyan_italic.each { |k,v| @message[k] = PASTEL.italic.cyan(v) } magenta_bold.each { |k,v| @message[k] = PASTEL.bold.magenta(v) } cyan_bold.each { |k,v| @message[k] = PASTEL.bold.cyan(v) } end