Class: Confinement::Compiler

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ Compiler

Returns a new instance of Compiler.



518
519
520
521
# File 'lib/confinement.rb', line 518

def initialize(site)
  @site = site
  @lock = Mutex.new
end

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site.



523
524
525
# File 'lib/confinement.rb', line 523

def site
  @site
end

Instance Method Details

#compile_everythingObject



525
526
527
528
529
530
531
532
533
# File 'lib/confinement.rb', line 525

def compile_everything
  # All compilation happens inside the same lock. So we shouldn't have
  # to worry about deadlocks or anything
  @lock.synchronize do
    # Assets first since it's almost always a dependency of contents
    compile_assets(site.asset_blobs.send(:lookup))
    compile_contents(site.route_identifiers.send(:lookup).values)
  end
end