xrbp 0.2.7 → 0.2.8

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
  SHA256:
3
- metadata.gz: 5f48abc4b153d8aa5a31d794dc7c0ed9a8e86645fa47cd40fe8e7fdfa40a089c
4
- data.tar.gz: ad79925c9fa4c3b3ac7383d70361ce702d48b0cd3569224a66c96f6c7e401fd7
3
+ metadata.gz: b68319257ee3db7f21eb9b900d2df871cc85e974124e0606501055fd192a795c
4
+ data.tar.gz: 71a9e1f2118e6fe767ef652629ba5b28528d41d68821497130f7b70981eaacb5
5
5
  SHA512:
6
- metadata.gz: 8e328dd52b245837f57da0b4c2bf1739c252f6ae9b226c2d7c95cdeac237bc31d9640082cdcdc0b880853a3bb282ce2c9c11d8a1ec7c7e7c63cb35544c66d20c
7
- data.tar.gz: 9e5f4fa85c9a019ebdc651f4c6cd47f5db8eed98b61ab46123900bdd6fe08d1ac41088c49d7fdd9eb87460f4f830bb47030459a1d29a3c76881f0937dee7bf26
6
+ metadata.gz: 81e61dacd24b1a67a2f93f20b038e1912d67d180a02cb0d2bcb4186f6bbf5a32562b80c6d5b609de34341a2e2ea311a9137dc869276eab51f8976e72e1535552
7
+ data.tar.gz: c4365fcf0fc32018f4029525a9edb7df2840049ced91fc94fa90f19f492250f886fa5538b262f990901b141716fec96c6113c11851c605de96721b4a01dfe38d
@@ -64,7 +64,7 @@ module XRBP
64
64
  # start at last marker
65
65
  marker = File.exist?("#{cache}/marker") ?
66
66
  File.read("#{cache}/marker") : nil
67
- marker = nil if marker.strip.empty?
67
+ marker = nil if marker&.strip&.empty?
68
68
 
69
69
  # load start time, if set
70
70
  start = File.exist?("#{cache}/start") ?
@@ -87,14 +87,17 @@ module XRBP
87
87
  break if connection.force_quit?
88
88
  break unless res[:accounts] && !res[:accounts].empty?
89
89
 
90
+ page = marker || start.strftime("%Y%m%d%H%M%S")
91
+
90
92
  # Cache data
91
- cache_file = "#{cache}/#{marker || start.strftime("%Y%m%d%H%M%S")}"
93
+ cache_file = "#{cache}/#{page}"
92
94
  File.write(cache_file, res[:accounts].to_json)
93
95
 
94
96
  # Emit signal
95
97
  res[:accounts].each { |acct|
96
98
  break if connection.force_quit?
97
99
  connection.emit :account, acct
100
+ # TODO yield account
98
101
  }
99
102
 
100
103
  break if connection.force_quit?
@@ -105,6 +108,8 @@ module XRBP
105
108
  # Store state, eval exit condition
106
109
  File.write("#{cache}/marker", marker.to_s)
107
110
  finished = !marker
111
+
112
+ connection.emit :account_page, page
108
113
  end
109
114
 
110
115
  # Store state for next run
@@ -1,3 +1,3 @@
1
1
  module XRBP
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end # module XRBP
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrbp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dev Null Productions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-15 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json