Class: Expressir::Commands::Format

Inherits:
Base
  • Object
show all
Defined in:
lib/expressir/commands/format.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#exit_with_error, #initialize, #say

Constructor Details

This class inherits a constructor from Expressir::Commands::Base

Instance Method Details

#run(path) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/expressir/commands/format.rb', line 4

def run(path)
  repository = Expressir::Express::Parser.from_file(path)
  repository.schemas.each do |schema|
    say "\n(* Expressir formatted schema: #{schema.id} *)\n"
    say schema.to_s(no_remarks: true)
  end
end