doing 1.0.30 → 1.0.35

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: 9b8804eda56710f55c158ade59d30d906291c552949141d13d758b4058cb6f0e
4
- data.tar.gz: aee921d4b234b07f0e65d1b759da5faa160165de45d57341bac6bd0e75a63190
3
+ metadata.gz: 4a6e33a93b18f4a9e8ebd13602ba59ab98021296c7e7d5a7df848eba3b914c64
4
+ data.tar.gz: 0772cfb068a9ea75223c6d2e62292b44244b35db576ac9c0b350a4428fe46a05
5
5
  SHA512:
6
- metadata.gz: 21b230f2ec73c53c1f7422d0111f776a97e030dec0510dbf5d88f68449128b01724206b11c1a94c233c1bf422b2904ebb993c72687542047f247745831032941
7
- data.tar.gz: a80e50e594d3a46924afe6813df728ae576bb40c5c887cbefdc426f5fc428a8be983dc6f7c9f7466747b0e641245f04811e821e4ce3e59387865a65212c55969
6
+ metadata.gz: fd1d6f8e2c58ddb0282df2724adc64440185c093a85c9b9523dbe5ae64e02fedff32ccb87bad06a16dea6f0c4a688a082c8ab79e52b53120e156386375da019f
7
+ data.tar.gz: e2839e739b8a7fb5072f4d1c7f5d63ec0135971e0eca44411121c47409684b7dcc42738ce7566a80f32b527d5f8405c4926690b924b793234de88b1f5e8c6bca
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.
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.30'
2
+ VERSION = '1.0.35'
3
3
  end
@@ -201,13 +201,15 @@ class WWID
201
201
  # end
202
202
  # end
203
203
 
204
- File.open(@config_file, 'w') { |yf| YAML::dump(@config, yf) } unless @config == user_config
204
+ unless File.exists?(@config_file)
205
+ File.open(@config_file, 'w') { |yf| YAML::dump(@config, yf) }
206
+ end
205
207
 
206
208
  @config = @local_config.deep_merge(@config)
207
209
 
208
210
  @current_section = @config['current_section']
209
211
  @default_template = @config['templates']['default']['template']
210
- @default_date_format = @config['templates']['default']['date_format']
212
+ @default_date_format = @config['templates']['default']['date_format'];
211
213
 
212
214
 
213
215
  end
@@ -579,6 +581,8 @@ class WWID
579
581
  opt[:back] ||= Time.now
580
582
  opt[:timed] ||= false
581
583
 
584
+ opt[:note] = [opt[:note]] if opt[:note].class == String
585
+
582
586
  title = [title.strip.cap_first]
583
587
  title = title.join(' ')
584
588
 
@@ -600,7 +604,7 @@ class WWID
600
604
  title.gsub!(/ +/,' ')
601
605
  entry = {'title' => title.strip, 'date' => opt[:back]}
602
606
  unless opt[:note].join('').strip == ''
603
- entry['note'] = opt[:note].map {|n| n.gsub(/ *$/,'')}
607
+ entry['note'] = opt[:note].map {|n| n.chomp}
604
608
  end
605
609
  items = @content[section]['items']
606
610
  if opt[:timed]
@@ -1691,6 +1695,25 @@ EOS
1691
1695
  end
1692
1696
  }
1693
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
1694
1717
  if whitelisted.length > 0
1695
1718
  @results.push("Whitelisted tags: #{whitelisted.join(', ')}")
1696
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.30
4
+ version: 1.0.35
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-04-25 00:00:00.000000000 Z
11
+ date: 2020-11-13 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,40 +72,40 @@ 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
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: 5.0.0
102
93
  - - "~>"
103
94
  - !ruby/object:Gem::Version
104
- version: 5.0.0
95
+ version: 5.1.2
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 5.1.2
105
99
  type: :runtime
106
100
  prerelease: false
107
101
  version_requirements: !ruby/object:Gem::Requirement
108
102
  requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: 5.0.0
112
103
  - - "~>"
113
104
  - !ruby/object:Gem::Version
114
- version: 5.0.0
105
+ version: 5.1.2
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 5.1.2
115
109
  - !ruby/object:Gem::Dependency
116
110
  name: chronic
117
111
  requirement: !ruby/object:Gem::Requirement
@@ -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.1.4
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: []