zet 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zet/cli.rb +7 -4
- data/lib/zet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af846fb195d74e4da3745ebbfde379267f5624cb53ae1b7a7b5707701e49578b
|
4
|
+
data.tar.gz: a08347e1ee4c3109da5fec9fba30413bcb7a8a2ea619ed801ee8b628b9fd3653
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a194f3c09c2a140ca5e075c7467a2d38d9e5113fb1c6cdcb418123f78b976a07d645d9d53a17c65bd615fcb195dc219696b61ad0875d25588954e163a4514017
|
7
|
+
data.tar.gz: 60c78fe0b7678fe388484d1ef4ac8f119625828775c4ee7f1a4e1381412d03b44a9941a9eec2a71ac6a046cab632d049d3d86d68baa595c94474fbf4d7f3fd60
|
data/lib/zet/cli.rb
CHANGED
@@ -25,12 +25,15 @@ module Zet
|
|
25
25
|
if File.exists?(note_file)
|
26
26
|
puts "This file already exists: #{note_file}! 🙀"
|
27
27
|
else
|
28
|
-
|
29
|
-
template = File.read("
|
30
|
-
template.gsub("# HEADLINE", note_name)
|
28
|
+
File.open(note_file, "w") do |file|
|
29
|
+
template = File.read(File.join(Dir.pwd, "note_template.md"))
|
30
|
+
template.gsub!("# HEADLINE", "# #{note_name}")
|
31
31
|
|
32
32
|
file.puts(template)
|
33
33
|
end
|
34
|
+
|
35
|
+
system `code .`
|
36
|
+
system `code #{note_file}`
|
34
37
|
end
|
35
38
|
end
|
36
39
|
else
|
@@ -57,7 +60,7 @@ module Zet
|
|
57
60
|
slug = name.downcase.gsub(/\W/, "").split(" ").join("-")
|
58
61
|
timestamp = Time.now.strftime("%Y%m%d%H%M")
|
59
62
|
|
60
|
-
File.join("notes", "#{timestamp}-#{slug}.md")
|
63
|
+
File.join(Dir.pwd, "notes", "#{timestamp}-#{slug}.md")
|
61
64
|
end
|
62
65
|
end
|
63
66
|
end
|
data/lib/zet/version.rb
CHANGED