Sha256: 62e0065704f735b217bff91ea275f9d14aaa6ade2ed5016e01b97dd33212aa7f

Contents?: true

Size: 558 Bytes

Versions: 9

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2020-2022, by Samuel Williams.

require 'rack/builder'
require 'rack/test'
require 'irb'

module Utopia
	# This is designed to be used with the corresponding bake task.
	class Shell
		include Rack::Test::Methods
		
		def initialize(context)
			@context = context
			@app = nil
		end
		
		def app
			@app ||= Rack::Builder.parse_file(
				File.expand_path('config.ru', @context.root)
			).first
		end
		
		def to_s
			self.class.name
		end
		
		def binding
			super
		end
	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
utopia-2.25.0 lib/utopia/shell.rb
utopia-2.24.4 lib/utopia/shell.rb
utopia-2.24.3 lib/utopia/shell.rb
utopia-2.24.1 lib/utopia/shell.rb
utopia-2.23.0 lib/utopia/shell.rb
utopia-2.22.2 lib/utopia/shell.rb
utopia-2.22.1 lib/utopia/shell.rb
utopia-2.22.0 lib/utopia/shell.rb
utopia-2.21.0 lib/utopia/shell.rb