lib/epuber/command/init.rb in epuber-0.9.3 vs lib/epuber/command/init.rb in epuber-0.10.1
- old
+ new
@@ -50,11 +50,11 @@
private
def print_good_bye(book_id)
- UI.puts <<~TEXT.ansi.green
+ UI.info <<~TEXT.ansi.green
Project initialized, please review #{book_id}.bookspec file, remove comments and fill some attributes like book title.
TEXT
end
# Creates <book-id>.bookspec file from template
@@ -122,11 +122,11 @@
#
# @return [void]
#
def write(file_path, string)
File.write(file_path, string)
- UI.puts " #{'create'.ansi.green} #{file_path}"
+ UI.info " #{'create'.ansi.green} #{file_path}"
end
# @param [String] string text to file
# @param [String] file_path path to file
#
@@ -146,20 +146,20 @@
end
existing_content << "\n"
File.write(file_path, existing_content)
- UI.puts " #{'update'.ansi.green} #{file_path}"
+ UI.info " #{'update'.ansi.green} #{file_path}"
end
# @param [String] dir_path path to dir
#
# @return [nil]
#
def create_folder(dir_path)
FileUtils.mkdir_p(dir_path)
- UI.puts " #{'create'.ansi.green} #{dir_path}/"
+ UI.info " #{'create'.ansi.green} #{dir_path}/"
end
# @param [String] text
#
# @return [String] returned text without new line
@@ -167,10 +167,10 @@
def ask(text)
print text
result = $stdin.gets.chomp
while result.empty?
- UI.puts 'Value cannot be empty, please fill it!'.ansi.red
+ UI.info 'Value cannot be empty, please fill it!'.ansi.red
print text
result = $stdin.gets.chomp
end
result