Class: Ramlstyle::Command::FileCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/ramlstyle/command/file_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts, raml_file) ⇒ FileCommand

Returns a new instance of FileCommand.



4
5
6
7
# File 'lib/ramlstyle/command/file_command.rb', line 4

def initialize(opts, raml_file)
  @opts = opts
  @raml_file = raml_file
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/ramlstyle/command/file_command.rb', line 9

def run
  puts "\nParsing #{@raml_file}"

  begin
    ParseCommand.new(ReviewCommand.new(DocumentCommand.new)).run(@opts, @raml_file)
  rescue StandardError => error
    puts error
    print error.backtrace.join("\n") if @opts.trace
  end
end