Class: Bitters::Generator

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

Instance Method Summary collapse

Instance Method Details

#installObject



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

def install
  if bitters_files_already_exist?
    puts "Bitters files already installed, doing nothing."
  else
    install_files
    puts "Bitters files installed to #{install_path}/base"
  end
end

#removeObject



35
36
37
38
39
40
41
42
# File 'lib/bitters/generator.rb', line 35

def remove
  if bitters_files_already_exist?
    remove_bitters_directory
    puts "Bitters was successfully removed."
  else
    puts "No existing Bitters installation. Doing nothing."
  end
end

#resetObject



24
25
26
27
28
29
30
31
32
# File 'lib/bitters/generator.rb', line 24

def reset
  if bitters_files_already_exist?
    remove_bitters_directory
    install_files
    puts "Bitters files updated."
  else
    puts "No existing Bitters installation. Doing nothing."
  end
end

#versionObject



45
46
47
# File 'lib/bitters/generator.rb', line 45

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