Class: Maintainer::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/maintainer_core/writer.rb

Class Method Summary collapse

Class Method Details

.file_replace(filepath, regexp, *args, &block) ⇒ Object



30
31
32
33
# 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) ⇒ Object



34
35
36
# File 'lib/maintainer_core/writer.rb', line 34

def file_write(filepath, text)
    filepath.puts "#{text}"
end

.newline!Object



18
19
20
# File 'lib/maintainer_core/writer.rb', line 18

def newline!()
    puts"\n"
end

.setup_guide!Object



15
16
17
# File 'lib/maintainer_core/writer.rb', line 15

def setup_guide!()
    puts "Starting setup guide...\n".green
end

.show_error(message: nil) ⇒ Object



24
25
26
# File 'lib/maintainer_core/writer.rb', line 24

def show_error(message: nil)
    puts "#{message}".red
end

.show_success(message: nil) ⇒ Object



21
22
23
# File 'lib/maintainer_core/writer.rb', line 21

def show_success(message: nil)
    puts "#{message}".green
end

.welcome!Object



6
7
8
9
10
11
12
13
14
# 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) ⇒ Object



27
28
29
# File 'lib/maintainer_core/writer.rb', line 27

def write(message: nil)
    puts message
end