na 1.2.75 → 1.2.76

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: 60c130a4627ba88391063defb0657065187dce30063606afbe188374924657eb
4
- data.tar.gz: b3fa6e217ac70d08f1e9d43f8fd6c1d49e18ce987903f495d25eb339c5dd5e22
3
+ metadata.gz: 0f1d84c6427569793e34ba529a78cb8394939e43e0c5553d8f50999a63acd126
4
+ data.tar.gz: 5e5015977befb6e2151a74a72af57847899a80d72579d49cc1171b86236fdd50
5
5
  SHA512:
6
- metadata.gz: a809987215e9aaeb387ca3bdedc61dfce4a7e20141b2108e70f1986627098147c083461c443f04bc60f5d031bd0f18ab9e8dda355ac6e54cec54c9e627df2635
7
- data.tar.gz: 672c81b6fbc512ee6a1ce723a506b70216cf98737af9e084c9cabe0acb500e876c01a5d32091d56d2ac024d66ada7d175e592972d0780776dc2d3c3d15bd47fe
6
+ metadata.gz: 80a44d88223a79478cb1d1c3e240d058507f1cf337b6dfbb8d46f9d8040ca9d8c9ca5b6acf6a11e5b104c8aeb0c8788b3fdb891e5ddda87ad2f0c6595706509f
7
+ data.tar.gz: d2cc5932e760da57f8fe76168b091a61361031fd778853a3b7d15390abfd0559235ab65e275dd15e06a2b0997e5154cc34aad6384b85b9bda4a73da2d3cad621
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 1.2.76
2
+
3
+ 2025-05-10 11:43
4
+
1
5
  ### 1.2.75
2
6
 
3
7
  2025-03-17 07:47
data/Gemfile CHANGED
@@ -1,26 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "bump", "~> 0.10"
6
- gem "bundler", "~> 2.2"
7
- gem "rake", "~> 13.0"
8
-
9
- gem "guard", "~> 2.16"
10
- gem "guard-rspec", "~> 4.5"
11
- gem "guard-rubocop", "~> 1.2"
12
- gem "guard-yard", "~> 2.1"
13
-
14
- gem "cli-test", "~> 1.0"
15
- gem "fuubar", "~> 2.0"
16
- gem "rspec", "~> 3.13"
17
- gem "rubocop", ">= 1.50"
18
- gem "rubocop-rake", ">= 0.6.0"
19
- gem "rubocop-rspec", ">= 2.20.0"
20
- gem "simplecov", "~> 0.9"
21
-
22
- gem "github-markup", "~> 1.3"
23
- gem "redcarpet", "~> 3.2"
24
- gem "yard", "~> 0.9.5"
25
-
1
+ source 'https://rubygems.org'
26
2
  gemspec
3
+ gem 'rake'
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.75)
4
+ na (1.2.76)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
+ git (~> 3.0.0)
6
7
  gli (~> 2.21.0)
7
8
  mdless (~> 1.0, >= 1.0.32)
8
9
  tty-reader (~> 0.9, >= 0.9.0)
@@ -12,132 +13,46 @@ PATH
12
13
  GEM
13
14
  remote: https://rubygems.org/
14
15
  specs:
15
- ast (2.4.2)
16
- bump (0.10.0)
16
+ activesupport (8.0.2)
17
+ base64
18
+ benchmark (>= 0.3)
19
+ bigdecimal
20
+ concurrent-ruby (~> 1.0, >= 1.3.1)
21
+ connection_pool (>= 2.2.5)
22
+ drb
23
+ i18n (>= 1.6, < 2)
24
+ logger (>= 1.4.2)
25
+ minitest (>= 5.1)
26
+ securerandom (>= 0.3)
27
+ tzinfo (~> 2.0, >= 2.0.5)
28
+ uri (>= 0.13.1)
29
+ addressable (2.8.7)
30
+ public_suffix (>= 2.0.2, < 7.0)
31
+ base64 (0.2.0)
32
+ benchmark (0.4.0)
33
+ bigdecimal (3.1.9)
17
34
  chronic (0.10.2)
18
- cli-test (1.0.0)
19
- coderay (1.1.3)
20
- diff-lcs (1.6.0)
21
- docile (1.4.1)
22
- ffi (1.17.1)
23
- ffi (1.17.1-aarch64-linux-gnu)
24
- ffi (1.17.1-aarch64-linux-musl)
25
- ffi (1.17.1-arm-linux-gnu)
26
- ffi (1.17.1-arm-linux-musl)
27
- ffi (1.17.1-arm64-darwin)
28
- ffi (1.17.1-x86-linux-gnu)
29
- ffi (1.17.1-x86-linux-musl)
30
- ffi (1.17.1-x86_64-darwin)
31
- ffi (1.17.1-x86_64-linux-gnu)
32
- ffi (1.17.1-x86_64-linux-musl)
33
- formatador (1.1.0)
34
- fuubar (2.5.1)
35
- rspec-core (~> 3.0)
36
- ruby-progressbar (~> 1.4)
37
- github-markup (1.7.0)
35
+ concurrent-ruby (1.3.5)
36
+ connection_pool (2.5.1)
37
+ drb (2.2.1)
38
+ git (3.0.0)
39
+ activesupport (>= 5.0)
40
+ addressable (~> 2.8)
41
+ process_executer (~> 1.3)
42
+ rchardet (~> 1.9)
38
43
  gli (2.21.5)
39
- guard (2.19.1)
40
- formatador (>= 0.2.4)
41
- listen (>= 2.7, < 4.0)
42
- logger (~> 1.6)
43
- lumberjack (>= 1.0.12, < 2.0)
44
- nenv (~> 0.1)
45
- notiffany (~> 0.0)
46
- ostruct (~> 0.6)
47
- pry (>= 0.13.0)
48
- shellany (~> 0.0)
49
- thor (>= 0.18.1)
50
- guard-compat (1.2.1)
51
- guard-rspec (4.7.3)
52
- guard (~> 2.1)
53
- guard-compat (~> 1.1)
54
- rspec (>= 2.99.0, < 4.0)
55
- guard-rubocop (1.5.0)
56
- guard (~> 2.0)
57
- rubocop (< 2.0)
58
- guard-yard (2.2.1)
59
- guard (>= 1.1.0)
60
- yard (>= 0.7.0)
61
- json (2.10.2)
62
- language_server-protocol (3.17.0.4)
63
- lint_roller (1.1.0)
64
- listen (3.9.0)
65
- rb-fsevent (~> 0.10, >= 0.10.3)
66
- rb-inotify (~> 0.9, >= 0.9.10)
44
+ i18n (1.14.7)
45
+ concurrent-ruby (~> 1.0)
67
46
  logger (1.6.6)
68
- lumberjack (1.2.10)
69
47
  mdless (1.0.37)
70
- method_source (1.1.0)
71
48
  minitest (5.25.5)
72
- nenv (0.3.0)
73
- notiffany (0.1.3)
74
- nenv (~> 0.1)
75
- shellany (~> 0.0)
76
- ostruct (0.6.1)
77
- parallel (1.26.3)
78
- parser (3.3.7.1)
79
- ast (~> 2.4.1)
80
- racc
81
- pry (0.15.2)
82
- coderay (~> 1.1)
83
- method_source (~> 1.0)
84
- racc (1.8.1)
85
- rainbow (3.1.1)
49
+ process_executer (1.3.0)
50
+ public_suffix (6.0.1)
86
51
  rake (13.2.1)
87
- rb-fsevent (0.11.2)
88
- rb-inotify (0.11.1)
89
- ffi (~> 1.0)
52
+ rchardet (1.9.0)
90
53
  rdoc (4.3.0)
91
- redcarpet (3.6.1)
92
- regexp_parser (2.10.0)
93
- rspec (3.13.0)
94
- rspec-core (~> 3.13.0)
95
- rspec-expectations (~> 3.13.0)
96
- rspec-mocks (~> 3.13.0)
97
- rspec-core (3.13.3)
98
- rspec-support (~> 3.13.0)
99
- rspec-expectations (3.13.3)
100
- diff-lcs (>= 1.2.0, < 2.0)
101
- rspec-support (~> 3.13.0)
102
- rspec-mocks (3.13.2)
103
- diff-lcs (>= 1.2.0, < 2.0)
104
- rspec-support (~> 3.13.0)
105
- rspec-support (3.13.2)
106
- rubocop (1.74.0)
107
- json (~> 2.3)
108
- language_server-protocol (~> 3.17.0.2)
109
- lint_roller (~> 1.1.0)
110
- parallel (~> 1.10)
111
- parser (>= 3.3.0.2)
112
- rainbow (>= 2.2.2, < 4.0)
113
- regexp_parser (>= 2.9.3, < 3.0)
114
- rubocop-ast (>= 1.38.0, < 2.0)
115
- ruby-progressbar (~> 1.7)
116
- unicode-display_width (>= 2.4.0, < 4.0)
117
- rubocop-ast (1.39.0)
118
- parser (>= 3.3.1.0)
119
- rubocop-rake (0.7.1)
120
- lint_roller (~> 1.1)
121
- rubocop (>= 1.72.1)
122
- rubocop-rspec (3.5.0)
123
- lint_roller (~> 1.1)
124
- rubocop (~> 1.72, >= 1.72.1)
125
- ruby-progressbar (1.13.0)
126
- shellany (0.0.1)
127
- simplecov (0.22.0)
128
- docile (~> 1.1)
129
- simplecov-html (~> 0.11)
130
- simplecov_json_formatter (~> 0.1)
131
- simplecov-html (0.13.1)
132
- simplecov_json_formatter (0.1.4)
133
- strings-ansi (0.2.0)
134
- thor (1.3.2)
54
+ securerandom (0.4.1)
135
55
  tty-cursor (0.7.1)
136
- tty-progressbar (0.18.3)
137
- strings-ansi (~> 0.2)
138
- tty-cursor (~> 0.7)
139
- tty-screen (~> 0.8)
140
- unicode-display_width (>= 1.6, < 3.0)
141
56
  tty-reader (0.9.0)
142
57
  tty-cursor (~> 0.7)
143
58
  tty-screen (~> 0.8)
@@ -146,9 +61,10 @@ GEM
146
61
  tty-spinner (0.9.3)
147
62
  tty-cursor (~> 0.7)
148
63
  tty-which (0.5.0)
149
- unicode-display_width (2.6.0)
64
+ tzinfo (2.0.6)
65
+ concurrent-ruby (~> 1.0)
66
+ uri (1.0.3)
150
67
  wisper (2.0.1)
151
- yard (0.9.37)
152
68
 
153
69
  PLATFORMS
154
70
  aarch64-linux-gnu
@@ -164,28 +80,11 @@ PLATFORMS
164
80
  x86_64-linux-musl
165
81
 
166
82
  DEPENDENCIES
167
- bump (~> 0.10)
168
- bundler (~> 2.2)
169
- cli-test (~> 1.0)
170
- fuubar (~> 2.0)
171
- github-markup (~> 1.3)
172
- guard (~> 2.16)
173
- guard-rspec (~> 4.5)
174
- guard-rubocop (~> 1.2)
175
- guard-yard (~> 2.1)
176
83
  minitest (~> 5.14)
177
84
  na!
178
- rake (~> 13.0)
85
+ rake
179
86
  rdoc (~> 4.3)
180
- redcarpet (~> 3.2)
181
- rspec (~> 3.13)
182
- rubocop (>= 1.50)
183
- rubocop-rake (>= 0.6.0)
184
- rubocop-rspec (>= 2.20.0)
185
- simplecov (~> 0.9)
186
- tty-progressbar (~> 0.18, >= 0.18.3)
187
87
  tty-spinner (~> 0.9, >= 0.9.0)
188
- yard (~> 0.9.5)
189
88
 
190
89
  BUNDLED WITH
191
90
  2.6.6
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.75.
12
+ The current version of `na` is 1.2.76.
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
 
@@ -76,7 +76,7 @@ SYNOPSIS
76
76
  na [global options] command [command options] [arguments...]
77
77
 
78
78
  VERSION
79
- 1.2.75
79
+ 1.2.76
80
80
 
81
81
  GLOBAL OPTIONS
82
82
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -93,8 +93,9 @@ GLOBAL OPTIONS
93
93
  -p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
94
94
  --[no-]pager - Enable pagination (default: enabled)
95
95
  -r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability)
96
+ --[no-]repo - Use a taskpaper file named after the git repository (default: enabled)
96
97
  -t, --na_tag=TAG - Tag to consider a next action (default: na)
97
- --template=PATH - Provide a template for new/blank todo files, use initconfig to make permanent (default: none)
98
+ --template=arg - Provide a template for new/blank todo files, use initconfig to make permanent (default: none)
98
99
  --version - Display the program version
99
100
 
100
101
  COMMANDS
@@ -223,6 +224,7 @@ COMMAND OPTIONS
223
224
  -e, --regex - Interpret search pattern as regular expression
224
225
  --in=TODO_PATH - Show actions from a specific todo file in history. May use wildcards (* and ?) (default: none)
225
226
  --nest - Output actions nested by file
227
+ --no_file - No filename in output
226
228
  --[no-]notes - Include notes in output
227
229
  -o, --or - Combine search tokens with OR, displaying actions matching ANY of the terms
228
230
  --omnifocus - Output actions nested by file and project
data/bin/commands/find.rb CHANGED
@@ -56,6 +56,9 @@ class App
56
56
  c.desc "Output actions nested by file"
57
57
  c.switch %[nest], negatable: false
58
58
 
59
+ c.desc "No filename in output"
60
+ c.switch %i[no_file], negatable: false
61
+
59
62
  c.desc "Output actions nested by file and project"
60
63
  c.switch %[omnifocus], negatable: false
61
64
 
@@ -171,7 +174,8 @@ class App
171
174
  regexes: regexes,
172
175
  notes: options[:notes],
173
176
  nest: options[:nest],
174
- nest_projects: options[:omnifocus] })
177
+ nest_projects: options[:omnifocus],
178
+ no_files: options[:no_file] })
175
179
  end
176
180
  end
177
181
  end
@@ -62,6 +62,9 @@ class App
62
62
  c.desc "Output actions nested by file"
63
63
  c.switch %i[nest], negatable: false
64
64
 
65
+ c.desc "No filename in output"
66
+ c.switch %i[no_file], negatable: false
67
+
65
68
  c.desc "Output actions nested by file and project"
66
69
  c.switch %i[omnifocus], negatable: false
67
70
 
@@ -158,7 +161,8 @@ class App
158
161
  regexes: regexes,
159
162
  notes: options[:notes],
160
163
  nest: options[:nest],
161
- nest_projects: options[:omnifocus] })
164
+ nest_projects: options[:omnifocus],
165
+ no_files: options[:no_files] })
162
166
  end
163
167
  end
164
168
  end
data/bin/na CHANGED
@@ -8,6 +8,25 @@ require 'na'
8
8
  require 'fcntl'
9
9
  require 'tempfile'
10
10
 
11
+ # Search for XDG compliant config first. Default to ~/.na.rc for compatibility
12
+ def self.find_config_file
13
+ home = ENV['HOME']
14
+ xdg_config_home = ENV['XDG_CONFIG_HOME'] || File.join(home, '.config')
15
+
16
+ rc_paths = [
17
+ File.join(xdg_config_home, 'na', 'na.rc'), # Check $XDG_CONFIG_HOME/na/na.rc first
18
+ File.join(xdg_config_home, 'na.rc'), # Then check $XDG_CONFIG_HOME/na.rc
19
+ File.join(home, '.na.rc') # Finally check ~/.na.rc for compatibility
20
+ ]
21
+
22
+ # Return the first path that exists
23
+ existing_path = rc_paths.find { |path| File.exist?(path) }
24
+
25
+ # If none exist, return XDG-compliant path for creation
26
+ existing_path || File.join(xdg_config_home, 'na', 'na.rc')
27
+ end
28
+
29
+
11
30
  # Main application
12
31
  class App
13
32
  extend GLI::App
@@ -56,8 +75,11 @@ class App
56
75
  arg_name 'PATH'
57
76
  flag %i[f file]
58
77
 
78
+ desc 'Use a taskpaper file named after the git repository'
79
+ arg_name 'REPO'
80
+ switch %i[repo], negatable: true, default_value: true
81
+
59
82
  desc 'Provide a template for new/blank todo files, use initconfig to make permanent'
60
- arg_name 'PATH'
61
83
  flag %[template]
62
84
 
63
85
  desc 'Use current working directory as [p]roject, [t]ag, or [n]one'
@@ -101,6 +123,41 @@ class App
101
123
  else
102
124
  global[:cwd_as] =~ /^p/ ? :project : :tag
103
125
  end
126
+
127
+ # start of git repo addition ==================================
128
+ # defaut to git repo if in a git managed directory
129
+ if global[:repo]
130
+ begin
131
+ require 'git'
132
+
133
+ # Check if we're in a git repo first
134
+ in_git_repo = system('git rev-parse --is-inside-work-tree >/dev/null 2>&1')
135
+
136
+ if in_git_repo
137
+ g = Git.open('.', log: Logger.new(File::NULL)) # Silence Git logs
138
+ repo_root = g.dir.path
139
+ repo_name = File.basename(repo_root)
140
+ taskpaper_file = File.join(repo_root, "#{repo_name}.#{NA.extension}")
141
+ NA.notify("Using repository taskpaper file: #{taskpaper_file}", debug: true)
142
+ NA.global_file = taskpaper_file
143
+ # Add this block to create the file if it doesn't exist
144
+ unless File.exist?(taskpaper_file)
145
+ res = NA.yn(NA::Color.template("#{NA.theme[:warning]}Repository file not found, create #{taskpaper_file}"), default: true)
146
+ if res
147
+ NA.create_todo(taskpaper_file, repo_name, template: global[:template])
148
+ else
149
+ NA.notify("#{NA.theme[:error]}Cancelled", exit_code: 1)
150
+ end
151
+ end
152
+ else
153
+ NA.notify("#{NA.theme[:warning]}Not in a git repository, using default file location logic.", debug: true)
154
+ end
155
+ rescue LoadError
156
+ NA.notify("#{NA.theme[:error]}Git gem not installed. Run 'gem install git' to use --repo option.", exit_code: 1)
157
+ end
158
+ end
159
+ # end of git repo addition ====================================
160
+
104
161
  NA.weed_cache_file
105
162
  NA.notify("{dw}{ globals: #{NA.globals}, command_line: #{NA.command_line}, command: #{NA.command}}", debug: true)
106
163
  true
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.75'
2
+ VERSION = '1.2.76'
3
3
  end
data/na.gemspec CHANGED
@@ -29,5 +29,6 @@ spec = Gem::Specification.new do |s|
29
29
  s.add_runtime_dependency('tty-reader', '~> 0.9', '>= 0.9.0')
30
30
  s.add_runtime_dependency('tty-screen', '~> 0.8', '>= 0.8.1')
31
31
  s.add_runtime_dependency('tty-which', '~> 0.5', '>= 0.5.0')
32
+ s.add_runtime_dependency('git', '~> 3.0.0')
32
33
  s.add_development_dependency('tty-spinner', '~> 0.9', '>= 0.9.0')
33
34
  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.74<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.75<!--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,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.75
4
+ version: 1.2.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-17 00:00:00.000000000 Z
10
+ date: 2025-05-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: minitest
@@ -151,6 +151,20 @@ dependencies:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
153
  version: 0.5.0
154
+ - !ruby/object:Gem::Dependency
155
+ name: git
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: 3.0.0
161
+ type: :runtime
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: 3.0.0
154
168
  - !ruby/object:Gem::Dependency
155
169
  name: tty-spinner
156
170
  requirement: !ruby/object:Gem::Requirement