summaryrefslogtreecommitdiff
path: root/ports/dsl/nano-bots.rb
blob: b6f44623f819e8e39cf7d570a6f92502d74d4218 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require 'dotenv/load'

require_relative '../../static/gem'
require_relative '../../controllers/instance'
require_relative '../../controllers/interfaces/cli'

module NanoBot
  def self.new(cartridge:, state: '-')
    Controllers::Instance.new(cartridge_path: cartridge, state:, stream: StringIO.new)
  end

  def self.cli
    Controllers::Interfaces::CLI.handle!
  end

  def self.repl(cartridge:, state: '-')
    Controllers::Instance.new(cartridge_path: cartridge, state:).repl
  end

  def self.version
    NanoBot::GEM[:version]
  end
end