na 1.2.3 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cc9bb0b48d32bab1e3ece2c1a9ab357dfde238e88a02ceeb5c5a172d4a6e747
4
- data.tar.gz: 53300e826f4d4c56b30f846aa94039cb054d99c3d930709de419261409c4d9b3
3
+ metadata.gz: 145c2efb28f23a047dced5bad341aa9339ff437fd4f31faeb44923fdc5d6af0c
4
+ data.tar.gz: b16951edb2e2753c8c1a83a52b1650db7770a4d6ac2615aa4995e37bdcf20a02
5
5
  SHA512:
6
- metadata.gz: b16ed47431b61a853e03b44efd04c44909814e2bfbde897833f43f640a75a0932c2db14c9cbdfc25834d20bb5d4147ba10ebe84b137d9f6bcdda4266bb80d64d
7
- data.tar.gz: 6f97489661677a3cd9fabfb01b1f99c39ff7b1e034d9936fdf1fa578c82fdbceb9c208c050d5e3b7a0bec956a3ea35534ba89c8764de85b41a2c9eceaf8bd207
6
+ metadata.gz: e790052ffdabf6ee749f545d4dade110a45167174700fc3f351d4e688b870c8b7bebf063678232613c12d1e3db3f0bc4491f12a01eededd0c8fd0d8710cfc63c
7
+ data.tar.gz: c433b14e48f7ee09ca8a3a27a305b67e21087e0230a16d6f75c1b9d404e46ee5f120a8411f1f1d139b6e36512ac866ad5edc0ca2f29530b7b990baf0da776b16
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ### 1.2.5
2
+
3
+ 2022-10-26 07:39
4
+
5
+ #### FIXED
6
+
7
+ - Error with add command
8
+
9
+ ### 1.2.4
10
+
11
+ 2022-10-26 07:28
12
+
13
+ #### FIXED
14
+
15
+ - Backup file naming
16
+
1
17
  ### 1.2.3
2
18
 
3
19
  2022-10-25 17:05
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.3)
4
+ na (1.2.5)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  gli (~> 2.21.0)
7
7
  mdless (~> 1.0, >= 1.0.32)
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  _If you're one of the rare people like me who find this useful, feel free to
10
10
  [buy me some coffee][donate]._
11
11
 
12
- The current version of `na` is 1.2.3
12
+ The current version of `na` is 1.2.5
13
13
  .
14
14
 
15
15
  `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
@@ -63,7 +63,7 @@ SYNOPSIS
63
63
  na [global options] command [command options] [arguments...]
64
64
 
65
65
  VERSION
66
- 1.2.3
66
+ 1.2.5
67
67
 
68
68
  GLOBAL OPTIONS
69
69
  -a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
@@ -382,7 +382,7 @@ You can specify a particular todo file using `--file PATH` or any todo from hist
382
382
 
383
383
  If more than one file is matched, a menu will be presented, multiple selections allowed. If multiple actions match the search within the selected file(s), a menu will be presented. If you have fzf installed, you can select one action to update with return, or use tab to mark multiple tasks to which the action will be applied. With gum you can use j, k, and x to mark multiple actions. Use the `--all` switch to force operation on all matched tasks, skipping the menu.
384
384
 
385
- Any time an update action is carried out, a backup of the file before modification will be made in the same directory with a `~` appended to the file extension (e.g. "marked.taskpaper" is backed up to "marked.taskpaper~"). Only one undo step is available, but if something goes wrong (and this feature is still experimental, so be wary), you can just copy the "~" file back to the original.
385
+ Any time an update action is carried out, a backup of the file before modification will be made in the same directory with a `.` prepended and `.bak` appended (e.g. `marked.taskpaper` is copied to `.marked.taskpaper.bak`). Only one undo step is available, but if something goes wrong (and this feature is still experimental, so be wary), you can just copy the "~" file back to the original.
386
386
 
387
387
  You can specify a new project for an action (moving it) with `--proj PROJECT_PATH`. A project path is hierarchical, with each level separated by a colon or slash. If the project path provided roughly matches an existing project, e.g. "mark:bug" would match "Marked:Bugs", then that project will be used. If no match is found, na will offer to generate a new project/hierarchy for the path provided. Strings will be exact but the first letter will be uppercased.
388
388
 
@@ -316,6 +316,7 @@ module NA
316
316
  contents = target.read_file.split(/\n/)
317
317
 
318
318
  if add.is_a?(Action)
319
+ add_tag ||= []
319
320
  action = process_action(add, priority: priority, finish: finish, add_tag: add_tag, remove_tag: remove_tag)
320
321
 
321
322
  projects = find_projects(target)
@@ -397,6 +398,7 @@ module NA
397
398
  contents.insert(target_line, "#{indent}\t- #{action.action}#{note}")
398
399
  end
399
400
  end
401
+
400
402
  backup_file(target)
401
403
  File.open(target, 'w') { |f| f.puts contents.join("\n") }
402
404
 
@@ -751,7 +753,10 @@ module NA
751
753
  ## @param target [String] The file to back up
752
754
  ##
753
755
  def backup_file(target)
754
- FileUtils.cp(target, ".#{target}~")
756
+ file = ".#{File.basename(target)}.bak"
757
+ backup = File.join(File.dirname(target), file)
758
+ FileUtils.cp(target, backup)
759
+ NA.notify("{dw}Backup file created at #{backup}", debug: true)
755
760
  end
756
761
 
757
762
  ##
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.3'
2
+ VERSION = '1.2.5'
3
3
  end
data/src/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  _If you're one of the rare people like me who find this useful, feel free to
10
10
  [buy me some coffee][donate]._
11
11
 
12
- The current version of `na` is <!--VER-->1.2.2<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.4<!--END VER-->.
13
13
 
14
14
  `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
15
15
 
@@ -158,7 +158,7 @@ You can specify a particular todo file using `--file PATH` or any todo from hist
158
158
 
159
159
  If more than one file is matched, a menu will be presented, multiple selections allowed. If multiple actions match the search within the selected file(s), a menu will be presented. If you have fzf installed, you can select one action to update with return, or use tab to mark multiple tasks to which the action will be applied. With gum you can use j, k, and x to mark multiple actions. Use the `--all` switch to force operation on all matched tasks, skipping the menu.
160
160
 
161
- Any time an update action is carried out, a backup of the file before modification will be made in the same directory with a `~` appended to the file extension (e.g. "marked.taskpaper" is backed up to "marked.taskpaper~"). Only one undo step is available, but if something goes wrong (and this feature is still experimental, so be wary), you can just copy the "~" file back to the original.
161
+ Any time an update action is carried out, a backup of the file before modification will be made in the same directory with a `.` prepended and `.bak` appended (e.g. `marked.taskpaper` is copied to `.marked.taskpaper.bak`). Only one undo step is available, but if something goes wrong (and this feature is still experimental, so be wary), you can just copy the "~" file back to the original.
162
162
 
163
163
  You can specify a new project for an action (moving it) with `--proj PROJECT_PATH`. A project path is hierarchical, with each level separated by a colon or slash. If the project path provided roughly matches an existing project, e.g. "mark:bug" would match "Marked:Bugs", then that project will be used. If no match is found, na will offer to generate a new project/hierarchy for the path provided. Strings will be exact but the first letter will be uppercased.
164
164
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-25 00:00:00.000000000 Z
11
+ date: 2022-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake