feedx 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +9 -8
- data/feedx.gemspec +1 -1
- data/feedx_test.go +2 -2
- data/writer.go +12 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56df5ddf3814a2ee80e89b53f9a48f58b9a94ee8163ff6013fede7691f03cebd
|
4
|
+
data.tar.gz: 3bc6efb19588faa8726139557e908a1b5de818082a3bc9dcaf54c61e51e3da99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3ab0601d519a8a8202da226b08071750589f0e1c6d068de27d4c6b6f19bb66530a35eab33ea805a564489aa59dda9fba12e17958dc67eb835bae21569e58874
|
7
|
+
data.tar.gz: 0e10dbd78e1aca6fffc8d95d875094bb65df00f4aeb620b56d358264675ba9ab70315db8318c8cade501736256247b43a20adb886425ab7ae9573d09df7c8350
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
feedx (0.
|
4
|
+
feedx (0.5.0)
|
5
5
|
bfs (>= 0.3.4)
|
6
6
|
|
7
7
|
GEM
|
@@ -10,10 +10,10 @@ GEM
|
|
10
10
|
ast (2.4.0)
|
11
11
|
bfs (0.3.6)
|
12
12
|
diff-lcs (1.3)
|
13
|
-
google-protobuf (3.
|
14
|
-
jaro_winkler (1.5.
|
15
|
-
parallel (1.
|
16
|
-
parser (2.
|
13
|
+
google-protobuf (3.7.0.rc.2)
|
14
|
+
jaro_winkler (1.5.2)
|
15
|
+
parallel (1.13.0)
|
16
|
+
parser (2.6.0.0)
|
17
17
|
ast (~> 2.4.0)
|
18
18
|
pbio (0.1.0)
|
19
19
|
google-protobuf
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
34
34
|
rspec-support (~> 3.8.0)
|
35
35
|
rspec-support (3.8.0)
|
36
|
-
rubocop (0.
|
36
|
+
rubocop (0.63.1)
|
37
37
|
jaro_winkler (~> 1.5.1)
|
38
38
|
parallel (~> 1.10)
|
39
39
|
parser (>= 2.5, != 2.5.1.1)
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
ruby-progressbar (~> 1.7)
|
43
43
|
unicode-display_width (~> 1.4.0)
|
44
44
|
ruby-progressbar (1.10.0)
|
45
|
-
unicode-display_width (1.4.
|
45
|
+
unicode-display_width (1.4.1)
|
46
46
|
|
47
47
|
PLATFORMS
|
48
48
|
ruby
|
@@ -50,10 +50,11 @@ PLATFORMS
|
|
50
50
|
DEPENDENCIES
|
51
51
|
bundler
|
52
52
|
feedx!
|
53
|
+
google-protobuf (>= 3.7.0.pre.rc2)
|
53
54
|
pbio
|
54
55
|
rake
|
55
56
|
rspec
|
56
57
|
rubocop
|
57
58
|
|
58
59
|
BUNDLED WITH
|
59
|
-
1.17.
|
60
|
+
1.17.3
|
data/feedx.gemspec
CHANGED
data/feedx_test.go
CHANGED
@@ -37,7 +37,7 @@ func writeMulti(obj *bfs.Object, numEntries int) error {
|
|
37
37
|
if err != nil {
|
38
38
|
return err
|
39
39
|
}
|
40
|
-
defer w.
|
40
|
+
defer w.Discard()
|
41
41
|
|
42
42
|
for i := 0; i < numEntries; i++ {
|
43
43
|
fix := fixture
|
@@ -45,7 +45,7 @@ func writeMulti(obj *bfs.Object, numEntries int) error {
|
|
45
45
|
return err
|
46
46
|
}
|
47
47
|
}
|
48
|
-
return w.
|
48
|
+
return w.Commit()
|
49
49
|
}
|
50
50
|
|
51
51
|
func TestSuite(t *testing.T) {
|
data/writer.go
CHANGED
@@ -47,6 +47,8 @@ func (o *WriterOptions) norm(name string) error {
|
|
47
47
|
// Writer encodes feeds to remote locations.
|
48
48
|
type Writer struct {
|
49
49
|
ctx context.Context
|
50
|
+
cancel context.CancelFunc
|
51
|
+
|
50
52
|
remote *bfs.Object
|
51
53
|
opt WriterOptions
|
52
54
|
num int
|
@@ -64,8 +66,10 @@ func NewWriter(ctx context.Context, remote *bfs.Object, opt *WriterOptions) (*Wr
|
|
64
66
|
}
|
65
67
|
o.norm(remote.Name())
|
66
68
|
|
69
|
+
ctx, cancel := context.WithCancel(ctx)
|
67
70
|
return &Writer{
|
68
71
|
ctx: ctx,
|
72
|
+
cancel: cancel,
|
69
73
|
remote: remote,
|
70
74
|
opt: o,
|
71
75
|
}, nil
|
@@ -113,8 +117,14 @@ func (w *Writer) NumWritten() int {
|
|
113
117
|
return w.num
|
114
118
|
}
|
115
119
|
|
116
|
-
//
|
117
|
-
func (w *Writer)
|
120
|
+
// Discard closes the writer and discards the contents.
|
121
|
+
func (w *Writer) Discard() error {
|
122
|
+
w.cancel()
|
123
|
+
return w.Commit()
|
124
|
+
}
|
125
|
+
|
126
|
+
// Commit closes the writer and persists the contents.
|
127
|
+
func (w *Writer) Commit() error {
|
118
128
|
var err error
|
119
129
|
if w.fe != nil {
|
120
130
|
if e := w.fe.Close(); e != nil {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feedx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Black Square Media Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bfs
|
@@ -164,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
|
-
|
168
|
-
rubygems_version: 2.7.7
|
167
|
+
rubygems_version: 3.0.2
|
169
168
|
signing_key:
|
170
169
|
specification_version: 4
|
171
170
|
summary: Exchange data between components via feeds
|