md_edit 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: fa79511d68a40f851efec9839e9a7ecdf1621ba5
4
- data.tar.gz: 6dc2c3f5460caee008abab86031e7d950f85d766
3
+ metadata.gz: 6ed6b33250079d8a899f4a70695b67e5296235b1
4
+ data.tar.gz: db9e8a43942863088a36ac1d4a18836b17009426
5
5
  SHA512:
6
- metadata.gz: 9cb6cd8364f709d8828ab10c021bdf9c0af8afe1c9a71c3e87cdfd98f709d3c468a74e5079d12fd4fca5910b167c1b3e835285f0f13e07814f6ab0724d1a021c
7
- data.tar.gz: 6d159a56fef40c5943cfdb1f9767203237e01a4e7aa0406dc102db6f73bb29a13d47bd35fb1dbba263da0421336c637d132670a3f56ebd31b7ca23be8094b9df
6
+ metadata.gz: 8fb40f29041a519f35e92e3e6293dc73c286c075fd8a1c72e54f354d28764705944b7ff8d316ce91619933878453883270233202ffdebaf111a90f52463b1c7a
7
+ data.tar.gz: df17764df07161bccec2f49fd8e114c4e47570693865d12a03af5baa35aabba227ff3bf371c17dbd1d58df8617261a7bcaa034941292dd6c10de6ba5f28657cf
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -15,10 +15,15 @@ class MdEdit
15
15
  #
16
16
  def initialize(md)
17
17
 
18
- s, @filename = if md.lines.length == 1 and File.exists? md then
19
- [File.read(md), md]
18
+ s, @filename = if md.lines.length == 1 then
19
+
20
+ File.write(md, "# Thoughts\n\n") unless File.exists? md
21
+ File.exists?(md) ? [File.read(md), md] : md
22
+
20
23
  else
24
+
21
25
  md
26
+
22
27
  end
23
28
 
24
29
  load_sections(s)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: md_edit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  R5r1JjTBaaHOaqI14bIkwUSY5q1cO4Wl7HWly80kX2AD8o/tPHvyF9Tx3pBvaboU
32
32
  etnSPHbQwmBvFQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-12-20 00:00:00.000000000 Z
34
+ date: 2017-12-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: line-tree
metadata.gz.sig CHANGED
Binary file