Class: AutoSqlFormatter::Core
- Inherits:
-
Object
- Object
- AutoSqlFormatter::Core
- Defined in:
- lib/auto_sql_formatter/core.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- DEFAULT_DIR =
'app'.freeze
Instance Attribute Summary collapse
-
#workdir ⇒ Object
readonly
Returns the value of attribute workdir.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(dir = DEFAULT_DIR) ⇒ Core
constructor
A new instance of Core.
Constructor Details
#initialize(dir = DEFAULT_DIR) ⇒ Core
Returns a new instance of Core.
8 9 10 |
# File 'lib/auto_sql_formatter/core.rb', line 8 def initialize(dir = DEFAULT_DIR) @workdir = dir end |
Instance Attribute Details
#workdir ⇒ Object (readonly)
Returns the value of attribute workdir.
6 7 8 |
# File 'lib/auto_sql_formatter/core.rb', line 6 def workdir @workdir end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/auto_sql_formatter/core.rb', line 12 def execute puts "========Start to format sql=========" puts files.each do |file| result = Runner.do file[:path] display(file[:status] = result) end puts puts files.each do |file| puts "#{file[:path]} #{file[:status]}\n" end puts puts '===========Completed!!!============' end |