doing 2.0.9.pre → 2.0.10

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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.yardoc/checksums +20 -0
  3. data/.yardoc/complete +0 -0
  4. data/.yardoc/object_types +0 -0
  5. data/.yardoc/objects/root.dat +0 -0
  6. data/.yardoc/proxy_types +0 -0
  7. data/.yardopts +1 -0
  8. data/CHANGELOG.md +1 -1
  9. data/Gemfile.lock +30 -10
  10. data/README.md +1 -1
  11. data/Rakefile +8 -1
  12. data/bin/doing +76 -30
  13. data/doc/Array.html +135 -0
  14. data/doc/Doing/Color.html +506 -0
  15. data/doc/Doing/Configuration.html +680 -0
  16. data/doc/Doing/Errors/DoingNoTraceError.html +186 -0
  17. data/doc/Doing/Errors/DoingRuntimeError.html +186 -0
  18. data/doc/Doing/Errors/DoingStandardError.html +186 -0
  19. data/doc/Doing/Errors/EmptyInput.html +186 -0
  20. data/doc/Doing/Errors/NoResults.html +186 -0
  21. data/doc/Doing/Errors/PluginException.html +248 -0
  22. data/doc/Doing/Errors/UserCancelled.html +186 -0
  23. data/doc/Doing/Errors/WrongCommand.html +186 -0
  24. data/doc/Doing/Errors.html +191 -0
  25. data/doc/Doing/Hooks.html +364 -0
  26. data/doc/Doing/Item.html +1385 -0
  27. data/doc/Doing/Items.html +393 -0
  28. data/doc/Doing/LogAdapter.html +1650 -0
  29. data/doc/Doing/Note.html +535 -0
  30. data/doc/Doing/Pager.html +268 -0
  31. data/doc/Doing/Plugins.html +849 -0
  32. data/doc/Doing/Util.html +870 -0
  33. data/doc/Doing/WWID.html +4827 -0
  34. data/doc/Doing.html +145 -0
  35. data/doc/GLI/Commands/MarkdownDocumentListener.html +763 -0
  36. data/doc/GLI/Commands.html +115 -0
  37. data/doc/GLI.html +115 -0
  38. data/doc/Hash.html +332 -0
  39. data/doc/Status.html +292 -0
  40. data/doc/String.html +1714 -0
  41. data/doc/Symbol.html +250 -0
  42. data/doc/Time.html +182 -0
  43. data/doc/_index.html +411 -0
  44. data/doc/class_list.html +51 -0
  45. data/doc/css/common.css +1 -0
  46. data/doc/css/full_list.css +58 -0
  47. data/doc/css/style.css +497 -0
  48. data/doc/file.README.html +123 -0
  49. data/doc/file_list.html +56 -0
  50. data/doc/frames.html +17 -0
  51. data/doc/index.html +123 -0
  52. data/doc/js/app.js +314 -0
  53. data/doc/js/full_list.js +216 -0
  54. data/doc/js/jquery.js +4 -0
  55. data/doc/method_list.html +1867 -0
  56. data/doc/top-level-namespace.html +112 -0
  57. data/doing.gemspec +5 -1
  58. data/doing.rdoc +86 -16
  59. data/example_plugin.rb +6 -6
  60. data/lib/doing/array.rb +1 -1
  61. data/lib/doing/configuration.rb +14 -12
  62. data/lib/doing/hash.rb +1 -1
  63. data/lib/doing/item.rb +101 -17
  64. data/lib/doing/log_adapter.rb +123 -113
  65. data/lib/doing/note.rb +1 -1
  66. data/lib/doing/plugin_manager.rb +5 -5
  67. data/lib/doing/plugins/export/csv_export.rb +1 -1
  68. data/lib/doing/plugins/export/template_export.rb +5 -7
  69. data/lib/doing/plugins/import/calendar_import.rb +1 -1
  70. data/lib/doing/plugins/import/doing_import.rb +4 -4
  71. data/lib/doing/plugins/import/timing_import.rb +5 -3
  72. data/lib/doing/string.rb +75 -22
  73. data/lib/doing/symbol.rb +9 -5
  74. data/lib/doing/time.rb +1 -1
  75. data/lib/doing/util.rb +18 -11
  76. data/lib/doing/version.rb +1 -1
  77. data/lib/doing/wwid.rb +419 -326
  78. data/lib/doing/wwidfile.rb +5 -5
  79. data/lib/doing.rb +2 -1
  80. data/lib/examples/plugins/say_export.rb +6 -6
  81. data/rdocfixer.rb +1 -1
  82. data/yard_templates/default/method_details/setup.rb +3 -0
  83. metadata +117 -4
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+
41
+
42
+ <span class="title">Top Level Namespace</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Top Level Namespace
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <h2>Defined Under Namespace</h2>
82
+ <p class="children">
83
+
84
+
85
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Doing.html" title="Doing (module)">Doing</a></span>, <span class='object_link'><a href="GLI.html" title="GLI (module)">GLI</a></span>, <span class='object_link'><a href="Status.html" title="Status (module)">Status</a></span>
86
+
87
+
88
+
89
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span>, <span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span>, <span class='object_link'><a href="String.html" title="String (class)">String</a></span>, <span class='object_link'><a href="Symbol.html" title="Symbol (class)">Symbol</a></span>, <span class='object_link'><a href="Time.html" title="Time (class)">Time</a></span>
90
+
91
+
92
+ </p>
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+ </div>
103
+
104
+ <div id="footer">
105
+ Generated on Thu Nov 18 16:39:11 2021 by
106
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
+ 0.9.26 (ruby-3.0.1).
108
+ </div>
109
+
110
+ </div>
111
+ </body>
112
+ </html>
data/doing.gemspec CHANGED
@@ -27,8 +27,12 @@ spec = Gem::Specification.new do |s|
27
27
  s.add_development_dependency 'rdoc', '~> 6.3.1'
28
28
  s.add_development_dependency 'aruba', '~> 1.0.2'
29
29
  s.add_development_dependency 'test-unit', '~> 3.4.4'
30
+ s.add_development_dependency 'yard'
31
+ s.add_development_dependency 'redcarpet'
32
+ s.add_development_dependency 'github-markup'
30
33
  s.add_runtime_dependency('gli', '~> 2.19', '>= 2.19.2')
31
34
  s.add_runtime_dependency('haml','~>5.0.0', '>= 5.0.0')
32
35
  s.add_runtime_dependency('chronic','~> 0.10', '>= 0.10.2')
33
- s.add_runtime_dependency 'deep_merge', '~> 1.2', '>= 1.2.1'
36
+ s.add_runtime_dependency('deep_merge', '~> 1.2', '>= 1.2.1')
37
+ s.add_runtime_dependency('amatch', '~> 0.4', '>= 0.4.0')
34
38
  end
data/doing.rdoc CHANGED
@@ -5,7 +5,7 @@ record of what you've been doing, complete with tag-based time tracking. The
5
5
  command line tool allows you to add entries, annotate with tags and notes, and
6
6
  view your entries with myriad options, with a focus on a "natural" language syntax.
7
7
 
8
- v2.0.9.pre
8
+ v2.0.10
9
9
 
10
10
  === Global Options
11
11
  === --config_file arg
@@ -92,7 +92,7 @@ Boolean used to combine multiple tags
92
92
 
93
93
  ===== --case TYPE
94
94
 
95
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
95
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
96
96
 
97
97
  [Default Value] smart
98
98
  [Must Match] (?-mix:^[csi])
@@ -139,6 +139,11 @@ Edit duplicated entry with vim before adding
139
139
 
140
140
 
141
141
 
142
+ ===== --fuzzy
143
+ Use alternative fuzzy matching for search string
144
+
145
+
146
+
142
147
  ===== -i|--interactive
143
148
  Select item to resume from a menu of matching entries
144
149
 
@@ -180,7 +185,7 @@ Tag boolean (AND|OR|NOT)
180
185
 
181
186
  ===== --case TYPE
182
187
 
183
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
188
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
184
189
 
185
190
  [Default Value] smart
186
191
  [Must Match] (?-mix:^[csi])
@@ -215,6 +220,11 @@ Tag filter, combine multiple tags with a comma. Added for compatibility with oth
215
220
  [Default Value] None
216
221
 
217
222
 
223
+ ===== --fuzzy
224
+ Use alternative fuzzy matching for search string
225
+
226
+
227
+
218
228
  ===== --[no-]label
219
229
  Label moved items with @from(SECTION_NAME)
220
230
 
@@ -305,7 +315,7 @@ Boolean (AND|OR|NOT) with which to combine multiple tag filters
305
315
 
306
316
  ===== --case TYPE
307
317
 
308
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
318
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
309
319
 
310
320
  [Default Value] smart
311
321
  [Must Match] (?-mix:^[csi])
@@ -337,6 +347,11 @@ Archive entries
337
347
 
338
348
 
339
349
 
350
+ ===== --fuzzy
351
+ Use alternative fuzzy matching for search string
352
+
353
+
354
+
340
355
  ===== -i|--interactive
341
356
  Select item(s) to cancel from a menu of matching entries
342
357
 
@@ -539,7 +554,7 @@ Boolean (AND|OR|NOT) with which to combine multiple tag filters
539
554
 
540
555
  ===== --case TYPE
541
556
 
542
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
557
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
543
558
 
544
559
  [Default Value] smart
545
560
  [Must Match] (?-mix:^[csi])
@@ -591,6 +606,11 @@ Include date
591
606
 
592
607
 
593
608
 
609
+ ===== --fuzzy
610
+ Use alternative fuzzy matching for search string
611
+
612
+
613
+
594
614
  ===== -i|--interactive
595
615
  Select item(s) to finish from a menu of matching entries
596
616
 
@@ -639,7 +659,7 @@ Constrain search to entries older than date
639
659
 
640
660
  ===== --case TYPE
641
661
 
642
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
662
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
643
663
 
644
664
  [Default Value] smart
645
665
  [Must Match] (?-mix:^[csi])
@@ -667,6 +687,11 @@ Sort tags by (name|time)
667
687
  [Must Match] (?i-mx:^(?:name|time)$)
668
688
 
669
689
 
690
+ ===== --fuzzy
691
+ Use alternative fuzzy matching for search string
692
+
693
+
694
+
670
695
  ===== -i|--interactive
671
696
  Display an interactive menu of results to perform further operations
672
697
 
@@ -728,7 +753,7 @@ Import entries older than date
728
753
 
729
754
  ===== --case TYPE
730
755
 
731
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
756
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
732
757
 
733
758
  [Default Value] smart
734
759
  [Must Match] (?-mix:^[csi])
@@ -783,6 +808,11 @@ Autotag entries
783
808
 
784
809
 
785
810
 
811
+ ===== --fuzzy
812
+ Use alternative fuzzy matching for search string
813
+
814
+
815
+
786
816
  ===== --not
787
817
  Import items that *don't* match search/tag/date filters
788
818
 
@@ -818,7 +848,7 @@ Tag boolean
818
848
 
819
849
  ===== --case TYPE
820
850
 
821
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
851
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
822
852
 
823
853
  [Default Value] smart
824
854
  [Must Match] (?-mix:^[csi])
@@ -850,6 +880,11 @@ Edit entry with vim
850
880
 
851
881
 
852
882
 
883
+ ===== --fuzzy
884
+ Use alternative fuzzy matching for search string
885
+
886
+
887
+
853
888
  ===== --not
854
889
  Show items that *don't* match search string or tag filter
855
890
 
@@ -907,7 +942,7 @@ How many recent entries to tag (0 for all)
907
942
 
908
943
  ===== --case TYPE
909
944
 
910
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
945
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
911
946
 
912
947
  [Default Value] smart
913
948
  [Must Match] (?-mix:^[csi])
@@ -945,6 +980,11 @@ Don't ask permission to flag all entries when count is 0
945
980
 
946
981
 
947
982
 
983
+ ===== --fuzzy
984
+ Use alternative fuzzy matching for search string
985
+
986
+
987
+
948
988
  ===== -i|--interactive
949
989
  Select item(s) to flag from a menu of matching entries
950
990
 
@@ -1025,7 +1065,7 @@ Boolean (AND|OR|NOT) with which to combine multiple tag filters
1025
1065
 
1026
1066
  ===== --case TYPE
1027
1067
 
1028
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
1068
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
1029
1069
 
1030
1070
  [Default Value] smart
1031
1071
  [Must Match] (?-mix:^[csi])
@@ -1057,6 +1097,11 @@ Edit entry with vim
1057
1097
 
1058
1098
 
1059
1099
 
1100
+ ===== --fuzzy
1101
+ Use alternative fuzzy matching for search string
1102
+
1103
+
1104
+
1060
1105
  ===== -i|--interactive
1061
1106
  Select item for new note from a menu of matching entries
1062
1107
 
@@ -1247,7 +1292,7 @@ Boolean (AND|OR|NOT) with which to combine multiple tag filters
1247
1292
 
1248
1293
  ===== --case TYPE
1249
1294
 
1250
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
1295
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
1251
1296
 
1252
1297
  [Default Value] smart
1253
1298
  [Must Match] (?-mix:^[csi])
@@ -1274,6 +1319,11 @@ Reset last entry matching tag
1274
1319
  [Default Value] None
1275
1320
 
1276
1321
 
1322
+ ===== --fuzzy
1323
+ Use alternative fuzzy matching for search string
1324
+
1325
+
1326
+
1277
1327
  ===== -i|--interactive
1278
1328
  Select from a menu of matching entries
1279
1329
 
@@ -1317,7 +1367,7 @@ Tag boolean (AND|OR|NOT)
1317
1367
 
1318
1368
  ===== --case TYPE
1319
1369
 
1320
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
1370
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
1321
1371
 
1322
1372
  [Default Value] smart
1323
1373
  [Must Match] (?-mix:^[csi])
@@ -1352,6 +1402,11 @@ Tag filter, combine multiple tags with a comma. Added for compatibility with oth
1352
1402
  [Default Value] None
1353
1403
 
1354
1404
 
1405
+ ===== --fuzzy
1406
+ Use alternative fuzzy matching for search string
1407
+
1408
+
1409
+
1355
1410
  ===== --not
1356
1411
  Rotate items that *don't* match search string or tag filter
1357
1412
 
@@ -1383,7 +1438,7 @@ selected entries.
1383
1438
  ===== Options
1384
1439
  ===== --case TYPE
1385
1440
 
1386
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
1441
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
1387
1442
 
1388
1443
  [Default Value] smart
1389
1444
  [Must Match] (?-mix:^[csi])
@@ -1535,7 +1590,7 @@ Max count to show
1535
1590
 
1536
1591
  ===== --case TYPE
1537
1592
 
1538
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
1593
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
1539
1594
 
1540
1595
  [Default Value] smart
1541
1596
  [Must Match] (?-mix:^[csi])
@@ -1595,6 +1650,11 @@ Sort tags by (name|time)
1595
1650
  [Must Match] (?i-mx:^(?:name|time))
1596
1651
 
1597
1652
 
1653
+ ===== --fuzzy
1654
+ Use alternative fuzzy matching for search string
1655
+
1656
+
1657
+
1598
1658
  ===== -i|--interactive
1599
1659
  Select from a menu of matching entries to perform additional operations
1600
1660
 
@@ -1698,7 +1758,7 @@ How many recent entries to tag (0 for all)
1698
1758
 
1699
1759
  ===== --case TYPE
1700
1760
 
1701
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
1761
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
1702
1762
 
1703
1763
  [Default Value] smart
1704
1764
  [Must Match] (?-mix:^[csi])
@@ -1748,6 +1808,11 @@ Don't ask permission to tag all entries when count is 0
1748
1808
 
1749
1809
 
1750
1810
 
1811
+ ===== --fuzzy
1812
+ Use alternative fuzzy matching for search string
1813
+
1814
+
1815
+
1751
1816
  ===== -i|--interactive
1752
1817
  Select item(s) to tag from a menu of matching entries
1753
1818
 
@@ -1898,7 +1963,7 @@ Count to display
1898
1963
 
1899
1964
  ===== --case TYPE
1900
1965
 
1901
- Case sensitivity for search string matching [(c)ase-sensitive, (i)nsensitive, (s)mart]
1966
+ Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]
1902
1967
 
1903
1968
  [Default Value] smart
1904
1969
  [Must Match] (?-mix:^[csi])
@@ -1953,6 +2018,11 @@ Include colors in output
1953
2018
 
1954
2019
 
1955
2020
 
2021
+ ===== --fuzzy
2022
+ Use alternative fuzzy matching for search string
2023
+
2024
+
2025
+
1956
2026
  ===== -i|--interactive
1957
2027
  Select from a menu of matching entries to perform additional operations
1958
2028
 
data/example_plugin.rb CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  module Doing
28
28
  ##
29
- ## @brief Plugin class
29
+ ## Plugin class
30
30
  ##
31
31
  class SayExport
32
32
  include Doing::Util
@@ -65,7 +65,7 @@ module Doing
65
65
  ##
66
66
  ## wwid.config['plugins'][PLUGIN_NAME][KEY]
67
67
  ##
68
- ## @brief Method to return plugin settings (required)
68
+ ## Method to return plugin settings (required)
69
69
  ##
70
70
  ## @return Hash of settings for this plugin
71
71
  ##
@@ -87,7 +87,7 @@ module Doing
87
87
  ## included in settings. The method should return a
88
88
  ## string (not output it to the STDOUT).
89
89
  ##
90
- ## @brief Method to return template (optional)
90
+ ## Method to return template (optional)
91
91
  ##
92
92
  ## @param trigger The trigger passed to the
93
93
  ## template function. When this
@@ -96,7 +96,7 @@ module Doing
96
96
  ## used to determine which one is
97
97
  ## output.
98
98
  ##
99
- ## @return (String) template contents
99
+ ## @return [String] template contents
100
100
  ##
101
101
  def self.template(trigger)
102
102
  return unless trigger =~ /^say(it)?$/
@@ -106,7 +106,7 @@ module Doing
106
106
 
107
107
 
108
108
  ##
109
- ## @brief Render data received from an output
109
+ ## Render data received from an output
110
110
  ## command
111
111
  ##
112
112
  ## @param wwid The wwid object with config
@@ -118,7 +118,7 @@ module Doing
118
118
  ## flags passed to command
119
119
  ## (variables[:options])
120
120
  ##
121
- ## @return (String) Rendered output
121
+ ## @return [String] Rendered output
122
122
  ##
123
123
  def self.render(wwid, items, variables: {})
124
124
  return if items.nil? || items.empty?
data/lib/doing/array.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Doing
4
4
  ##
5
- ## @brief Array helpers
5
+ ## Array helpers
6
6
  ##
7
7
  class ::Array end
8
8
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Doing
4
4
  ##
5
- ## @brief Configuration object
5
+ ## Configuration object
6
6
  ##
7
7
  class Configuration
8
8
  attr_reader :settings
@@ -106,14 +106,15 @@ module Doing
106
106
 
107
107
  def value_for_key(keypath = '')
108
108
  cfg = @settings
109
+ real_path = []
109
110
  unless keypath =~ /^[.*]?$/
110
111
  paths = keypath.split(/[:.]/)
111
112
  while paths.length.positive? && !cfg.nil?
112
113
  path = paths.shift
113
114
  new_cfg = nil
114
115
  cfg.each do |key, val|
115
- next unless key =~ /#{path.to_rx(2)}/
116
-
116
+ next unless key =~ path.to_rx(distance: 2)
117
+ real_path << key
117
118
  new_cfg = val
118
119
  break
119
120
  end
@@ -122,12 +123,13 @@ module Doing
122
123
  Doing.logger.error("Key match not found: #{path}")
123
124
  break
124
125
  end
125
-
126
126
  cfg = new_cfg
127
127
  end
128
128
  end
129
-
130
- cfg
129
+ Doing.logger.debug('Config:', "translated key path #{keypath} to #{real_path.join('.')}")
130
+ result = {}
131
+ result[real_path[-1]] = cfg
132
+ result
131
133
  end
132
134
 
133
135
  # It takes the input, fills in the defaults where values do not exist.
@@ -148,9 +150,9 @@ module Doing
148
150
  end
149
151
 
150
152
  ##
151
- ## @brief Read user configuration and merge with defaults
153
+ ## Read user configuration and merge with defaults
152
154
  ##
153
- ## @param opt (Hash) Additional Options
155
+ ## @param opt [Hash] Additional Options
154
156
  ##
155
157
  def configure(opt = {})
156
158
  @ignore_local = opt[:ignore_local] if opt[:ignore_local]
@@ -219,7 +221,7 @@ module Doing
219
221
  end
220
222
 
221
223
  ##
222
- ## @brief Read local configurations
224
+ ## Read local configurations
223
225
  ##
224
226
  ## @return Hash of config options
225
227
  ##
@@ -251,7 +253,7 @@ module Doing
251
253
  end
252
254
 
253
255
  ##
254
- ## @brief Reads a configuration.
256
+ ## Reads a configuration.
255
257
  ##
256
258
  def read_config
257
259
  unless File.exist?(config_file)
@@ -279,9 +281,9 @@ module Doing
279
281
  end
280
282
 
281
283
  ##
282
- ## @brief Finds a project-specific configuration file
284
+ ## Finds a project-specific configuration file
283
285
  ##
284
- ## @return (String) A file path
286
+ ## @return [String] A file path
285
287
  ##
286
288
  def find_local_config
287
289
  dir = Dir.pwd
data/lib/doing/hash.rb CHANGED
@@ -4,7 +4,7 @@ module Doing
4
4
  # Hash helpers
5
5
  class ::Hash
6
6
  ##
7
- ## @brief Freeze all values in a hash
7
+ ## Freeze all values in a hash
8
8
  ##
9
9
  ## @return { description_of_the_return_value }
10
10
  ##