Class: AwesomeAnnotate::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/awesome_annotate/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/awesome_annotate/cli.rb', line 94

def self.exit_on_failure?
  true
end

Instance Method Details

#allObject



75
76
77
78
# File 'lib/awesome_annotate/cli.rb', line 75

def all
  model_annotator.annotate_all
  route_annotator.annotate
end

#initObject



81
82
83
84
85
86
87
88
89
# File 'lib/awesome_annotate/cli.rb', line 81

def init
  path = AwesomeAnnotate::Configuration::DEFAULT_PATH
  if File.exist?(path)
    say "Config file already exists: #{path}"
  else
    AwesomeAnnotate::Configuration.create(path)
    say "create #{path}"
  end
end

#model(model_name) ⇒ Object



59
60
61
# File 'lib/awesome_annotate/cli.rb', line 59

def model(model_name)
  model_annotator.annotate(model_name)
end

#models(*model_names) ⇒ Object



64
65
66
# File 'lib/awesome_annotate/cli.rb', line 64

def models(*model_names)
  model_annotator.annotate_all(model_names)
end


53
54
55
# File 'lib/awesome_annotate/cli.rb', line 53

def print_version
  say AwesomeAnnotate::VERSION
end

#routesObject



70
71
72
# File 'lib/awesome_annotate/cli.rb', line 70

def routes
  route_annotator.annotate
end