Method: Xmvc::Generator::App#boot

Defined in:
lib/xmvc/generators/app.rb

#bootObject



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/xmvc/generators/app.rb', line 84

def boot
  ##
  # We want to get rid of Xmvc::Builder in favour of each vendor providing its own secretary
  #
  @vendors = []
  # bundle all vendor assets
  inside "vendor" do |dir|
    Xmvc.vendors.each do |vendor|
      api = vendor::API.load({
        :root => dir,
        :format => :js,
        :asset_root => Xmvc::PUBLIC_PATH
      })
      api.invoke(:bundle)
      @vendors << api
    end
  end
  
  # Bundle application code last
  app = Xmvc::API.load({
    :root => ".",
    :format => :js,
    :asset_root => Xmvc::PUBLIC_PATH
  })
  app.invoke(:bundle)
  @vendors << app
  
  # Create a boot-generator
  boot = Xmvc::Generator::Boot.new([], {
    :root => self.destination_root,
    :vendors => @vendors
  })
  boot.invoke(:default)
  boot.invoke(:sprockets)
end