na 1.2.23 → 1.2.25

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: 156cd1491d6307f4e28005d50c7b7fd0bd9d40da460533fa5a52e0a472ead137
4
- data.tar.gz: fc1900ffb0aa9984f039aa9ca8f3b85fb787069f31a7ed2d071c786b4fe2638b
3
+ metadata.gz: fb2c991e3e916c35ac9820504725f1e8b41f0030c0f87a0672ec4cfcc5190c09
4
+ data.tar.gz: 97de5c78cf2ce7f53a6268030b9c0fb5d4881c7f40e312d289207353fc53801a
5
5
  SHA512:
6
- metadata.gz: 190d47fd1308faf2401234d9dc28c02ed61c89888a5fa96139ffad51a6ff41f0f48babb90971c132c3e890abeaf3177b878fa94363bd8a4f534b2eab7dadf43c
7
- data.tar.gz: 6e40bf25ec1e3dd609181c467c4d885efbd9a634e8ab90424f4d443683d01d8594bace90df10c47cc12a498caae12e32efff20d0ad2d749508406bd838b05401
6
+ metadata.gz: 74a6012339df8e359f39942c481905de44c066a1d0c464ce942de7590d23a80da3fe68b79f86215faeaa5efc831e3b88f96630b51ca2285967afbd9b24956e07
7
+ data.tar.gz: 134d9db7430525d873025c23b00bd57c2494038a8af9e4bb48d1544f39e804b065313ad4f542ebe871129fe09eda3fc4330ce796e870514e2370616e51291c22
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ### 1.2.25
2
+
3
+ 2023-08-21 07:23
4
+
5
+ #### FIXED
6
+
7
+ - Find command on Linux
8
+
9
+ ### 1.2.24
10
+
11
+ 2023-06-14 09:16
12
+
1
13
  ### 1.2.23
2
14
 
3
15
  2023-06-05 10:42
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.23)
4
+ na (1.2.25)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  gli (~> 2.21.0)
7
7
  mdless (~> 1.0, >= 1.0.32)
@@ -14,7 +14,7 @@ GEM
14
14
  specs:
15
15
  chronic (0.10.2)
16
16
  gli (2.21.0)
17
- mdless (1.0.32)
17
+ mdless (1.0.33)
18
18
  minitest (5.16.3)
19
19
  rake (0.9.6)
20
20
  rdoc (4.3.0)
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.23
12
+ The current version of `na` is 1.2.25
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.
@@ -20,7 +20,7 @@ It can also auto-display next actions when you enter a project directory, automa
20
20
 
21
21
  ### Installation
22
22
 
23
- Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, use `sudo gem install na`.
23
+ Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, try `gem install --user-install na`, or use `sudo gem install na`.
24
24
 
25
25
  If you're using Homebrew, you have the option to install via [brew-gem](https://github.com/sportngin/brew-gem):
26
26
 
@@ -77,14 +77,14 @@ SYNOPSIS
77
77
  na [global options] command [command options] [arguments...]
78
78
 
79
79
  VERSION
80
- 1.2.23
80
+ 1.2.25
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --add - Add a next action (deprecated, for backwards compatibility)
84
84
  --add_at=POSITION - Add all new/moved entries at [s]tart or [e]nd of target project (default: start)
85
85
  --[no-]color - Colorize output (default: enabled)
86
86
  --cwd_as=TYPE - Use current working directory as [p]roject, [t]ag, or [n]one (default: none)
87
- -d, --depth=DEPTH - Recurse to depth (default: 1)
87
+ -d, --depth=DEPTH - Recurse to depth (default: 3)
88
88
  --[no-]debug - Display verbose output
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)
@@ -105,7 +105,7 @@ module NA
105
105
  def find_files(depth: 1)
106
106
  return [NA.global_file] if NA.global_file
107
107
 
108
- files = `find . -name "*.#{NA.extension}" -maxdepth #{depth}`.strip.split("\n")
108
+ files = `find . -maxdepth #{depth} -name "*.#{NA.extension}"`.strip.split("\n")
109
109
  files.each { |f| save_working_dir(File.expand_path(f)) }
110
110
  files
111
111
  end
@@ -166,7 +166,7 @@ module NA
166
166
  [projects, selected]
167
167
  end
168
168
 
169
- def insert_project(target, project)
169
+ def insert_project(target, project, projects)
170
170
  path = project.split(%r{[:/]})
171
171
  _, _, projects = parse_actions(file_path: target)
172
172
  built = []
@@ -196,9 +196,13 @@ module NA
196
196
  end
197
197
 
198
198
  if new_path.join('') =~ /Archive/i
199
- content = "#{content.strip}\n#{input.join("\n")}"
199
+ line = projects.last.last_line
200
+ content = content.split(/\n/).insert(line, input.join("\n")).join("\n")
200
201
  else
201
- content = "#{input.join("\n")}\n#{content}"
202
+ split = content.split(/\n/)
203
+ before = split.slice(0, projects.first.line).join("\n")
204
+ after = split.slice(projects.first.line, split.count - projects.first.line).join("\n")
205
+ content = "#{before}\n#{input.join("\n")}\n#{after}"
202
206
  end
203
207
 
204
208
  new_project = NA::Project.new(path.map(&:cap_first).join(':'), indent - 1, input.count - 1, input.count - 1)
@@ -210,7 +214,7 @@ module NA
210
214
  input.push("#{"\t" * indent}#{part.cap_first}:")
211
215
  indent += 1
212
216
  end
213
- content = content.split("\n").insert(line, input.join("\n")).join("\n")
217
+ content = content.split(/\n/).insert(line, input.join("\n")).join("\n")
214
218
  new_project = NA::Project.new(path.map(&:cap_first).join(':'), indent - 1, line + input.count - 1, line + input.count - 1)
215
219
  end
216
220
 
@@ -273,7 +277,7 @@ module NA
273
277
  if target_proj.nil?
274
278
  res = NA.yn(NA::Color.template("{y}Project {bw}#{project}{xy} doesn't exist, add it"), default: true)
275
279
  if res
276
- target_proj = insert_project(target, project)
280
+ target_proj = insert_project(target, project, projects)
277
281
  else
278
282
  NA.notify('{x}Cancelled', exit_code: 1)
279
283
  end
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.23'
2
+ VERSION = '1.2.25'
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.22<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.24<!--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
 
@@ -19,7 +19,7 @@ It can also auto-display next actions when you enter a project directory, automa
19
19
 
20
20
  ### Installation
21
21
 
22
- Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, use `sudo gem install na`.
22
+ Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, try `gem install --user-install na`, or use `sudo gem install na`.
23
23
 
24
24
  If you're using Homebrew, you have the option to install via [brew-gem](https://github.com/sportngin/brew-gem):
25
25
 
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.23
4
+ version: 1.2.25
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-06-05 00:00:00.000000000 Z
11
+ date: 2023-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  - !ruby/object:Gem::Version
247
247
  version: '0'
248
248
  requirements: []
249
- rubygems_version: 3.2.15
249
+ rubygems_version: 3.2.16
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: A command line tool for adding and listing project todos