doing 1.0.31 → 1.0.36

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: 0255bb5d4f5bfeda0dc436ec5d7b39cc0076015b38367ae9a3f69aa377ae29aa
4
- data.tar.gz: 765dff7df4c68a482a2f18db18afc2605945d0d87503aa2ec46da138f5cadef6
3
+ metadata.gz: 2c3c3262c843227728b4dc7c4bc31bcc3a8516d9137dae660317ab13f36f297b
4
+ data.tar.gz: 50581e74a2291d871289d9f63b422a4afa6eba93360b3312dd3225bab11f54c9
5
5
  SHA512:
6
- metadata.gz: b401382aaea67cea9e1ce6aaf414a8bcc104ef8375f044d674f0728e8110128285c9d0a88ed998537430546175220faaf821dce83779606b8281997aaf7fddd5
7
- data.tar.gz: 5116d2b3723a1caf501380dfe501600644661a6fd019e214e4c5dc87920a9a9890a93dd8797b0a7cf5a8b0b6cefa0efc5af269a15a035c640847d689bd65a845
6
+ metadata.gz: 89833a04a42bca5da37f07ff12ebefc91abaa9a91bb744ff583a4cfb03363c54acffb6a5306545b074cc42d012b078abec0f2facdf47c8f20bd83ffc4cfc494d
7
+ data.tar.gz: 0c54a76ed0e0d65b81a3dc6270d2b3f2c848e713f339b7512c3150d65e1ef424ded4afe5266ff9fcc668e7877099563b63c247daea6d8d4e10615a0cb4db8f97
data/README.md CHANGED
@@ -464,6 +464,16 @@ To add autotagging, include a section like this in your `~/.doingrc` file:
464
464
  - posting
465
465
  - publishing
466
466
 
467
+ ###### Tag transformation
468
+
469
+ You can include a `transform` section in the autotag config which contains pairs of regular expressions and replacement patterns separated by a colon. These will be used to look at existing tags in the text and generate additional tags from them. For example:
470
+
471
+ autotag:
472
+ transform:
473
+ - (\w+)-\d+:$1
474
+
475
+ This creates a search pattern looking for a string of word characters followed by a hyphen and one or more digits, e.g. `@projecttag-12`. Do not include the @ symbol in the pattern. The replacement (`$1`) indicates that the first matched group (in parenthesis) should be used to generate the new tag, resulting in `@projecttag` being added to the entry.
476
+
467
477
  ##### Annotating
468
478
 
469
479
  `note` lets you append a note to the last entry. You can specify a section to grab the last entry from with `-s section_name`. `-e` will open your `$EDITOR` for typing the note, but you can also just include it on the command line after any flags. You can also pipe a note in on STDIN (`echo "fun stuff"|doing note`). If you don't use the `-r` switch, new notes will be appended to the existing notes, and using the `-e` switch will let you edit and add to an existing note. The `-r` switch will remove/replace a note; if there's new note text passed when using the `-r` switch, it will replace any existing note. If the `-r` switch is used alone, any existing note will be removed.
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.31'
2
+ VERSION = '1.0.36'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -581,6 +581,8 @@ class WWID
581
581
  opt[:back] ||= Time.now
582
582
  opt[:timed] ||= false
583
583
 
584
+ opt[:note] = [opt[:note]] if opt[:note].class == String
585
+
584
586
  title = [title.strip.cap_first]
585
587
  title = title.join(' ')
586
588
 
@@ -602,7 +604,7 @@ class WWID
602
604
  title.gsub!(/ +/,' ')
603
605
  entry = {'title' => title.strip, 'date' => opt[:back]}
604
606
  unless opt[:note].join('').strip == ''
605
- entry['note'] = opt[:note].map {|n| n.gsub(/ *$/,'')}
607
+ entry['note'] = opt[:note].map {|n| n.chomp}
606
608
  end
607
609
  items = @content[section]['items']
608
610
  if opt[:timed]
@@ -1693,6 +1695,25 @@ EOS
1693
1695
  end
1694
1696
  }
1695
1697
  }
1698
+ if @config['autotag'].key? 'transform'
1699
+ @config['autotag']['transform'].each {|tag|
1700
+ if tag =~ /\S+:\S+/
1701
+ rx, r = tag.split(/:/)
1702
+ r.gsub!(/\$/,'\\')
1703
+ rx.sub!(/^@/,'')
1704
+ regex = Regexp.new('@' + rx + '\b')
1705
+
1706
+ matches = text.scan(regex)
1707
+
1708
+ matches.each {|m|
1709
+ puts rx,r
1710
+ new_tag = m[0].sub(Regexp.new(rx), r)
1711
+ puts new_tag
1712
+ tail_tags.push(new_tag)
1713
+ } if matches
1714
+ end
1715
+ }
1716
+ end
1696
1717
  if whitelisted.length > 0
1697
1718
  @results.push("Whitelisted tags: #{whitelisted.join(', ')}")
1698
1719
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.31
4
+ version: 1.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,48 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 12.3.3
19
+ version: 13.0.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 12.3.3
26
+ version: 13.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '4.1'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 4.1.1
33
+ version: 6.2.1
37
34
  type: :development
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '4.1'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 4.1.1
40
+ version: 6.2.1
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: aruba
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: 1.0.2
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '0'
54
+ version: 1.0.2
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: test-unit
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -78,38 +72,38 @@ dependencies:
78
72
  requirements:
79
73
  - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: '2.17'
75
+ version: '2.19'
82
76
  - - ">="
83
77
  - !ruby/object:Gem::Version
84
- version: 2.17.1
78
+ version: 2.19.2
85
79
  type: :runtime
86
80
  prerelease: false
87
81
  version_requirements: !ruby/object:Gem::Requirement
88
82
  requirements:
89
83
  - - "~>"
90
84
  - !ruby/object:Gem::Version
91
- version: '2.17'
85
+ version: '2.19'
92
86
  - - ">="
93
87
  - !ruby/object:Gem::Version
94
- version: 2.17.1
88
+ version: 2.19.2
95
89
  - !ruby/object:Gem::Dependency
96
90
  name: haml
97
91
  requirement: !ruby/object:Gem::Requirement
98
92
  requirements:
99
- - - ">="
93
+ - - "~>"
100
94
  - !ruby/object:Gem::Version
101
95
  version: 5.0.0
102
- - - "~>"
96
+ - - ">="
103
97
  - !ruby/object:Gem::Version
104
98
  version: 5.0.0
105
99
  type: :runtime
106
100
  prerelease: false
107
101
  version_requirements: !ruby/object:Gem::Requirement
108
102
  requirements:
109
- - - ">="
103
+ - - "~>"
110
104
  - !ruby/object:Gem::Version
111
105
  version: 5.0.0
112
- - - "~>"
106
+ - - ">="
113
107
  - !ruby/object:Gem::Version
114
108
  version: 5.0.0
115
109
  - !ruby/object:Gem::Dependency
@@ -156,22 +150,22 @@ dependencies:
156
150
  name: json
157
151
  requirement: !ruby/object:Gem::Requirement
158
152
  requirements:
153
+ - - "~>"
154
+ - !ruby/object:Gem::Version
155
+ version: 2.3.1
159
156
  - - ">="
160
157
  - !ruby/object:Gem::Version
161
158
  version: 1.8.1
162
- - - "~>"
163
- - !ruby/object:Gem::Version
164
- version: 2.2.0
165
159
  type: :runtime
166
160
  prerelease: false
167
161
  version_requirements: !ruby/object:Gem::Requirement
168
162
  requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: 2.3.1
169
166
  - - ">="
170
167
  - !ruby/object:Gem::Version
171
168
  version: 1.8.1
172
- - - "~>"
173
- - !ruby/object:Gem::Version
174
- version: 2.2.0
175
169
  description: A tool for managing a TaskPaper-like file of recent activites. Perfect
176
170
  for the late-night hacker on too much caffeine to remember what they accomplished
177
171
  at 2 in the morning.
@@ -193,7 +187,7 @@ homepage: http://brettterpstra.com/project/doing/
193
187
  licenses:
194
188
  - MIT
195
189
  metadata: {}
196
- post_install_message:
190
+ post_install_message:
197
191
  rdoc_options:
198
192
  - "--title"
199
193
  - doing
@@ -216,8 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
210
  - !ruby/object:Gem::Version
217
211
  version: '0'
218
212
  requirements: []
219
- rubygems_version: 3.0.3
220
- signing_key:
213
+ rubygems_version: 3.2.16
214
+ signing_key:
221
215
  specification_version: 4
222
216
  summary: A command line tool for managing What Was I Doing reminders
223
217
  test_files: []