Guest User

Untitled

a guest
Feb 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. diff --git a/lib/runtime/runtime.rb b/lib/runtime/runtime.rb
  2. index e46b7ec..1db4fd5 100644
  3. --- a/lib/runtime/runtime.rb
  4. +++ b/lib/runtime/runtime.rb
  5. @@ -6,6 +6,10 @@ module Waves
  6. class Applications < Array
  7. def []( name ) ; self.find { |app| app.name == name.to_s.camel_case } ; end
  8. end
  9. +
  10. + def self.config; Waves.main::Configurations[ mode ]; end
  11. +
  12. + def self.mode; ENV['mode'] || :development ; end
  13.  
  14. # The list of all loaded applications
  15. def self.applications ; @applications ||= Applications.new ; end
  16. @@ -49,13 +53,13 @@ module Waves
  17. def synchronize( &block ) ; ( @mutex ||= Mutex.new ).synchronize( &block ) ; end
  18.  
  19. # The 'mode' of the runtime determines which configuration it will run under.
  20. - def mode ; @mode ||= @options[:mode]||:development ; end
  21. + def mode ; Waves.mode ; end
  22.  
  23. # Returns true if debug was set to true in the current configuration.
  24. def debug? ; config.debug ; end
  25.  
  26. # Returns the current configuration.
  27. - def config ; Waves.main::Configurations[ mode ] ; end
  28. + def config ; Waves.config ; end
  29.  
  30. # Reload the modules specified in the current configuration.
  31. def reload ; config.reloadable.each { |mod| mod.reload } ; end
Add Comment
Please, Sign In to add comment