doing 1.0.34 → 1.0.35
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 +4 -4
- data/README.md +10 -0
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a6e33a93b18f4a9e8ebd13602ba59ab98021296c7e7d5a7df848eba3b914c64
|
4
|
+
data.tar.gz: 0772cfb068a9ea75223c6d2e62292b44244b35db576ac9c0b350a4428fe46a05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/doing/version.rb
CHANGED
data/lib/doing/wwid.rb
CHANGED
@@ -1695,6 +1695,25 @@ EOS
|
|
1695
1695
|
end
|
1696
1696
|
}
|
1697
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
|
1698
1717
|
if whitelisted.length > 0
|
1699
1718
|
@results.push("Whitelisted tags: #{whitelisted.join(', ')}")
|
1700
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.
|
4
|
+
version: 1.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|