seeing_is_believing 3.3.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +39 -0
- data/{Readme.md → README.md} +9 -12
- data/Rakefile +12 -23
- data/appveyor.yml +3 -1
- data/features/flags.feature +251 -1
- data/features/regression.feature +166 -23
- data/features/xmpfilter-style.feature +1 -0
- data/lib/seeing_is_believing.rb +5 -2
- data/lib/seeing_is_believing/binary.rb +6 -1
- data/lib/seeing_is_believing/binary/annotate_end_of_file.rb +1 -1
- data/lib/seeing_is_believing/binary/annotate_marked_lines.rb +8 -5
- data/lib/seeing_is_believing/binary/comment_lines.rb +2 -2
- data/lib/seeing_is_believing/binary/commentable_lines.rb +7 -7
- data/lib/seeing_is_believing/binary/config.rb +21 -4
- data/lib/seeing_is_believing/binary/engine.rb +58 -1
- data/lib/seeing_is_believing/binary/format_comment.rb +9 -6
- data/lib/seeing_is_believing/binary/remove_annotations.rb +1 -1
- data/lib/seeing_is_believing/code.rb +5 -5
- data/lib/seeing_is_believing/compatibility.rb +28 -0
- data/lib/seeing_is_believing/evaluate_by_moving_files.rb +52 -71
- data/lib/seeing_is_believing/event_stream/consumer.rb +26 -28
- data/lib/seeing_is_believing/event_stream/events.rb +7 -0
- data/lib/seeing_is_believing/event_stream/handlers/record_exit_events.rb +3 -3
- data/lib/seeing_is_believing/event_stream/handlers/update_result.rb +2 -1
- data/lib/seeing_is_believing/event_stream/producer.rb +29 -5
- data/lib/seeing_is_believing/safe.rb +8 -7
- data/lib/seeing_is_believing/swap_files.rb +90 -0
- data/lib/seeing_is_believing/the_matrix.rb +17 -4
- data/lib/seeing_is_believing/version.rb +1 -1
- data/lib/seeing_is_believing/wrap_expressions.rb +27 -13
- data/lib/seeing_is_believing/wrap_expressions_with_inspect.rb +4 -1
- data/seeing_is_believing.gemspec +4 -6
- data/spec/binary/config_spec.rb +63 -35
- data/spec/binary/engine_spec.rb +11 -1
- data/spec/binary/format_comment_spec.rb +5 -1
- data/spec/evaluate_by_moving_files_spec.rb +35 -18
- data/spec/event_stream_spec.rb +15 -0
- data/spec/seeing_is_believing_spec.rb +148 -26
- data/spec/sib_spec_helpers/version.rb +17 -0
- data/spec/spec_helper.rb +2 -18
- data/spec/wrap_expressions_spec.rb +9 -2
- metadata +31 -31
- data/.travis.yml +0 -10
- data/lib/seeing_is_believing/customize_pp.rb +0 -5
- data/spec/binary/options_spec.rb +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
module SibSpecHelpers
|
2
|
+
class Version
|
3
|
+
attr_reader :segments
|
4
|
+
include Comparable
|
5
|
+
def initialize(version_string)
|
6
|
+
@segments = version_string.scan(/\d+/).map(&:to_i)
|
7
|
+
end
|
8
|
+
def <=>(other)
|
9
|
+
other = Version.new other unless other.kind_of? Version
|
10
|
+
segments.zip(other.segments).each do |ours, theirs|
|
11
|
+
return 1 if theirs.nil? || theirs < ours
|
12
|
+
return -1 if ours < theirs
|
13
|
+
end
|
14
|
+
segments.length <=> other.segments.length
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'sib_spec_helpers/version'
|
2
|
+
|
1
3
|
module SibSpecHelpers
|
2
4
|
def pending!(message="Not yet implemented")
|
3
5
|
pending message
|
@@ -7,24 +9,6 @@ module SibSpecHelpers
|
|
7
9
|
def ruby_version
|
8
10
|
Version.new RUBY_VERSION
|
9
11
|
end
|
10
|
-
|
11
|
-
|
12
|
-
class Version
|
13
|
-
attr_reader :segments
|
14
|
-
include Comparable
|
15
|
-
def initialize(version_string)
|
16
|
-
@segments = version_string.scan(/\d+/).map(&:to_i)
|
17
|
-
end
|
18
|
-
def <=>(other)
|
19
|
-
other = Version.new other unless other.kind_of? Version
|
20
|
-
segments.zip(other.segments).each do |ours, theirs|
|
21
|
-
return 1 if theirs.nil? || theirs < ours
|
22
|
-
return -1 if ours < theirs
|
23
|
-
end
|
24
|
-
segments.length <=> other.segments.length
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
12
|
end
|
29
13
|
|
30
14
|
RSpec.configure do |c|
|
@@ -334,6 +334,14 @@ RSpec.describe SeeingIsBelieving::WrapExpressions do
|
|
334
334
|
it 'wraps the array equivalent' do
|
335
335
|
expect(wrap("a,* =[1,2,3]")).to eq "<a,* =[1,2,3]>"
|
336
336
|
expect(wrap("a,* = [ 1,2,3 ] ")).to eq "<a,* = [ 1,2,3 ]> "
|
337
|
+
expect(wrap("a,* = 1,2,3")).to eq "<a,* = 1,2,3>"
|
338
|
+
end
|
339
|
+
|
340
|
+
it 'wraps the array elements' do
|
341
|
+
expect(wrap("a,* = [ 1,2,\n3 ] ")).to eq "<a,* = [ 1,<2>,\n3 ]> "
|
342
|
+
expect(wrap("a,* = 1,2,\n3")).to eq "<a,* = 1,<2>,\n3>"
|
343
|
+
expect(wrap("a = [ 1,2,\n3 ] ")).to eq "<a = [ 1,<2>,\n3 ]> "
|
344
|
+
expect(wrap("a = 1,2,\n3")).to eq "<a = 1,<2>,\n3>"
|
337
345
|
end
|
338
346
|
|
339
347
|
it 'wraps repeated assignments' do
|
@@ -586,7 +594,7 @@ RSpec.describe SeeingIsBelieving::WrapExpressions do
|
|
586
594
|
expect(wrap("%w[\n1\n]")).to eq "<%w[\n1\n]>"
|
587
595
|
end
|
588
596
|
|
589
|
-
it '
|
597
|
+
it 'wraps splat elements' do
|
590
598
|
expect(wrap("[1,\n*2..3,\n4\n]")).to eq "<[<1>,\n*<2..3>,\n<4>\n]>"
|
591
599
|
end
|
592
600
|
end
|
@@ -708,7 +716,6 @@ RSpec.describe SeeingIsBelieving::WrapExpressions do
|
|
708
716
|
expect(wrap("begin\nrescue Exception\n$!\nend")).to eq "<begin\nrescue Exception\n<$!>\nend>"
|
709
717
|
end
|
710
718
|
it 'wraps inline rescues' do
|
711
|
-
pending "can't figure out how to identify these as different from begin/rescue/end"
|
712
719
|
expect(wrap("1 rescue nil")).to eq "<1 rescue nil>"
|
713
720
|
end
|
714
721
|
it 'wraps the bodies' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seeing_is_believing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Cheek
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: childprocess
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 3.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 3.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ffi
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.11.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.11.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: pry
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,28 +92,14 @@ dependencies:
|
|
78
92
|
requirements:
|
79
93
|
- - "~>"
|
80
94
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: 12.0.0
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: mrspec
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: 0.3.1
|
95
|
+
version: 13.0.0
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
102
|
+
version: 13.0.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rspec
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,12 +152,12 @@ executables:
|
|
152
152
|
extensions: []
|
153
153
|
extra_rdoc_files: []
|
154
154
|
files:
|
155
|
+
- ".github/workflows/test.yml"
|
155
156
|
- ".gitignore"
|
156
157
|
- ".rspec"
|
157
|
-
- ".travis.yml"
|
158
158
|
- Gemfile
|
159
|
+
- README.md
|
159
160
|
- Rakefile
|
160
|
-
- Readme.md
|
161
161
|
- appveyor.yml
|
162
162
|
- bin/seeing_is_believing
|
163
163
|
- docs/example.gif
|
@@ -188,7 +188,7 @@ files:
|
|
188
188
|
- lib/seeing_is_believing/binary/remove_annotations.rb
|
189
189
|
- lib/seeing_is_believing/binary/rewrite_comments.rb
|
190
190
|
- lib/seeing_is_believing/code.rb
|
191
|
-
- lib/seeing_is_believing/
|
191
|
+
- lib/seeing_is_believing/compatibility.rb
|
192
192
|
- lib/seeing_is_believing/debugger.rb
|
193
193
|
- lib/seeing_is_believing/error.rb
|
194
194
|
- lib/seeing_is_believing/evaluate_by_moving_files.rb
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/seeing_is_believing/hash_struct.rb
|
204
204
|
- lib/seeing_is_believing/result.rb
|
205
205
|
- lib/seeing_is_believing/safe.rb
|
206
|
+
- lib/seeing_is_believing/swap_files.rb
|
206
207
|
- lib/seeing_is_believing/the_matrix.rb
|
207
208
|
- lib/seeing_is_believing/version.rb
|
208
209
|
- lib/seeing_is_believing/wrap_expressions.rb
|
@@ -214,7 +215,6 @@ files:
|
|
214
215
|
- spec/binary/engine_spec.rb
|
215
216
|
- spec/binary/format_comment_spec.rb
|
216
217
|
- spec/binary/marker_spec.rb
|
217
|
-
- spec/binary/options_spec.rb
|
218
218
|
- spec/binary/remove_annotations_spec.rb
|
219
219
|
- spec/binary/rewrite_comments_spec.rb
|
220
220
|
- spec/code_spec.rb
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- spec/hard_core_ensure_spec.rb
|
225
225
|
- spec/hash_struct_spec.rb
|
226
226
|
- spec/seeing_is_believing_spec.rb
|
227
|
+
- spec/sib_spec_helpers/version.rb
|
227
228
|
- spec/spec_helper.rb
|
228
229
|
- spec/spec_helper_spec.rb
|
229
230
|
- spec/wrap_expressions_spec.rb
|
@@ -286,9 +287,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
287
|
- !ruby/object:Gem::Version
|
287
288
|
version: '0'
|
288
289
|
requirements: []
|
289
|
-
|
290
|
-
|
291
|
-
signing_key:
|
290
|
+
rubygems_version: 3.2.3
|
291
|
+
signing_key:
|
292
292
|
specification_version: 4
|
293
293
|
summary: Records results of every line of code in your file
|
294
294
|
test_files:
|
@@ -305,7 +305,6 @@ test_files:
|
|
305
305
|
- spec/binary/engine_spec.rb
|
306
306
|
- spec/binary/format_comment_spec.rb
|
307
307
|
- spec/binary/marker_spec.rb
|
308
|
-
- spec/binary/options_spec.rb
|
309
308
|
- spec/binary/remove_annotations_spec.rb
|
310
309
|
- spec/binary/rewrite_comments_spec.rb
|
311
310
|
- spec/code_spec.rb
|
@@ -315,6 +314,7 @@ test_files:
|
|
315
314
|
- spec/hard_core_ensure_spec.rb
|
316
315
|
- spec/hash_struct_spec.rb
|
317
316
|
- spec/seeing_is_believing_spec.rb
|
317
|
+
- spec/sib_spec_helpers/version.rb
|
318
318
|
- spec/spec_helper.rb
|
319
319
|
- spec/spec_helper_spec.rb
|
320
320
|
- spec/wrap_expressions_spec.rb
|
data/.travis.yml
DELETED
data/spec/binary/options_spec.rb
DELETED
File without changes
|