work_md 0.2.2 → 0.2.3

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: 8c7ac71894ac4ae951f1b0b2a7e6e4c7f5bbca415b3e2a175b8ca35c9adfb4ca
4
- data.tar.gz: 8c5372912117c88e8e1c25c7245d400b585c616101f13da1094fb13f61abc81f
3
+ metadata.gz: e1c858bf12a976912f85e9fd1a22b39e2bd5daf4e56ec46299c1297aa4e576cb
4
+ data.tar.gz: 8a542af4507b9765d9317f23ad7db72bc1f4cf8ffe7bc27342ea9c1e8f592e82
5
5
  SHA512:
6
- metadata.gz: c347b644ee03cab1a499f7bea1cab09bd0e5601c52b39edb41e76f2d616ae4225e1c557ae6fd77eb368e403e094188c060f56e2589ae6462e55139122d7cc8ac
7
- data.tar.gz: 81ec971d682d95fb2834c73df6615bea6448294c764f36470af1fe607784fa8d6bf47b5163a2117c03494b909cdf153282899ee0f96812743f44dbbe8732ae0a
6
+ metadata.gz: '02389407af0f604e5cf9fac532639b5cb5553179cd98d67fa18aecf56bc182cccbc2bc674cd1f8ca3f5b11ede62d82d8b85320613a55e0cf6d432f273618e06a'
7
+ data.tar.gz: 3983b233410dd07224abf01bf74998c31307780b52b43cdb83495d4745ed83938c72d0f0cb449e34dcdb7cded9e28fd5dec440fedacd823446f8ec0309152457
@@ -64,7 +64,13 @@ module WorkMd
64
64
  f.puts(parser.pomodoros)
65
65
  end
66
66
 
67
- ::TTY::Editor.open(PARSED_FILE_PATH)
67
+ editor = WorkMd::Config.editor
68
+
69
+ unless editor.nil?
70
+ ::TTY::Editor.open(PARSED_FILE_PATH, {command: editor})
71
+ else
72
+ ::TTY::Editor.open(PARSED_FILE_PATH)
73
+ end
68
74
  rescue
69
75
  WorkMd::Cli.info(
70
76
  ::TTY::Box.frame(
@@ -37,8 +37,17 @@ module WorkMd
37
37
  end
38
38
  end
39
39
 
40
+ editor = WorkMd::Config.editor
41
+
40
42
  ::FileUtils.cd(work_dir) do
41
- ::TTY::Editor.open("#{today.strftime('%Y/%m/%d')}.md")
43
+ unless editor.nil?
44
+ ::TTY::Editor.open(
45
+ "#{today.strftime('%Y/%m/%d')}.md",
46
+ {command: editor}
47
+ )
48
+ else
49
+ ::TTY::Editor.open("#{today.strftime('%Y/%m/%d')}.md")
50
+ end
42
51
  end
43
52
  end
44
53
  end
@@ -5,7 +5,6 @@ require 'yaml'
5
5
  module WorkMd
6
6
  module Config
7
7
  DEFAULT_WORK_DIR = Dir.home + '/work_md'
8
- DEFAULT_EDITOR = 'vi'
9
8
  TRANSLATIONS = {
10
9
  'pt' =>
11
10
  {
@@ -34,7 +33,7 @@ module WorkMd
34
33
  end
35
34
 
36
35
  def self.editor
37
- ENV['EDITOR'] || ENV['VISUAL'] || yaml_file['editor'] || DEFAULT_EDITOR
36
+ ENV['EDITOR'] || ENV['VISUAL'] || yaml_file['editor'] || nil
38
37
  end
39
38
 
40
39
  def self.work_dir
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkMd
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: work_md
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique Fernandez Teixeira