Module: E2B
- Defined in:
- lib/e2b.rb,
lib/e2b/client.rb,
lib/e2b/errors.rb,
lib/e2b/sandbox.rb,
lib/e2b/version.rb,
lib/e2b/template.rb,
lib/e2b/paginator.rb,
lib/e2b/ready_cmd.rb,
lib/e2b/services/git.rb,
lib/e2b/services/pty.rb,
lib/e2b/configuration.rb,
lib/e2b/api/http_client.rb,
lib/e2b/sandbox_helpers.rb,
lib/e2b/template_logger.rb,
lib/e2b/dockerfile_parser.rb,
lib/e2b/models/build_info.rb,
lib/e2b/models/entry_info.rb,
lib/e2b/services/commands.rb,
lib/e2b/models/sandbox_info.rb,
lib/e2b/models/template_tag.rb,
lib/e2b/services/filesystem.rb,
lib/e2b/models/snapshot_info.rb,
lib/e2b/models/process_result.rb,
lib/e2b/services/base_service.rb,
lib/e2b/services/watch_handle.rb,
lib/e2b/services/command_handle.rb,
lib/e2b/models/template_tag_info.rb,
lib/e2b/services/live_streamable.rb,
lib/e2b/models/template_log_entry.rb,
lib/e2b/models/build_status_reason.rb,
lib/e2b/models/template_build_status_response.rb
Overview
E2B SDK for Ruby
Provides access to E2B sandboxes - secure cloud environments for AI-generated code execution.
Defined Under Namespace
Modules: API, DockerfileParser, Models, SandboxHelpers, Services Classes: AuthenticationError, BasePaginator, BuildError, Client, CommandExitError, Configuration, ConfigurationError, ConflictError, DefaultBuildLogger, E2BError, FileUploadError, GitAuthError, GitUpstreamError, InvalidArgumentError, NotEnoughSpaceError, NotFoundError, RateLimitError, ReadyCmd, Sandbox, SandboxPaginator, SandboxStateError, SnapshotPaginator, Template, TemplateError, TimeoutError
Constant Summary collapse
- ALL_TRAFFIC =
"0.0.0.0/0"- SandboxError =
Alias matching official SDK naming
E2BError- VERSION =
"0.3.2"
Class Attribute Summary collapse
-
.configuration ⇒ Configuration?
Global configuration.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Configuration
Configure the E2B SDK globally.
- .default_build_logger(min_level: nil, io: $stdout) ⇒ Object
-
.reset_configuration! ⇒ Object
Reset global configuration.
- .wait_for_file(filename) ⇒ Object
- .wait_for_port(port) ⇒ Object
- .wait_for_process(process_name) ⇒ Object
- .wait_for_timeout(timeout) ⇒ Object
- .wait_for_url(url, status_code = 200) ⇒ Object
Class Attribute Details
.configuration ⇒ Configuration?
Returns Global configuration.
79 80 81 |
# File 'lib/e2b.rb', line 79 def configuration @configuration end |
Class Method Details
.configure {|config| ... } ⇒ Configuration
Configure the E2B SDK globally
92 93 94 95 96 |
# File 'lib/e2b.rb', line 92 def configure self.configuration ||= Configuration.new yield(configuration) if block_given? configuration end |
.default_build_logger(min_level: nil, io: $stdout) ⇒ Object
47 48 49 50 |
# File 'lib/e2b/template_logger.rb', line 47 def default_build_logger(min_level: nil, io: $stdout) build_logger = DefaultBuildLogger.new(min_level: min_level, io: io) build_logger.method(:logger).to_proc end |
.reset_configuration! ⇒ Object
Reset global configuration
99 100 101 |
# File 'lib/e2b.rb', line 99 def reset_configuration! self.configuration = nil end |
.wait_for_file(filename) ⇒ Object
27 28 29 |
# File 'lib/e2b/ready_cmd.rb', line 27 def wait_for_file(filename) ReadyCmd.new("[ -f #{filename} ]") end |
.wait_for_port(port) ⇒ Object
15 16 17 |
# File 'lib/e2b/ready_cmd.rb', line 15 def wait_for_port(port) ReadyCmd.new("ss -tuln | grep :#{port}") end |
.wait_for_process(process_name) ⇒ Object
23 24 25 |
# File 'lib/e2b/ready_cmd.rb', line 23 def wait_for_process(process_name) ReadyCmd.new("pgrep #{process_name} > /dev/null") end |