Class: YamlCss::Generator

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

Overview

Use Thor for own generator.

Instance Method Summary collapse

Instance Method Details

#installObject



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

def install
  if yaml_files_already_exist? && !options[:force]
    puts 'YAML files already installed, doing nothing.'
  else
    install_files
    puts "YAML files installed to #{install_path}/"
  end
end

#updateObject



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

def update
  if yaml_files_already_exist?
    remove_yaml_directory
    install_files
    puts 'YAML files updated.'
  else
    puts 'No existing YAML installation. Doing nothing.'
  end
end

#versionObject



35
36
37
# File 'lib/yamlcss/generator.rb', line 35

def version
  say "YAML #{YamlCss::VERSION}"
end