Module: Toolchest
- Defined in:
- lib/toolchest.rb,
lib/toolchest/app.rb,
lib/toolchest/rspec.rb,
lib/toolchest/engine.rb,
lib/toolchest/naming.rb,
lib/toolchest/router.rb,
lib/toolchest/current.rb,
lib/toolchest/toolbox.rb,
lib/toolchest/version.rb,
lib/toolchest/endpoint.rb,
lib/toolchest/rack_app.rb,
lib/toolchest/renderer.rb,
lib/toolchest/auth/base.rb,
lib/toolchest/auth/none.rb,
lib/toolchest/auth/oauth.rb,
lib/toolchest/auth/token.rb,
lib/toolchest/parameters.rb,
app/models/toolchest/token.rb,
lib/toolchest/auth_context.rb,
lib/toolchest/tool_builder.rb,
lib/toolchest/configuration.rb,
lib/toolchest/tool_definition.rb,
lib/toolchest/param_definition.rb,
lib/toolchest/route_delegation.rb,
lib/toolchest/sampling_builder.rb,
app/models/toolchest/oauth_application.rb,
app/models/toolchest/oauth_access_grant.rb,
app/models/toolchest/oauth_access_token.rb,
lib/generators/toolchest/auth_generator.rb,
lib/generators/toolchest/skills_generator.rb,
lib/generators/toolchest/consent_generator.rb,
lib/generators/toolchest/install_generator.rb,
lib/generators/toolchest/toolbox_generator.rb,
lib/generators/toolchest/oauth_views_generator.rb,
app/controllers/toolchest/application_controller.rb,
app/controllers/toolchest/oauth/tokens_controller.rb,
app/controllers/toolchest/oauth/metadata_controller.rb,
app/controllers/toolchest/oauth/registrations_controller.rb,
app/controllers/toolchest/oauth/authorizations_controller.rb,
app/controllers/toolchest/oauth/authorized_applications_controller.rb
Defined Under Namespace
Modules: Auth, Generators, Naming, Oauth, RSpec, Renderer, RouteDelegation Classes: App, ApplicationController, AuthContext, Configuration, Current, Endpoint, Engine, Error, MissingTemplate, OauthAccessGrant, OauthAccessToken, OauthApplication, ParamDefinition, ParameterMissing, Parameters, RackApp, Router, SamplingBuilder, Token, ToolBuilder, ToolDefinition, Toolbox
Constant Summary collapse
- VERSION =
"0.3.7"
Class Attribute Summary collapse
- .base_controller ⇒ Object
-
.default_oauth_mount ⇒ Object
When multiple OAuth mounts exist, bare /.well-known/* resolves to this mount.
- .delegate_route_helpers ⇒ Object
Class Method Summary collapse
-
.app(name = :default) ⇒ Object
Returns a Rack app for a mount.
-
.configuration(name = :default) ⇒ Object
Toolchest.configuration → :default config (backward compat) Toolchest.configuration(:admin) → :admin config.
-
.configure(name = :default) {|| ... } ⇒ Object
Per-mount configuration Toolchest.configure { } → configures :default Toolchest.configure(:admin) { } → configures :admin.
-
.mount_keys ⇒ Object
All configured mount names.
- .reset! ⇒ Object
-
.reset_routers! ⇒ Object
Reset only routers/apps (preserves config set by initializers).
-
.router(name = :default) ⇒ Object
Per-mount router.
Class Attribute Details
.base_controller ⇒ Object
75 76 77 |
# File 'lib/toolchest.rb', line 75 def base_controller @base_controller || "::ApplicationController" end |
.default_oauth_mount ⇒ Object
When multiple OAuth mounts exist, bare /.well-known/* resolves to this mount
70 71 72 |
# File 'lib/toolchest.rb', line 70 def default_oauth_mount @default_oauth_mount end |
.delegate_route_helpers ⇒ Object
83 84 85 |
# File 'lib/toolchest.rb', line 83 def delegate_route_helpers @delegate_route_helpers != false end |
Class Method Details
.app(name = :default) ⇒ Object
Returns a Rack app for a mount. Toolchest.app → :default app Toolchest.app(:admin) → :admin app
55 56 57 58 |
# File 'lib/toolchest.rb', line 55 def app(name = :default) @apps ||= {} @apps[name.to_sym] ||= App.new(name.to_sym) end |
.configuration(name = :default) ⇒ Object
Toolchest.configuration → :default config (backward compat) Toolchest.configuration(:admin) → :admin config
47 48 49 50 |
# File 'lib/toolchest.rb', line 47 def configuration(name = :default) @configs ||= {} @configs[name.to_sym] ||= Configuration.new(name) end |
.configure(name = :default) {|| ... } ⇒ Object
Per-mount configuration Toolchest.configure { } → configures :default Toolchest.configure(:admin) { } → configures :admin
38 39 40 41 42 43 |
# File 'lib/toolchest.rb', line 38 def configure(name = :default, &block) @configs ||= {} @configs[name.to_sym] ||= Configuration.new(name) yield @configs[name.to_sym] if block @configs[name.to_sym] end |
.mount_keys ⇒ Object
All configured mount names
67 |
# File 'lib/toolchest.rb', line 67 def mount_keys = (@configs || {}).keys |
.reset! ⇒ Object
87 88 89 90 91 92 93 94 |
# File 'lib/toolchest.rb', line 87 def reset! @configs = nil @routers = nil @apps = nil @default_oauth_mount = nil @base_controller = nil @delegate_route_helpers = nil end |
.reset_routers! ⇒ Object
Reset only routers/apps (preserves config set by initializers)
97 98 99 100 |
# File 'lib/toolchest.rb', line 97 def reset_routers! @routers = nil @apps = nil end |