spreen-wiki 0.1.0 → 0.3.0

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +0 -0
  3. data/README.md +12 -11
  4. data/exe/{spreen → wiki-organise} +2 -2
  5. data/lib/spreen-wiki.rb +2 -2
  6. data/lib/spreen_wiki/application.rb +149 -0
  7. data/lib/spreen_wiki/cli.rb +157 -0
  8. data/lib/spreen_wiki/configuration.rb +215 -0
  9. data/lib/spreen_wiki/home.rb +100 -0
  10. data/lib/spreen_wiki/sidebar.rb +48 -0
  11. data/lib/{spreen/wiki → spreen_wiki}/templates/category/english.md +0 -0
  12. data/lib/{spreen/wiki → spreen_wiki}/templates/category/japanese.md +0 -0
  13. data/lib/{spreen/wiki → spreen_wiki}/templates/owner/english.md +0 -0
  14. data/lib/{spreen/wiki → spreen_wiki}/templates/owner/japanese.md +0 -0
  15. data/lib/spreen_wiki/unknown_wiki_count_list_exporter.rb +59 -0
  16. data/lib/spreen_wiki/unknown_wiki_list_exporter_for_llm.rb +51 -0
  17. data/lib/{spreen/wiki → spreen_wiki}/version.rb +2 -4
  18. data/lib/spreen_wiki.rb +18 -0
  19. data/sig/generated/spreen-wiki.rbs +0 -0
  20. data/sig/generated/spreen_wiki/application.rbs +91 -0
  21. data/sig/generated/spreen_wiki/cli.rbs +68 -0
  22. data/sig/generated/spreen_wiki/configuration.rbs +148 -0
  23. data/sig/generated/spreen_wiki/home.rbs +52 -0
  24. data/sig/generated/spreen_wiki/sidebar.rbs +29 -0
  25. data/sig/generated/spreen_wiki/unknown_wiki_count_list_exporter.rbs +38 -0
  26. data/sig/generated/spreen_wiki/unknown_wiki_list_exporter_for_llm.rbs +35 -0
  27. data/sig/generated/spreen_wiki/version.rbs +5 -0
  28. data/sig/generated/spreen_wiki.rbs +8 -0
  29. data/sig/generated/test/application_test.rbs +0 -0
  30. data/sig/generated/test/configuration_test.rbs +0 -0
  31. data/sig/generated/test/home_test.rbs +0 -0
  32. data/sig/generated/test/sidebar_test.rbs +0 -0
  33. data/sig/generated/test/unknown_wiki_count_list_exporter_test.rbs +0 -0
  34. data/sig/generated/test/unknown_wiki_list_exporter_for_llm_test.rbs +0 -0
  35. metadata +25 -25
  36. data/lib/spreen/wiki/application.rb +0 -151
  37. data/lib/spreen/wiki/cli.rb +0 -159
  38. data/lib/spreen/wiki/configuration.rb +0 -217
  39. data/lib/spreen/wiki/home.rb +0 -102
  40. data/lib/spreen/wiki/sidebar.rb +0 -50
  41. data/lib/spreen/wiki/unknown_wiki_count_list_exporter.rb +0 -61
  42. data/lib/spreen/wiki/unknown_wiki_list_exporter_for_llm.rb +0 -53
  43. data/lib/spreen/wiki.rb +0 -20
  44. data/sig/generated/spreen/wiki/application.rbs +0 -93
  45. data/sig/generated/spreen/wiki/cli.rbs +0 -70
  46. data/sig/generated/spreen/wiki/configuration.rbs +0 -150
  47. data/sig/generated/spreen/wiki/home.rbs +0 -54
  48. data/sig/generated/spreen/wiki/sidebar.rbs +0 -31
  49. data/sig/generated/spreen/wiki/unknown_wiki_count_list_exporter.rbs +0 -40
  50. data/sig/generated/spreen/wiki/unknown_wiki_list_exporter_for_llm.rbs +0 -37
  51. data/sig/generated/spreen/wiki/version.rbs +0 -7
  52. data/sig/generated/spreen/wiki.rbs +0 -10
@@ -1,217 +0,0 @@
1
- # frozen_string_literal: true
2
- # rbs_inline: enabled
3
-
4
- require 'yaml'
5
-
6
- module Spreen
7
- module Wiki
8
- # Resolves the runtime configuration for a wiki checkout. Every value is
9
- # looked up with the same precedence: explicit keyword argument, then the
10
- # `.spreen.yml` file under base_path (or config_path), then the
11
- # ORGANISATION_NAME environment variable (organisation only), then the
12
- # built-in defaults.
13
- class Configuration
14
- CONFIG_FILENAME = '.spreen.yml'
15
- EMPTY_HASH = {}.freeze #: Hash[String, untyped]
16
- DEFAULT_TEMPLATE_DIR = File.expand_path(File.join(__dir__.to_s, 'templates'))
17
- DEFAULT_EXCLUDED_DIRS = %w[spreen-wiki wikis-by-owner].freeze
18
-
19
- # Built-in labels: how the first line of a wiki page is parsed (regexp),
20
- # which namespace collects pages without a declaration (no_declaration),
21
- # which namespaces the count report covers (unknown_namespaces) and which
22
- # namespace the LLM export targets (llm_target_namespace). A config file
23
- # can override any of these, add languages or add group_by criteria.
24
- DEFAULT_LABELS = {
25
- 'Owner' => {
26
- 'regexp' => '[Oo]wner:\s?',
27
- 'languages' => {
28
- 'English' => {
29
- 'no_declaration' => 'Unowned',
30
- 'unknown_namespaces' => ['Unknown Owner nor Necessity', 'Unowned but Necessary', 'Unowned'],
31
- 'llm_target_namespace' => 'Unknown Owner nor Necessity'
32
- },
33
- 'Japanese' => {
34
- 'no_declaration' => 'Owner記名なし',
35
- 'unknown_namespaces' => [
36
- 'Ownerチームが不明だが必要なページ群',
37
- 'Ownerチーム・要or不要が不明なページ群',
38
- 'Owner記名なし'
39
- ],
40
- 'llm_target_namespace' => 'Ownerチーム・要or不要が不明なページ群'
41
- }
42
- }
43
- },
44
- 'Category' => {
45
- 'regexp' => '[Cc]ategory:\s?',
46
- 'languages' => {
47
- 'English' => {
48
- 'no_declaration' => 'Uncategorised',
49
- 'unknown_namespaces' => ['Uncategorised'],
50
- 'llm_target_namespace' => 'Uncategorised'
51
- },
52
- 'Japanese' => {
53
- 'no_declaration' => 'Category記載なし',
54
- 'unknown_namespaces' => ['Category記載なし'],
55
- 'llm_target_namespace' => 'Category記載なし'
56
- }
57
- }
58
- }
59
- }.freeze
60
-
61
- attr_reader :organisation, :repository, :wiki_url, :owner_base_url, :excluded_dirs, :template_dir
62
-
63
- # @rbs!
64
- # @organisation: String?
65
- # @repository: String?
66
- # @wiki_url: String?
67
- # @owner_base_url: String?
68
- # @excluded_dirs: Array[String]
69
- # @template_dir: String
70
- # @file: Hash[String, untyped]
71
- # @labels: Hash[String, untyped]
72
-
73
- # @rbs base_path: String
74
- # @rbs config_path: String?
75
- # @rbs organisation: String?
76
- # @rbs repository: String?
77
- # @rbs wiki_url: String?
78
- # @rbs owner_base_url: String?
79
- # @rbs excluded_dirs: Array[String]?
80
- # @rbs template_dir: String?
81
- # @rbs return: void
82
- def initialize(base_path:, config_path: nil, organisation: nil, repository: nil, wiki_url: nil,
83
- owner_base_url: nil, excluded_dirs: nil, template_dir: nil)
84
- @file = load_file(config_path || File.join(base_path, CONFIG_FILENAME))
85
- @organisation = resolve_organisation(organisation)
86
- @repository = resolve(repository, 'repository')
87
- @wiki_url = resolve_wiki_url(wiki_url)
88
- @owner_base_url = resolve_owner_base_url(owner_base_url)
89
- @excluded_dirs = excluded_dirs || file.fetch('exclude', DEFAULT_EXCLUDED_DIRS)
90
- @template_dir = template_dir || file.fetch('template_dir', DEFAULT_TEMPLATE_DIR)
91
- @labels = deep_merge(DEFAULT_LABELS, file.fetch('labels', EMPTY_HASH))
92
- end
93
-
94
- # @rbs return: Array[String]
95
- def group_bys
96
- labels.keys
97
- end
98
-
99
- # @rbs group_by: String
100
- # @rbs return: Array[String]
101
- def languages(group_by)
102
- label_for(group_by).fetch('languages', EMPTY_HASH).keys
103
- end
104
-
105
- # @rbs group_by: String
106
- # @rbs return: Regexp
107
- def target_regexp(group_by)
108
- Regexp.new(label_for(group_by).fetch('regexp', ''))
109
- end
110
-
111
- # @rbs group_by: String
112
- # @rbs language: String
113
- # @rbs return: String
114
- def no_declaration(group_by, language)
115
- language_labels(group_by, language).fetch('no_declaration', '')
116
- end
117
-
118
- # @rbs group_by: String
119
- # @rbs language: String
120
- # @rbs return: Array[String]
121
- def unknown_namespaces(group_by, language)
122
- language_labels(group_by, language).fetch('unknown_namespaces', [])
123
- end
124
-
125
- # @rbs group_by: String
126
- # @rbs language: String
127
- # @rbs return: String
128
- def llm_target_namespace(group_by, language)
129
- language_labels(group_by, language).fetch('llm_target_namespace', '')
130
- end
131
-
132
- # @rbs group_by: String
133
- # @rbs language: String
134
- # @rbs return: String
135
- def path_to_template(group_by, language)
136
- File.join(template_dir, group_by.downcase, "#{language.downcase}.md")
137
- end
138
-
139
- private
140
-
141
- attr_reader :file, :labels
142
-
143
- # Treats empty strings the same as nil so that callers can pass values
144
- # straight from optional environment variables or CLI flags.
145
- # @rbs value: String?
146
- # @rbs return: String?
147
- def presence(value)
148
- value unless value.nil? || value.empty?
149
- end
150
-
151
- # @rbs explicit: String?
152
- # @rbs key: String
153
- # @rbs return: String?
154
- def resolve(explicit, key)
155
- presence(explicit) || presence(file[key])
156
- end
157
-
158
- # @rbs explicit: String?
159
- # @rbs return: String?
160
- def resolve_organisation(explicit)
161
- resolve(explicit, 'organisation') || presence(ENV.fetch('ORGANISATION_NAME', nil))
162
- end
163
-
164
- # @rbs explicit: String?
165
- # @rbs return: String?
166
- def resolve_wiki_url(explicit)
167
- resolve(explicit, 'wiki_url') || default_wiki_url
168
- end
169
-
170
- # @rbs explicit: String?
171
- # @rbs return: String?
172
- def resolve_owner_base_url(explicit)
173
- resolve(explicit, 'owner_base_url') || default_owner_base_url
174
- end
175
-
176
- # @rbs path: String
177
- # @rbs return: Hash[String, untyped]
178
- def load_file(path)
179
- return {} unless File.exist?(path)
180
-
181
- YAML.safe_load_file(path) || {}
182
- end
183
-
184
- # @rbs group_by: String
185
- # @rbs return: Hash[String, untyped]
186
- def label_for(group_by)
187
- labels.fetch(group_by, EMPTY_HASH)
188
- end
189
-
190
- # @rbs group_by: String
191
- # @rbs language: String
192
- # @rbs return: Hash[String, untyped]
193
- def language_labels(group_by, language)
194
- label_for(group_by).fetch('languages', EMPTY_HASH).fetch(language, EMPTY_HASH)
195
- end
196
-
197
- # @rbs return: String?
198
- def default_wiki_url
199
- "https://github.com/#{organisation}/#{repository}/wiki" if organisation && repository
200
- end
201
-
202
- # @rbs return: String?
203
- def default_owner_base_url
204
- "https://github.com/orgs/#{organisation}/teams/" if organisation
205
- end
206
-
207
- # @rbs base: Hash[String, untyped]
208
- # @rbs override: Hash[String, untyped]
209
- # @rbs return: Hash[String, untyped]
210
- def deep_merge(base, override)
211
- base.merge(override) do |_key, old_value, new_value|
212
- old_value.is_a?(Hash) && new_value.is_a?(Hash) ? deep_merge(old_value, new_value) : new_value
213
- end
214
- end
215
- end
216
- end
217
- end
@@ -1,102 +0,0 @@
1
- # frozen_string_literal: true
2
- # rbs_inline: enabled
3
-
4
- require 'fileutils'
5
- require_relative 'application'
6
-
7
- module Spreen
8
- module Wiki
9
- # Generates the wiki Home page, optionally splitting per-owner content out
10
- # into `wikis-by-owner/<owner>.md` when home_overflow is enabled. Returns
11
- # the configured wiki URL (if any) so callers can point at the result.
12
- class Home < Application
13
- # @rbs return: String?
14
- def run
15
- home_overflow ? write_concise_home_passage : write_home_passage
16
- config.wiki_url
17
- end
18
-
19
- private
20
-
21
- # @rbs return: String
22
- def path_to_wikis_by_owner
23
- @path_to_wikis_by_owner ||= File.join(base_path, 'wikis-by-owner')
24
- end
25
-
26
- # @rbs return: String
27
- def path_to_home_template
28
- path = config.path_to_template(group_by, language)
29
- unless File.exist?(path)
30
- raise ArgumentError, "Missing Home template: `#{path}`. Ship one there or configure template_dir."
31
- end
32
-
33
- path
34
- end
35
-
36
- # @rbs return: Array[String]
37
- def home_passage
38
- @home_passage ||= File.readlines(path_to_home_template).append("\n")
39
- end
40
-
41
- # @rbs return: void
42
- def write_home_passage
43
- FileUtils.rm_rf(path_to_wikis_by_owner)
44
- owned_wiki_maps.each { |namespace, wikis| append_block(home_passage, namespace, wikis, owned: true) }
45
- plain_wiki_maps.each { |namespace, wikis| append_block(home_passage, namespace, wikis, owned: false) }
46
- File.write(path_to_home, home_passage.join.chomp)
47
- end
48
-
49
- # @rbs return: void
50
- def write_concise_home_passage
51
- FileUtils.mkdir_p(path_to_wikis_by_owner)
52
- write_per_namespace_files
53
- write_home_table_of_contents
54
- end
55
-
56
- # @rbs return: void
57
- def write_per_namespace_files
58
- owned_wiki_maps.each { |namespace, wikis| write_overflow_block(namespace, wikis, owned: true) }
59
- plain_wiki_maps.each { |namespace, wikis| write_overflow_block(namespace, wikis, owned: false) }
60
- end
61
-
62
- # @rbs return: void
63
- def write_home_table_of_contents
64
- (owned_wiki_maps.keys + plain_wiki_maps.keys).each { |namespace| home_passage << "- [[#{namespace}]]\n" }
65
- home_passage << "\n"
66
- File.write(path_to_home, home_passage.join.chomp)
67
- end
68
-
69
- # @rbs passage: Array[String]
70
- # @rbs namespace: String
71
- # @rbs wikis: Array[String]
72
- # @rbs owned: bool
73
- # @rbs return: void
74
- def append_block(passage, namespace, wikis, owned:)
75
- passage << "#{heading_for(namespace, owned:)}\n"
76
- passage << "\n"
77
- wikis.each { |wiki| passage << "- [[#{wiki.gsub('.md', '')}]]\n" }
78
- passage << "\n"
79
- end
80
-
81
- # @rbs namespace: String
82
- # @rbs wikis: Array[String]
83
- # @rbs owned: bool
84
- # @rbs return: void
85
- def write_overflow_block(namespace, wikis, owned:)
86
- scratch = [] #: Array[String]
87
- append_block(scratch, namespace, wikis, owned:)
88
- File.write(File.join(path_to_wikis_by_owner, "#{namespace}.md"), scratch.join.chomp)
89
- end
90
-
91
- # @rbs namespace: String
92
- # @rbs owned: bool
93
- # @rbs return: String
94
- def heading_for(namespace, owned:)
95
- owner_base_url = config.owner_base_url
96
- return "## #{namespace}" unless owned && owner_base_url
97
-
98
- "## [#{namespace}](#{owner_base_url + namespace.delete('@')})"
99
- end
100
- end
101
- end
102
- end
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
- # rbs_inline: enabled
3
-
4
- require_relative 'application'
5
-
6
- module Spreen
7
- module Wiki
8
- # Generates the wiki _Sidebar.md as a nested list of owners/categories and
9
- # their wiki pages.
10
- class Sidebar < Application
11
- # @rbs return: void
12
- def run
13
- update_wiki_list
14
- File.write(path_to_sidebar, wiki_list.join)
15
- end
16
-
17
- private
18
-
19
- # @rbs return: Array[String]
20
- def wiki_list
21
- @wiki_list ||= []
22
- end
23
-
24
- # @rbs return: void
25
- def update_wiki_list
26
- owned_wiki_maps.each { |namespace, wikis| append_section(namespace, wikis, owned: true) }
27
- plain_wiki_maps.each { |namespace, wikis| append_section(namespace, wikis, owned: false) }
28
- end
29
-
30
- # @rbs namespace: String
31
- # @rbs wikis: Array[String]
32
- # @rbs owned: bool
33
- # @rbs return: void
34
- def append_section(namespace, wikis, owned:)
35
- wiki_list << "#{section_heading(namespace, owned:)}\n"
36
- wikis.each { |wiki| wiki_list << " - [[#{wiki.gsub('.md', '')}]]\n" }
37
- end
38
-
39
- # @rbs namespace: String
40
- # @rbs owned: bool
41
- # @rbs return: String
42
- def section_heading(namespace, owned:)
43
- owner_base_url = config.owner_base_url
44
- return "- #{namespace}" unless owned && owner_base_url
45
-
46
- "- [#{namespace}](#{owner_base_url + namespace.delete('@')})"
47
- end
48
- end
49
- end
50
- end
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
- # rbs_inline: enabled
3
-
4
- require_relative 'application'
5
-
6
- module Spreen
7
- module Wiki
8
- # Writes a sorted text report of how many wikis exist under each of the
9
- # configured "unknown owner/category" namespaces.
10
- class UnknownWikiCountListExporter < Application
11
- DEFAULT_OUTPUT_FILENAME = 'unknown_wiki_count_list_by_namespace.txt'
12
-
13
- # @rbs base_path: String
14
- # @rbs group_by: String
15
- # @rbs language: String
16
- # @rbs home_overflow: (bool | String)
17
- # @rbs output: String?
18
- # @rbs **options: untyped
19
- # @rbs return: void
20
- def initialize(base_path: Dir.pwd, group_by: 'Owner', language: 'English', home_overflow: 'false',
21
- output: nil, **)
22
- super(base_path:, group_by:, language:, home_overflow:, **)
23
- @path_to_export = resolve_output_path(output || DEFAULT_OUTPUT_FILENAME)
24
- end
25
-
26
- # @rbs return: [Array[String], String]
27
- def run
28
- File.open(path_to_export, 'wb') { |f| f.puts(count_list_by_namespace) }
29
- [count_list_by_namespace, path_to_export]
30
- end
31
-
32
- private
33
-
34
- attr_reader :path_to_export #: String
35
-
36
- # @rbs filename: String
37
- # @rbs return: String
38
- def resolve_output_path(filename)
39
- File.absolute_path?(filename) ? filename : File.join(base_path, filename)
40
- end
41
-
42
- # @rbs return: Array[String]
43
- def namespace_list
44
- config.unknown_namespaces(group_by, language)
45
- end
46
-
47
- # @rbs return: Array[String]
48
- def missing_count_list_by_namespace
49
- (namespace_list - plain_wiki_maps.keys).map { |namespace| "#{namespace}: 0" }
50
- end
51
-
52
- # @rbs return: Array[String]
53
- def count_list_by_namespace
54
- @count_list_by_namespace ||= begin
55
- counts = plain_wiki_maps.slice(*namespace_list).map { |namespace, wikis| "#{namespace}: #{wikis.length}" }
56
- (counts + missing_count_list_by_namespace).sort
57
- end
58
- end
59
- end
60
- end
61
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
- # rbs_inline: enabled
3
-
4
- require_relative 'application'
5
-
6
- module Spreen
7
- module Wiki
8
- # Writes a flat list of the wikis under the configured "unknown
9
- # owner/category" namespace in a form suitable for feeding to an LLM.
10
- class UnknownWikiListExporterForLLM < Application
11
- DEFAULT_OUTPUT_FILENAME = 'unknown_wiki_list_for_llm.txt'
12
-
13
- # @rbs base_path: String
14
- # @rbs group_by: String
15
- # @rbs language: String
16
- # @rbs home_overflow: (bool | String)
17
- # @rbs output: String?
18
- # @rbs **options: untyped
19
- # @rbs return: void
20
- def initialize(base_path: Dir.pwd, group_by: 'Owner', language: 'English', home_overflow: 'false',
21
- output: nil, **)
22
- super(base_path:, group_by:, language:, home_overflow:, **)
23
- @path_to_export = resolve_output_path(output || DEFAULT_OUTPUT_FILENAME)
24
- end
25
-
26
- # @rbs return: String
27
- def run
28
- File.open(path_to_export, 'wb') { |f| f.puts(unknown_wiki_list_for_llm) }
29
- path_to_export
30
- end
31
-
32
- private
33
-
34
- attr_reader :path_to_export #: String
35
-
36
- # @rbs filename: String
37
- # @rbs return: String
38
- def resolve_output_path(filename)
39
- File.absolute_path?(filename) ? filename : File.join(base_path, filename)
40
- end
41
-
42
- # @rbs return: String
43
- def target_namespace
44
- config.llm_target_namespace(group_by, language)
45
- end
46
-
47
- # @rbs return: Array[String]
48
- def unknown_wiki_list_for_llm
49
- @unknown_wiki_list_for_llm ||= plain_wiki_maps.slice(target_namespace).values.flatten
50
- end
51
- end
52
- end
53
- end
data/lib/spreen/wiki.rb DELETED
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
- # rbs_inline: enabled
3
-
4
- require_relative 'wiki/version'
5
- require_relative 'wiki/configuration'
6
- require_relative 'wiki/application'
7
- require_relative 'wiki/home'
8
- require_relative 'wiki/sidebar'
9
- require_relative 'wiki/unknown_wiki_count_list_exporter'
10
- require_relative 'wiki/unknown_wiki_list_exporter_for_llm'
11
- require_relative 'wiki/cli'
12
-
13
- module Spreen
14
- # Spreens a GitHub wiki — the falcon's stoop, then the preen: generates
15
- # Home.md and _Sidebar.md grouped by the Owner/Category declared on the
16
- # first line of each page, and exports reports of the pages whose owner
17
- # or category is unknown.
18
- module Wiki
19
- end
20
- end
@@ -1,93 +0,0 @@
1
- # Generated from lib/spreen/wiki/application.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- # Base class for the wiki-organising commands. Loads the wiki tree under
6
- # base_path, groups it by Owner or Category in either English or Japanese,
7
- # and exposes the resulting maps to its subclasses. Grouping criteria,
8
- # languages and labels are resolved through Configuration and can be
9
- # extended via a `.spreen.yml` file.
10
- class Application
11
- class NotImplementedError < StandardError
12
- end
13
-
14
- # @rbs base_path: String
15
- # @rbs group_by: String
16
- # @rbs language: String
17
- # @rbs home_overflow: (bool | String)
18
- # @rbs **options: untyped
19
- # @rbs return: untyped
20
- def self.run: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, **untyped) -> untyped
21
-
22
- # @rbs base_path: String
23
- # @rbs group_by: String
24
- # @rbs language: String
25
- # @rbs home_overflow: (bool | String)
26
- # @rbs config: Configuration?
27
- # @rbs **options: untyped
28
- # @rbs return: void
29
- def initialize: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, ?config: Configuration?, **untyped) -> void
30
-
31
- # @rbs return: void
32
- def validate!: () -> void
33
-
34
- # @rbs return: untyped
35
- def run: () -> untyped
36
-
37
- private
38
-
39
- attr_reader base_path: untyped
40
-
41
- attr_reader group_by: untyped
42
-
43
- attr_reader language: untyped
44
-
45
- attr_reader home_overflow: untyped
46
-
47
- attr_reader config: untyped
48
-
49
- attr_reader path_to_home: untyped
50
-
51
- attr_reader path_to_sidebar: untyped
52
-
53
- attr_reader paths_to_wikis: untyped
54
-
55
- attr_reader excluded_paths: untyped
56
-
57
- # @rbs return: void
58
- def validate_home_overflow!: () -> void
59
-
60
- # @rbs raw: (bool | String)
61
- # @rbs return: (bool | String)
62
- def parse_home_overflow: (bool | String raw) -> (bool | String)
63
-
64
- # @rbs return: Array[String]
65
- def target_paths: () -> Array[String]
66
-
67
- # @rbs return: Regexp
68
- def target_regexp: () -> Regexp
69
-
70
- # @rbs return: String
71
- def no_declaration: () -> String
72
-
73
- # @rbs return: Hash[String, Array[String]]
74
- def wiki_maps_with_namespace: () -> Hash[String, Array[String]]
75
-
76
- # @rbs target_path: String
77
- # @rbs named: Hash[String, Array[String]]
78
- # @rbs undeclared: Hash[String, Array[String]]
79
- # @rbs return: void
80
- def populate_namespace: (String target_path, Hash[String, Array[String]] named, Hash[String, Array[String]] undeclared) -> void
81
-
82
- # @rbs target_path: String
83
- # @rbs return: String
84
- def namespace_for: (String target_path) -> String
85
-
86
- # @rbs return: Hash[String, Array[String]]
87
- def owned_wiki_maps: () -> Hash[String, Array[String]]
88
-
89
- # @rbs return: Hash[String, Array[String]]
90
- def plain_wiki_maps: () -> Hash[String, Array[String]]
91
- end
92
- end
93
- end
@@ -1,70 +0,0 @@
1
- # Generated from lib/spreen/wiki/cli.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- # Command line interface behind the `spreen` executable:
6
- # `spreen <update|count-report|llm-export> [options]`.
7
- class CLI
8
- HELP: ::String
9
-
10
- # Flags shared by every command, mapped to the keyword arguments of the
11
- # underlying classes. --exclude and the per-command flags are wired up
12
- # separately because they need a type or a fixed value.
13
- COMMON_OPTIONS: untyped
14
-
15
- # @rbs argv: Array[String]
16
- # @rbs return: Integer
17
- def self.start: (?Array[String] argv) -> Integer
18
-
19
- # @rbs argv: Array[String]
20
- # @rbs return: void
21
- def initialize: (Array[String] argv) -> void
22
-
23
- # @rbs return: Integer
24
- def run: () -> Integer
25
-
26
- private
27
-
28
- attr_reader argv: untyped
29
-
30
- attr_reader options: untyped
31
-
32
- # @rbs command: String
33
- # @rbs return: Integer
34
- def execute: (String command) -> Integer
35
-
36
- # @rbs return: Integer
37
- def print_version: () -> Integer
38
-
39
- # @rbs command: String?
40
- # @rbs return: Integer
41
- def print_help: (String? command) -> Integer
42
-
43
- # @rbs command: String
44
- # @rbs return: Integer
45
- def unknown_command: (String command) -> Integer
46
-
47
- # @rbs return: void
48
- def update: () -> void
49
-
50
- # @rbs return: void
51
- def count_report: () -> void
52
-
53
- # @rbs return: void
54
- def llm_export: () -> void
55
-
56
- # @rbs command: String
57
- # @rbs return: OptionParser
58
- def parser: (String command) -> OptionParser
59
-
60
- # @rbs opt: OptionParser
61
- # @rbs return: void
62
- def add_common_options: (OptionParser opt) -> void
63
-
64
- # @rbs opt: OptionParser
65
- # @rbs command: String
66
- # @rbs return: void
67
- def add_command_options: (OptionParser opt, String command) -> void
68
- end
69
- end
70
- end