zet 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zet/cli.rb +7 -4
  3. data/lib/zet/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0839a2349887f44ef2cd431b634152fe754c4f775cf1088bd218bdd5f4e5948e'
4
- data.tar.gz: 29c45ac355aeeefd8a8d0c077249c26b7c0d311a4cdd08a5d12b17bb191c1ae3
3
+ metadata.gz: af846fb195d74e4da3745ebbfde379267f5624cb53ae1b7a7b5707701e49578b
4
+ data.tar.gz: a08347e1ee4c3109da5fec9fba30413bcb7a8a2ea619ed801ee8b628b9fd3653
5
5
  SHA512:
6
- metadata.gz: bddd85c7f58a703e194f4180a09c62df34d69d9f1b2058169d8ab9f504205852c259c672f4d241bf306f096ff5a105f26ca07ffc6e0463ea8db152798b10dd3b
7
- data.tar.gz: 113f410ef3a74335be5cd6f032ef85f441d8fb9fc967ba6754d1f97775aa9112e3a8d82f4adf33c75da341bcf1a351e133ca365f6d43fec70906fd8df82b8fd3
6
+ metadata.gz: a194f3c09c2a140ca5e075c7467a2d38d9e5113fb1c6cdcb418123f78b976a07d645d9d53a17c65bd615fcb195dc219696b61ad0875d25588954e163a4514017
7
+ data.tar.gz: 60c78fe0b7678fe388484d1ef4ac8f119625828775c4ee7f1a4e1381412d03b44a9941a9eec2a71ac6a046cab632d049d3d86d68baa595c94474fbf4d7f3fd60
@@ -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
- FileUtils.open(note_file, "w") do |file|
29
- template = File.read("note_teamplate.md")
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
@@ -3,5 +3,5 @@
3
3
  # Module to keep the gem's version in. Make sure to bump it before release.
4
4
  #
5
5
  module Zet
6
- VERSION = "0.1.0".freeze
6
+ VERSION = "0.2.0".freeze
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoli Makarevich