Class: Nginxtra::Actions::Print

Inherits:
Object
  • Object
show all
Includes:
Nginxtra::Action
Defined in:
lib/nginxtra/actions/print.rb

Instance Method Summary collapse

Methods included from Nginxtra::Action

#daemon, #initialize

Instance Method Details

#fileObject



18
19
20
# File 'lib/nginxtra/actions/print.rb', line 18

def file
  @thor.options["file"]
end


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/nginxtra/actions/print.rb', line 6

def print
  if @thor.options["list"]
    @thor.say "Known config files:\n  #{@config.files.sort.join "\n  "}"
  elsif @thor.options["compile-options"]
    @thor.say "Compilation options:\n  #{@config.compile_options}"
  elsif @config.files.include?(file)
    @thor.say @config.file_contents(file)
  else
    @thor.say "No config file by the name '#{file}' exists!"
  end
end