class Maintainer::Writer
Public Class Methods
file_replace(filepath, regexp, *args, &block)
click to toggle source
# File lib/maintainer_core/writer.rb, line 30 def file_replace(filepath, regexp, *args, &block) content = File.read(filepath).gsub(regexp, *args, &block) File.open(filepath, 'wb') { |file| file.write(content) } end
file_write(filepath, text)
click to toggle source
# File lib/maintainer_core/writer.rb, line 34 def file_write(filepath, text) filepath.puts "#{text}" end
newline!()
click to toggle source
# File lib/maintainer_core/writer.rb, line 18 def newline!() puts"\n" end
setup_guide!()
click to toggle source
# File lib/maintainer_core/writer.rb, line 15 def setup_guide!() puts "Starting setup guide...\n".green end
show_error(message: nil)
click to toggle source
# File lib/maintainer_core/writer.rb, line 24 def show_error(message: nil) puts "#{message}".red end
show_success(message: nil)
click to toggle source
# File lib/maintainer_core/writer.rb, line 21 def show_success(message: nil) puts "#{message}".green end
welcome!()
click to toggle source
# File lib/maintainer_core/writer.rb, line 6 def welcome!() print "\nHi there!".green puts " Welcome to maintainer 🤘\n" puts "\nUnsure what this is? Read below!" puts "\nWith maintainer install/downloads and updates have never been easier" puts "Maintainer will keep track of all of your depenencies." puts "Updating those that need updating and keeping the dependency files out of the way" puts "\nMaintainer currently supports [cocoapods, git]\n\n" end
write(message: nil)
click to toggle source
# File lib/maintainer_core/writer.rb, line 27 def write(message: nil) puts message end