doing 1.0.27 → 1.0.29

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: a6b820922f541c1841b9e3cd6613fcdf20e39f726c455a289b035cd46adad4be
4
- data.tar.gz: 03b371b4badb689f42c2132d252b69a592456efd00c26c94c78cde8ebd0091c9
3
+ metadata.gz: 3e90af6beb426b1b419b0083b8ced51f2c715796a4be8619f6985fb4d2b91802
4
+ data.tar.gz: 557ffd5e2d3d3fb3a7f36e9b9f85605e798287f57e3537680176819203d5a47e
5
5
  SHA512:
6
- metadata.gz: a37aa02c0d7b72c9a3ee7fc920b14a90ac930b7b52e0b18aa5669850a5b84e9f99b6ceeda5e0e058d6a4de65d10736a3f4ea803869629617781daeb581b95460
7
- data.tar.gz: 54ddce825edf7a8aa32b898c86ae698b29e3dd71b443d2154816b3c40714be8a7d0af35f8010640bab76dd135380779cf0598fcacab8deedab9841878e66b3c0
6
+ metadata.gz: d37b931b4bd81bc0a123d1c4b09221251eb86d920c1aac74d97da49da78d44d7417e811a87e1ee3f5db9c36961b725c7ee0cc6bc0e486e4d6c8964366d660a22
7
+ data.tar.gz: 29d320d0d8053633aa93fce728503add9929fb1e68719002dfb7501911358455ca80dacea06a3d807b7c75ec41eae5fc2b3ea64dadd1b4a0f4c285bb6ef7006f
data/README.md CHANGED
@@ -54,6 +54,8 @@ When using the `now` and `later` commands on the command line, you can start the
54
54
 
55
55
  Notes can be prevented from ever appearing in output with the global option `--no-notes`: `doing --no-notes show all`.
56
56
 
57
+ Auto tagging (adding tags listed in .doingrc under `autotag` and `default_tags`) can be skipped for an entry with the `-x` global option: `doing -x done skipping some automatic tagging`.
58
+
57
59
  ## Configuration
58
60
 
59
61
  A basic configuration looks like this:
@@ -382,6 +384,7 @@ Note that you can include a tag with synonyms in the whitelist as well to tag it
382
384
  --[no-]notes - Output notes if included in the template (default: enabled)
383
385
  --stdout - Send results report to STDOUT instead of STDERR
384
386
  --version - Display the program version
387
+ -x, --[no-]noauto - Exclude auto tags and default tags
385
388
 
386
389
  ### Commands:
387
390
 
data/bin/doing CHANGED
@@ -43,10 +43,14 @@ desc 'Send results report to STDOUT instead of STDERR'
43
43
  default_value false
44
44
  switch [:stdout], :default_value => false, :negatable => false
45
45
 
46
+ desc 'Exclude auto tags and default tags'
47
+ switch [:x,:noauto], :default_value => false
48
+
46
49
  desc 'Use a specific configuration file'
47
50
  default_value false
48
51
  flag [:config_file]
49
52
 
53
+
50
54
  # desc 'Wrap notes at X chars (0 for no wrap)'
51
55
  # flag [:w,:wrapwidth], :must_match => /^\d+$/, :type => Integer
52
56
 
@@ -488,23 +492,23 @@ desc 'Tag last entry'
488
492
  arg_name 'tag1 [tag2...]'
489
493
  command :tag do |c|
490
494
  c.desc 'Section'
491
- c.flag [:s,:section], :default_value => "All"
495
+ c.flag [:s, :section], :default_value => "All"
492
496
 
493
497
  c.desc 'How many recent entries to tag (0 for all)'
494
498
  c.default_value 1
495
- c.flag [:c,:count], :default_value => 1
499
+ c.flag [:c, :count], :default_value => 1
496
500
 
497
501
  c.desc 'Include current date/time with tag'
498
502
  c.default_value false
499
- c.switch [:d,:date], :negatable => false, :default_value => false
503
+ c.switch [:d, :date], :negatable => false, :default_value => false
500
504
 
501
505
  c.desc 'Remove given tag(s)'
502
506
  c.default_value false
503
- c.switch [:r,:remove], :negatable => false, :default_value => false
507
+ c.switch [:r, :remove], :negatable => false, :default_value => false
504
508
 
505
509
  c.desc 'Autotag entries based on autotag configuration in ~/.doingrc'
506
510
  c.default_value false
507
- c.switch [:a,:autotag], :negatable => false, :default_value => false
511
+ c.switch [:a, :autotag], :negatable => false, :default_value => false
508
512
 
509
513
  c.action do |global_options,options,args|
510
514
  if args.length == 0 && !options[:a]
@@ -1128,6 +1132,8 @@ pre do |global,command,options,args|
1128
1132
  wwid.init_doing_file
1129
1133
  end
1130
1134
 
1135
+ wwid.auto_tag = !global[:noauto]
1136
+
1131
1137
  wwid.config[:include_notes] = false unless global[:notes]
1132
1138
 
1133
1139
  if global[:version]
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.27'
2
+ VERSION = '1.0.29'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -42,7 +42,7 @@ end
42
42
  ## @brief Main "What Was I Doing" methods
43
43
  ##
44
44
  class WWID
45
- attr_accessor :content, :sections, :current_section, :doing_file, :config, :user_home, :default_config_file, :config_file, :results
45
+ attr_accessor :content, :sections, :current_section, :doing_file, :config, :user_home, :default_config_file, :config_file, :results, :auto_tag
46
46
 
47
47
  ##
48
48
  ## @brief Initializes the object.
@@ -53,6 +53,7 @@ class WWID
53
53
  @default_config_file = '.doingrc'
54
54
  @interval_cache = {}
55
55
  @results = []
56
+ @auto_tag = true
56
57
  end
57
58
 
58
59
  ##
@@ -579,19 +580,24 @@ class WWID
579
580
  opt[:timed] ||= false
580
581
 
581
582
  title = [title.strip.cap_first]
582
- title = autotag(title.join(' '))
583
- unless @config['default_tags'].empty?
584
- title += @config['default_tags'].map{|t|
585
- unless t.nil?
586
- dt = t.sub(/^ *@/,'').chomp
587
- if title =~ /@#{dt}/
588
- ""
589
- else
590
- ' @' + dt
583
+ title = title.join(' ')
584
+
585
+ if @auto_tag
586
+ title = autotag(title)
587
+ unless @config['default_tags'].empty?
588
+ title += @config['default_tags'].map{|t|
589
+ unless t.nil?
590
+ dt = t.sub(/^ *@/,'').chomp
591
+ if title =~ /@#{dt}/
592
+ ""
593
+ else
594
+ ' @' + dt
595
+ end
591
596
  end
592
- end
593
- }.delete_if {|t| t == "" }.join(" ")
597
+ }.delete_if {|t| t == "" }.join(" ")
598
+ end
594
599
  end
600
+ title.gsub!(/ +/,' ')
595
601
  entry = {'title' => title.strip, 'date' => opt[:back]}
596
602
  unless opt[:note] =~ /^\s*$/s
597
603
  entry['note'] = opt[:note].map {|n| n.gsub(/ *$/,'')}
@@ -729,7 +735,7 @@ class WWID
729
735
  }
730
736
  item['title'] = title
731
737
  else
732
- new_title = autotag(item['title'])
738
+ new_title = autotag(item['title']) if @auto_tag
733
739
  unless new_title == item['title']
734
740
  @results.push("Tags updated: #{new_title}")
735
741
  item['title'] = new_title
@@ -1665,6 +1671,7 @@ EOS
1665
1671
  #
1666
1672
  def autotag(text)
1667
1673
  return unless text
1674
+ return text unless @auto_tag
1668
1675
  current_tags = text.scan(/@\w+/)
1669
1676
  whitelisted = []
1670
1677
  @config['autotag']['whitelist'].each {|tag|
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.27
4
+ version: 1.0.29
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-02-16 00:00:00.000000000 Z
11
+ date: 2020-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  - !ruby/object:Gem::Version
217
217
  version: '0'
218
218
  requirements: []
219
- rubygems_version: 3.0.6
219
+ rubygems_version: 3.0.3
220
220
  signing_key:
221
221
  specification_version: 4
222
222
  summary: A command line tool for managing What Was I Doing reminders