Sha256: b735401d2d1366e7003418c22fe76efdf2d99b0c83ea8c631e1f6e240a668385

Contents?: true

Size: 627 Bytes

Versions: 4

Compression:

Stored size: 627 Bytes

Contents

require_relative 'repl/version'
require_relative 'repl/loader'
module Alf
  module Repl

    def self.database
      @database ||= begin
        adapter = ENV['DATABASE_URL']
        adapter = Alf.examples_adapter unless adapter
        raise "No database found" unless adapter
        Alf::Database.new(adapter)
      end
    end

    def self.database=(db)
      @database = db
    end

    def self.launch
      require_relative 'repl/service'
      x = Class.new(Sinatra::Base) do
        def call(env)
          Alf::Repl::Service.call(env)
        end
      end
      x.run!
    end

  end # module Repl
end # module Alf

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-repl-0.16.3 lib/alf/repl.rb
alf-repl-0.16.2 lib/alf/repl.rb
alf-repl-0.16.1 lib/alf/repl.rb
alf-repl-0.16.0 lib/alf/repl.rb