feedx 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67b4f1f345ff01e33e63e66daed1810694330cfe9158b60886f29ae6f98d169c
4
- data.tar.gz: 684f5f44a347d13cc4f71aa31741e1fe5c477205d870a0db96555364b166b235
3
+ metadata.gz: 56df5ddf3814a2ee80e89b53f9a48f58b9a94ee8163ff6013fede7691f03cebd
4
+ data.tar.gz: 3bc6efb19588faa8726139557e908a1b5de818082a3bc9dcaf54c61e51e3da99
5
5
  SHA512:
6
- metadata.gz: 0a8a9c98a96d79644a1e36d9035cc17f92e3b41c372424fd4a46180e9517da0090c8a123d30d8bfd959a9726ee92b9b71dbfa0a7992fd3171642b1bfd3fa364e
7
- data.tar.gz: ba6dcde4c14857f3f024a558ba64050d7eca53cafb66599fef5e39e1a9b3ed6e036fb1f94e43217a77d7cba47cd307b21ea5145a25f51131feeace142976a6b8
6
+ metadata.gz: a3ab0601d519a8a8202da226b08071750589f0e1c6d068de27d4c6b6f19bb66530a35eab33ea805a564489aa59dda9fba12e17958dc67eb835bae21569e58874
7
+ data.tar.gz: 0e10dbd78e1aca6fffc8d95d875094bb65df00f4aeb620b56d358264675ba9ab70315db8318c8cade501736256247b43a20adb886425ab7ae9573d09df7c8350
@@ -1,5 +1,8 @@
1
1
  matrix:
2
2
  include:
3
+ - language: ruby
4
+ rvm:
5
+ - 2.6
3
6
  - language: ruby
4
7
  rvm:
5
8
  - 2.5
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
+
4
+ gem 'google-protobuf', '>= 3.7.0-rc2'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- feedx (0.4.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.6.1)
14
- jaro_winkler (1.5.1)
15
- parallel (1.12.1)
16
- parser (2.5.3.0)
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.61.1)
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.0)
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.2
60
+ 1.17.3
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'feedx'
3
- s.version = '0.4.0'
3
+ s.version = '0.5.0'
4
4
  s.authors = ['Black Square Media Ltd']
5
5
  s.email = ['info@blacksquaremedia.com']
6
6
  s.summary = %(Exchange data between components via feeds)
@@ -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.Close()
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.Close()
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
- // Close closes the writer.
117
- func (w *Writer) Close() error {
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.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: 2018-12-17 00:00:00.000000000 Z
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
- rubyforge_project:
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