vedeu 0.4.16 → 0.4.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/api.rb +7 -21
- data/lib/vedeu/bindings.rb +2 -6
- data/lib/vedeu/buffers/buffer.rb +29 -34
- data/lib/vedeu/cursor/cursor.rb +5 -2
- data/lib/vedeu/distributed/all.rb +5 -5
- data/lib/vedeu/distributed/server.rb +1 -1
- data/lib/vedeu/dsl/components/border.rb +1 -2
- data/lib/vedeu/dsl/components/geometry.rb +0 -47
- data/lib/vedeu/dsl/interface.rb +4 -11
- data/lib/vedeu/dsl/line.rb +1 -2
- data/lib/vedeu/dsl/shared/all.rb +1 -2
- data/lib/vedeu/dsl/shared/{colour.rb → presentation.rb} +27 -4
- data/lib/vedeu/dsl/shared/use.rb +50 -29
- data/lib/vedeu/dsl/stream.rb +1 -2
- data/lib/vedeu/geometry/geometry.rb +22 -11
- data/lib/vedeu/geometry/index_position.rb +0 -19
- data/lib/vedeu/geometry/position_validator.rb +8 -8
- data/lib/vedeu/models/interface.rb +34 -76
- data/lib/vedeu/models/null_interface.rb +5 -0
- data/lib/vedeu/models/stream.rb +1 -1
- data/lib/vedeu/output/border.rb +25 -41
- data/lib/vedeu/output/clear.rb +1 -7
- data/lib/vedeu/output/esc.rb +10 -10
- data/lib/vedeu/output/presentation.rb +2 -0
- data/lib/vedeu/output/renderers/escape_sequence_renderer.rb +3 -0
- data/lib/vedeu/repositories/model.rb +6 -0
- data/lib/vedeu/repositories/repositories/groups.rb +12 -0
- data/lib/vedeu/repositories/repository.rb +11 -8
- data/lib/vedeu/storage/all.rb +4 -4
- data/lib/vedeu/support/visibility.rb +8 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +0 -2
- data/test/lib/vedeu/cursor/cursor_test.rb +14 -0
- data/test/lib/vedeu/dsl/components/border_test.rb +2 -2
- data/test/lib/vedeu/dsl/components/geometry_test.rb +63 -82
- data/test/lib/vedeu/dsl/components/keymap_test.rb +3 -3
- data/test/lib/vedeu/dsl/components/menu_test.rb +8 -8
- data/test/lib/vedeu/dsl/interface_test.rb +14 -22
- data/test/lib/vedeu/dsl/line_test.rb +4 -4
- data/test/lib/vedeu/dsl/shared/{colour_test.rb → presentation_test.rb} +19 -11
- data/test/lib/vedeu/dsl/shared/text_test.rb +15 -15
- data/test/lib/vedeu/dsl/shared/use_test.rb +24 -7
- data/test/lib/vedeu/geometry/geometry_test.rb +22 -19
- data/test/lib/vedeu/geometry/grid_test.rb +3 -3
- data/test/lib/vedeu/geometry/index_position_test.rb +0 -45
- data/test/lib/vedeu/geometry/position_test.rb +5 -5
- data/test/lib/vedeu/models/cell_test.rb +3 -3
- data/test/lib/vedeu/models/char_test.rb +5 -5
- data/test/lib/vedeu/models/interface_test.rb +7 -53
- data/test/lib/vedeu/models/null_test.rb +2 -2
- data/test/lib/vedeu/models/stream_test.rb +5 -5
- data/test/lib/vedeu/output/border_test.rb +1 -0
- data/test/lib/vedeu/output/colour_test.rb +16 -16
- data/test/lib/vedeu/output/esc_test.rb +15 -1
- data/test/lib/vedeu/output/html_char_test.rb +4 -4
- data/test/lib/vedeu/output/style_test.rb +15 -13
- data/test/lib/vedeu/output/text_test.rb +3 -3
- data/test/lib/vedeu/repositories/collection_test.rb +2 -2
- data/test/lib/vedeu/repositories/model_test.rb +19 -0
- data/test/lib/vedeu/repositories/repositories/groups_test.rb +22 -0
- data/test/lib/vedeu/repositories/repository_test.rb +50 -16
- data/test/lib/vedeu/support/common_test.rb +5 -5
- data/test/lib/vedeu/support/terminal_test.rb +3 -3
- data/test/lib/vedeu/support/visibility_test.rb +8 -0
- data/test/support/helpers/model_test_class.rb +18 -0
- data/test/test_helper.rb +1 -1
- data/vedeu.gemspec +2 -2
- metadata +7 -20
- data/lib/vedeu/dsl/shared/style.rb +0 -39
- data/test/lib/vedeu/dsl/shared/style_test.rb +0 -25
- data/test/support/helpers/all.rb +0 -5
- data/test/support/helpers/dsl_model_test_class.rb +0 -25
- data/test/support/helpers/helpers.rb +0 -17
- data/test/support/helpers/repositories.rb +0 -26
- data/test/support/helpers/repository_test_module.rb +0 -21
@@ -1,39 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
module DSL
|
4
|
-
|
5
|
-
# Provides a style helper for use in the {DSL::Interface}, {DSL::Line} and
|
6
|
-
# {DSL::Stream} classes.
|
7
|
-
#
|
8
|
-
# @api public
|
9
|
-
#
|
10
|
-
module Style
|
11
|
-
|
12
|
-
# Define a style or styles for an interface, line or a stream.
|
13
|
-
#
|
14
|
-
# @param value [Array<Symbol>|Array<String>|Symbol|String]
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# interface 'my_interface' do
|
18
|
-
# style 'normal'
|
19
|
-
# ...
|
20
|
-
#
|
21
|
-
# lines do
|
22
|
-
# style ['bold', 'underline']
|
23
|
-
# ...
|
24
|
-
#
|
25
|
-
# stream do
|
26
|
-
# style 'blink'
|
27
|
-
# ...
|
28
|
-
#
|
29
|
-
# @return [Vedeu::Style]
|
30
|
-
def style(value)
|
31
|
-
model.style = Vedeu::Style.coerce(value)
|
32
|
-
end
|
33
|
-
alias_method :styles, :style
|
34
|
-
|
35
|
-
end # Style
|
36
|
-
|
37
|
-
end # DSL
|
38
|
-
|
39
|
-
end # Vedeu
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Vedeu
|
4
|
-
|
5
|
-
module DSL
|
6
|
-
|
7
|
-
describe Style do
|
8
|
-
|
9
|
-
let(:described) { Vedeu::DSL::Style }
|
10
|
-
let(:instance) { Vedeu::DSL::ModelTestClass.new(model) }
|
11
|
-
let(:model) { Vedeu::ModelTestClass.new({}) }
|
12
|
-
|
13
|
-
describe '#style' do
|
14
|
-
let(:args) { :bold }
|
15
|
-
|
16
|
-
subject { instance.style(args) }
|
17
|
-
|
18
|
-
it { subject.must_be_instance_of(Vedeu::Style) }
|
19
|
-
end
|
20
|
-
|
21
|
-
end # Style
|
22
|
-
|
23
|
-
end # DSL
|
24
|
-
|
25
|
-
end # Vedeu
|
data/test/support/helpers/all.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'vedeu/dsl/shared/all'
|
2
|
-
|
3
|
-
module Vedeu
|
4
|
-
|
5
|
-
module DSL
|
6
|
-
|
7
|
-
class ModelTestClass
|
8
|
-
|
9
|
-
include Vedeu::DSL::Colour
|
10
|
-
include Vedeu::DSL::Style
|
11
|
-
|
12
|
-
def initialize(model, client = nil)
|
13
|
-
@model = model
|
14
|
-
@client = client
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
attr_reader :model
|
20
|
-
|
21
|
-
end # ModelTestClass
|
22
|
-
|
23
|
-
end # DSL
|
24
|
-
|
25
|
-
end # Vedeu
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'vedeu/repositories/repository'
|
2
|
-
|
3
|
-
module Vedeu
|
4
|
-
|
5
|
-
class RepositoriesTestClass < Repository
|
6
|
-
|
7
|
-
attr_accessor :storage
|
8
|
-
alias_method :in_memory, :storage
|
9
|
-
|
10
|
-
def initialize(storage = {})
|
11
|
-
@storage = storage
|
12
|
-
end
|
13
|
-
|
14
|
-
def add(model)
|
15
|
-
if storage.is_a?(Hash)
|
16
|
-
@storage = in_memory.merge!(model)
|
17
|
-
|
18
|
-
else
|
19
|
-
@storage << model
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
end # RepositoriesTestClass
|
25
|
-
|
26
|
-
end # Vedeu
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
module RepositoryTestModule
|
4
|
-
|
5
|
-
extend self
|
6
|
-
|
7
|
-
# The real repository stores the model and returns it.
|
8
|
-
def store(model)
|
9
|
-
model
|
10
|
-
end
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
# A storage solution that uses memory to persist models.
|
15
|
-
def in_memory
|
16
|
-
{}
|
17
|
-
end
|
18
|
-
|
19
|
-
end # RepositoryTestModule
|
20
|
-
|
21
|
-
end # Vedeu
|