Module: Sandals

Defined in:
lib/sandals.rb,
lib/sandals/cli.rb,
lib/sandals/view.rb,
lib/sandals/server.rb,
lib/sandals/version.rb,
lib/sandals/application.rb,
lib/sandals/action_error.rb,
lib/sandals/test_session.rb,
lib/sandals/code_reloader.rb,
lib/sandals/html_renderer.rb,
lib/sandals/uploaded_file.rb,
lib/sandals/binding_resolver.rb,
lib/sandals/event_dispatcher.rb,
lib/sandals/snapshot_history.rb

Defined Under Namespace

Modules: Actionable, FieldValidation Classes: ActionError, Application, BindingResolver, Button, CLI, Checkbox, CodeReloader, Container, Emphasis, Error, EventDispatcher, FileField, Flow, Form, HTMLRenderer, Image, Link, Notice, NumberField, Para, Radio, Select, Server, SnapshotHistory, Stack, Strong, Submit, Subtitle, Table, TestSession, TextArea, TextField, Title, UploadedFile, View

Constant Summary collapse

VERSION =
"0.1.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.applicationObject (readonly)

Returns the value of attribute application.



18
19
20
# File 'lib/sandals.rb', line 18

def application
  @application
end

Class Method Details

.app(title: "Sandals", &block) ⇒ Object



20
21
22
# File 'lib/sandals.rb', line 20

def app(title: "Sandals", &block)
  @application = Application.new(title:, &block)
end

.load(path) ⇒ Object



24
25
26
27
28
# File 'lib/sandals.rb', line 24

def load(path)
  @application = nil
  Kernel.load(File.expand_path(path))
  application || raise(ArgumentError, "#{path} does not define Sandals.app")
end

.test(application) ⇒ Object



30
31
32
# File 'lib/sandals.rb', line 30

def test(application)
  TestSession.new(application)
end