na 1.1.9 → 1.1.10

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: e1c1a61c33eaccbf930903d5adbc75fd4ef717b31bdb21539240535d03b71922
4
- data.tar.gz: 1c1067564d9e0e8452512cf146ff9443ecc8a61456ed1d1d46dc5a76c5cf2280
3
+ metadata.gz: 7d9dd176974a6c4c20be90d5051c7608469ea7b105537a7859697e3be4050ea5
4
+ data.tar.gz: b201fecc68568c3b80c6626eb425929d2f50faf6a1bd5fe5bae076021ea0d8b1
5
5
  SHA512:
6
- metadata.gz: a39268399afd4fdb653b5578f729967fca4c4313b1c0698e42b714d775257cbdae511380c895066ef7a399dc0637f806cc6890d6664919244cbacbca23a2182b
7
- data.tar.gz: 7cc6f8938f297e23352d9b5d5bdfa6d3727d316cd6508dc29cf829e8a68939c30964e40036e04624921e157ccbcc45df2e71fd426a06d1e80d59cdcd8b80d98a
6
+ metadata.gz: 169372ba631178c20af2af22e461ba0a6c9fcb7e7e5421d71464b1f180ad766bcd2888d30305354554e24ab86c366c12ffdbab9cc2e0f6c7c03f48f402a32679
7
+ data.tar.gz: c6ea88026936d1f0fe6d9c822945bd7f9ecf351a67871d5fbe27673a2142ef03502fb1759d20d817b4ab8f435942cf6bbdfa24829e535c9684fe507549ac5bee
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.1.10
2
+
3
+ 2022-10-05 08:19
4
+
5
+ #### FIXED
6
+
7
+ - When adding a project, don't use Ruby #capitalize, which downcases the rest of the project name
8
+
1
9
  ### 1.1.9
2
10
 
3
11
  2022-10-03 12:08
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.1.9)
4
+ na (1.1.10)
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.1.9
12
+ The current version of `na` is 1.1.10
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.
@@ -37,7 +37,7 @@ You can list next actions in files in the current directory by typing `na`. By d
37
37
 
38
38
  #### Easy matching
39
39
 
40
- `na` features intelligent project matching. Every time it locates a todo file, it adds the project to the database. Once a project is recorded, you can list its actions by using any portion of the parent directories or file names. If your project is in `~/Sites/dev/markedapp`, you could quickly list its next actions by typing `na dev mark`. It will always look for the shortest match.
40
+ `na` features intelligent project matching. Every time it locates a todo file, it adds the project to the database. Once a project is recorded, you can list its actions by using any portion of the parent directories or file names. If your project is in `~/Sites/dev/markedapp`, you could quickly list its next actions by typing `na next dev mark`. It will always look for the shortest match.
41
41
 
42
42
  #### Recursion
43
43
 
@@ -60,13 +60,13 @@ module NA
60
60
  def add_action(file, project, action, note = nil)
61
61
  content = IO.read(file)
62
62
  unless content =~ /^[ \t]*#{project}:/i
63
- content = "#{project.capitalize}:\n#{content}"
63
+ content = "#{project.cap_first}:\n#{content}"
64
64
  end
65
65
 
66
66
  content.sub!(/^([ \t]*)#{project}:(.*?)$/i) do
67
67
  m = Regexp.last_match
68
68
  note = note.nil? ? '' : "\n#{m[1]}\t\t#{note.join('').strip}"
69
- "#{m[1]}#{project.capitalize}:#{m[2]}\n#{m[1]}\t- #{action}#{note}"
69
+ "#{m[1]}#{project.cap_first}:#{m[2]}\n#{m[1]}\t- #{action}#{note}"
70
70
  end
71
71
 
72
72
  File.open(file, 'w') { |f| f.puts content }
data/lib/na/string.rb CHANGED
@@ -48,4 +48,15 @@ class ::String
48
48
  end
49
49
  true
50
50
  end
51
+
52
+ def cap_first!
53
+ replace cap_first
54
+ end
55
+
56
+ def cap_first
57
+ sub(/^([a-z])(.*)$/) do
58
+ m = Regexp.last_match
59
+ m[1].upcase << m[2]
60
+ end
61
+ end
51
62
  end
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.1.9'
2
+ VERSION = '1.1.10'
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.1.8<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.1.9<!--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
 
@@ -36,7 +36,7 @@ You can list next actions in files in the current directory by typing `na`. By d
36
36
 
37
37
  #### Easy matching
38
38
 
39
- `na` features intelligent project matching. Every time it locates a todo file, it adds the project to the database. Once a project is recorded, you can list its actions by using any portion of the parent directories or file names. If your project is in `~/Sites/dev/markedapp`, you could quickly list its next actions by typing `na dev mark`. It will always look for the shortest match.
39
+ `na` features intelligent project matching. Every time it locates a todo file, it adds the project to the database. Once a project is recorded, you can list its actions by using any portion of the parent directories or file names. If your project is in `~/Sites/dev/markedapp`, you could quickly list its next actions by typing `na next dev mark`. It will always look for the shortest match.
40
40
 
41
41
  #### Recursion
42
42
 
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.1.9
4
+ version: 1.1.10
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-03 00:00:00.000000000 Z
11
+ date: 2022-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake