yinx_st 0.1.2 → 0.1.3

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: 91b14bf4ca30477ec819c66bc87867798d178d04
4
- data.tar.gz: cec528a451a3d023f22b017fef0da54347e7033b
3
+ metadata.gz: 8c3d3d186fa2bba07b7314e6195b19a5df87ead5
4
+ data.tar.gz: 848bc6578b833a3ffa8267b17b81691a7e51c8a7
5
5
  SHA512:
6
- metadata.gz: 2a0d6edf2393009286caf3a6faa7742f7aa10726e483c0206660df16c0f2acfa01136bf5ab57e854beb706dfa1c610b7162d93606993b4a577e41676cb7d4f6a
7
- data.tar.gz: 49ac8e7ed3bccea336f62e62dd4f23a6aa1556566a535c29d438975edf2c5dd70de4386333ba252ff1ed7d8f9ab4741255cc044a2b898326027c141e80937c31
6
+ metadata.gz: 1bd84662616f72ac877bc53241d3148fd7304169f08089d1b66037b78a7e1e19f97e1278a228a392645e78d870871e922d1f1d8cdcebf6c84a4893adc92348a1
7
+ data.tar.gz: f29e77e31b6d1c49a2d6c8abf3fdaeb56ce86d666403adc839308f6bfbb81767b80fb484c677994d0e9cbe4e5fb86f2e88c72a767b27d22e8378e03a469cfd3e
@@ -15,9 +15,14 @@ class Yinx::NoteMeta
15
15
  created_at.between? (dump_at - 1.day), dump_at
16
16
  end
17
17
 
18
+ def deleted_today?
19
+ batches.of_guid(guid).first == self and dump_id != batches.latest_id
20
+ end
21
+
18
22
  def status
19
23
  return :created if created_today?
20
24
  return :updated if updated_today?
25
+ return :deleted if deleted_today?
21
26
  :remained
22
27
  end
23
28
 
@@ -1,3 +1,3 @@
1
1
  module YinxSt
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/yinx_st.rb CHANGED
@@ -15,7 +15,7 @@ module YinxSt
15
15
  end
16
16
 
17
17
  def last_n_days n
18
- batches = Batches.new n
18
+ batches = Batches.new(n + 1)
19
19
  duration = "最近#{n}日"
20
20
 
21
21
  @chart = MyChart.js do
@@ -31,7 +31,7 @@ module YinxSt
31
31
  end
32
32
 
33
33
  select :changed_content do |note|
34
- note.status == :created or note.status == :updated
34
+ note.status != :remained
35
35
  end
36
36
 
37
37
  select :moved_book do |note|
@@ -53,20 +53,20 @@ module YinxSt
53
53
  note.tags.count
54
54
  end
55
55
 
56
- plainBar :dump_day, name: "#{duration}总数变化", w: 1000, h:240, asc: :key
57
- line :dump_day, :status, name: "#{duration}新建/修改", from: :changed_content, w: 1000, h:240, asc: :key, keys: batches.time_line
58
- line :dump_day, name: "#{duration}移动笔记本", from: :moved_book, w: 1000, h:240, asc: :key, keys: batches.time_line
59
- line :dump_day, name: "#{duration}更改标签", from: :changed_tags, w: 1000, h:240, asc: :key, keys: batches.time_line
56
+ plainBar :dump_day, name: "#{duration}总数变化", w: 1000, h:240, asc: :key, last: n
57
+ line :dump_day, :status, name: "#{duration}新建/修改/删除", from: :changed_content, w: 1000, h:240, asc: :key, keys: batches.time_line, last: n
58
+ line :dump_day, name: "#{duration}移动笔记本", from: :moved_book, w: 1000, h:240, asc: :key, keys: batches.time_line, last: n
59
+ line :dump_day, name: "#{duration}更改标签", from: :changed_tags, w: 1000, h:240, asc: :key, keys: batches.time_line, last: n
60
60
 
61
61
  bar :stack_book, name: '目前最大的10个笔记本', from: :yesterday, w:1400 ,h: 540, desc: :count, first: 10
62
- line :dump_day, :stack_book, name: "#{duration}笔记本体积变化", w: 1200, h:540, asc: :key, keys: batches.time_line
62
+ line :dump_day, :stack_book, name: "#{duration}笔记本体积变化", w: 1200, h:540, asc: :key, keys: batches.time_line, last: n
63
63
 
64
64
  bar :stack, name: '目前最大的10个笔记本组', from: :yesterday, w:1400 ,h: 240, desc: :count, first: 10
65
- line :dump_day, :stack, name: "#{duration}笔记本组体积变化", w: 1000, h:340, asc: :key, keys: batches.time_line
65
+ line :dump_day, :stack, name: "#{duration}笔记本组体积变化", w: 1000, h:340, asc: :key, keys: batches.time_line, last: n
66
66
 
67
67
  pie :tags, name: '目前使用最多的15个标签', from: :yesterday__from__unwind_tags, w:1400 ,h: 340, desc: :count, first: 15
68
68
  bar :number_of_tags, name: '目前每篇笔记的标签数', from: :yesterday, w: 800, h: 240, asc: :key
69
- line :dump_day, :tags, name: "#{duration}标签数变化", from: :unwind_tags, w: 1400, h:740, asc: :key, keys: batches.time_line
69
+ line :dump_day, :tags, name: "#{duration}标签数变化", from: :unwind_tags, w: 1400, h:740, asc: :key, keys: batches.time_line, last: n
70
70
 
71
71
  end
72
72
 
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-05 00:00:00.000000000 Z
11
+ date: 2017-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler