Module: Belt

Defined in:
lib/belt.rb,
lib/belt/cli.rb,
lib/belt/root.rb,
lib/belt/version.rb,
lib/belt/rendering.rb,
lib/belt/route_dsl.rb,
lib/belt/action_router.rb,
lib/belt/observability.rb,
lib/belt/lambda_handler.rb,
lib/belt/cli/new_command.rb,
lib/belt/table_inference.rb,
lib/belt/cli/env_resolver.rb,
lib/belt/helpers/response.rb,
lib/belt/cli/app_detection.rb,
lib/belt/cli/setup_command.rb,
lib/belt/cli/tasks_command.rb,
lib/belt/cli/views_command.rb,
lib/belt/cli/deploy_command.rb,
lib/belt/cli/routes_command.rb,
lib/belt/cli/server_command.rb,
lib/belt/cli/tables_command.rb,
lib/belt/cli/bucket_security.rb,
lib/belt/cli/console_command.rb,
lib/belt/cli/destroy_command.rb,
lib/belt/helpers/cors_origin.rb,
lib/belt/cli/frontend_command.rb,
lib/belt/cli/generate_command.rb,
lib/belt/cli/terraform_command.rb,
lib/belt/helpers/error_logging.rb,
lib/belt/cli/environment_command.rb,
lib/belt/cli/frontend_setup_command.rb,
lib/belt/cli/frontend_deploy_command.rb,
lib/belt/controllers/welcome_controller.rb,
lib/belt/cli/routes_command/schema_loader.rb,
lib/belt/cli/routes_command/route_inference.rb

Defined Under Namespace

Modules: CLI, Helpers, LambdaHandler, Observability, Rendering Classes: ActionNotFound, ActionRouter, ApiGateway, Application, AuthenticationError, ContextBuilder, MemberCollectionBuilder, NestedResourceBuilder, RecordNotFound, RequestModelBuilder, ResponseModelBuilder, Route, RouteDSL, SchemaBuilder, TableInference, TemplateNotFound, WelcomeController

Constant Summary collapse

VERSION =
'0.1.7'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.controller_pathsObject (readonly)

Returns the value of attribute controller_paths.



19
20
21
# File 'lib/belt.rb', line 19

def controller_paths
  @controller_paths
end

Class Method Details

.all_controller_pathsObject

All controller paths: app-defined + gem-discovered



32
33
34
# File 'lib/belt.rb', line 32

def all_controller_paths
  controller_paths + gem_controller_paths
end

.all_model_pathsObject

All gem model paths that exist on disk



37
38
39
# File 'lib/belt.rb', line 37

def all_model_paths
  gem_model_paths
end

.applicationObject



418
419
420
# File 'lib/belt/route_dsl.rb', line 418

def application
  @application ||= Application.new
end

.gem_controller_pathsObject

Auto-discover lambda/controllers dirs in all loaded gems



22
23
24
# File 'lib/belt.rb', line 22

def gem_controller_paths
  @gem_controller_paths ||= discover_gem_paths('lambda/controllers')
end

.gem_model_pathsObject

Auto-discover lambda/models dirs in all loaded gems



27
28
29
# File 'lib/belt.rb', line 27

def gem_model_paths
  @gem_model_paths ||= discover_gem_paths('lambda/models')
end

.reset_gem_paths!Object

Reset cached paths (useful in tests)



42
43
44
45
# File 'lib/belt.rb', line 42

def reset_gem_paths!
  @gem_controller_paths = nil
  @gem_model_paths = nil
end

.rootObject



4
5
6
# File 'lib/belt/root.rb', line 4

def self.root
  @root ||= detect_root
end

.root=(path) ⇒ Object



8
9
10
# File 'lib/belt/root.rb', line 8

def self.root=(path)
  @root = path
end