example_app/config/environment.rb in shatter-rb-0.0.2 vs example_app/config/environment.rb in shatter-rb-0.1.0
- old
+ new
@@ -1,9 +1,15 @@
-Shatter::Config.zookeeper_host = "localhost:2181"
-Shatter::Config.initial_delay = 100
-Shatter::Config.missing_result_delay = 100
-Shatter::Config.service_port = ENV.fetch('SHATTER_SERVICE_PORT') { 8787 }
+# frozen_string_literal: true
-require_relative '../application'
+Shatter.config do |config|
+ config.root = File.expand_path("..", __dir__)
+ config.zookeeper_host = "localhost:2181"
+ config.initial_delay = 100
+ config.missing_result_delay = 100
+ config.service_port = ENV.fetch("SHATTER_SERVICE_PORT", 8787)
+ config.autoload_paths = %w[app app/functions]
+end
-Shatter::Service::Base.service_definition = MyApp::ServiceDefinition
-Shatter::Web::Server.application = MyApp::Application
+Shatter.load
+
+Shatter::Service::Base.service_definition = ServiceDefinition
+Shatter::Web::Server.application = Application