Module: Milkshake::RailsExtentions::Initializer
- Defined in:
- lib/milkshake/rails_extentions/initializer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #check_for_unbuilt_gems_with_milkshake ⇒ Object
- #load_application_initializers_with_milkshake ⇒ Object
- #process_with_milkshake ⇒ Object
- #require_frameworks_with_milkshake ⇒ Object
Class Method Details
.included(base) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/milkshake/rails_extentions/initializer.rb', line 6 def self.included(base) %w( require_frameworks check_for_unbuilt_gems load_application_initializers process ).each do |meth| base.send :alias_method, "#{meth}_without_milkshake", meth base.send :alias_method, meth, "#{meth}_with_milkshake" end end |
Instance Method Details
#check_for_unbuilt_gems_with_milkshake ⇒ Object
18 19 20 21 22 |
# File 'lib/milkshake/rails_extentions/initializer.rb', line 18 def check_for_unbuilt_gems_with_milkshake check_for_unbuilt_gems_without_milkshake Milkshake.linker.link! end |
#load_application_initializers_with_milkshake ⇒ Object
24 25 26 27 28 29 |
# File 'lib/milkshake/rails_extentions/initializer.rb', line 24 def load_application_initializers_with_milkshake Milkshake.loader.load_gem_initializers! Milkshake.persist! load_application_initializers_without_milkshake end |
#process_with_milkshake ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/milkshake/rails_extentions/initializer.rb', line 31 def process_with_milkshake process_without_milkshake rescue Exception => exception begin Milkshake.cache.restore! Milkshake.environment.reload! if Milkshake.linker.current_snapshot Snapshots.load(Milkshake.linker.current_snapshot) end rescue Exception nil end raise exception end |