na 1.2.49 → 1.2.51

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: 7f4d4be5554378f0112d206fba77680a74a4a5d66a272400a27a5c1809aad1bf
4
- data.tar.gz: e7e3506d44cce698a7bd951c771e783aa39d264db8dfb5aeb0d2c208e4a17265
3
+ metadata.gz: 5edc215f757a568603dff43b55a7e727d756cf4112771a898c7132ac5c335d34
4
+ data.tar.gz: 395a80b95e1e303d62000b036235a40199d6fb70eb56d854509681dcc78030a6
5
5
  SHA512:
6
- metadata.gz: 7e6e46c762ca2a0e1248c8a34492ea1733a5598aa9b309521ea41edb751f07490e9adf431baddb45000adb8e8a07eec48111fdc56c9b2cdb94f5d0ce243db53c
7
- data.tar.gz: e072634d013b304870e4fb9e3aa38e726e2915e45c461ac449e23140483c76bd781e052536280b98a6baa9c1198a42bde10d408adf4f66ed1de308dd1c15eed4
6
+ metadata.gz: 589d810297ff33afaa36d93b1ab006a9332ea908437008642b3d9810a90759f47cbeea1e4928e32381372b24f4e107786a7d53cae821fd1e49536683e6414584
7
+ data.tar.gz: 2f8418d040cdc7bda601220d35906b8f8d48e7be5ed4e6fbb07b8dc6674c52bcdfe07c43dda553c4a0161e9370411b75e9c4bd0dc7cc357a0cb2f73710efd447
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ### 1.2.51
2
+
3
+ 2023-09-09 13:20
4
+
5
+ #### FIXED
6
+
7
+ - Ensure new actions are added within newly created projects
8
+ - When creating a subproject, ensure new project gets inserted
9
+
10
+ ### 1.2.50
11
+
12
+ 2023-09-09 08:04
13
+
14
+ #### NEW
15
+
16
+ - Global option `--include_ext` can be configured to use full
17
+
18
+ #### FIXED
19
+
20
+ - `--no-color` wasn't stripping templated hex codes
21
+
1
22
  ### 1.2.49
2
23
 
3
24
  2023-09-08 13:34
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.49)
4
+ na (1.2.51)
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.49
12
+ The current version of `na` is 1.2.51
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.
@@ -77,7 +77,7 @@ SYNOPSIS
77
77
  na [global options] command [command options] [arguments...]
78
78
 
79
79
  VERSION
80
- 1.2.49
80
+ 1.2.51
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -89,6 +89,7 @@ GLOBAL OPTIONS
89
89
  --ext=EXT - File extension to consider a todo file (default: taskpaper)
90
90
  -f, --file=PATH - Use a single file as global todo, use initconfig to make permanent (default: none)
91
91
  --help - Show this message
92
+ --include_ext - Include file extension in display
92
93
  -n, --note - Prompt for additional notes (deprecated, for backwards compatibility)
93
94
  -p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
94
95
  --[no-]pager - Enable pagination (default: enabled)
data/bin/na CHANGED
@@ -26,6 +26,9 @@ class App
26
26
  arg_name 'EXT'
27
27
  flag :ext
28
28
 
29
+ desc 'Include file extension in display'
30
+ switch :include_ext, default_value: false, negatable: false
31
+
29
32
  desc 'Tag to consider a next action'
30
33
  default_value 'na'
31
34
  arg_name 'TAG'
@@ -86,8 +89,9 @@ class App
86
89
  pre do |global, _command, _options, _args|
87
90
  NA.verbose = global[:debug]
88
91
  NA::Pager.paginate = global[:pager] && $stdout.isatty
89
- NA::Color.coloring = global[:color]
92
+ NA::Color.coloring = global[:color] && $stdout.isatty
90
93
  NA.extension = global[:ext]
94
+ NA.include_ext = global[:include_ext]
91
95
  NA.na_tag = global[:na_tag]
92
96
  NA.global_file = global[:file]
93
97
  NA.cwd = File.basename(ENV['PWD'])
data/lib/na/action.rb CHANGED
@@ -89,7 +89,7 @@ module NA
89
89
 
90
90
  # Create the source filename string, substituting ~ for HOME and removing extension
91
91
  file = @file.sub(%r{^\./}, '').sub(/#{ENV['HOME']}/, '~')
92
- file = file.sub(/\.#{extension}$/, '')
92
+ file = file.sub(/\.#{extension}$/, '') unless NA.include_ext
93
93
  # colorize the basename
94
94
  file = file.highlight_filename
95
95
  file_tpl = "#{template[:file]}#{file} {x}"
data/lib/na/colors.rb CHANGED
@@ -232,7 +232,7 @@ module NA
232
232
  ##
233
233
  def template(input)
234
234
  input = input.join(' ') if input.is_a? Array
235
- return input.gsub(/(?<!\\)\{(\w+)\}/i, '') unless NA::Color.coloring?
235
+ return input.gsub(/(?<!\\)\{#?(\w+)\}/i, '') unless NA::Color.coloring?
236
236
 
237
237
  input = input.gsub(/(?<!\\)\{((?:[fb]g?)?#[a-f0-9]{3,6})\}/i) do
238
238
  hex = Regexp.last_match(1)
@@ -5,7 +5,7 @@ module NA
5
5
  class << self
6
6
  include NA::Editor
7
7
 
8
- attr_accessor :verbose, :extension, :na_tag, :command_line, :command, :globals, :global_file, :cwd_is, :cwd, :stdin
8
+ attr_accessor :verbose, :extension, :include_ext, :na_tag, :command_line, :command, :globals, :global_file, :cwd_is, :cwd, :stdin
9
9
 
10
10
  def theme
11
11
  @theme ||= NA::Theme.load_theme
@@ -203,15 +203,15 @@ module NA
203
203
  content = content.split(/\n/).insert(line, input.join("\n")).join("\n")
204
204
  else
205
205
  split = content.split(/\n/)
206
- line = todo.projects.first&.line || 0
206
+ line = todo.projects.first&.last_line || 0
207
207
  before = split.slice(0, line).join("\n")
208
208
  after = split.slice(line, split.count - 0).join("\n")
209
209
  content = "#{before}\n#{input.join("\n")}\n#{after}"
210
210
  end
211
211
 
212
- new_project = NA::Project.new(path.map(&:cap_first).join(':'), indent - 1, line, line + 1)
212
+ new_project = NA::Project.new(path.map(&:cap_first).join(':'), indent - 1, line, line)
213
213
  else
214
- line = final_match.line + 1
214
+ line = final_match.last_line + 1
215
215
  indent = final_match.indent + 1
216
216
  input = []
217
217
  new_path.each do |part|
@@ -292,9 +292,12 @@ module NA
292
292
 
293
293
  NA.notify("#{NA.theme[:error]}Error parsing project #{NA.theme[:filename]}#{target}", exit_code: 1) if target_proj.nil?
294
294
 
295
+ projects = find_projects(target)
295
296
  contents = target.read_file.split("\n")
296
297
  end
297
298
 
299
+ pp projects.map(&:inspect)
300
+
298
301
  indent = "\t" * target_proj.indent
299
302
  note = note.split("\n") unless note.is_a?(Array)
300
303
  note = if note.empty?
data/lib/na/string.rb CHANGED
@@ -91,7 +91,7 @@ class ::String
91
91
  ##
92
92
  def highlight_filename
93
93
  dir = File.dirname(self).shorten_path
94
- file = File.basename(self, ".#{NA.extension}")
94
+ file = NA.include_ext ? File.basename(self) : File.basename(self, ".#{NA.extension}")
95
95
  "#{NA.theme[:dirname]}#{dir}/#{NA.theme[:filename]}#{file}{x}"
96
96
  end
97
97
 
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.49'
2
+ VERSION = '1.2.51'
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.48<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.50<!--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
 
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.49
4
+ version: 1.2.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-08 00:00:00.000000000 Z
11
+ date: 2023-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake