Class: Stratum::Generator

Inherits:
Thor
  • Object
show all
Defined in:
lib/stratum/generator.rb

Instance Method Summary collapse

Instance Method Details

#installObject



14
15
16
17
18
19
20
21
# File 'lib/stratum/generator.rb', line 14

def install
  if install_path.exist? && !options[:force]
    puts "Stratum installation already exists. Use -f to force"
  else
    copy_files
    puts "Stratum installed to #{install_path}"
  end
end

#remove(replace = false) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/stratum/generator.rb', line 29

def remove(replace = false)
  if stratum_exists?
    FileUtils.rm_rf("stratum")
    if replace
      copy_files
      puts "Stratum updated"
    else
      puts "Stratum has been removed"
    end
  else
    puts "Stratum installation is not found in current directory"
  end
end

#updateObject



24
25
26
# File 'lib/stratum/generator.rb', line 24

def update
  remove(true)
end

#versionObject



44
45
46
# File 'lib/stratum/generator.rb', line 44

def version
  say "Stratum #{Stratum::VERSION}"
end