vedeu 0.6.41 → 0.6.42

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7db3488d578544ebd7396a2c9729aa8d197c29d0
4
- data.tar.gz: ae67cc4985f4acb9989b6ca86ba0d6b2035b06ba
3
+ metadata.gz: b62ee246d1c9de2ac2eb6550b9fde097a68fcefd
4
+ data.tar.gz: 6d5d120d36d610b98760645417b5f40b85efcec8
5
5
  SHA512:
6
- metadata.gz: dd84a463c30f4169ad8ec50134fdd16d638d2d5557c4b18d05dab2016a0d190735764ad86cade780e6a10596dcc288e162e5dd759c33ac4aa2501d94341a2dfa
7
- data.tar.gz: 298aea3fceff6d65d62af1821f5feebe71bbabec593e17f63be2852abd930b5f9f250e4152eee043a4dc05b7c7cb8b92b6d1d2cdd47b769d353feab15b410bde
6
+ metadata.gz: 459e560a74dc825caaca7d05cc0ceb1b786ddbe6e8b8eaeb3bd9bb7fdc7b0777cb5e8fc3491dcb55a574bf2a1e97f7207a2c81e4648b75fcc437952349dab18b
7
+ data.tar.gz: 0b24360813d018af3acd34282867274f8c835727da8411f2410e71e88a7fea98ea03c5979a4938b8ee6adfcae9da69736d53868cd3fa3a25d565d1910d28c349
data/lib/vedeu/all.rb CHANGED
@@ -13,7 +13,6 @@ require 'vedeu/terminal/all'
13
13
 
14
14
  require 'vedeu/models/toggleable'
15
15
 
16
- require 'vedeu/output/clear/all'
17
16
  require 'vedeu/output/compressor'
18
17
  require 'vedeu/output/text'
19
18
  require 'vedeu/output/output'
@@ -221,14 +221,14 @@ module Vedeu
221
221
 
222
222
  # Move the virtual cursor to the beginning of the line.
223
223
  #
224
- # @return [Vedeu::Editor::Document]
224
+ # @return [Vedeu::Editor::Cursor]
225
225
  def bol
226
226
  cursor.bol.refresh
227
227
  end
228
228
 
229
229
  # Move the virtual cursor to the end of the line.
230
230
  #
231
- # @return [Vedeu::Editor::Document]
231
+ # @return [Vedeu::Editor::Cursor]
232
232
  def eol
233
233
  cursor.x = line.size
234
234
 
@@ -8,6 +8,7 @@ module Vedeu
8
8
  end # Vedeu
9
9
 
10
10
  require 'vedeu/interfaces/interface'
11
+ require 'vedeu/interfaces/clear'
11
12
  require 'vedeu/interfaces/dsl'
12
13
  require 'vedeu/interfaces/null'
13
14
  require 'vedeu/interfaces/repository'
@@ -1,10 +1,10 @@
1
1
  module Vedeu
2
2
 
3
- module Clear
3
+ module Interfaces
4
4
 
5
5
  # Clear the named interface.
6
6
  #
7
- class Interface
7
+ class Clear
8
8
 
9
9
  include Vedeu::Common
10
10
 
@@ -42,7 +42,7 @@ module Vedeu
42
42
 
43
43
  end # Eigenclass
44
44
 
45
- # Return a new instance of Vedeu::Clear::Interface.
45
+ # Return a new instance of Vedeu::Interfaces::Clear.
46
46
  #
47
47
  # @param name [String|Symbol] The name of the interface to
48
48
  # clear.
@@ -54,7 +54,7 @@ module Vedeu
54
54
  # will still be updated. This improves the refresh time for
55
55
  # Vedeu as we will not be building a grid of
56
56
  # {Vedeu::Views::Char} objects.
57
- # @return [Vedeu::Clear::Interface]
57
+ # @return [Vedeu::Interfaces::Clear]
58
58
  def initialize(name, options = {})
59
59
  @name = present?(name) ? name : Vedeu.focus
60
60
  @options = options
@@ -204,18 +204,18 @@ module Vedeu
204
204
  geometry.x
205
205
  end
206
206
 
207
- end # Interface
207
+ end # Clear
208
208
 
209
- end # Clear
209
+ end # Interfaces
210
210
 
211
211
  # @!method clear_by_name
212
- # @see Vedeu::Clear::Interface.render
213
- def_delegators Vedeu::Clear::Interface,
212
+ # @see Vedeu::Interfaces::Clear.clear_by_name
213
+ def_delegators Vedeu::Interfaces::Clear,
214
214
  :clear_by_name
215
215
 
216
216
  # @!method clear_content_by_name
217
- # @see Vedeu::Clear::Interface.clear_content_by_name
218
- def_delegators Vedeu::Clear::Interface,
217
+ # @see Vedeu::Interfaces.Clear.clear_content_by_name
218
+ def_delegators Vedeu::Interfaces::Clear,
219
219
  :clear_content_by_name
220
220
 
221
221
  # :nocov:
@@ -6,11 +6,14 @@ module Vedeu
6
6
 
7
7
  module Debug
8
8
 
9
+ # Provide wrapper for 'benchmark-ips' gem.
10
+ #
9
11
  class IPS
10
12
 
11
13
  attr_accessor :samples
12
14
  attr_accessor :benchmark
13
15
 
16
+ # @return [Vedeu::Logging::Debug::IPS]
14
17
  def initialize
15
18
  @old_stdout = $stdout
16
19
  $stdout = StringIO.new
@@ -19,6 +22,8 @@ module Vedeu
19
22
  @count = 0
20
23
  end
21
24
 
25
+ # @param label [String]
26
+ # @return [void]
22
27
  def add_item(label = '', &blk)
23
28
  samples[label] = blk
24
29
  @count += 1
@@ -26,6 +31,7 @@ module Vedeu
26
31
  benchmark.item(label, &blk)
27
32
  end
28
33
 
34
+ # @return [void]
29
35
  def execute!
30
36
  benchmark.compare!
31
37
  benchmark.run_warmup
@@ -44,6 +50,7 @@ module Vedeu
44
50
 
45
51
  private
46
52
 
53
+ # @return [void]
47
54
  def key
48
55
  @key ||= samples.keys.sample
49
56
  end
data/lib/vedeu/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Vedeu
2
2
 
3
3
  # The current version of Vedeu.
4
- VERSION = '0.6.41'.freeze
4
+ VERSION = '0.6.42'.freeze
5
5
 
6
6
  end
@@ -76,15 +76,33 @@ module Vedeu
76
76
  end
77
77
 
78
78
  describe '#delete_character' do
79
- it { instance.must_respond_to(:delete_character) }
79
+ subject { instance.delete_character }
80
+
81
+ it { subject.must_be_instance_of(Vedeu::Editor::Cursor) }
82
+
83
+ context 'when on the first column of the first row' do
84
+ it { subject.must_be_instance_of(Vedeu::Editor::Cursor) }
85
+ end
86
+
87
+ context 'when on the first column of not the first row' do
88
+ # @todo Add more tests.
89
+ end
90
+
91
+ context 'when not on the first column' do
92
+ # @todo Add more tests.
93
+ end
80
94
  end
81
95
 
82
96
  describe '#delete_line' do
83
- it { instance.must_respond_to(:delete_line) }
97
+ subject { instance.delete_line }
98
+
99
+ it { subject.must_be_instance_of(Vedeu::Editor::Document) }
84
100
  end
85
101
 
86
102
  describe '#down' do
87
- it { instance.must_respond_to(:down) }
103
+ subject { instance.down }
104
+
105
+ it { subject.must_be_instance_of(Vedeu::Editor::Document) }
88
106
  end
89
107
 
90
108
  describe '#execute' do
@@ -108,11 +126,21 @@ module Vedeu
108
126
  end
109
127
 
110
128
  describe '#insert_line' do
111
- it { instance.must_respond_to(:insert_line) }
129
+ subject { instance.left }
130
+
131
+ it { subject.must_be_instance_of(Vedeu::Editor::Document) }
112
132
  end
113
133
 
114
134
  describe '#left' do
115
- it { instance.must_respond_to(:left) }
135
+ subject { instance.left }
136
+
137
+ context 'when moving goes out of bounds' do
138
+ it { subject.must_be_instance_of(Vedeu::Editor::Document) }
139
+ end
140
+
141
+ # context 'when moving does not go out of bounds' do
142
+ # it { subject.must_be_instance_of(Vedeu::Editor::Cursor) }
143
+ # end
116
144
  end
117
145
 
118
146
  describe '#line' do
@@ -152,19 +180,27 @@ module Vedeu
152
180
  end
153
181
 
154
182
  describe '#right' do
155
- it { instance.must_respond_to(:right) }
183
+ subject { instance.right }
184
+
185
+ it { subject.must_be_instance_of(Vedeu::Editor::Cursor) }
156
186
  end
157
187
 
158
188
  describe '#up' do
159
- it { instance.must_respond_to(:up) }
189
+ subject { instance.up }
190
+
191
+ it { subject.must_be_instance_of(Vedeu::Editor::Document) }
160
192
  end
161
193
 
162
194
  describe '#bol' do
163
- it { instance.must_respond_to(:bol) }
195
+ subject { instance.bol }
196
+
197
+ it { subject.must_be_instance_of(Vedeu::Editor::Cursor) }
164
198
  end
165
199
 
166
200
  describe '#eol' do
167
- it { instance.must_respond_to(:eol) }
201
+ subject { instance.eol }
202
+
203
+ it { subject.must_be_instance_of(Vedeu::Editor::Cursor) }
168
204
  end
169
205
 
170
206
  end # Editor
@@ -7,11 +7,11 @@ module Vedeu
7
7
  it { Vedeu.bound?(:_clear_view_content_).must_equal(true) }
8
8
  end
9
9
 
10
- module Clear
10
+ module Interfaces
11
11
 
12
- describe Interface do
12
+ describe Clear do
13
13
 
14
- let(:described) { Vedeu::Clear::Interface }
14
+ let(:described) { Vedeu::Interfaces::Clear }
15
15
  let(:instance) { described.new(_name, options) }
16
16
  let(:options) {
17
17
  {
@@ -19,7 +19,7 @@ module Vedeu
19
19
  direct: false,
20
20
  }
21
21
  }
22
- let(:_name) { 'Vedeu::Clear::Interface' }
22
+ let(:_name) { 'Vedeu::Interfaces::Clear' }
23
23
 
24
24
  describe '#initialize' do
25
25
  it { instance.must_be_instance_of(described) }
@@ -71,8 +71,8 @@ module Vedeu
71
71
  it { subject.must_equal(output) }
72
72
  end
73
73
 
74
- end # Interface
74
+ end # Clear
75
75
 
76
- end # Clear
76
+ end # Interfaces
77
77
 
78
78
  end # Vedeu
data/vedeu.gemspec CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_development_dependency 'benchmark-ips', '2.3.0'
24
23
  spec.add_development_dependency 'guard', '2.13.0'
25
24
  spec.add_development_dependency 'guard-minitest', '2.4.4'
26
25
  spec.add_development_dependency 'guard-rubocop', '1.2.0'
@@ -33,9 +32,10 @@ Gem::Specification.new do |spec|
33
32
  spec.add_development_dependency 'simplecov-console', '0.2.0'
34
33
  spec.add_development_dependency 'yard', '0.8.7.6'
35
34
 
36
- spec.add_dependency 'bundler', '~> 1.10'
37
- spec.add_dependency 'rake', '~> 10.4'
38
- spec.add_dependency 'ruby-prof', '0.15.8'
39
- spec.add_dependency 'thor', '0.19.1'
40
- spec.add_dependency 'vedeu_cli', '0.0.7'
35
+ spec.add_dependency 'benchmark-ips', '2.3.0'
36
+ spec.add_dependency 'bundler', '~> 1.10'
37
+ spec.add_dependency 'rake', '~> 10.4'
38
+ spec.add_dependency 'ruby-prof', '0.15.8'
39
+ spec.add_dependency 'thor', '0.19.1'
40
+ spec.add_dependency 'vedeu_cli', '0.0.7'
41
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.41
4
+ version: 0.6.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
@@ -10,20 +10,6 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: benchmark-ips
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '='
18
- - !ruby/object:Gem::Version
19
- version: 2.3.0
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '='
25
- - !ruby/object:Gem::Version
26
- version: 2.3.0
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: guard
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +164,20 @@ dependencies:
178
164
  - - '='
179
165
  - !ruby/object:Gem::Version
180
166
  version: 0.8.7.6
167
+ - !ruby/object:Gem::Dependency
168
+ name: benchmark-ips
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '='
172
+ - !ruby/object:Gem::Version
173
+ version: 2.3.0
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '='
179
+ - !ruby/object:Gem::Version
180
+ version: 2.3.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: bundler
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -430,6 +430,7 @@ files:
430
430
  - lib/vedeu/input/store.rb
431
431
  - lib/vedeu/input/translator.rb
432
432
  - lib/vedeu/interfaces/all.rb
433
+ - lib/vedeu/interfaces/clear.rb
433
434
  - lib/vedeu/interfaces/dsl.rb
434
435
  - lib/vedeu/interfaces/interface.rb
435
436
  - lib/vedeu/interfaces/null.rb
@@ -463,8 +464,6 @@ files:
463
464
  - lib/vedeu/null/all.rb
464
465
  - lib/vedeu/null/generic.rb
465
466
  - lib/vedeu/null/view.rb
466
- - lib/vedeu/output/clear/all.rb
467
- - lib/vedeu/output/clear/interface.rb
468
467
  - lib/vedeu/output/compressor.rb
469
468
  - lib/vedeu/output/output.rb
470
469
  - lib/vedeu/output/presentation/all.rb
@@ -603,6 +602,7 @@ files:
603
602
  - test/lib/vedeu/input/mapper_test.rb
604
603
  - test/lib/vedeu/input/store_test.rb
605
604
  - test/lib/vedeu/input/translator_test.rb
605
+ - test/lib/vedeu/interfaces/clear_test.rb
606
606
  - test/lib/vedeu/interfaces/dsl_test.rb
607
607
  - test/lib/vedeu/interfaces/interface_test.rb
608
608
  - test/lib/vedeu/interfaces/null_test.rb
@@ -630,7 +630,6 @@ files:
630
630
  - test/lib/vedeu/models/views/view_test.rb
631
631
  - test/lib/vedeu/null/generic_test.rb
632
632
  - test/lib/vedeu/null/view_test.rb
633
- - test/lib/vedeu/output/clear/interface_test.rb
634
633
  - test/lib/vedeu/output/compressor_test.rb
635
634
  - test/lib/vedeu/output/output_test.rb
636
635
  - test/lib/vedeu/output/presentation/colour_test.rb
@@ -806,6 +805,7 @@ test_files:
806
805
  - test/lib/vedeu/input/mapper_test.rb
807
806
  - test/lib/vedeu/input/store_test.rb
808
807
  - test/lib/vedeu/input/translator_test.rb
808
+ - test/lib/vedeu/interfaces/clear_test.rb
809
809
  - test/lib/vedeu/interfaces/dsl_test.rb
810
810
  - test/lib/vedeu/interfaces/interface_test.rb
811
811
  - test/lib/vedeu/interfaces/null_test.rb
@@ -833,7 +833,6 @@ test_files:
833
833
  - test/lib/vedeu/models/views/view_test.rb
834
834
  - test/lib/vedeu/null/generic_test.rb
835
835
  - test/lib/vedeu/null/view_test.rb
836
- - test/lib/vedeu/output/clear/interface_test.rb
837
836
  - test/lib/vedeu/output/compressor_test.rb
838
837
  - test/lib/vedeu/output/output_test.rb
839
838
  - test/lib/vedeu/output/presentation/colour_test.rb
@@ -1,12 +0,0 @@
1
- module Vedeu
2
-
3
- # Provides the mechanisms to clear an interface or group of
4
- # interfaces.
5
- #
6
- module Clear
7
-
8
- end # Clear
9
-
10
- end # Vedeu
11
-
12
- require 'vedeu/output/clear/interface'