Module: Sandals

Defined in:
lib/sandals.rb,
lib/sandals/cli.rb,
lib/sandals/view.rb,
lib/sandals/style.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/error_details.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, Styled Classes: ActionError, Application, BindingResolver, Button, CLI, Checkbox, CodeReloader, Container, Emphasis, Error, ErrorDetails, EventDispatcher, FileField, Flow, Form, HTMLRenderer, Image, Link, Notice, NumberField, Para, Radio, Select, Server, SnapshotHistory, Stack, Strong, Style, Submit, Subtitle, Table, TestSession, TextArea, TextField, Title, UploadedFile, View

Constant Summary collapse

VERSION =
"0.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.applicationObject (readonly)

Returns the value of attribute application.



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

def application
  @application
end

Class Method Details

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



22
23
24
# File 'lib/sandals.rb', line 22

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

.load(path) ⇒ Object



26
27
28
29
30
# File 'lib/sandals.rb', line 26

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

.test(application) ⇒ Object



32
33
34
# File 'lib/sandals.rb', line 32

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