na 1.0.6 → 1.0.7

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: ac0a37d801443c68aaee6eee3b6c4a31461a61d4221c7a073beb0f176d7d7424
4
- data.tar.gz: d04d6bd01a3104f6858e9a797af728486b80a8482b6644a09940a6272ae2ec4b
3
+ metadata.gz: 9aab87ece3f35afbe5280d6c1b777c9d8dece4916f796eedb3dfebdbbeb5032e
4
+ data.tar.gz: 46b7eef3d84ede3a69f9497e4d0bb4fcc772fd159fbffe23f9749f3172bc2cdf
5
5
  SHA512:
6
- metadata.gz: 7ec40b0dd9ff9f154cc22e5d1cb2df700fae82e9c8118110d72b0ea3aeed46a0bd7543955e8b491f99816a9c5dea8ede5866534c362abbb771a3fefbe8d346d9
7
- data.tar.gz: c66d44910edfe4200655b6775665ead7836b47dd7b8b20385da29ee21ce6ba38d5fef0f99b2da009385d9962204cf491d3ee928b2c255bd5d2ce278d8a4c15fa
6
+ metadata.gz: 05bda9033431ce005ad32fb9cd1c711642504972ffa73131d1c989b90dd4b50089b53d9e6746df4555d87e9b65d8b3c2c3707023dd8a8287f8596f4583a727f5
7
+ data.tar.gz: d474663a84ca7ef0287f05c3c2ed6fa63b0fb3d6482337b33343bbfa71a7a7d1c4fe542f91d9c75797c48a4f073079b85a96ef6704d2056b193b7f891596cbf9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 1.0.7
2
+
3
+ 2022-09-28 04:38
4
+
1
5
  ### 1.0.6
2
6
 
3
7
  2022-09-28 04:22
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.0.5)
4
+ na (1.0.6)
5
5
  gli (~> 2.21.0)
6
6
  tty-reader (~> 0.9, >= 0.9.0)
7
7
  tty-screen (~> 0.8, >= 0.8.1)
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.0.5.
12
+ The current version of `na` is 1.0.6.
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
 
data/bin/na CHANGED
@@ -91,7 +91,7 @@ class App
91
91
  end
92
92
  end
93
93
 
94
- tag = options[:tag] == global_options[:na_tag] ? nil : options[:tag]
94
+ tag = options[:tag] == NA.na_tag ? nil : options[:tag]
95
95
  files, actions = NA.parse_actions(depth: depth,
96
96
  query: tokens,
97
97
  tag: tag)
@@ -122,6 +122,9 @@ class App
122
122
  c.arg_name 'TAG'
123
123
  c.flag %i[t tag]
124
124
 
125
+ c.desc 'Don\'t add next action tag to new entry'
126
+ c.switch %i[x]
127
+
125
128
  c.desc 'Specify the file to which the task should be added'
126
129
  c.arg_name 'PATH'
127
130
  c.flag %i[f file]
@@ -147,9 +150,14 @@ class App
147
150
  end
148
151
 
149
152
  na_tag = NA.na_tag
150
- na_tag = options[:tag] unless options[:tag].nil?
153
+ if options[:x]
154
+ na_tag = ''
155
+ else
156
+ na_tag = options[:tag] unless options[:tag].nil?
157
+ na_tag = " @#{na_tag}"
158
+ end
151
159
 
152
- action = "#{action.gsub(/@#{na_tag}/, '')} @#{na_tag}"
160
+ action = "#{action.gsub(/#{na_tag}/, '')}#{na_tag}"
153
161
 
154
162
  note = if options[:note]
155
163
  if TTY::Which.exist?('gum')
@@ -191,7 +199,6 @@ class App
191
199
  end
192
200
  end
193
201
 
194
- NA.save_working_dir(File.expand_path(target))
195
202
  NA.add_action(target, action, note)
196
203
  end
197
204
  end
@@ -26,7 +26,9 @@ module NA
26
26
  end
27
27
 
28
28
  def find_files(depth: 1)
29
- `find . -name "*.#{NA.extension}" -maxdepth #{depth}`.strip.split("\n")
29
+ files = `find . -name "*.#{NA.extension}" -maxdepth #{depth}`.strip.split("\n")
30
+ files.each { |f| save_working_dir(File.expand_path(f)) }
31
+ files
30
32
  end
31
33
 
32
34
  def select_file(files)
@@ -151,12 +153,14 @@ module NA
151
153
  indent_level = indent
152
154
  end
153
155
  elsif line =~ /^[ \t]*- / && line !~ / @done/
156
+ next unless line =~ /@#{NA.na_tag}\b/
157
+
154
158
  unless optional.empty? && required.empty?
155
159
  next unless line.matches(any: optional, all: required)
156
160
 
157
161
  end
158
162
 
159
- action = line.sub(/^[ \t]*- /, '').sub(/ #{NA.na_tag}/, '')
163
+ action = line.sub(/^[ \t]*- /, '').sub(/ @#{NA.na_tag}\b/, '')
160
164
  new_action = NA::Action.new(file, File.basename(file, ".#{NA.extension}"), parent.dup, action)
161
165
  actions.push(new_action)
162
166
  end
data/lib/na/prompt.rb CHANGED
@@ -9,20 +9,20 @@ module NA
9
9
  when :zsh
10
10
  <<~EOHOOK
11
11
  # zsh prompt hook for na
12
- chpwd() { na }
12
+ chpwd() { na next }
13
13
  EOHOOK
14
14
  when :fish
15
15
  <<~EOHOOK
16
16
  # Fish Prompt Command
17
17
  function __should_na --on-variable PWD
18
- test -s (basename $PWD)".#{NA.extension}" && na
18
+ test -s (basename $PWD)".#{NA.extension}" && na next
19
19
  end
20
20
  EOHOOK
21
21
  when :bash
22
22
  <<~EOHOOK
23
23
  # Bash PROMPT_COMMAND for na
24
24
  last_command_was_cd() {
25
- [[ $(history 1|sed -e "s/^[ ]*[0-9]*[ ]*//") =~ ^((cd|z|j|jump|g|f|pushd|popd|exit)([ ]|$)) ]] && na
25
+ [[ $(history 1|sed -e "s/^[ ]*[0-9]*[ ]*//") =~ ^((cd|z|j|jump|g|f|pushd|popd|exit)([ ]|$)) ]] && na next
26
26
  }
27
27
  if [[ -z "$PROMPT_COMMAND" ]]; then
28
28
  PROMPT_COMMAND="eval 'last_command_was_cd'"
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'
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.0.5<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.0.6<!--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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra