Class: Remont::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/remont/script.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Script

Returns a new instance of Script.



4
5
6
7
# File 'lib/remont/script.rb', line 4

def initialize(path)
  @path = path
  @schemas = []
end

Instance Method Details

#run!Object

Returns:

  • (Object)


10
11
12
13
14
# File 'lib/remont/script.rb', line 10

def run!
  instance_eval(File.read(path))

  schemas.each(&:process!)
end

#schemaRemont::Schema

Parameters:

  • opts (Hash)
  • block (Proc)
  • [Proc] (Hash)

    a customizable set of options

Returns:



21
22
23
# File 'lib/remont/script.rb', line 21

def schema(...)
  @schemas << Schema.new(...)
end