doing 1.0.39 → 1.0.40

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: 62aab464d54aaaa9afbe992bc0e7d466d79ee24b9bdc5127ae8b45cfb4895795
4
- data.tar.gz: '048bc4ec14d0df9c0c44940b9bd0cfc25c8167ea78db3e64526f8fdbad119588'
3
+ metadata.gz: e9647740f610a441d3740aa8233e20cfa2b95cce65d047bf046233f7685b1936
4
+ data.tar.gz: 99a6dc7fcb96ca1e3a54cedc3e41be3f3d9bdd71f8c6d50c0d2aa4efc5c95ce4
5
5
  SHA512:
6
- metadata.gz: 5500256aa08f6a75a83118a6c4521453f1900a67d69bc57d31a753c4f064c5d9597675152508f5770eb2fbe036b11c7bbe506376cc1da48c6b9919169cb2c849
7
- data.tar.gz: 51607b30fd337af37e21bea90d5b5e91c3fdf6d15c4909fce3f35836337d5f791504644afb5d9505e376bbd53e7b5e0ae386da2695d877bb3fac455c3cf9778b
6
+ metadata.gz: 53d0c3b2162eaf701b4b7df557446fdf12af0834e6083c7d59b4059f73f098c0339d5a2f72249981227c13f7b3f4f21b3f3cd6286260195a44e989b5899f5f66
7
+ data.tar.gz: 9249e276bfd117e47e10a4832ca5ccf376b425fe39ebd34574d0c66e1503483d02655a944dc8cd231106cbbecd39b0ad47ff357713fcbce1a50bf3ce04e555bb
data/bin/doing CHANGED
@@ -699,6 +699,13 @@ command [:grep,:search] do |c|
699
699
  c.default_value false
700
700
  c.switch [:totals], :default_value => false, :negatable => true
701
701
 
702
+ c.desc 'Sort tags by (name|time)'
703
+ default = 'time'
704
+ if wwid.config.has_key?('tag_sort')
705
+ default = wwid.config['tag_sort']
706
+ end
707
+ c.flag [:tag_sort], :default_value => default
708
+
702
709
  c.desc 'Only show items with recorded time intervals'
703
710
  c.default_value false
704
711
  c.switch [:only_timed], :default_value => false, :negatable => false
@@ -708,8 +715,9 @@ command [:grep,:search] do |c|
708
715
  section = wwid.guess_section(options[:s]) if options[:s]
709
716
 
710
717
  options[:t] = true if options[:totals]
718
+ options[:sort_tags] = options[:tag_sort] =~ /^n/i
711
719
 
712
- puts wwid.list_section({:search => args.join(' '), :section => section, :output => options[:output], :times => options[:t], :highlight => true, :totals => options[:totals], :only_timed => options[:only_timed]})
720
+ puts wwid.list_section({:search => args.join(' '), :section => section, :output => options[:output], :times => options[:t], :highlight => true, :totals => options[:totals], :only_timed => options[:only_timed], :sort_tags => options[:sort_tags]})
713
721
 
714
722
  end
715
723
  end
@@ -730,6 +738,13 @@ command :recent do |c|
730
738
  c.default_value false
731
739
  c.switch [:totals], :default_value => false, :negatable => true
732
740
 
741
+ c.desc 'Sort tags by (name|time)'
742
+ default = 'time'
743
+ if wwid.config.has_key?('tag_sort')
744
+ default = wwid.config['tag_sort']
745
+ end
746
+ c.flag [:tag_sort], :default_value => default
747
+
733
748
  c.action do |global_options,options,args|
734
749
 
735
750
  section = wwid.guess_section(options[:s]) || options[:s].cap_first
@@ -741,8 +756,9 @@ command :recent do |c|
741
756
  count = 10
742
757
  end
743
758
  options[:t] = true if options[:totals]
759
+ options[:sort_tags] = options[:tag_sort] =~ /^n/i
744
760
 
745
- puts wwid.recent(count,section.cap_first,{ :times => options[:t], :totals => options[:totals] })
761
+ puts wwid.recent(count,section.cap_first,{ :times => options[:t], :totals => options[:totals], :sort_tags => options[:sort_tags] })
746
762
 
747
763
  end
748
764
  end
@@ -763,14 +779,22 @@ command :today do |c|
763
779
  c.default_value false
764
780
  c.switch [:totals], :default_value => false, :negatable => true
765
781
 
782
+ c.desc 'Sort tags by (name|time)'
783
+ default = 'time'
784
+ if wwid.config.has_key?('tag_sort')
785
+ default = wwid.config['tag_sort']
786
+ end
787
+ c.flag [:tag_sort], :default_value => default
788
+
766
789
  c.desc 'Output to export format (csv|html|json)'
767
790
  c.flag [:o,:output]
768
791
 
769
792
  c.action do |global_options,options,args|
770
793
 
771
794
  options[:t] = true if options[:totals]
795
+ options[:sort_tags] = options[:tag_sort] =~ /^n/i
772
796
 
773
- puts wwid.today(options[:t],options[:output],{:totals => options[:totals], :section => options[:s]}).chomp
797
+ puts wwid.today(options[:t],options[:output],{:totals => options[:totals], :section => options[:s], :sort_tags => options[:sort_tags]}).chomp
774
798
 
775
799
  end
776
800
  end
@@ -792,6 +816,13 @@ command :on do |c|
792
816
  c.default_value false
793
817
  c.switch [:totals], :default_value => false, :negatable => true
794
818
 
819
+ c.desc 'Sort tags by (name|time)'
820
+ default = 'time'
821
+ if wwid.config.has_key?('tag_sort')
822
+ default = wwid.config['tag_sort']
823
+ end
824
+ c.flag [:tag_sort], :default_value => default
825
+
795
826
  c.desc 'Output to export format (csv|html|json)'
796
827
  c.flag [:o,:output]
797
828
 
@@ -815,8 +846,9 @@ command :on do |c|
815
846
  wwid.results.push(message)
816
847
 
817
848
  options[:t] = true if options[:totals]
849
+ options[:sort_tags] = options[:tag_sort] =~ /^n/i
818
850
 
819
- puts wwid.list_date([start,finish],options[:s],options[:t],options[:output],{:totals => options[:totals]}).chomp
851
+ puts wwid.list_date([start, finish], options[:s], options[:t], options[:output], {:totals => options[:totals], :sort_tags => options[:sort_tags]}).chomp
820
852
 
821
853
  end
822
854
  end
@@ -839,8 +871,16 @@ command :yesterday do |c|
839
871
  c.default_value false
840
872
  c.switch [:totals], :default_value => false, :negatable => true
841
873
 
874
+ c.desc 'Sort tags by (name|time)'
875
+ default = 'time'
876
+ if wwid.config.has_key?('tag_sort')
877
+ default = wwid.config['tag_sort']
878
+ end
879
+ c.flag [:tag_sort], :default_value => default
880
+
842
881
  c.action do |global_options, options,args|
843
- puts wwid.yesterday(options[:s],options[:t],options[:o],{:totals => options[:totals]}).chomp
882
+ options[:sort_tags] = options[:tag_sort] =~ /^n/i
883
+ puts wwid.yesterday(options[:s],options[:t],options[:o],{:totals => options[:totals], :sort_tags => options[:sort_tags]}).chomp
844
884
 
845
885
  end
846
886
  end
@@ -927,6 +967,13 @@ command :view do |c|
927
967
  c.default_value false
928
968
  c.switch [:totals], :default_value => false, :negatable => true
929
969
 
970
+ c.desc 'Sort tags by (name|time)'
971
+ default = 'time'
972
+ if wwid.config.has_key?('tag_sort')
973
+ default = wwid.config['tag_sort']
974
+ end
975
+ c.flag [:tag_sort], :default_value => default
976
+
930
977
  c.desc 'Only show items with recorded time intervals'
931
978
  c.default_value false
932
979
  c.switch [:only_timed], :default_value => false, :negatable => true
@@ -972,9 +1019,12 @@ command :view do |c|
972
1019
  count = options[:c] ? options[:c] : view.has_key?('count') ? view['count'] : 10
973
1020
  section = options[:s] ? section : view.has_key?('section') ? view['section'] : wwid.current_section
974
1021
  order = view.has_key?('order') ? view['order'] : "asc"
1022
+
975
1023
  options[:t] = true if options[:totals]
976
1024
  options[:output].downcase! if options[:output]
977
- puts wwid.list_section({:section => section, :count => count, :template => template, :format => format, :order => order, :tag_filter => tag_filter, :output => options[:o], :tags_color => tags_color, :times => options[:t], :highlight => true, :totals => options[:totals], :only_timed => only_timed })
1025
+ options[:sort_tags] = options[:tag_sort] =~ /^n/i
1026
+
1027
+ puts wwid.list_section({:section => section, :count => count, :template => template, :format => format, :order => order, :tag_filter => tag_filter, :output => options[:o], :tags_color => tags_color, :times => options[:t], :highlight => true, :totals => options[:totals], :only_timed => only_timed, :sort_tags => options[:sort_tags] })
978
1028
  else
979
1029
  if title.class == FalseClass
980
1030
  exit_now! "Cancelled"
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.39'
2
+ VERSION = '1.0.40'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -1528,8 +1528,10 @@ EOTEMPLATE
1528
1528
  ##
1529
1529
  def today(times=true,output=nil,opt={})
1530
1530
  opt[:totals] ||= false
1531
+ opt[:sort_tags] ||= false
1532
+
1531
1533
  cfg = @config['templates']['today']
1532
- list_section({:section => opt[:section], :wrap_width => cfg['wrap_width'], :count => 0, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :today => true, :times => times, :output => output, :totals => opt[:totals]})
1534
+ list_section({:section => opt[:section], :wrap_width => cfg['wrap_width'], :count => 0, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :today => true, :times => times, :output => output, :totals => opt[:totals], :sort_tags => opt[:sort_tags]})
1533
1535
  end
1534
1536
 
1535
1537
  ##
@@ -1543,13 +1545,14 @@ EOTEMPLATE
1543
1545
  ##
1544
1546
  def list_date(dates,section,times=nil,output=nil,opt={})
1545
1547
  opt[:totals] ||= false
1548
+ opt[:sort_tags] ||= false
1546
1549
  section = guess_section(section)
1547
1550
  # :date_filter expects an array with start and end date
1548
1551
  if dates.class == String
1549
1552
  dates = [dates, dates]
1550
1553
  end
1551
1554
 
1552
- list_section({:section => section, :count => 0, :order => "asc", :date_filter => dates, :times => times, :output => output, :totals => opt[:totals] })
1555
+ list_section({:section => section, :count => 0, :order => "asc", :date_filter => dates, :times => times, :output => output, :totals => opt[:totals], :sort_tags => opt[:sort_tags] })
1553
1556
  end
1554
1557
 
1555
1558
  ##
@@ -1562,8 +1565,9 @@ EOTEMPLATE
1562
1565
  ##
1563
1566
  def yesterday(section,times=nil,output=nil,opt={})
1564
1567
  opt[:totals] ||= false
1568
+ opt[:sort_tags] ||= false
1565
1569
  section = guess_section(section)
1566
- list_section({:section => section, :count => 0, :order => "asc", :yesterday => true, :times => times, :output => output, :totals => opt[:totals] })
1570
+ list_section({:section => section, :count => 0, :order => "asc", :yesterday => true, :times => times, :output => output, :totals => opt[:totals], :sort_tags => opt[:sort_tags] })
1567
1571
  end
1568
1572
 
1569
1573
  ##
@@ -1576,10 +1580,12 @@ EOTEMPLATE
1576
1580
  def recent(count=10,section=nil,opt={})
1577
1581
  times = opt[:t] || true
1578
1582
  opt[:totals] ||= false
1583
+ opt[:sort_tags] ||= false
1584
+
1579
1585
  cfg = @config['templates']['recent']
1580
1586
  section ||= @current_section
1581
1587
  section = guess_section(section)
1582
- list_section({:section => section, :wrap_width => cfg['wrap_width'], :count => count, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :times => times, :totals => opt[:totals] })
1588
+ list_section({:section => section, :wrap_width => cfg['wrap_width'], :count => count, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :times => times, :totals => opt[:totals], :sort_tags => opt[:sort_tags] })
1583
1589
  end
1584
1590
 
1585
1591
  ##
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.39
4
+ version: 1.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-21 00:00:00.000000000 Z
11
+ date: 2021-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake