Class: Motion::Project::Config

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

Instance Method Summary collapse

Instance Method Details

#post_setup_blocksObject


22
23
24
# File 'lib/sugarcube_pre_setup.rb', line 22

def post_setup_blocks
  @post_setup_blocks ||= []
end

#pre_setup_blocksObject


18
19
20
# File 'lib/sugarcube_pre_setup.rb', line 18

def pre_setup_blocks
  @pre_setup_blocks ||= []
end

#setupObject


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/sugarcube_pre_setup.rb', line 27

def setup
  app_files = @files.flatten.select { |file| file.start_with?('app/')}
  @files = @files - app_files
  if @pre_setup_blocks
    @pre_setup_blocks.each { |b| b.call(self) }
    @pre_setup_blocks = nil
  end
  @files.concat(app_files)

  sugarcube_old_setup.tap do
    if @post_setup_blocks
      @post_setup_blocks.each { |b| b.call(self) }
      @post_setup_blocks = nil
    end
  end
end

#sugarcube_old_setupObject


26
# File 'lib/sugarcube_pre_setup.rb', line 26

alias sugarcube_old_setup setup