yinx_st 0.1.4 → 0.1.5

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: 0b0deeefba377acfcc34856ffa6bd7ad58903312
4
- data.tar.gz: 6dd56be4c22f6df1d08d2d88f3ca59aa70087d74
3
+ metadata.gz: 1e8ab234762227878f0d75715bca89fdfdf4bf5f
4
+ data.tar.gz: 572d84a83d035aa11ef67d3270c87a77d43fa41d
5
5
  SHA512:
6
- metadata.gz: 0b77671dea7ef76537d791d3b253766aeb5b0b7ef233261d085b2b6394edc54a7484f86297f4eb384130484892dc6477c9e8d8a0bc934fb39d22e51ea339af7c
7
- data.tar.gz: 805f5f49cb9423bc8dd57c82bac8efef126cbbe14425c9b3d56d55685b5d20ed3dd2e361dd981aa6d56f42c2836269acacdb2e6dd2c0dc7019fe7d8676641c40
6
+ metadata.gz: 1f0aa180ab44f780120dc9988377564827acf5c5ce6a1b780f5461b6ed144bde826553a4dff7ca6bb07a016d6339a5bef317064b466c7e72bc49530a9d0a5791
7
+ data.tar.gz: 872cc17135ff110d373414c6c3fa0262b994e401c0c05322cd1804ce182b86d4f86f2afa844b5337c4effa1b43560009cf53d7830f1f0d355012246127513e22
@@ -38,7 +38,7 @@ module YinxSt
38
38
  s.my_line_chart all,
39
39
  title: "#{duration}总数变化",
40
40
  x: :dump_day,
41
- min: 2400,
41
+ min: batches.smallest_batch_size.floor(-1),
42
42
  asc: :key,
43
43
  last: n
44
44
 
@@ -3,19 +3,21 @@ require 'yinx_sql/json_batch'
3
3
 
4
4
  module YinxSt
5
5
  class Batches
6
- attr_reader :all_notes
6
+ attr_reader :all_notes, :smallest_batch_size
7
7
 
8
8
  def initialize n
9
9
  batches = Yinx::SQL::JsonBatch.last(n)
10
- @all_notes = batches.map do |b|
11
- b.batch.map do |h|
10
+ @smallest_batch_size = Float::INFINITY
11
+ @all_notes = batches.each_with_object([]) do |b, rs|
12
+ @smallest_batch_size = b.batch.size if b.batch.size < @smallest_batch_size
13
+ b.batch.each_with_object(rs) do |h, rs|
12
14
  n = Yinx::NoteMeta.from_h h
13
15
  n.dump_id = b.id
14
16
  n.dump_at = (b.fixed_dump_date or b.created_at)
15
17
  n.batches = self
16
- n
18
+ rs << n
17
19
  end
18
- end.flatten
20
+ end
19
21
  end
20
22
 
21
23
  def of_guid guid
@@ -1,3 +1,3 @@
1
1
  module YinxSt
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yinx_st
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-03 00:00:00.000000000 Z
11
+ date: 2018-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler