daily_reflection 0.1.0 → 0.1.1

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: b39e08fabbe50427fafbb996dc511e55c8e87706426f5fa864450e3d51dc661b
4
- data.tar.gz: 5797bfb0cc4f6e9e4c8cc826fa5b60e2797ba3e696dfadf09b7fbafc6791c9d0
3
+ metadata.gz: 0b138597d2edae1ccc75b8088741861a51dd98dbd67338d74ba1552f6b5f5068
4
+ data.tar.gz: b936918873420a299902f5140b56dd64fe4b790d127781769e971b834957e5a5
5
5
  SHA512:
6
- metadata.gz: 0a8e9e9870bc420ac8ca3c60fd032d5c576b1b5597232848b5a6b38d611fa0a027093e6b204246b4f62f5b4f082442a831f865206bb4e99ac4902195e1fcbce7
7
- data.tar.gz: 9dc874e37240175906e97cc9818d247180abbadb4163aa85bc03bfc58ac97f5f5cc38413ec1ac66b00775bfd1cd1727dccee8be87b8a6c633a75b51fba8d5d18
6
+ metadata.gz: 376c3c34b6d27137a56832b5119a6ce9aad956971dfde5bd2456982970a217ba0583fa147fb36868118610d97b75af44922e7f8ef488b517cd7fc414c0745280
7
+ data.tar.gz: e621bae3255591f6f36e9be587a50d5d9a71fe375dcdac9d77bdac4b6638ca4b747001519e8e2b6bc07b6beb478b0e668f6b10a70a2ef1773547035f639d13f4
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -6,6 +6,7 @@ require 'wiki_md'
6
6
 
7
7
 
8
8
  class DailyReflection < WikiMd
9
+ using ColouredText
9
10
 
10
11
  attr_accessor :date
11
12
 
@@ -15,28 +16,30 @@ class DailyReflection < WikiMd
15
16
  @date = date
16
17
  super(s, order: 'descending', debug: debug, title: title)
17
18
 
18
- # if the section for today doesn't exist create it
19
-
20
- create_day() unless found_today()
19
+ create_day() unless found_today?
21
20
 
22
21
  end
23
22
 
24
23
  def add_entry(s)
25
24
 
26
- create_day() unless found_today()
25
+ create_day() unless found_today?
27
26
 
28
- rx = @dxsx.dx.all.first
29
- lines = rx.x.lines
30
- lines.insert -3, s + "\n"
31
- rx.x = lines.join
27
+ e = Entry.new(@dxsx.dx.all.first)
28
+ e.body = e.body + "\n" + s
29
+ update_index(@dx.all.first, e.tags.join(' '))
30
+ save_files()
32
31
 
33
32
  end
34
33
 
35
34
  def find_today()
36
- self.find @date.strftime("%-d %b %Y")
35
+ r = self.find @date.strftime("%-d %b %Y")
36
+ puts ('r: ' + r.inspect).debug if @debug
37
+ r
37
38
  end
38
39
 
39
- alias found_today find_today
40
+ def found_today?()
41
+ self.find_today()
42
+ end
40
43
 
41
44
  def create_day()
42
45
 
@@ -47,36 +50,7 @@ class DailyReflection < WikiMd
47
50
 
48
51
  def today()
49
52
 
50
- rx = @dxsx.dx.all.first
51
-
52
- def rx.body()
53
- x.lines[1..-2].join.strip
54
- end
55
-
56
- def rx.body=(s)
57
- text_entry = "%s\n\n%s\n\n%s" % [self.heading, s, self.footer]
58
- self.x = text_entry
59
- end
60
-
61
- def rx.footer()
62
- x.lines.last.chomp
63
- end
64
-
65
- def rx.footer=(s)
66
- a = x.lines
67
- a[-1] = s
68
- self.x = a.join
69
- end
70
-
71
- def rx.heading()
72
- x.lines.first.chomp
73
- end
74
-
75
- def rx.tags()
76
- footer[1..-1].strip.split
77
- end
78
-
79
- rx
53
+ Entry.new(@dxsx.dx.all.first)
80
54
 
81
55
  end
82
56
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daily_reflection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  b2BjS30NjJ1ip3dATTcNML+TzkqoRwvprlZgx9mPUPLhhzy6XPSvVD4ErwvxKSlZ
36
36
  C9mRU23Hzg7ASRqGw0rzoDgj
37
37
  -----END CERTIFICATE-----
38
- date: 2019-01-04 00:00:00.000000000 Z
38
+ date: 2019-01-05 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: wiki_md
metadata.gz.sig CHANGED
Binary file