roast-ai 0.4.3 → 0.4.5

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 (232) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +2 -0
  3. data/.github/workflows/ci.yaml +1 -0
  4. data/.gitignore +0 -26
  5. data/.rubocop.yml +13 -0
  6. data/.rubocop_todo.yml +21 -0
  7. data/CHANGELOG.md +29 -0
  8. data/Gemfile +4 -0
  9. data/Gemfile.lock +47 -29
  10. data/bin/rubocop +27 -0
  11. data/bin/spoom +27 -0
  12. data/bin/srb +27 -0
  13. data/bin/srb-rbi +27 -0
  14. data/bin/tapioca +27 -0
  15. data/docs/INSTRUMENTATION.md +3 -3
  16. data/dsl/simple.rb +10 -0
  17. data/lib/roast/dsl/executor.rb +26 -0
  18. data/lib/roast/dsl.rb +7 -0
  19. data/lib/roast/errors.rb +1 -0
  20. data/lib/roast/factories/api_provider_factory.rb +1 -0
  21. data/lib/roast/helpers/function_caching_interceptor.rb +3 -0
  22. data/lib/roast/helpers/logger.rb +6 -9
  23. data/lib/roast/helpers/metadata_access.rb +1 -0
  24. data/lib/roast/helpers/minitest_coverage_runner.rb +1 -0
  25. data/lib/roast/helpers/path_resolver.rb +8 -18
  26. data/lib/roast/helpers/prompt_loader.rb +3 -2
  27. data/lib/roast/helpers/timeout_handler.rb +3 -5
  28. data/lib/roast/initializers.rb +1 -0
  29. data/lib/roast/resources/api_resource.rb +4 -3
  30. data/lib/roast/resources/base_resource.rb +1 -0
  31. data/lib/roast/resources/directory_resource.rb +1 -0
  32. data/lib/roast/resources/file_resource.rb +1 -0
  33. data/lib/roast/resources/none_resource.rb +1 -0
  34. data/lib/roast/resources/url_resource.rb +2 -1
  35. data/lib/roast/resources.rb +1 -2
  36. data/lib/roast/services/context_threshold_checker.rb +1 -0
  37. data/lib/roast/services/token_counting_service.rb +1 -0
  38. data/lib/roast/tools/apply_diff.rb +1 -0
  39. data/lib/roast/tools/ask_user.rb +1 -0
  40. data/lib/roast/tools/bash.rb +1 -0
  41. data/lib/roast/tools/cmd.rb +1 -0
  42. data/lib/roast/tools/coding_agent.rb +1 -0
  43. data/lib/roast/tools/context_summarizer.rb +1 -0
  44. data/lib/roast/tools/grep.rb +1 -0
  45. data/lib/roast/tools/helpers/coding_agent_message_formatter.rb +1 -0
  46. data/lib/roast/tools/read_file.rb +1 -0
  47. data/lib/roast/tools/search_file.rb +1 -0
  48. data/lib/roast/tools/swarm.rb +1 -0
  49. data/lib/roast/tools/update_files.rb +1 -0
  50. data/lib/roast/tools/write_file.rb +1 -0
  51. data/lib/roast/tools.rb +2 -0
  52. data/lib/roast/value_objects/api_token.rb +1 -0
  53. data/lib/roast/value_objects/step_name.rb +1 -0
  54. data/lib/roast/value_objects/uri_base.rb +1 -0
  55. data/lib/roast/value_objects/workflow_path.rb +1 -0
  56. data/lib/roast/value_objects.rb +1 -0
  57. data/lib/roast/version.rb +2 -1
  58. data/lib/roast/workflow/agent_step.rb +1 -0
  59. data/lib/roast/workflow/api_configuration.rb +1 -0
  60. data/lib/roast/workflow/base_iteration_step.rb +1 -0
  61. data/lib/roast/workflow/base_step.rb +1 -0
  62. data/lib/roast/workflow/base_workflow.rb +1 -0
  63. data/lib/roast/workflow/case_executor.rb +1 -0
  64. data/lib/roast/workflow/case_step.rb +1 -0
  65. data/lib/roast/workflow/command_executor.rb +1 -0
  66. data/lib/roast/workflow/conditional_executor.rb +1 -0
  67. data/lib/roast/workflow/conditional_step.rb +1 -0
  68. data/lib/roast/workflow/configuration.rb +9 -0
  69. data/lib/roast/workflow/configuration_loader.rb +4 -1
  70. data/lib/roast/workflow/context_manager.rb +1 -0
  71. data/lib/roast/workflow/context_path_resolver.rb +1 -0
  72. data/lib/roast/workflow/dot_access_hash.rb +1 -0
  73. data/lib/roast/workflow/each_step.rb +1 -0
  74. data/lib/roast/workflow/error_handler.rb +7 -1
  75. data/lib/roast/workflow/expression_evaluator.rb +1 -0
  76. data/lib/roast/workflow/expression_utils.rb +1 -0
  77. data/lib/roast/workflow/file_state_repository.rb +2 -1
  78. data/lib/roast/workflow/input_executor.rb +1 -0
  79. data/lib/roast/workflow/input_step.rb +1 -0
  80. data/lib/roast/workflow/interpolator.rb +2 -1
  81. data/lib/roast/workflow/iteration_executor.rb +1 -0
  82. data/lib/roast/workflow/llm_boolean_coercer.rb +1 -0
  83. data/lib/roast/workflow/metadata_manager.rb +1 -0
  84. data/lib/roast/workflow/output_handler.rb +1 -0
  85. data/lib/roast/workflow/output_manager.rb +1 -0
  86. data/lib/roast/workflow/parallel_executor.rb +1 -0
  87. data/lib/roast/workflow/prompt_step.rb +1 -0
  88. data/lib/roast/workflow/repeat_step.rb +1 -0
  89. data/lib/roast/workflow/replay_handler.rb +1 -0
  90. data/lib/roast/workflow/resource_resolver.rb +2 -6
  91. data/lib/roast/workflow/session_manager.rb +1 -0
  92. data/lib/roast/workflow/shell_script_step.rb +1 -0
  93. data/lib/roast/workflow/sqlite_state_repository.rb +1 -0
  94. data/lib/roast/workflow/state_manager.rb +1 -0
  95. data/lib/roast/workflow/state_repository.rb +1 -0
  96. data/lib/roast/workflow/state_repository_factory.rb +4 -2
  97. data/lib/roast/workflow/step_completion_reporter.rb +1 -0
  98. data/lib/roast/workflow/step_executor_coordinator.rb +9 -5
  99. data/lib/roast/workflow/step_executor_factory.rb +1 -0
  100. data/lib/roast/workflow/step_executor_registry.rb +2 -3
  101. data/lib/roast/workflow/step_executor_with_reporting.rb +1 -0
  102. data/lib/roast/workflow/step_executors/base_step_executor.rb +1 -0
  103. data/lib/roast/workflow/step_executors/hash_step_executor.rb +1 -0
  104. data/lib/roast/workflow/step_executors/parallel_step_executor.rb +1 -0
  105. data/lib/roast/workflow/step_executors/string_step_executor.rb +1 -0
  106. data/lib/roast/workflow/step_factory.rb +1 -0
  107. data/lib/roast/workflow/step_finder.rb +1 -0
  108. data/lib/roast/workflow/step_loader.rb +1 -0
  109. data/lib/roast/workflow/step_name_extractor.rb +1 -0
  110. data/lib/roast/workflow/step_runner.rb +1 -0
  111. data/lib/roast/workflow/step_type_resolver.rb +1 -0
  112. data/lib/roast/workflow/validation_command.rb +1 -0
  113. data/lib/roast/workflow/validator.rb +1 -0
  114. data/lib/roast/workflow/validators/base_validator.rb +1 -0
  115. data/lib/roast/workflow/validators/dependency_validator.rb +1 -0
  116. data/lib/roast/workflow/validators/linting_validator.rb +1 -0
  117. data/lib/roast/workflow/validators/schema_validator.rb +1 -0
  118. data/lib/roast/workflow/validators/step_collector.rb +1 -0
  119. data/lib/roast/workflow/validators/validation_orchestrator.rb +1 -0
  120. data/lib/roast/workflow/workflow_context.rb +1 -0
  121. data/lib/roast/workflow/workflow_execution_context.rb +1 -0
  122. data/lib/roast/workflow/workflow_executor.rb +2 -1
  123. data/lib/roast/workflow/workflow_initializer.rb +1 -0
  124. data/lib/roast/workflow/workflow_runner.rb +66 -55
  125. data/lib/roast/workflow.rb +1 -0
  126. data/lib/roast/workflow_diagram_generator.rb +3 -2
  127. data/lib/roast.rb +23 -8
  128. data/roast.gemspec +1 -1
  129. data/sorbet/config +8 -0
  130. data/sorbet/rbi/dsl/.gitattributes +1 -0
  131. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  132. data/sorbet/rbi/gems/.gitattributes +1 -0
  133. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +19107 -0
  134. data/sorbet/rbi/gems/addressable@2.8.7.rbi +1994 -0
  135. data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
  136. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  137. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  138. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +62 -0
  139. data/sorbet/rbi/gems/cgi@0.5.0.rbi +2961 -0
  140. data/sorbet/rbi/gems/claude_swarm@0.1.19.rbi +568 -0
  141. data/sorbet/rbi/gems/cli-kit@5.0.1.rbi +1991 -0
  142. data/sorbet/rbi/gems/cli-ui@2.3.0.rbi +3181 -0
  143. data/sorbet/rbi/gems/coderay@1.1.3.rbi +9 -0
  144. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11657 -0
  145. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
  146. data/sorbet/rbi/gems/crack@1.0.0.rbi +145 -0
  147. data/sorbet/rbi/gems/diff-lcs@1.6.2.rbi +972 -0
  148. data/sorbet/rbi/gems/dotenv@3.1.8.rbi +295 -0
  149. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  150. data/sorbet/rbi/gems/dry-configurable@1.3.0.rbi +672 -0
  151. data/sorbet/rbi/gems/dry-core@1.1.0.rbi +1894 -0
  152. data/sorbet/rbi/gems/dry-inflector@1.2.0.rbi +659 -0
  153. data/sorbet/rbi/gems/dry-initializer@3.2.0.rbi +781 -0
  154. data/sorbet/rbi/gems/dry-logic@1.6.0.rbi +1127 -0
  155. data/sorbet/rbi/gems/dry-schema@1.14.1.rbi +3727 -0
  156. data/sorbet/rbi/gems/dry-types@1.8.3.rbi +3969 -0
  157. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  158. data/sorbet/rbi/gems/event_stream_parser@1.0.0.rbi +49 -0
  159. data/sorbet/rbi/gems/faraday-multipart@1.1.1.rbi +283 -0
  160. data/sorbet/rbi/gems/faraday-net_http@3.4.1.rbi +147 -0
  161. data/sorbet/rbi/gems/faraday-retry@2.3.2.rbi +9 -0
  162. data/sorbet/rbi/gems/faraday@2.13.1.rbi +2977 -0
  163. data/sorbet/rbi/gems/fast-mcp-annotations@1.5.3.rbi +1588 -0
  164. data/sorbet/rbi/gems/ffi@1.17.2.rbi +9 -0
  165. data/sorbet/rbi/gems/formatador@1.1.0.rbi +9 -0
  166. data/sorbet/rbi/gems/guard-compat@1.2.1.rbi +102 -0
  167. data/sorbet/rbi/gems/guard-minitest@2.4.6.rbi +402 -0
  168. data/sorbet/rbi/gems/guard@2.19.1.rbi +2283 -0
  169. data/sorbet/rbi/gems/hashdiff@1.2.0.rbi +355 -0
  170. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2359 -0
  171. data/sorbet/rbi/gems/json-schema@5.1.1.rbi +1466 -0
  172. data/sorbet/rbi/gems/json@2.12.2.rbi +2051 -0
  173. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  174. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +9 -0
  175. data/sorbet/rbi/gems/listen@3.9.0.rbi +1206 -0
  176. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  177. data/sorbet/rbi/gems/lumberjack@1.2.10.rbi +1830 -0
  178. data/sorbet/rbi/gems/method_source@1.1.0.rbi +9 -0
  179. data/sorbet/rbi/gems/mime-types-data@3.2025.0617.rbi +136 -0
  180. data/sorbet/rbi/gems/mime-types@3.7.0.rbi +1342 -0
  181. data/sorbet/rbi/gems/minitest-rg@5.3.0.rbi +160 -0
  182. data/sorbet/rbi/gems/minitest@5.25.5.rbi +1640 -0
  183. data/sorbet/rbi/gems/mocha@2.7.1.rbi +12 -0
  184. data/sorbet/rbi/gems/multipart-post@2.4.1.rbi +244 -0
  185. data/sorbet/rbi/gems/nenv@0.3.0.rbi +147 -0
  186. data/sorbet/rbi/gems/net-http@0.6.0.rbi +4247 -0
  187. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  188. data/sorbet/rbi/gems/notiffany@0.1.3.rbi +1079 -0
  189. data/sorbet/rbi/gems/open_router@0.3.3.rbi +230 -0
  190. data/sorbet/rbi/gems/ostruct@0.6.2.rbi +354 -0
  191. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  192. data/sorbet/rbi/gems/parser@3.3.8.0.rbi +5535 -0
  193. data/sorbet/rbi/gems/prism@1.4.0.rbi +41732 -0
  194. data/sorbet/rbi/gems/pry@0.15.2.rbi +9 -0
  195. data/sorbet/rbi/gems/public_suffix@6.0.2.rbi +936 -0
  196. data/sorbet/rbi/gems/racc@1.8.1.rbi +158 -0
  197. data/sorbet/rbi/gems/rack@2.2.17.rbi +5659 -0
  198. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +9 -0
  199. data/sorbet/rbi/gems/raix@1.0.2.rbi +1104 -0
  200. data/sorbet/rbi/gems/rake@13.3.0.rbi +3036 -0
  201. data/sorbet/rbi/gems/rb-fsevent@0.11.2.rbi +9 -0
  202. data/sorbet/rbi/gems/rb-inotify@0.11.1.rbi +9 -0
  203. data/sorbet/rbi/gems/rbi@0.3.6.rbi +6893 -0
  204. data/sorbet/rbi/gems/rbs@3.9.4.rbi +6978 -0
  205. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +9 -0
  206. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5346 -0
  207. data/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi +9 -0
  208. data/sorbet/rbi/gems/rubocop-shopify@2.17.1.rbi +9 -0
  209. data/sorbet/rbi/gems/rubocop@1.77.0.rbi +9 -0
  210. data/sorbet/rbi/gems/ruby-graphviz@1.2.5.rbi +1333 -0
  211. data/sorbet/rbi/gems/ruby-openai@8.1.0.rbi +758 -0
  212. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +9 -0
  213. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
  214. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  215. data/sorbet/rbi/gems/shellany@0.0.1.rbi +102 -0
  216. data/sorbet/rbi/gems/spoom@1.6.3.rbi +6985 -0
  217. data/sorbet/rbi/gems/sqlite3@2.7.0.rbi +1900 -0
  218. data/sorbet/rbi/gems/tapioca@0.16.11.rbi +3628 -0
  219. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  220. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  221. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +9 -0
  222. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +9 -0
  223. data/sorbet/rbi/gems/uri@1.0.3.rbi +2349 -0
  224. data/sorbet/rbi/gems/vcr@6.3.1.rbi +3040 -0
  225. data/sorbet/rbi/gems/webmock@3.25.1.rbi +1792 -0
  226. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  227. data/sorbet/rbi/gems/yard@0.9.37.rbi +18492 -0
  228. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1429 -0
  229. data/sorbet/tapioca/config.yml +13 -0
  230. data/sorbet/tapioca/require.rb +36 -0
  231. metadata +116 -5
  232. data/lib/roast/workflow/configuration_parser.rb +0 -54
@@ -0,0 +1,4399 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `thor` gem.
5
+ # Please instead update this file by running `bin/tapioca gem thor`.
6
+
7
+
8
+ # source://thor//lib/thor/shell/lcs_diff.rb#1
9
+ module LCSDiff
10
+ protected
11
+
12
+ # Overwrite show_diff to show diff with colors if Diff::LCS is
13
+ # available.
14
+ #
15
+ # source://thor//lib/thor/shell/lcs_diff.rb#6
16
+ def show_diff(destination, content); end
17
+
18
+ private
19
+
20
+ # Check if Diff::LCS is loaded. If it is, use it to create pretty output
21
+ # for diff.
22
+ #
23
+ # @return [Boolean]
24
+ #
25
+ # source://thor//lib/thor/shell/lcs_diff.rb#37
26
+ def diff_lcs_loaded?; end
27
+
28
+ # source://thor//lib/thor/shell/lcs_diff.rb#21
29
+ def output_diff_line(diff); end
30
+ end
31
+
32
+ # source://thor//lib/thor/command.rb#1
33
+ class Thor
34
+ include ::Thor::Base
35
+ include ::Thor::Invocation
36
+ include ::Thor::Shell
37
+ extend ::Thor::Base::ClassMethods
38
+ extend ::Thor::Invocation::ClassMethods
39
+
40
+ # source://thor//lib/thor.rb#663
41
+ def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
42
+
43
+ class << self
44
+ # Adds and declares option group for required at least one of options in the
45
+ # block of arguments. You can declare options as the outside of the block.
46
+ #
47
+ # If :for is given as option, it allows you to change the options from
48
+ # a previous defined command.
49
+ #
50
+ # ==== Parameters
51
+ # Array[Thor::Option.name]
52
+ # options<Hash>:: :for is applied for previous defined command.
53
+ #
54
+ # ==== Examples
55
+ #
56
+ # at_least_one do
57
+ # option :one
58
+ # option :two
59
+ # end
60
+ #
61
+ # Or
62
+ #
63
+ # option :one
64
+ # option :two
65
+ # at_least_one :one, :two
66
+ #
67
+ # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError
68
+ # will be raised.
69
+ #
70
+ # You can use at_least_one and exclusive at the same time.
71
+ #
72
+ # exclusive do
73
+ # at_least_one do
74
+ # option :one
75
+ # option :two
76
+ # end
77
+ # end
78
+ #
79
+ # Then it is required either only one of "--one" or "--two".
80
+ #
81
+ # source://thor//lib/thor.rb#246
82
+ def at_least_one(*args, &block); end
83
+
84
+ # Extend check unknown options to accept a hash of conditions.
85
+ #
86
+ # === Parameters
87
+ # options<Hash>: A hash containing :only and/or :except keys
88
+ #
89
+ # source://thor//lib/thor.rb#350
90
+ def check_unknown_options!(options = T.unsafe(nil)); end
91
+
92
+ # Overwrite check_unknown_options? to take subcommands and options into account.
93
+ #
94
+ # @return [Boolean]
95
+ #
96
+ # source://thor//lib/thor.rb#363
97
+ def check_unknown_options?(config); end
98
+
99
+ # Checks if a specified command exists.
100
+ #
101
+ # ==== Parameters
102
+ # command_name<String>:: The name of the command to check for existence.
103
+ #
104
+ # ==== Returns
105
+ # Boolean:: +true+ if the command exists, +false+ otherwise.
106
+ #
107
+ # @return [Boolean]
108
+ #
109
+ # source://thor//lib/thor.rb#449
110
+ def command_exists?(command_name); end
111
+
112
+ # Prints help information for the given command.
113
+ #
114
+ # ==== Parameters
115
+ # shell<Thor::Shell>
116
+ # command_name<String>
117
+ #
118
+ # source://thor//lib/thor.rb#258
119
+ def command_help(shell, command_name); end
120
+
121
+ # Sets the default command when thor is executed without an explicit command to be called.
122
+ #
123
+ # ==== Parameters
124
+ # meth<Symbol>:: name of the default command
125
+ #
126
+ # source://thor//lib/thor.rb#21
127
+ def default_command(meth = T.unsafe(nil)); end
128
+
129
+ # Sets the default command when thor is executed without an explicit command to be called.
130
+ #
131
+ # ==== Parameters
132
+ # meth<Symbol>:: name of the default command
133
+ #
134
+ # source://thor//lib/thor.rb#21
135
+ def default_task(meth = T.unsafe(nil)); end
136
+
137
+ # source://thor//lib/thor/base.rb#26
138
+ def deprecation_warning(message); end
139
+
140
+ # Defines the usage and the description of the next command.
141
+ #
142
+ # ==== Parameters
143
+ # usage<String>
144
+ # description<String>
145
+ # options<String>
146
+ #
147
+ # source://thor//lib/thor.rb#54
148
+ def desc(usage, description, options = T.unsafe(nil)); end
149
+
150
+ # Disable the check for required options for the given commands.
151
+ # This is useful if you have a command that does not need the required options
152
+ # to work, like help.
153
+ #
154
+ # ==== Parameters
155
+ # Symbol ...:: A list of commands that should be affected.
156
+ #
157
+ # source://thor//lib/thor.rb#434
158
+ def disable_required_check!(*command_names); end
159
+
160
+ # @return [Boolean]
161
+ #
162
+ # source://thor//lib/thor.rb#438
163
+ def disable_required_check?(command); end
164
+
165
+ # Adds and declares option group for exclusive options in the
166
+ # block and arguments. You can declare options as the outside of the block.
167
+ #
168
+ # If :for is given as option, it allows you to change the options from
169
+ # a previous defined command.
170
+ #
171
+ # ==== Parameters
172
+ # Array[Thor::Option.name]
173
+ # options<Hash>:: :for is applied for previous defined command.
174
+ #
175
+ # ==== Examples
176
+ #
177
+ # exclusive do
178
+ # option :one
179
+ # option :two
180
+ # end
181
+ #
182
+ # Or
183
+ #
184
+ # option :one
185
+ # option :two
186
+ # exclusive :one, :two
187
+ #
188
+ # If you give "--one" and "--two" at the same time ExclusiveArgumentsError
189
+ # will be raised.
190
+ #
191
+ # source://thor//lib/thor.rb#203
192
+ def exclusive(*args, &block); end
193
+
194
+ # Prints help information for this class.
195
+ #
196
+ # ==== Parameters
197
+ # shell<Thor::Shell>
198
+ #
199
+ # source://thor//lib/thor.rb#288
200
+ def help(shell, subcommand = T.unsafe(nil)); end
201
+
202
+ # Defines the long description of the next command.
203
+ #
204
+ # Long description is by default indented, line-wrapped and repeated whitespace merged.
205
+ # In order to print long description verbatim, with indentation and spacing exactly
206
+ # as found in the code, use the +wrap+ option
207
+ #
208
+ # long_desc 'your very long description', wrap: false
209
+ #
210
+ # ==== Parameters
211
+ # long description<String>
212
+ # options<Hash>
213
+ #
214
+ # source://thor//lib/thor.rb#78
215
+ def long_desc(long_description, options = T.unsafe(nil)); end
216
+
217
+ # Maps an input to a command. If you define:
218
+ #
219
+ # map "-T" => "list"
220
+ #
221
+ # Running:
222
+ #
223
+ # thor -T
224
+ #
225
+ # Will invoke the list command.
226
+ #
227
+ # ==== Parameters
228
+ # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command.
229
+ #
230
+ # source://thor//lib/thor.rb#101
231
+ def map(mappings = T.unsafe(nil), **kw); end
232
+
233
+ # Adds and declares option group for required at least one of options in the
234
+ # block of arguments. You can declare options as the outside of the block.
235
+ #
236
+ # If :for is given as option, it allows you to change the options from
237
+ # a previous defined command.
238
+ #
239
+ # ==== Parameters
240
+ # Array[Thor::Option.name]
241
+ # options<Hash>:: :for is applied for previous defined command.
242
+ #
243
+ # ==== Examples
244
+ #
245
+ # at_least_one do
246
+ # option :one
247
+ # option :two
248
+ # end
249
+ #
250
+ # Or
251
+ #
252
+ # option :one
253
+ # option :two
254
+ # at_least_one :one, :two
255
+ #
256
+ # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError
257
+ # will be raised.
258
+ #
259
+ # You can use at_least_one and exclusive at the same time.
260
+ #
261
+ # exclusive do
262
+ # at_least_one do
263
+ # option :one
264
+ # option :two
265
+ # end
266
+ # end
267
+ #
268
+ # Then it is required either only one of "--one" or "--two".
269
+ #
270
+ # source://thor//lib/thor.rb#246
271
+ def method_at_least_one(*args, &block); end
272
+
273
+ # Adds and declares option group for exclusive options in the
274
+ # block and arguments. You can declare options as the outside of the block.
275
+ #
276
+ # If :for is given as option, it allows you to change the options from
277
+ # a previous defined command.
278
+ #
279
+ # ==== Parameters
280
+ # Array[Thor::Option.name]
281
+ # options<Hash>:: :for is applied for previous defined command.
282
+ #
283
+ # ==== Examples
284
+ #
285
+ # exclusive do
286
+ # option :one
287
+ # option :two
288
+ # end
289
+ #
290
+ # Or
291
+ #
292
+ # option :one
293
+ # option :two
294
+ # exclusive :one, :two
295
+ #
296
+ # If you give "--one" and "--two" at the same time ExclusiveArgumentsError
297
+ # will be raised.
298
+ #
299
+ # source://thor//lib/thor.rb#203
300
+ def method_exclusive(*args, &block); end
301
+
302
+ # Adds an option to the set of method options. If :for is given as option,
303
+ # it allows you to change the options from a previous defined command.
304
+ #
305
+ # def previous_command
306
+ # # magic
307
+ # end
308
+ #
309
+ # method_option :foo, :for => :previous_command
310
+ #
311
+ # def next_command
312
+ # # magic
313
+ # end
314
+ #
315
+ # ==== Parameters
316
+ # name<Symbol>:: The name of the argument.
317
+ # options<Hash>:: Described below.
318
+ #
319
+ # ==== Options
320
+ # :desc - Description for the argument.
321
+ # :required - If the argument is required or not.
322
+ # :default - Default value for this argument. It cannot be required and have default values.
323
+ # :aliases - Aliases for this option.
324
+ # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
325
+ # :banner - String to show on usage notes.
326
+ # :hide - If you want to hide this option from the help.
327
+ #
328
+ # source://thor//lib/thor.rb#163
329
+ def method_option(name, options = T.unsafe(nil)); end
330
+
331
+ # Declares the options for the next command to be declared.
332
+ #
333
+ # ==== Parameters
334
+ # Hash[Symbol => Object]:: The hash key is the name of the option and the value
335
+ # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric
336
+ # or :required (string). If you give a value, the type of the value is used.
337
+ #
338
+ # source://thor//lib/thor.rb#129
339
+ def method_options(options = T.unsafe(nil)); end
340
+
341
+ # Adds an option to the set of method options. If :for is given as option,
342
+ # it allows you to change the options from a previous defined command.
343
+ #
344
+ # def previous_command
345
+ # # magic
346
+ # end
347
+ #
348
+ # method_option :foo, :for => :previous_command
349
+ #
350
+ # def next_command
351
+ # # magic
352
+ # end
353
+ #
354
+ # ==== Parameters
355
+ # name<Symbol>:: The name of the argument.
356
+ # options<Hash>:: Described below.
357
+ #
358
+ # ==== Options
359
+ # :desc - Description for the argument.
360
+ # :required - If the argument is required or not.
361
+ # :default - Default value for this argument. It cannot be required and have default values.
362
+ # :aliases - Aliases for this option.
363
+ # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
364
+ # :banner - String to show on usage notes.
365
+ # :hide - If you want to hide this option from the help.
366
+ #
367
+ # source://thor//lib/thor.rb#163
368
+ def option(name, options = T.unsafe(nil)); end
369
+
370
+ # Declares the options for the next command to be declared.
371
+ #
372
+ # ==== Parameters
373
+ # Hash[Symbol => Object]:: The hash key is the name of the option and the value
374
+ # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric
375
+ # or :required (string). If you give a value, the type of the value is used.
376
+ #
377
+ # source://thor//lib/thor.rb#129
378
+ def options(options = T.unsafe(nil)); end
379
+
380
+ # Allows for custom "Command" package naming.
381
+ #
382
+ # === Parameters
383
+ # name<String>
384
+ # options<Hash>
385
+ #
386
+ # source://thor//lib/thor.rb#12
387
+ def package_name(name, _ = T.unsafe(nil)); end
388
+
389
+ # Returns commands ready to be printed.
390
+ #
391
+ # source://thor//lib/thor.rb#309
392
+ def printable_commands(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end
393
+
394
+ # Returns commands ready to be printed.
395
+ #
396
+ # source://thor//lib/thor.rb#309
397
+ def printable_tasks(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end
398
+
399
+ # Registers another Thor subclass as a command.
400
+ #
401
+ # ==== Parameters
402
+ # klass<Class>:: Thor subclass to register
403
+ # command<String>:: Subcommand name to use
404
+ # usage<String>:: Short usage for the subcommand
405
+ # description<String>:: Description for the subcommand
406
+ #
407
+ # source://thor//lib/thor.rb#37
408
+ def register(klass, subcommand_name, usage, description, options = T.unsafe(nil)); end
409
+
410
+ # Stop parsing of options as soon as an unknown option or a regular
411
+ # argument is encountered. All remaining arguments are passed to the command.
412
+ # This is useful if you have a command that can receive arbitrary additional
413
+ # options, and where those additional options should not be handled by
414
+ # Thor.
415
+ #
416
+ # ==== Example
417
+ #
418
+ # To better understand how this is useful, let's consider a command that calls
419
+ # an external command. A user may want to pass arbitrary options and
420
+ # arguments to that command. The command itself also accepts some options,
421
+ # which should be handled by Thor.
422
+ #
423
+ # class_option "verbose", :type => :boolean
424
+ # stop_on_unknown_option! :exec
425
+ # check_unknown_options! :except => :exec
426
+ #
427
+ # desc "exec", "Run a shell command"
428
+ # def exec(*args)
429
+ # puts "diagnostic output" if options[:verbose]
430
+ # Kernel.exec(*args)
431
+ # end
432
+ #
433
+ # Here +exec+ can be called with +--verbose+ to get diagnostic output,
434
+ # e.g.:
435
+ #
436
+ # $ thor exec --verbose echo foo
437
+ # diagnostic output
438
+ # foo
439
+ #
440
+ # But if +--verbose+ is given after +echo+, it is passed to +echo+ instead:
441
+ #
442
+ # $ thor exec echo --verbose foo
443
+ # --verbose foo
444
+ #
445
+ # ==== Parameters
446
+ # Symbol ...:: A list of commands that should be affected.
447
+ #
448
+ # source://thor//lib/thor.rb#420
449
+ def stop_on_unknown_option!(*command_names); end
450
+
451
+ # @return [Boolean]
452
+ #
453
+ # source://thor//lib/thor.rb#424
454
+ def stop_on_unknown_option?(command); end
455
+
456
+ # source://thor//lib/thor.rb#329
457
+ def subcommand(subcommand, subcommand_class); end
458
+
459
+ # source://thor//lib/thor.rb#325
460
+ def subcommand_classes; end
461
+
462
+ # source://thor//lib/thor.rb#320
463
+ def subcommands; end
464
+
465
+ # source://thor//lib/thor.rb#329
466
+ def subtask(subcommand, subcommand_class); end
467
+
468
+ # source://thor//lib/thor.rb#320
469
+ def subtasks; end
470
+
471
+ # Prints help information for the given command.
472
+ #
473
+ # ==== Parameters
474
+ # shell<Thor::Shell>
475
+ # command_name<String>
476
+ #
477
+ # source://thor//lib/thor.rb#258
478
+ def task_help(shell, command_name); end
479
+
480
+ protected
481
+
482
+ # The banner for this class. You can customize it if you are invoking the
483
+ # thor class by another ways which is not the Thor::Runner. It receives
484
+ # the command that is going to be invoked and a boolean which indicates if
485
+ # the namespace should be displayed as arguments.
486
+ #
487
+ # source://thor//lib/thor.rb#546
488
+ def banner(command, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end
489
+
490
+ # source://thor//lib/thor.rb#552
491
+ def baseclass; end
492
+
493
+ # source://thor//lib/thor.rb#560
494
+ def create_command(meth); end
495
+
496
+ # source://thor//lib/thor.rb#560
497
+ def create_task(meth); end
498
+
499
+ # help command has the required check disabled by default.
500
+ #
501
+ # source://thor//lib/thor.rb#478
502
+ def disable_required_check; end
503
+
504
+ # The method responsible for dispatching given the args.
505
+ #
506
+ # @yield [instance]
507
+ #
508
+ # source://thor//lib/thor.rb#505
509
+ def dispatch(meth, given_args, given_opts, config); end
510
+
511
+ # source://thor//lib/thor.rb#556
512
+ def dynamic_command_class; end
513
+
514
+ # this is the logic that takes the command name passed in by the user
515
+ # and determines whether it is an unambiguous substrings of a command or
516
+ # alias name.
517
+ #
518
+ # source://thor//lib/thor.rb#626
519
+ def find_command_possibilities(meth); end
520
+
521
+ # this is the logic that takes the command name passed in by the user
522
+ # and determines whether it is an unambiguous substrings of a command or
523
+ # alias name.
524
+ #
525
+ # source://thor//lib/thor.rb#626
526
+ def find_task_possibilities(meth); end
527
+
528
+ # source://thor//lib/thor.rb#586
529
+ def initialize_added; end
530
+
531
+ # Returns this class at least one of required options array set.
532
+ #
533
+ # ==== Returns
534
+ # Array[Array[Thor::Option.name]]
535
+ #
536
+ # source://thor//lib/thor.rb#469
537
+ def method_at_least_one_option_names; end
538
+
539
+ # Returns this class exclusive options array set.
540
+ #
541
+ # ==== Returns
542
+ # Array[Array[Thor::Option.name]]
543
+ #
544
+ # source://thor//lib/thor.rb#460
545
+ def method_exclusive_option_names; end
546
+
547
+ # receives a (possibly nil) command name and returns a name that is in
548
+ # the commands hash. In addition to normalizing aliases, this logic
549
+ # will determine if a shortened command is an unambiguous substring of
550
+ # a command or alias.
551
+ #
552
+ # +normalize_command_name+ also converts names like +animal-prison+
553
+ # into +animal_prison+.
554
+ #
555
+ # @raise [AmbiguousTaskError]
556
+ #
557
+ # source://thor//lib/thor.rb#605
558
+ def normalize_command_name(meth); end
559
+
560
+ # receives a (possibly nil) command name and returns a name that is in
561
+ # the commands hash. In addition to normalizing aliases, this logic
562
+ # will determine if a shortened command is an unambiguous substring of
563
+ # a command or alias.
564
+ #
565
+ # +normalize_command_name+ also converts names like +animal-prison+
566
+ # into +animal_prison+.
567
+ #
568
+ # @raise [AmbiguousTaskError]
569
+ #
570
+ # source://thor//lib/thor.rb#605
571
+ def normalize_task_name(meth); end
572
+
573
+ # source://thor//lib/thor.rb#493
574
+ def print_at_least_one_required_options(shell, command = T.unsafe(nil)); end
575
+
576
+ # source://thor//lib/thor.rb#482
577
+ def print_exclusive_options(shell, command = T.unsafe(nil)); end
578
+
579
+ # Retrieve the command name from given args.
580
+ #
581
+ # source://thor//lib/thor.rb#592
582
+ def retrieve_command_name(args); end
583
+
584
+ # Retrieve the command name from given args.
585
+ #
586
+ # source://thor//lib/thor.rb#592
587
+ def retrieve_task_name(args); end
588
+
589
+ # Sort the commands, lexicographically by default.
590
+ #
591
+ # Can be overridden in the subclass to change the display order of the
592
+ # commands.
593
+ #
594
+ # source://thor//lib/thor.rb#653
595
+ def sort_commands!(list); end
596
+
597
+ # source://thor//lib/thor.rb#473
598
+ def stop_on_unknown_option; end
599
+
600
+ # source://thor//lib/thor.rb#641
601
+ def subcommand_help(cmd); end
602
+
603
+ # source://thor//lib/thor.rb#641
604
+ def subtask_help(cmd); end
605
+ end
606
+ end
607
+
608
+ # source://thor//lib/thor/actions/empty_directory.rb#2
609
+ module Thor::Actions
610
+ mixes_in_class_methods ::Thor::Actions::ClassMethods
611
+
612
+ # Extends initializer to add more configuration options.
613
+ #
614
+ # ==== Configuration
615
+ # behavior<Symbol>:: The actions default behavior. Can be :invoke or :revoke.
616
+ # It also accepts :force, :skip and :pretend to set the behavior
617
+ # and the respective option.
618
+ #
619
+ # destination_root<String>:: The root directory needed for some actions.
620
+ #
621
+ # source://thor//lib/thor/actions.rb#72
622
+ def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end
623
+
624
+ # Wraps an action object and call it accordingly to the thor class behavior.
625
+ #
626
+ # source://thor//lib/thor/actions.rb#89
627
+ def action(instance); end
628
+
629
+ # Create a new file relative to the destination root with the given data,
630
+ # which is the return value of a block or a data string.
631
+ #
632
+ # ==== Parameters
633
+ # destination<String>:: the relative path to the destination root.
634
+ # data<String|NilClass>:: the data to append to the file.
635
+ # config<Hash>:: give :verbose => false to not log the status.
636
+ #
637
+ # ==== Examples
638
+ #
639
+ # create_file "lib/fun_party.rb" do
640
+ # hostname = ask("What is the virtual hostname I should use?")
641
+ # "vhost.name = #{hostname}"
642
+ # end
643
+ #
644
+ # create_file "config/apache.conf", "your apache config"
645
+ #
646
+ # source://thor//lib/thor/actions/create_file.rb#22
647
+ def add_file(destination, *args, &block); end
648
+
649
+ # Create a new file relative to the destination root from the given source.
650
+ #
651
+ # ==== Parameters
652
+ # destination<String>:: the relative path to the destination root.
653
+ # source<String|NilClass>:: the relative path to the source root.
654
+ # config<Hash>:: give :verbose => false to not log the status.
655
+ # :: give :symbolic => false for hard link.
656
+ #
657
+ # ==== Examples
658
+ #
659
+ # create_link "config/apache.conf", "/etc/apache.conf"
660
+ #
661
+ # source://thor//lib/thor/actions/create_link.rb#17
662
+ def add_link(destination, *args); end
663
+
664
+ # Append text to a file. Since it depends on insert_into_file, it's reversible.
665
+ #
666
+ # ==== Parameters
667
+ # path<String>:: path of the file to be changed
668
+ # data<String>:: the data to append to the file, can be also given as a block.
669
+ # config<Hash>:: give :verbose => false to not log the status.
670
+ #
671
+ # ==== Example
672
+ #
673
+ # append_to_file 'config/environments/test.rb', 'config.gem "rspec"'
674
+ #
675
+ # append_to_file 'config/environments/test.rb' do
676
+ # 'config.gem "rspec"'
677
+ # end
678
+ #
679
+ # source://thor//lib/thor/actions/file_manipulation.rb#192
680
+ def append_file(path, *args, &block); end
681
+
682
+ # Append text to a file. Since it depends on insert_into_file, it's reversible.
683
+ #
684
+ # ==== Parameters
685
+ # path<String>:: path of the file to be changed
686
+ # data<String>:: the data to append to the file, can be also given as a block.
687
+ # config<Hash>:: give :verbose => false to not log the status.
688
+ #
689
+ # ==== Example
690
+ #
691
+ # append_to_file 'config/environments/test.rb', 'config.gem "rspec"'
692
+ #
693
+ # append_to_file 'config/environments/test.rb' do
694
+ # 'config.gem "rspec"'
695
+ # end
696
+ #
697
+ # source://thor//lib/thor/actions/file_manipulation.rb#192
698
+ def append_to_file(path, *args, &block); end
699
+
700
+ # Loads an external file and execute it in the instance binding.
701
+ #
702
+ # ==== Parameters
703
+ # path<String>:: The path to the file to execute. Can be a web address or
704
+ # a relative path from the source root.
705
+ #
706
+ # ==== Examples
707
+ #
708
+ # apply "http://gist.github.com/103208"
709
+ #
710
+ # apply "recipes/jquery.rb"
711
+ #
712
+ # source://thor//lib/thor/actions.rb#216
713
+ def apply(path, config = T.unsafe(nil)); end
714
+
715
+ # Returns the value of attribute behavior.
716
+ #
717
+ # source://thor//lib/thor/actions.rb#10
718
+ def behavior; end
719
+
720
+ # Sets the attribute behavior
721
+ #
722
+ # @param value the value to set the attribute behavior to.
723
+ #
724
+ # source://thor//lib/thor/actions.rb#10
725
+ def behavior=(_arg0); end
726
+
727
+ # Changes the mode of the given file or directory.
728
+ #
729
+ # ==== Parameters
730
+ # mode<Integer>:: the file mode
731
+ # path<String>:: the name of the file to change mode
732
+ # config<Hash>:: give :verbose => false to not log the status.
733
+ #
734
+ # ==== Example
735
+ #
736
+ # chmod "script/server", 0755
737
+ #
738
+ # source://thor//lib/thor/actions/file_manipulation.rb#145
739
+ def chmod(path, mode, config = T.unsafe(nil)); end
740
+
741
+ # Comment all lines matching a given regex. It will leave the space
742
+ # which existed before the beginning of the line in tact and will insert
743
+ # a single space after the comment hash.
744
+ #
745
+ # ==== Parameters
746
+ # path<String>:: path of the file to be changed
747
+ # flag<Regexp|String>:: the regexp or string used to decide which lines to comment
748
+ # config<Hash>:: give :verbose => false to not log the status.
749
+ #
750
+ # ==== Example
751
+ #
752
+ # comment_lines 'config/initializers/session_store.rb', /cookie_store/
753
+ #
754
+ # source://thor//lib/thor/actions/file_manipulation.rb#333
755
+ def comment_lines(path, flag, *args); end
756
+
757
+ # Copies the file from the relative source to the relative destination. If
758
+ # the destination is not given it's assumed to be equal to the source.
759
+ #
760
+ # ==== Parameters
761
+ # source<String>:: the relative path to the source root.
762
+ # destination<String>:: the relative path to the destination root.
763
+ # config<Hash>:: give :verbose => false to not log the status, and
764
+ # :mode => :preserve, to preserve the file mode from the source.
765
+ #
766
+ # ==== Examples
767
+ #
768
+ # copy_file "README", "doc/README"
769
+ #
770
+ # copy_file "doc/README"
771
+ #
772
+ # source://thor//lib/thor/actions/file_manipulation.rb#20
773
+ def copy_file(source, *args, &block); end
774
+
775
+ # Create a new file relative to the destination root with the given data,
776
+ # which is the return value of a block or a data string.
777
+ #
778
+ # ==== Parameters
779
+ # destination<String>:: the relative path to the destination root.
780
+ # data<String|NilClass>:: the data to append to the file.
781
+ # config<Hash>:: give :verbose => false to not log the status.
782
+ #
783
+ # ==== Examples
784
+ #
785
+ # create_file "lib/fun_party.rb" do
786
+ # hostname = ask("What is the virtual hostname I should use?")
787
+ # "vhost.name = #{hostname}"
788
+ # end
789
+ #
790
+ # create_file "config/apache.conf", "your apache config"
791
+ #
792
+ # source://thor//lib/thor/actions/create_file.rb#22
793
+ def create_file(destination, *args, &block); end
794
+
795
+ # Create a new file relative to the destination root from the given source.
796
+ #
797
+ # ==== Parameters
798
+ # destination<String>:: the relative path to the destination root.
799
+ # source<String|NilClass>:: the relative path to the source root.
800
+ # config<Hash>:: give :verbose => false to not log the status.
801
+ # :: give :symbolic => false for hard link.
802
+ #
803
+ # ==== Examples
804
+ #
805
+ # create_link "config/apache.conf", "/etc/apache.conf"
806
+ #
807
+ # source://thor//lib/thor/actions/create_link.rb#17
808
+ def create_link(destination, *args); end
809
+
810
+ # Returns the root for this thor class (also aliased as destination root).
811
+ #
812
+ # source://thor//lib/thor/actions.rb#99
813
+ def destination_root; end
814
+
815
+ # Sets the root for this thor class. Relatives path are added to the
816
+ # directory where the script was invoked and expanded.
817
+ #
818
+ # source://thor//lib/thor/actions.rb#106
819
+ def destination_root=(root); end
820
+
821
+ # Copies recursively the files from source directory to root directory.
822
+ # If any of the files finishes with .tt, it's considered to be a template
823
+ # and is placed in the destination without the extension .tt. If any
824
+ # empty directory is found, it's copied and all .empty_directory files are
825
+ # ignored. If any file name is wrapped within % signs, the text within
826
+ # the % signs will be executed as a method and replaced with the returned
827
+ # value. Let's suppose a doc directory with the following files:
828
+ #
829
+ # doc/
830
+ # components/.empty_directory
831
+ # README
832
+ # rdoc.rb.tt
833
+ # %app_name%.rb
834
+ #
835
+ # When invoked as:
836
+ #
837
+ # directory "doc"
838
+ #
839
+ # It will create a doc directory in the destination with the following
840
+ # files (assuming that the `app_name` method returns the value "blog"):
841
+ #
842
+ # doc/
843
+ # components/
844
+ # README
845
+ # rdoc.rb
846
+ # blog.rb
847
+ #
848
+ # <b>Encoded path note:</b> Since Thor internals use Object#respond_to? to check if it can
849
+ # expand %something%, this `something` should be a public method in the class calling
850
+ # #directory. If a method is private, Thor stack raises PrivateMethodEncodedError.
851
+ #
852
+ # ==== Parameters
853
+ # source<String>:: the relative path to the source root.
854
+ # destination<String>:: the relative path to the destination root.
855
+ # config<Hash>:: give :verbose => false to not log the status.
856
+ # If :recursive => false, does not look for paths recursively.
857
+ # If :mode => :preserve, preserve the file mode from the source.
858
+ # If :exclude_pattern => /regexp/, prevents copying files that match that regexp.
859
+ #
860
+ # ==== Examples
861
+ #
862
+ # directory "doc"
863
+ # directory "doc", "docs", :recursive => false
864
+ #
865
+ # source://thor//lib/thor/actions/directory.rb#49
866
+ def directory(source, *args, &block); end
867
+
868
+ # Creates an empty directory.
869
+ #
870
+ # ==== Parameters
871
+ # destination<String>:: the relative path to the destination root.
872
+ # config<Hash>:: give :verbose => false to not log the status.
873
+ #
874
+ # ==== Examples
875
+ #
876
+ # empty_directory "doc"
877
+ #
878
+ # source://thor//lib/thor/actions/empty_directory.rb#13
879
+ def empty_directory(destination, config = T.unsafe(nil)); end
880
+
881
+ # Receives a file or directory and search for it in the source paths.
882
+ #
883
+ # @raise [Error]
884
+ #
885
+ # source://thor//lib/thor/actions.rb#133
886
+ def find_in_source_paths(file); end
887
+
888
+ # Gets the content at the given address and places it at the given relative
889
+ # destination. If a block is given instead of destination, the content of
890
+ # the url is yielded and used as location.
891
+ #
892
+ # +get+ relies on open-uri, so passing application user input would provide
893
+ # a command injection attack vector.
894
+ #
895
+ # ==== Parameters
896
+ # source<String>:: the address of the given content.
897
+ # destination<String>:: the relative path to the destination root.
898
+ # config<Hash>:: give :verbose => false to not log the status, and
899
+ # :http_headers => <Hash> to add headers to an http request.
900
+ #
901
+ # ==== Examples
902
+ #
903
+ # get "http://gist.github.com/103208", "doc/README"
904
+ #
905
+ # get "http://gist.github.com/103208", "doc/README", :http_headers => {"Content-Type" => "application/json"}
906
+ #
907
+ # get "http://gist.github.com/103208" do |content|
908
+ # content.split("\n").first
909
+ # end
910
+ #
911
+ # source://thor//lib/thor/actions/file_manipulation.rb#81
912
+ def get(source, *args, &block); end
913
+
914
+ # Run a regular expression replacement on a file.
915
+ #
916
+ # ==== Parameters
917
+ # path<String>:: path of the file to be changed
918
+ # flag<Regexp|String>:: the regexp or string to be replaced
919
+ # replacement<String>:: the replacement, can be also given as a block
920
+ # config<Hash>:: give :verbose => false to not log the status, and
921
+ # :force => true, to force the replacement regardless of runner behavior.
922
+ #
923
+ # ==== Example
924
+ #
925
+ # gsub_file 'app/controllers/application_controller.rb', /#\s*(filter_parameter_logging :password)/, '\1'
926
+ #
927
+ # gsub_file 'README', /rake/, :green do |match|
928
+ # match << " no more. Use thor!"
929
+ # end
930
+ #
931
+ # source://thor//lib/thor/actions/file_manipulation.rb#291
932
+ def gsub_file(path, flag, *args, &block); end
933
+
934
+ # Run a regular expression replacement on a file, raising an error if the
935
+ # contents of the file are not changed.
936
+ #
937
+ # ==== Parameters
938
+ # path<String>:: path of the file to be changed
939
+ # flag<Regexp|String>:: the regexp or string to be replaced
940
+ # replacement<String>:: the replacement, can be also given as a block
941
+ # config<Hash>:: give :verbose => false to not log the status, and
942
+ # :force => true, to force the replacement regardless of runner behavior.
943
+ #
944
+ # ==== Example
945
+ #
946
+ # gsub_file! 'app/controllers/application_controller.rb', /#\s*(filter_parameter_logging :password)/, '\1'
947
+ #
948
+ # gsub_file! 'README', /rake/, :green do |match|
949
+ # match << " no more. Use thor!"
950
+ # end
951
+ #
952
+ # source://thor//lib/thor/actions/file_manipulation.rb#263
953
+ def gsub_file!(path, flag, *args, &block); end
954
+
955
+ # Goes to the root and execute the given block.
956
+ #
957
+ # source://thor//lib/thor/actions.rb#200
958
+ def in_root; end
959
+
960
+ # Injects text right after the class definition. Since it depends on
961
+ # insert_into_file, it's reversible.
962
+ #
963
+ # ==== Parameters
964
+ # path<String>:: path of the file to be changed
965
+ # klass<String|Class>:: the class to be manipulated
966
+ # data<String>:: the data to append to the class, can be also given as a block.
967
+ # config<Hash>:: give :verbose => false to not log the status.
968
+ #
969
+ # ==== Examples
970
+ #
971
+ # inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " filter_parameter :password\n"
972
+ #
973
+ # inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do
974
+ # " filter_parameter :password\n"
975
+ # end
976
+ #
977
+ # source://thor//lib/thor/actions/file_manipulation.rb#216
978
+ def inject_into_class(path, klass, *args, &block); end
979
+
980
+ # source://thor//lib/thor/actions/inject_into_file.rb#26
981
+ def inject_into_file(destination, *args, &block); end
982
+
983
+ # Injects text right after the module definition. Since it depends on
984
+ # insert_into_file, it's reversible.
985
+ #
986
+ # ==== Parameters
987
+ # path<String>:: path of the file to be changed
988
+ # module_name<String|Class>:: the module to be manipulated
989
+ # data<String>:: the data to append to the class, can be also given as a block.
990
+ # config<Hash>:: give :verbose => false to not log the status.
991
+ #
992
+ # ==== Examples
993
+ #
994
+ # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper", " def help; 'help'; end\n"
995
+ #
996
+ # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper" do
997
+ # " def help; 'help'; end\n"
998
+ # end
999
+ #
1000
+ # source://thor//lib/thor/actions/file_manipulation.rb#239
1001
+ def inject_into_module(path, module_name, *args, &block); end
1002
+
1003
+ # source://thor//lib/thor/actions/inject_into_file.rb#26
1004
+ def insert_into_file(destination, *args, &block); end
1005
+
1006
+ # Do something in the root or on a provided subfolder. If a relative path
1007
+ # is given it's referenced from the current root. The full path is yielded
1008
+ # to the block you provide. The path is set back to the previous path when
1009
+ # the method exits.
1010
+ #
1011
+ # Returns the value yielded by the block.
1012
+ #
1013
+ # ==== Parameters
1014
+ # dir<String>:: the directory to move to.
1015
+ # config<Hash>:: give :verbose => true to log and use padding.
1016
+ #
1017
+ # source://thor//lib/thor/actions.rb#170
1018
+ def inside(dir = T.unsafe(nil), config = T.unsafe(nil), &block); end
1019
+
1020
+ # Links the file from the relative source to the relative destination. If
1021
+ # the destination is not given it's assumed to be equal to the source.
1022
+ #
1023
+ # ==== Parameters
1024
+ # source<String>:: the relative path to the source root.
1025
+ # destination<String>:: the relative path to the destination root.
1026
+ # config<Hash>:: give :verbose => false to not log the status.
1027
+ #
1028
+ # ==== Examples
1029
+ #
1030
+ # link_file "README", "doc/README"
1031
+ #
1032
+ # link_file "doc/README"
1033
+ #
1034
+ # source://thor//lib/thor/actions/file_manipulation.rb#50
1035
+ def link_file(source, *args); end
1036
+
1037
+ # Prepend text to a file. Since it depends on insert_into_file, it's reversible.
1038
+ #
1039
+ # ==== Parameters
1040
+ # path<String>:: path of the file to be changed
1041
+ # data<String>:: the data to prepend to the file, can be also given as a block.
1042
+ # config<Hash>:: give :verbose => false to not log the status.
1043
+ #
1044
+ # ==== Example
1045
+ #
1046
+ # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"'
1047
+ #
1048
+ # prepend_to_file 'config/environments/test.rb' do
1049
+ # 'config.gem "rspec"'
1050
+ # end
1051
+ #
1052
+ # source://thor//lib/thor/actions/file_manipulation.rb#170
1053
+ def prepend_file(path, *args, &block); end
1054
+
1055
+ # Prepend text to a file. Since it depends on insert_into_file, it's reversible.
1056
+ #
1057
+ # ==== Parameters
1058
+ # path<String>:: path of the file to be changed
1059
+ # data<String>:: the data to prepend to the file, can be also given as a block.
1060
+ # config<Hash>:: give :verbose => false to not log the status.
1061
+ #
1062
+ # ==== Example
1063
+ #
1064
+ # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"'
1065
+ #
1066
+ # prepend_to_file 'config/environments/test.rb' do
1067
+ # 'config.gem "rspec"'
1068
+ # end
1069
+ #
1070
+ # source://thor//lib/thor/actions/file_manipulation.rb#170
1071
+ def prepend_to_file(path, *args, &block); end
1072
+
1073
+ # Returns the given path relative to the absolute root (ie, root where
1074
+ # the script started).
1075
+ #
1076
+ # source://thor//lib/thor/actions.rb#114
1077
+ def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end
1078
+
1079
+ # Removes a file at the given location.
1080
+ #
1081
+ # ==== Parameters
1082
+ # path<String>:: path of the file to be changed
1083
+ # config<Hash>:: give :verbose => false to not log the status.
1084
+ #
1085
+ # ==== Example
1086
+ #
1087
+ # remove_file 'README'
1088
+ # remove_file 'app/controllers/application_controller.rb'
1089
+ #
1090
+ # source://thor//lib/thor/actions/file_manipulation.rb#350
1091
+ def remove_dir(path, config = T.unsafe(nil)); end
1092
+
1093
+ # Removes a file at the given location.
1094
+ #
1095
+ # ==== Parameters
1096
+ # path<String>:: path of the file to be changed
1097
+ # config<Hash>:: give :verbose => false to not log the status.
1098
+ #
1099
+ # ==== Example
1100
+ #
1101
+ # remove_file 'README'
1102
+ # remove_file 'app/controllers/application_controller.rb'
1103
+ #
1104
+ # source://thor//lib/thor/actions/file_manipulation.rb#350
1105
+ def remove_file(path, config = T.unsafe(nil)); end
1106
+
1107
+ # Executes a command returning the contents of the command.
1108
+ #
1109
+ # ==== Parameters
1110
+ # command<String>:: the command to be executed.
1111
+ # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output. Specify :with
1112
+ # to append an executable to command execution.
1113
+ #
1114
+ # ==== Example
1115
+ #
1116
+ # inside('vendor') do
1117
+ # run('ln -s ~/edge rails')
1118
+ # end
1119
+ #
1120
+ # source://thor//lib/thor/actions.rb#248
1121
+ def run(command, config = T.unsafe(nil)); end
1122
+
1123
+ # Executes a ruby script (taking into account WIN32 platform quirks).
1124
+ #
1125
+ # ==== Parameters
1126
+ # command<String>:: the command to be executed.
1127
+ # config<Hash>:: give :verbose => false to not log the status.
1128
+ #
1129
+ # source://thor//lib/thor/actions.rb#285
1130
+ def run_ruby_script(command, config = T.unsafe(nil)); end
1131
+
1132
+ # Holds source paths in instance so they can be manipulated.
1133
+ #
1134
+ # source://thor//lib/thor/actions.rb#127
1135
+ def source_paths; end
1136
+
1137
+ # Gets an ERB template at the relative source, executes it and makes a copy
1138
+ # at the relative destination. If the destination is not given it's assumed
1139
+ # to be equal to the source removing .tt from the filename.
1140
+ #
1141
+ # ==== Parameters
1142
+ # source<String>:: the relative path to the source root.
1143
+ # destination<String>:: the relative path to the destination root.
1144
+ # config<Hash>:: give :verbose => false to not log the status.
1145
+ #
1146
+ # ==== Examples
1147
+ #
1148
+ # template "README", "doc/README"
1149
+ #
1150
+ # template "doc/README"
1151
+ #
1152
+ # source://thor//lib/thor/actions/file_manipulation.rb#117
1153
+ def template(source, *args, &block); end
1154
+
1155
+ # Run a thor command. A hash of options can be given and it's converted to
1156
+ # switches.
1157
+ #
1158
+ # ==== Parameters
1159
+ # command<String>:: the command to be invoked
1160
+ # args<Array>:: arguments to the command
1161
+ # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output.
1162
+ # Other options are given as parameter to Thor.
1163
+ #
1164
+ #
1165
+ # ==== Examples
1166
+ #
1167
+ # thor :install, "http://gist.github.com/103208"
1168
+ # #=> thor install http://gist.github.com/103208
1169
+ #
1170
+ # thor :list, :all => true, :substring => 'rails'
1171
+ # #=> thor list --all --substring=rails
1172
+ #
1173
+ # source://thor//lib/thor/actions.rb#308
1174
+ def thor(command, *args); end
1175
+
1176
+ # Uncomment all lines matching a given regex. Preserves indentation before
1177
+ # the comment hash and removes the hash and any immediate following space.
1178
+ #
1179
+ # ==== Parameters
1180
+ # path<String>:: path of the file to be changed
1181
+ # flag<Regexp|String>:: the regexp or string used to decide which lines to uncomment
1182
+ # config<Hash>:: give :verbose => false to not log the status.
1183
+ #
1184
+ # ==== Example
1185
+ #
1186
+ # uncomment_lines 'config/initializers/session_store.rb', /active_record/
1187
+ #
1188
+ # source://thor//lib/thor/actions/file_manipulation.rb#314
1189
+ def uncomment_lines(path, flag, *args); end
1190
+
1191
+ protected
1192
+
1193
+ # source://thor//lib/thor/actions.rb#329
1194
+ def _cleanup_options_and_set(options, key); end
1195
+
1196
+ # Allow current root to be shared between invocations.
1197
+ #
1198
+ # source://thor//lib/thor/actions.rb#325
1199
+ def _shared_configuration; end
1200
+
1201
+ private
1202
+
1203
+ # source://thor//lib/thor/actions/file_manipulation.rb#385
1204
+ def actually_gsub_file(path, flag, args, error_on_no_change, &block); end
1205
+
1206
+ # source://thor//lib/thor/actions/file_manipulation.rb#371
1207
+ def capture(*args); end
1208
+
1209
+ # source://thor//lib/thor/actions/file_manipulation.rb#367
1210
+ def concat(string); end
1211
+
1212
+ # Returns the value of attribute output_buffer.
1213
+ #
1214
+ # source://thor//lib/thor/actions/file_manipulation.rb#362
1215
+ def output_buffer; end
1216
+
1217
+ # Sets the attribute output_buffer
1218
+ #
1219
+ # @param value the value to set the attribute output_buffer to.
1220
+ #
1221
+ # source://thor//lib/thor/actions/file_manipulation.rb#362
1222
+ def output_buffer=(_arg0); end
1223
+
1224
+ # source://thor//lib/thor/actions/file_manipulation.rb#375
1225
+ def with_output_buffer(buf = T.unsafe(nil)); end
1226
+
1227
+ class << self
1228
+ # source://thor//lib/thor/actions.rb#12
1229
+ def included(base); end
1230
+ end
1231
+ end
1232
+
1233
+ # Thor::Actions#capture depends on what kind of buffer is used in ERB.
1234
+ # Thus CapturableERB fixes ERB to use String buffer.
1235
+ #
1236
+ # source://thor//lib/thor/actions/file_manipulation.rb#398
1237
+ class Thor::Actions::CapturableERB < ::ERB
1238
+ # source://thor//lib/thor/actions/file_manipulation.rb#399
1239
+ def set_eoutvar(compiler, eoutvar = T.unsafe(nil)); end
1240
+ end
1241
+
1242
+ # source://thor//lib/thor/actions.rb#17
1243
+ module Thor::Actions::ClassMethods
1244
+ # Add runtime options that help actions execution.
1245
+ #
1246
+ # source://thor//lib/thor/actions.rb#48
1247
+ def add_runtime_options!; end
1248
+
1249
+ # Hold source paths for one Thor instance. source_paths_for_search is the
1250
+ # method responsible to gather source_paths from this current class,
1251
+ # inherited paths and the source root.
1252
+ #
1253
+ # source://thor//lib/thor/actions.rb#22
1254
+ def source_paths; end
1255
+
1256
+ # Returns the source paths in the following order:
1257
+ #
1258
+ # 1) This class source paths
1259
+ # 2) Source root
1260
+ # 3) Parents source paths
1261
+ #
1262
+ # source://thor//lib/thor/actions.rb#38
1263
+ def source_paths_for_search; end
1264
+
1265
+ # Stores and return the source root for this class
1266
+ #
1267
+ # source://thor//lib/thor/actions.rb#27
1268
+ def source_root(path = T.unsafe(nil)); end
1269
+ end
1270
+
1271
+ # CreateFile is a subset of Template, which instead of rendering a file with
1272
+ # ERB, it gets the content from the user.
1273
+ #
1274
+ # source://thor//lib/thor/actions/create_file.rb#32
1275
+ class Thor::Actions::CreateFile < ::Thor::Actions::EmptyDirectory
1276
+ # @return [CreateFile] a new instance of CreateFile
1277
+ #
1278
+ # source://thor//lib/thor/actions/create_file.rb#35
1279
+ def initialize(base, destination, data, config = T.unsafe(nil)); end
1280
+
1281
+ # source://thor//lib/thor/actions/create_file.rb#33
1282
+ def data; end
1283
+
1284
+ # Checks if the content of the file at the destination is identical to the rendered result.
1285
+ #
1286
+ # ==== Returns
1287
+ # Boolean:: true if it is identical, false otherwise.
1288
+ #
1289
+ # @return [Boolean]
1290
+ #
1291
+ # source://thor//lib/thor/actions/create_file.rb#45
1292
+ def identical?; end
1293
+
1294
+ # source://thor//lib/thor/actions/create_file.rb#60
1295
+ def invoke!; end
1296
+
1297
+ # Holds the content to be added to the file.
1298
+ #
1299
+ # source://thor//lib/thor/actions/create_file.rb#52
1300
+ def render; end
1301
+
1302
+ protected
1303
+
1304
+ # Shows the file collision menu to the user and gets the result.
1305
+ #
1306
+ # @return [Boolean]
1307
+ #
1308
+ # source://thor//lib/thor/actions/create_file.rb#100
1309
+ def force_on_collision?; end
1310
+
1311
+ # If force is true, run the action, otherwise check if it's not being
1312
+ # skipped. If both are false, show the file_collision menu, if the menu
1313
+ # returns true, force it, otherwise skip.
1314
+ #
1315
+ # source://thor//lib/thor/actions/create_file.rb#86
1316
+ def force_or_skip_or_conflict(force, skip, &block); end
1317
+
1318
+ # Now on conflict we check if the file is identical or not.
1319
+ #
1320
+ # source://thor//lib/thor/actions/create_file.rb#73
1321
+ def on_conflict_behavior(&block); end
1322
+ end
1323
+
1324
+ # CreateLink is a subset of CreateFile, which instead of taking a block of
1325
+ # data, just takes a source string from the user.
1326
+ #
1327
+ # source://thor//lib/thor/actions/create_link.rb#27
1328
+ class Thor::Actions::CreateLink < ::Thor::Actions::CreateFile
1329
+ # source://thor//lib/thor/actions/create_link.rb#28
1330
+ def data; end
1331
+
1332
+ # @return [Boolean]
1333
+ #
1334
+ # source://thor//lib/thor/actions/create_link.rb#56
1335
+ def exists?; end
1336
+
1337
+ # Checks if the content of the file at the destination is identical to the rendered result.
1338
+ #
1339
+ # ==== Returns
1340
+ # Boolean:: true if it is identical, false otherwise.
1341
+ #
1342
+ # @return [Boolean]
1343
+ #
1344
+ # source://thor//lib/thor/actions/create_link.rb#35
1345
+ def identical?; end
1346
+
1347
+ # source://thor//lib/thor/actions/create_link.rb#40
1348
+ def invoke!; end
1349
+ end
1350
+
1351
+ # source://thor//lib/thor/actions/directory.rb#55
1352
+ class Thor::Actions::Directory < ::Thor::Actions::EmptyDirectory
1353
+ # @return [Directory] a new instance of Directory
1354
+ #
1355
+ # source://thor//lib/thor/actions/directory.rb#58
1356
+ def initialize(base, source, destination = T.unsafe(nil), config = T.unsafe(nil), &block); end
1357
+
1358
+ # source://thor//lib/thor/actions/directory.rb#64
1359
+ def invoke!; end
1360
+
1361
+ # source://thor//lib/thor/actions/directory.rb#69
1362
+ def revoke!; end
1363
+
1364
+ # Returns the value of attribute source.
1365
+ #
1366
+ # source://thor//lib/thor/actions/directory.rb#56
1367
+ def source; end
1368
+
1369
+ protected
1370
+
1371
+ # source://thor//lib/thor/actions/directory.rb#75
1372
+ def execute!; end
1373
+
1374
+ # source://thor//lib/thor/actions/directory.rb#99
1375
+ def file_level_lookup(previous_lookup); end
1376
+
1377
+ # source://thor//lib/thor/actions/directory.rb#103
1378
+ def files(lookup); end
1379
+ end
1380
+
1381
+ # source://thor//lib/thor/actions/empty_directory.rb#23
1382
+ class Thor::Actions::EmptyDirectory
1383
+ # Initializes given the source and destination.
1384
+ #
1385
+ # ==== Parameters
1386
+ # base<Thor::Base>:: A Thor::Base instance
1387
+ # source<String>:: Relative path to the source of this file
1388
+ # destination<String>:: Relative path to the destination of this file
1389
+ # config<Hash>:: give :verbose => false to not log the status.
1390
+ #
1391
+ # @return [EmptyDirectory] a new instance of EmptyDirectory
1392
+ #
1393
+ # source://thor//lib/thor/actions/empty_directory.rb#34
1394
+ def initialize(base, destination, config = T.unsafe(nil)); end
1395
+
1396
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1397
+ def base; end
1398
+
1399
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1400
+ def config; end
1401
+
1402
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1403
+ def destination; end
1404
+
1405
+ # Checks if the destination file already exists.
1406
+ #
1407
+ # ==== Returns
1408
+ # Boolean:: true if the file exists, false otherwise.
1409
+ #
1410
+ # @return [Boolean]
1411
+ #
1412
+ # source://thor//lib/thor/actions/empty_directory.rb#45
1413
+ def exists?; end
1414
+
1415
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1416
+ def given_destination; end
1417
+
1418
+ # source://thor//lib/thor/actions/empty_directory.rb#49
1419
+ def invoke!; end
1420
+
1421
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1422
+ def relative_destination; end
1423
+
1424
+ # source://thor//lib/thor/actions/empty_directory.rb#56
1425
+ def revoke!; end
1426
+
1427
+ protected
1428
+
1429
+ # Filenames in the encoded form are converted. If you have a file:
1430
+ #
1431
+ # %file_name%.rb
1432
+ #
1433
+ # It calls #file_name from the base and replaces %-string with the
1434
+ # return value (should be String) of #file_name:
1435
+ #
1436
+ # user.rb
1437
+ #
1438
+ # The method referenced can be either public or private.
1439
+ #
1440
+ # source://thor//lib/thor/actions/empty_directory.rb#103
1441
+ def convert_encoded_instructions(filename); end
1442
+
1443
+ # Sets the absolute destination value from a relative destination value.
1444
+ # It also stores the given and relative destination. Let's suppose our
1445
+ # script is being executed on "dest", it sets the destination root to
1446
+ # "dest". The destination, given_destination and relative_destination
1447
+ # are related in the following way:
1448
+ #
1449
+ # inside "bar" do
1450
+ # empty_directory "baz"
1451
+ # end
1452
+ #
1453
+ # destination #=> dest/bar/baz
1454
+ # relative_destination #=> bar/baz
1455
+ # given_destination #=> baz
1456
+ #
1457
+ # source://thor//lib/thor/actions/empty_directory.rb#85
1458
+ def destination=(destination); end
1459
+
1460
+ # Receives a hash of options and just execute the block if some
1461
+ # conditions are met.
1462
+ #
1463
+ # source://thor//lib/thor/actions/empty_directory.rb#113
1464
+ def invoke_with_conflict_check(&block); end
1465
+
1466
+ # What to do when the destination file already exists.
1467
+ #
1468
+ # source://thor//lib/thor/actions/empty_directory.rb#132
1469
+ def on_conflict_behavior; end
1470
+
1471
+ # source://thor//lib/thor/actions/empty_directory.rb#126
1472
+ def on_file_clash_behavior; end
1473
+
1474
+ # Shortcut for pretend.
1475
+ #
1476
+ # @return [Boolean]
1477
+ #
1478
+ # source://thor//lib/thor/actions/empty_directory.rb#67
1479
+ def pretend?; end
1480
+
1481
+ # Shortcut to say_status shell method.
1482
+ #
1483
+ # source://thor//lib/thor/actions/empty_directory.rb#138
1484
+ def say_status(status, color); end
1485
+ end
1486
+
1487
+ # source://thor//lib/thor/actions/inject_into_file.rb#36
1488
+ class Thor::Actions::InjectIntoFile < ::Thor::Actions::EmptyDirectory
1489
+ # @return [InjectIntoFile] a new instance of InjectIntoFile
1490
+ #
1491
+ # source://thor//lib/thor/actions/inject_into_file.rb#39
1492
+ def initialize(base, destination, data, config); end
1493
+
1494
+ # Returns the value of attribute behavior.
1495
+ #
1496
+ # source://thor//lib/thor/actions/inject_into_file.rb#37
1497
+ def behavior; end
1498
+
1499
+ # Returns the value of attribute flag.
1500
+ #
1501
+ # source://thor//lib/thor/actions/inject_into_file.rb#37
1502
+ def flag; end
1503
+
1504
+ # source://thor//lib/thor/actions/inject_into_file.rb#52
1505
+ def invoke!; end
1506
+
1507
+ # Returns the value of attribute replacement.
1508
+ #
1509
+ # source://thor//lib/thor/actions/inject_into_file.rb#37
1510
+ def replacement; end
1511
+
1512
+ # source://thor//lib/thor/actions/inject_into_file.rb#74
1513
+ def revoke!; end
1514
+
1515
+ protected
1516
+
1517
+ # source://thor//lib/thor/actions/inject_into_file.rb#110
1518
+ def content; end
1519
+
1520
+ # Adds the content to the file.
1521
+ #
1522
+ # source://thor//lib/thor/actions/inject_into_file.rb#120
1523
+ def replace!(regexp, string, force); end
1524
+
1525
+ # @return [Boolean]
1526
+ #
1527
+ # source://thor//lib/thor/actions/inject_into_file.rb#114
1528
+ def replacement_present?; end
1529
+
1530
+ # source://thor//lib/thor/actions/inject_into_file.rb#90
1531
+ def say_status(behavior, warning: T.unsafe(nil), color: T.unsafe(nil)); end
1532
+ end
1533
+
1534
+ # Injects the given content into a file. Different from gsub_file, this
1535
+ # method is reversible.
1536
+ #
1537
+ # ==== Parameters
1538
+ # destination<String>:: Relative path to the destination root
1539
+ # data<String>:: Data to add to the file. Can be given as a block.
1540
+ # config<Hash>:: give :verbose => false to not log the status and the flag
1541
+ # for injection (:after or :before) or :force => true for
1542
+ # insert two or more times the same content.
1543
+ #
1544
+ # ==== Examples
1545
+ #
1546
+ # insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n"
1547
+ #
1548
+ # insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do
1549
+ # gems = ask "Which gems would you like to add?"
1550
+ # gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n")
1551
+ # end
1552
+ #
1553
+ # source://thor//lib/thor/actions/inject_into_file.rb#24
1554
+ Thor::Actions::WARNINGS = T.let(T.unsafe(nil), Hash)
1555
+
1556
+ # source://thor//lib/thor/error.rb#57
1557
+ class Thor::AmbiguousCommandError < ::Thor::Error; end
1558
+
1559
+ # source://thor//lib/thor/error.rb#59
1560
+ Thor::AmbiguousTaskError = Thor::AmbiguousCommandError
1561
+
1562
+ # source://thor//lib/thor/parser/argument.rb#2
1563
+ class Thor::Argument
1564
+ # @raise [ArgumentError]
1565
+ # @return [Argument] a new instance of Argument
1566
+ #
1567
+ # source://thor//lib/thor/parser/argument.rb#8
1568
+ def initialize(name, options = T.unsafe(nil)); end
1569
+
1570
+ # Returns the value of attribute banner.
1571
+ #
1572
+ # source://thor//lib/thor/parser/argument.rb#5
1573
+ def banner; end
1574
+
1575
+ # Returns the value of attribute default.
1576
+ #
1577
+ # source://thor//lib/thor/parser/argument.rb#5
1578
+ def default; end
1579
+
1580
+ # Returns the value of attribute description.
1581
+ #
1582
+ # source://thor//lib/thor/parser/argument.rb#5
1583
+ def description; end
1584
+
1585
+ # Returns the value of attribute enum.
1586
+ #
1587
+ # source://thor//lib/thor/parser/argument.rb#5
1588
+ def enum; end
1589
+
1590
+ # source://thor//lib/thor/parser/argument.rb#52
1591
+ def enum_to_s; end
1592
+
1593
+ # Returns the value of attribute name.
1594
+ #
1595
+ # source://thor//lib/thor/parser/argument.rb#5
1596
+ def human_name; end
1597
+
1598
+ # Returns the value of attribute name.
1599
+ #
1600
+ # source://thor//lib/thor/parser/argument.rb#5
1601
+ def name; end
1602
+
1603
+ # source://thor//lib/thor/parser/argument.rb#27
1604
+ def print_default; end
1605
+
1606
+ # Returns the value of attribute required.
1607
+ #
1608
+ # source://thor//lib/thor/parser/argument.rb#5
1609
+ def required; end
1610
+
1611
+ # @return [Boolean]
1612
+ #
1613
+ # source://thor//lib/thor/parser/argument.rb#39
1614
+ def required?; end
1615
+
1616
+ # @return [Boolean]
1617
+ #
1618
+ # source://thor//lib/thor/parser/argument.rb#43
1619
+ def show_default?; end
1620
+
1621
+ # Returns the value of attribute type.
1622
+ #
1623
+ # source://thor//lib/thor/parser/argument.rb#5
1624
+ def type; end
1625
+
1626
+ # source://thor//lib/thor/parser/argument.rb#35
1627
+ def usage; end
1628
+
1629
+ protected
1630
+
1631
+ # source://thor//lib/thor/parser/argument.rb#71
1632
+ def default_banner; end
1633
+
1634
+ # @return [Boolean]
1635
+ #
1636
+ # source://thor//lib/thor/parser/argument.rb#67
1637
+ def valid_type?(type); end
1638
+
1639
+ # @raise [ArgumentError]
1640
+ #
1641
+ # source://thor//lib/thor/parser/argument.rb#62
1642
+ def validate!; end
1643
+ end
1644
+
1645
+ # source://thor//lib/thor/parser/argument.rb#3
1646
+ Thor::Argument::VALID_TYPES = T.let(T.unsafe(nil), Array)
1647
+
1648
+ # source://thor//lib/thor/parser/arguments.rb#2
1649
+ class Thor::Arguments
1650
+ # Takes an array of Thor::Argument objects.
1651
+ #
1652
+ # @return [Arguments] a new instance of Arguments
1653
+ #
1654
+ # source://thor//lib/thor/parser/arguments.rb#26
1655
+ def initialize(arguments = T.unsafe(nil)); end
1656
+
1657
+ # source://thor//lib/thor/parser/arguments.rb#40
1658
+ def parse(args); end
1659
+
1660
+ # source://thor//lib/thor/parser/arguments.rb#53
1661
+ def remaining; end
1662
+
1663
+ private
1664
+
1665
+ # Raises an error if @non_assigned_required array is not empty.
1666
+ #
1667
+ # @raise [RequiredArgumentMissingError]
1668
+ #
1669
+ # source://thor//lib/thor/parser/arguments.rb#186
1670
+ def check_requirement!; end
1671
+
1672
+ # @return [Boolean]
1673
+ #
1674
+ # source://thor//lib/thor/parser/arguments.rb#84
1675
+ def current_is_value?; end
1676
+
1677
+ # @return [Boolean]
1678
+ #
1679
+ # source://thor//lib/thor/parser/arguments.rb#64
1680
+ def last?; end
1681
+
1682
+ # @return [Boolean]
1683
+ #
1684
+ # source://thor//lib/thor/parser/arguments.rb#59
1685
+ def no_or_skip?(arg); end
1686
+
1687
+ # Runs through the argument array getting all strings until no string is
1688
+ # found or a switch is found.
1689
+ #
1690
+ # ["a", "b", "c"]
1691
+ #
1692
+ # And returns it as an array:
1693
+ #
1694
+ # ["a", "b", "c"]
1695
+ #
1696
+ # source://thor//lib/thor/parser/arguments.rb#118
1697
+ def parse_array(name); end
1698
+
1699
+ # Runs through the argument array getting strings that contains ":" and
1700
+ # mark it as a hash:
1701
+ #
1702
+ # [ "name:string", "age:integer" ]
1703
+ #
1704
+ # Becomes:
1705
+ #
1706
+ # { "name" => "string", "age" => "integer" }
1707
+ #
1708
+ # source://thor//lib/thor/parser/arguments.rb#97
1709
+ def parse_hash(name); end
1710
+
1711
+ # Check if the peek is numeric format and return a Float or Integer.
1712
+ # Check if the peek is included in enum if enum is provided.
1713
+ # Otherwise raises an error.
1714
+ #
1715
+ # source://thor//lib/thor/parser/arguments.rb#139
1716
+ def parse_numeric(name); end
1717
+
1718
+ # Parse string:
1719
+ # for --string-arg, just return the current value in the pile
1720
+ # for --no-string-arg, nil
1721
+ # Check if the peek is included in enum if enum is provided. Otherwise raises an error.
1722
+ #
1723
+ # source://thor//lib/thor/parser/arguments.rb#158
1724
+ def parse_string(name); end
1725
+
1726
+ # source://thor//lib/thor/parser/arguments.rb#68
1727
+ def peek; end
1728
+
1729
+ # source://thor//lib/thor/parser/arguments.rb#72
1730
+ def shift; end
1731
+
1732
+ # source://thor//lib/thor/parser/arguments.rb#76
1733
+ def unshift(arg); end
1734
+
1735
+ # Raises an error if the switch is an enum and the values aren't included on it.
1736
+ #
1737
+ # source://thor//lib/thor/parser/arguments.rb#172
1738
+ def validate_enum_value!(name, value, message); end
1739
+
1740
+ class << self
1741
+ # source://thor//lib/thor/parser/arguments.rb#19
1742
+ def parse(*args); end
1743
+
1744
+ # Receives an array of args and returns two arrays, one with arguments
1745
+ # and one with switches.
1746
+ #
1747
+ # source://thor//lib/thor/parser/arguments.rb#8
1748
+ def split(args); end
1749
+ end
1750
+ end
1751
+
1752
+ # source://thor//lib/thor/parser/arguments.rb#3
1753
+ Thor::Arguments::NUMERIC = T.let(T.unsafe(nil), Regexp)
1754
+
1755
+ # source://thor//lib/thor/error.rb#104
1756
+ class Thor::AtLeastOneRequiredArgumentError < ::Thor::InvocationError; end
1757
+
1758
+ # source://thor//lib/thor/shell.rb#4
1759
+ module Thor::Base
1760
+ include ::Thor::Invocation
1761
+ include ::Thor::Shell
1762
+
1763
+ mixes_in_class_methods ::Thor::Base::ClassMethods
1764
+ mixes_in_class_methods ::Thor::Invocation::ClassMethods
1765
+
1766
+ # It receives arguments in an Array and two hashes, one for options and
1767
+ # other for configuration.
1768
+ #
1769
+ # Notice that it does not check if all required arguments were supplied.
1770
+ # It should be done by the parser.
1771
+ #
1772
+ # ==== Parameters
1773
+ # args<Array[Object]>:: An array of objects. The objects are applied to their
1774
+ # respective accessors declared with <tt>argument</tt>.
1775
+ #
1776
+ # options<Hash>:: An options hash that will be available as self.options.
1777
+ # The hash given is converted to a hash with indifferent
1778
+ # access, magic predicates (options.skip?) and then frozen.
1779
+ #
1780
+ # config<Hash>:: Configuration for this Thor class.
1781
+ #
1782
+ # source://thor//lib/thor/base.rb#53
1783
+ def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end
1784
+
1785
+ # Returns the value of attribute args.
1786
+ #
1787
+ # source://thor//lib/thor/base.rb#35
1788
+ def args; end
1789
+
1790
+ # Sets the attribute args
1791
+ #
1792
+ # @param value the value to set the attribute args to.
1793
+ #
1794
+ # source://thor//lib/thor/base.rb#35
1795
+ def args=(_arg0); end
1796
+
1797
+ # Returns the value of attribute options.
1798
+ #
1799
+ # source://thor//lib/thor/base.rb#35
1800
+ def options; end
1801
+
1802
+ # Sets the attribute options
1803
+ #
1804
+ # @param value the value to set the attribute options to.
1805
+ #
1806
+ # source://thor//lib/thor/base.rb#35
1807
+ def options=(_arg0); end
1808
+
1809
+ # Returns the value of attribute parent_options.
1810
+ #
1811
+ # source://thor//lib/thor/base.rb#35
1812
+ def parent_options; end
1813
+
1814
+ # Sets the attribute parent_options
1815
+ #
1816
+ # @param value the value to set the attribute parent_options to.
1817
+ #
1818
+ # source://thor//lib/thor/base.rb#35
1819
+ def parent_options=(_arg0); end
1820
+
1821
+ class << self
1822
+ # source://thor//lib/thor/base.rb#116
1823
+ def included(base); end
1824
+
1825
+ # Whenever a class inherits from Thor or Thor::Group, we should track the
1826
+ # class and the file on Thor::Base. This is the method responsible for it.
1827
+ #
1828
+ # source://thor//lib/thor/base.rb#144
1829
+ def register_klass_file(klass); end
1830
+
1831
+ # Returns the shell used in all Thor classes. If you are in a Unix platform
1832
+ # it will use a colored log, otherwise it will use a basic one without color.
1833
+ #
1834
+ # source://thor//lib/thor/shell.rb#11
1835
+ def shell; end
1836
+
1837
+ # Sets the attribute shell
1838
+ #
1839
+ # @param value the value to set the attribute shell to.
1840
+ #
1841
+ # source://thor//lib/thor/shell.rb#6
1842
+ def shell=(_arg0); end
1843
+
1844
+ # Returns the files where the subclasses are kept.
1845
+ #
1846
+ # ==== Returns
1847
+ # Hash[path<String> => Class]
1848
+ #
1849
+ # source://thor//lib/thor/base.rb#137
1850
+ def subclass_files; end
1851
+
1852
+ # Returns the classes that inherits from Thor or Thor::Group.
1853
+ #
1854
+ # ==== Returns
1855
+ # Array[Class]
1856
+ #
1857
+ # source://thor//lib/thor/base.rb#128
1858
+ def subclasses; end
1859
+ end
1860
+ end
1861
+
1862
+ # source://thor//lib/thor/base.rb#153
1863
+ module Thor::Base::ClassMethods
1864
+ # Returns the commands for this Thor class and all subclasses.
1865
+ #
1866
+ # ==== Returns
1867
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
1868
+ # objects as values.
1869
+ #
1870
+ # source://thor//lib/thor/base.rb#482
1871
+ def all_commands; end
1872
+
1873
+ # Returns the commands for this Thor class and all subclasses.
1874
+ #
1875
+ # ==== Returns
1876
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
1877
+ # objects as values.
1878
+ #
1879
+ # source://thor//lib/thor/base.rb#482
1880
+ def all_tasks; end
1881
+
1882
+ # If you want to use defaults that don't match the type of an option,
1883
+ # either specify `check_default_type: false` or call `allow_incompatible_default_type!`
1884
+ #
1885
+ # source://thor//lib/thor/base.rb#189
1886
+ def allow_incompatible_default_type!; end
1887
+
1888
+ # Adds an argument to the class and creates an attr_accessor for it.
1889
+ #
1890
+ # Arguments are different from options in several aspects. The first one
1891
+ # is how they are parsed from the command line, arguments are retrieved
1892
+ # from position:
1893
+ #
1894
+ # thor command NAME
1895
+ #
1896
+ # Instead of:
1897
+ #
1898
+ # thor command --name=NAME
1899
+ #
1900
+ # Besides, arguments are used inside your code as an accessor (self.argument),
1901
+ # while options are all kept in a hash (self.options).
1902
+ #
1903
+ # Finally, arguments cannot have type :default or :boolean but can be
1904
+ # optional (supplying :optional => :true or :required => false), although
1905
+ # you cannot have a required argument after a non-required argument. If you
1906
+ # try it, an error is raised.
1907
+ #
1908
+ # ==== Parameters
1909
+ # name<Symbol>:: The name of the argument.
1910
+ # options<Hash>:: Described below.
1911
+ #
1912
+ # ==== Options
1913
+ # :desc - Description for the argument.
1914
+ # :required - If the argument is required or not.
1915
+ # :optional - If the argument is optional or not.
1916
+ # :type - The type of the argument, can be :string, :hash, :array, :numeric.
1917
+ # :default - Default value for this argument. It cannot be required and have default values.
1918
+ # :banner - String to show on usage notes.
1919
+ #
1920
+ # ==== Errors
1921
+ # ArgumentError:: Raised if you supply a required argument after a non required one.
1922
+ #
1923
+ # source://thor//lib/thor/base.rb#261
1924
+ def argument(name, options = T.unsafe(nil)); end
1925
+
1926
+ # Returns this class arguments, looking up in the ancestors chain.
1927
+ #
1928
+ # ==== Returns
1929
+ # Array[Thor::Argument]
1930
+ #
1931
+ # source://thor//lib/thor/base.rb#293
1932
+ def arguments; end
1933
+
1934
+ # source://thor//lib/thor/base.rb#162
1935
+ def attr_accessor(*_arg0); end
1936
+
1937
+ # source://thor//lib/thor/base.rb#154
1938
+ def attr_reader(*_arg0); end
1939
+
1940
+ # source://thor//lib/thor/base.rb#158
1941
+ def attr_writer(*_arg0); end
1942
+
1943
+ # source://thor//lib/thor/base.rb#193
1944
+ def check_default_type; end
1945
+
1946
+ # If you want to raise an error when the default value of an option does not match
1947
+ # the type call check_default_type!
1948
+ # This will be the default; for compatibility a deprecation warning is issued if necessary.
1949
+ #
1950
+ # source://thor//lib/thor/base.rb#183
1951
+ def check_default_type!; end
1952
+
1953
+ # source://thor//lib/thor/base.rb#172
1954
+ def check_unknown_options; end
1955
+
1956
+ # If you want to raise an error for unknown options, call check_unknown_options!
1957
+ # This is disabled by default to allow dynamic invocations.
1958
+ #
1959
+ # source://thor//lib/thor/base.rb#168
1960
+ def check_unknown_options!; end
1961
+
1962
+ # @return [Boolean]
1963
+ #
1964
+ # source://thor//lib/thor/base.rb#176
1965
+ def check_unknown_options?(config); end
1966
+
1967
+ # Adds and declares option group for required at least one of options in the
1968
+ # block and arguments. You can declare options as the outside of the block.
1969
+ #
1970
+ # ==== Examples
1971
+ #
1972
+ # class_at_least_one do
1973
+ # class_option :one
1974
+ # class_option :two
1975
+ # end
1976
+ #
1977
+ # Or
1978
+ #
1979
+ # class_option :one
1980
+ # class_option :two
1981
+ # class_at_least_one :one, :two
1982
+ #
1983
+ # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError
1984
+ # will be raised.
1985
+ #
1986
+ # You can use class_at_least_one and class_exclusive at the same time.
1987
+ #
1988
+ # class_exclusive do
1989
+ # class_at_least_one do
1990
+ # class_option :one
1991
+ # class_option :two
1992
+ # end
1993
+ # end
1994
+ #
1995
+ # Then it is required either only one of "--one" or "--two".
1996
+ #
1997
+ # source://thor//lib/thor/base.rb#392
1998
+ def class_at_least_one(*args, &block); end
1999
+
2000
+ # Returns this class at least one of required options array set, looking up in the ancestors chain.
2001
+ #
2002
+ # ==== Returns
2003
+ # Array[Array[Thor::Option.name]]
2004
+ #
2005
+ # source://thor//lib/thor/base.rb#411
2006
+ def class_at_least_one_option_names; end
2007
+
2008
+ # Adds and declares option group for exclusive options in the
2009
+ # block and arguments. You can declare options as the outside of the block.
2010
+ #
2011
+ # ==== Parameters
2012
+ # Array[Thor::Option.name]
2013
+ #
2014
+ # ==== Examples
2015
+ #
2016
+ # class_exclusive do
2017
+ # class_option :one
2018
+ # class_option :two
2019
+ # end
2020
+ #
2021
+ # Or
2022
+ #
2023
+ # class_option :one
2024
+ # class_option :two
2025
+ # class_exclusive :one, :two
2026
+ #
2027
+ # If you give "--one" and "--two" at the same time ExclusiveArgumentsError
2028
+ # will be raised.
2029
+ #
2030
+ # source://thor//lib/thor/base.rb#357
2031
+ def class_exclusive(*args, &block); end
2032
+
2033
+ # Returns this class exclusive options array set, looking up in the ancestors chain.
2034
+ #
2035
+ # ==== Returns
2036
+ # Array[Array[Thor::Option.name]]
2037
+ #
2038
+ # source://thor//lib/thor/base.rb#402
2039
+ def class_exclusive_option_names; end
2040
+
2041
+ # Adds an option to the set of class options
2042
+ #
2043
+ # ==== Parameters
2044
+ # name<Symbol>:: The name of the argument.
2045
+ # options<Hash>:: Described below.
2046
+ #
2047
+ # ==== Options
2048
+ # :desc:: -- Description for the argument.
2049
+ # :required:: -- If the argument is required or not.
2050
+ # :default:: -- Default value for this argument.
2051
+ # :group:: -- The group for this options. Use by class options to output options in different levels.
2052
+ # :aliases:: -- Aliases for this option. <b>Note:</b> Thor follows a convention of one-dash-one-letter options. Thus aliases like "-something" wouldn't be parsed; use either "\--something" or "-s" instead.
2053
+ # :type:: -- The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
2054
+ # :banner:: -- String to show on usage notes.
2055
+ # :hide:: -- If you want to hide this option from the help.
2056
+ #
2057
+ # source://thor//lib/thor/base.rb#328
2058
+ def class_option(name, options = T.unsafe(nil)); end
2059
+
2060
+ # Adds a bunch of options to the set of class options.
2061
+ #
2062
+ # class_options :foo => false, :bar => :required, :baz => :string
2063
+ #
2064
+ # If you prefer more detailed declaration, check class_option.
2065
+ #
2066
+ # ==== Parameters
2067
+ # Hash[Symbol => Object]
2068
+ #
2069
+ # source://thor//lib/thor/base.rb#306
2070
+ def class_options(options = T.unsafe(nil)); end
2071
+
2072
+ # Returns the commands for this Thor class.
2073
+ #
2074
+ # ==== Returns
2075
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
2076
+ # objects as values.
2077
+ #
2078
+ # source://thor//lib/thor/base.rb#471
2079
+ def commands; end
2080
+
2081
+ # If true, option set will not suspend the execution of the command when
2082
+ # a required option is not provided.
2083
+ #
2084
+ # @return [Boolean]
2085
+ #
2086
+ # source://thor//lib/thor/base.rb#207
2087
+ def disable_required_check?(command_name); end
2088
+
2089
+ # A flag that makes the process exit with status 1 if any error happens.
2090
+ #
2091
+ # @return [Boolean]
2092
+ #
2093
+ # source://thor//lib/thor/base.rb#628
2094
+ def exit_on_failure?; end
2095
+
2096
+ # Defines the group. This is used when thor list is invoked so you can specify
2097
+ # that only commands from a pre-defined group will be shown. Defaults to standard.
2098
+ #
2099
+ # ==== Parameters
2100
+ # name<String|Symbol>
2101
+ #
2102
+ # source://thor//lib/thor/base.rb#457
2103
+ def group(name = T.unsafe(nil)); end
2104
+
2105
+ # @raise [InvocationError]
2106
+ #
2107
+ # source://thor//lib/thor/base.rb#618
2108
+ def handle_argument_error(command, error, args, arity); end
2109
+
2110
+ # @raise [UndefinedCommandError]
2111
+ #
2112
+ # source://thor//lib/thor/base.rb#613
2113
+ def handle_no_command_error(command, has_namespace = T.unsafe(nil)); end
2114
+
2115
+ # @raise [UndefinedCommandError]
2116
+ #
2117
+ # source://thor//lib/thor/base.rb#613
2118
+ def handle_no_task_error(command, has_namespace = T.unsafe(nil)); end
2119
+
2120
+ # Sets the namespace for the Thor or Thor::Group class. By default the
2121
+ # namespace is retrieved from the class name. If your Thor class is named
2122
+ # Scripts::MyScript, the help method, for example, will be called as:
2123
+ #
2124
+ # thor scripts:my_script -h
2125
+ #
2126
+ # If you change the namespace:
2127
+ #
2128
+ # namespace :my_scripts
2129
+ #
2130
+ # You change how your commands are invoked:
2131
+ #
2132
+ # thor my_scripts -h
2133
+ #
2134
+ # Finally, if you change your namespace to default:
2135
+ #
2136
+ # namespace :default
2137
+ #
2138
+ # Your commands can be invoked with a shortcut. Instead of:
2139
+ #
2140
+ # thor :my_command
2141
+ #
2142
+ # source://thor//lib/thor/base.rb#566
2143
+ def namespace(name = T.unsafe(nil)); end
2144
+
2145
+ # All methods defined inside the given block are not added as commands.
2146
+ #
2147
+ # So you can do:
2148
+ #
2149
+ # class MyScript < Thor
2150
+ # no_commands do
2151
+ # def this_is_not_a_command
2152
+ # end
2153
+ # end
2154
+ # end
2155
+ #
2156
+ # You can also add the method and remove it from the command list:
2157
+ #
2158
+ # class MyScript < Thor
2159
+ # def this_is_not_a_command
2160
+ # end
2161
+ # remove_command :this_is_not_a_command
2162
+ # end
2163
+ #
2164
+ # source://thor//lib/thor/base.rb#530
2165
+ def no_commands(&block); end
2166
+
2167
+ # @return [Boolean]
2168
+ #
2169
+ # source://thor//lib/thor/base.rb#540
2170
+ def no_commands?; end
2171
+
2172
+ # source://thor//lib/thor/base.rb#536
2173
+ def no_commands_context; end
2174
+
2175
+ # All methods defined inside the given block are not added as commands.
2176
+ #
2177
+ # So you can do:
2178
+ #
2179
+ # class MyScript < Thor
2180
+ # no_commands do
2181
+ # def this_is_not_a_command
2182
+ # end
2183
+ # end
2184
+ # end
2185
+ #
2186
+ # You can also add the method and remove it from the command list:
2187
+ #
2188
+ # class MyScript < Thor
2189
+ # def this_is_not_a_command
2190
+ # end
2191
+ # remove_command :this_is_not_a_command
2192
+ # end
2193
+ #
2194
+ # source://thor//lib/thor/base.rb#530
2195
+ def no_tasks(&block); end
2196
+
2197
+ # Allows to use private methods from parent in child classes as commands.
2198
+ #
2199
+ # ==== Parameters
2200
+ # names<Array>:: Method names to be used as commands
2201
+ #
2202
+ # ==== Examples
2203
+ #
2204
+ # public_command :foo
2205
+ # public_command :foo, :bar, :baz
2206
+ #
2207
+ # source://thor//lib/thor/base.rb#606
2208
+ def public_command(*names); end
2209
+
2210
+ # Allows to use private methods from parent in child classes as commands.
2211
+ #
2212
+ # ==== Parameters
2213
+ # names<Array>:: Method names to be used as commands
2214
+ #
2215
+ # ==== Examples
2216
+ #
2217
+ # public_command :foo
2218
+ # public_command :foo, :bar, :baz
2219
+ #
2220
+ # source://thor//lib/thor/base.rb#606
2221
+ def public_task(*names); end
2222
+
2223
+ # Removes a previous defined argument. If :undefine is given, undefine
2224
+ # accessors as well.
2225
+ #
2226
+ # ==== Parameters
2227
+ # names<Array>:: Arguments to be removed
2228
+ #
2229
+ # ==== Examples
2230
+ #
2231
+ # remove_argument :foo
2232
+ # remove_argument :foo, :bar, :baz, :undefine => true
2233
+ #
2234
+ # source://thor//lib/thor/base.rb#426
2235
+ def remove_argument(*names); end
2236
+
2237
+ # Removes a previous defined class option.
2238
+ #
2239
+ # ==== Parameters
2240
+ # names<Array>:: Class options to be removed
2241
+ #
2242
+ # ==== Examples
2243
+ #
2244
+ # remove_class_option :foo
2245
+ # remove_class_option :foo, :bar, :baz
2246
+ #
2247
+ # source://thor//lib/thor/base.rb#445
2248
+ def remove_class_option(*names); end
2249
+
2250
+ # Removes a given command from this Thor class. This is usually done if you
2251
+ # are inheriting from another class and don't want it to be available
2252
+ # anymore.
2253
+ #
2254
+ # By default it only remove the mapping to the command. But you can supply
2255
+ # :undefine => true to undefine the method from the class as well.
2256
+ #
2257
+ # ==== Parameters
2258
+ # name<Symbol|String>:: The name of the command to be removed
2259
+ # options<Hash>:: You can give :undefine => true if you want commands the method
2260
+ # to be undefined from the class as well.
2261
+ #
2262
+ # source://thor//lib/thor/base.rb#500
2263
+ def remove_command(*names); end
2264
+
2265
+ # Removes a given command from this Thor class. This is usually done if you
2266
+ # are inheriting from another class and don't want it to be available
2267
+ # anymore.
2268
+ #
2269
+ # By default it only remove the mapping to the command. But you can supply
2270
+ # :undefine => true to undefine the method from the class as well.
2271
+ #
2272
+ # ==== Parameters
2273
+ # name<Symbol|String>:: The name of the command to be removed
2274
+ # options<Hash>:: You can give :undefine => true if you want commands the method
2275
+ # to be undefined from the class as well.
2276
+ #
2277
+ # source://thor//lib/thor/base.rb#500
2278
+ def remove_task(*names); end
2279
+
2280
+ # Parses the command and options from the given args, instantiate the class
2281
+ # and invoke the command. This method is used when the arguments must be parsed
2282
+ # from an array. If you are inside Ruby and want to use a Thor class, you
2283
+ # can simply initialize it:
2284
+ #
2285
+ # script = MyScript.new(args, options, config)
2286
+ # script.invoke(:command, first_arg, second_arg, third_arg)
2287
+ #
2288
+ # source://thor//lib/thor/base.rb#582
2289
+ def start(given_args = T.unsafe(nil), config = T.unsafe(nil)); end
2290
+
2291
+ # If true, option parsing is suspended as soon as an unknown option or a
2292
+ # regular argument is encountered. All remaining arguments are passed to
2293
+ # the command as regular arguments.
2294
+ #
2295
+ # @return [Boolean]
2296
+ #
2297
+ # source://thor//lib/thor/base.rb#201
2298
+ def stop_on_unknown_option?(command_name); end
2299
+
2300
+ # source://thor//lib/thor/base.rb#218
2301
+ def strict_args_position; end
2302
+
2303
+ # If you want only strict string args (useful when cascading thor classes),
2304
+ # call strict_args_position! This is disabled by default to allow dynamic
2305
+ # invocations.
2306
+ #
2307
+ # source://thor//lib/thor/base.rb#214
2308
+ def strict_args_position!; end
2309
+
2310
+ # @return [Boolean]
2311
+ #
2312
+ # source://thor//lib/thor/base.rb#222
2313
+ def strict_args_position?(config); end
2314
+
2315
+ # Returns the commands for this Thor class.
2316
+ #
2317
+ # ==== Returns
2318
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
2319
+ # objects as values.
2320
+ #
2321
+ # source://thor//lib/thor/base.rb#471
2322
+ def tasks; end
2323
+
2324
+ protected
2325
+
2326
+ # SIGNATURE: Sets the baseclass. This is where the superclass lookup
2327
+ # finishes.
2328
+ #
2329
+ # source://thor//lib/thor/base.rb#777
2330
+ def baseclass; end
2331
+
2332
+ # The basename of the program invoking the thor class.
2333
+ #
2334
+ # source://thor//lib/thor/base.rb#771
2335
+ def basename; end
2336
+
2337
+ # Build an option and adds it to the given scope.
2338
+ #
2339
+ # ==== Parameters
2340
+ # name<Symbol>:: The name of the argument.
2341
+ # options<Hash>:: Described in both class_option and method_option.
2342
+ # scope<Hash>:: Options hash that is being built up
2343
+ #
2344
+ # source://thor//lib/thor/base.rb#688
2345
+ def build_option(name, options, scope); end
2346
+
2347
+ # Receives a hash of options, parse them and add to the scope. This is a
2348
+ # fast way to set a bunch of options:
2349
+ #
2350
+ # build_options :foo => true, :bar => :required, :baz => :string
2351
+ #
2352
+ # ==== Parameters
2353
+ # Hash[Symbol => Object]
2354
+ #
2355
+ # source://thor//lib/thor/base.rb#699
2356
+ def build_options(options, scope); end
2357
+
2358
+ # Get target(method_options or class_options) options
2359
+ # of before and after by block evaluation.
2360
+ #
2361
+ # source://thor//lib/thor/base.rb#808
2362
+ def built_option_names(target, opt = T.unsafe(nil), &block); end
2363
+
2364
+ # Prints the class options per group. If an option does not belong to
2365
+ # any group, it's printed as Class option.
2366
+ #
2367
+ # source://thor//lib/thor/base.rb#638
2368
+ def class_options_help(shell, groups = T.unsafe(nil)); end
2369
+
2370
+ # Get command scope member by name.
2371
+ #
2372
+ # source://thor//lib/thor/base.rb#816
2373
+ def command_scope_member(name, options = T.unsafe(nil)); end
2374
+
2375
+ # SIGNATURE: Creates a new command if valid_command? is true. This method is
2376
+ # called when a new method is added to the class.
2377
+ #
2378
+ # source://thor//lib/thor/base.rb#782
2379
+ def create_command(meth); end
2380
+
2381
+ # SIGNATURE: Creates a new command if valid_command? is true. This method is
2382
+ # called when a new method is added to the class.
2383
+ #
2384
+ # source://thor//lib/thor/base.rb#782
2385
+ def create_task(meth); end
2386
+
2387
+ # SIGNATURE: The hook invoked by start.
2388
+ #
2389
+ # @raise [NotImplementedError]
2390
+ #
2391
+ # source://thor//lib/thor/base.rb#792
2392
+ def dispatch(command, given_args, given_opts, config); end
2393
+
2394
+ # Finds a command with the given name. If the command belongs to the current
2395
+ # class, just return it, otherwise dup it and add the fresh copy to the
2396
+ # current command hash.
2397
+ #
2398
+ # source://thor//lib/thor/base.rb#708
2399
+ def find_and_refresh_command(name); end
2400
+
2401
+ # Finds a command with the given name. If the command belongs to the current
2402
+ # class, just return it, otherwise dup it and add the fresh copy to the
2403
+ # current command hash.
2404
+ #
2405
+ # source://thor//lib/thor/base.rb#708
2406
+ def find_and_refresh_task(name); end
2407
+
2408
+ # Retrieves a value from superclass. If it reaches the baseclass,
2409
+ # returns default.
2410
+ #
2411
+ # source://thor//lib/thor/base.rb#749
2412
+ def from_superclass(method, default = T.unsafe(nil)); end
2413
+
2414
+ # Every time someone inherits from a Thor class, register the klass
2415
+ # and file into baseclass.
2416
+ #
2417
+ # source://thor//lib/thor/base.rb#721
2418
+ def inherited(klass); end
2419
+
2420
+ # SIGNATURE: Defines behavior when the initialize method is added to the
2421
+ # class.
2422
+ #
2423
+ # source://thor//lib/thor/base.rb#788
2424
+ def initialize_added; end
2425
+
2426
+ # Raises an error if the word given is a Thor reserved word.
2427
+ #
2428
+ # @return [Boolean]
2429
+ #
2430
+ # source://thor//lib/thor/base.rb#677
2431
+ def is_thor_reserved_word?(word, type); end
2432
+
2433
+ # Fire this callback whenever a method is added. Added methods are
2434
+ # tracked as commands by invoking the create_command method.
2435
+ #
2436
+ # source://thor//lib/thor/base.rb#729
2437
+ def method_added(meth); end
2438
+
2439
+ # Receives a set of options and print them.
2440
+ #
2441
+ # source://thor//lib/thor/base.rb#656
2442
+ def print_options(shell, options, group_name = T.unsafe(nil)); end
2443
+
2444
+ # Register a relation of options for target(method_option/class_option)
2445
+ # by args and block.
2446
+ #
2447
+ # source://thor//lib/thor/base.rb#798
2448
+ def register_options_relation_for(target, relation, *args, &block); end
2449
+ end
2450
+
2451
+ # source://thor//lib/thor/command.rb#2
2452
+ class Thor::Command < ::Struct
2453
+ # @return [Command] a new instance of Command
2454
+ #
2455
+ # source://thor//lib/thor/command.rb#5
2456
+ def initialize(name, description, long_description, wrap_long_description, usage, options = T.unsafe(nil), options_relation = T.unsafe(nil)); end
2457
+
2458
+ # Returns the formatted usage by injecting given required arguments
2459
+ # and required options into the given usage.
2460
+ #
2461
+ # source://thor//lib/thor/command.rb#42
2462
+ def formatted_usage(klass, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end
2463
+
2464
+ # @return [Boolean]
2465
+ #
2466
+ # source://thor//lib/thor/command.rb#15
2467
+ def hidden?; end
2468
+
2469
+ # source://thor//lib/thor/command.rb#70
2470
+ def method_at_least_one_option_names; end
2471
+
2472
+ # source://thor//lib/thor/command.rb#66
2473
+ def method_exclusive_option_names; end
2474
+
2475
+ # By default, a command invokes a method in the thor class. You can change this
2476
+ # implementation to create custom commands.
2477
+ #
2478
+ # source://thor//lib/thor/command.rb#21
2479
+ def run(instance, args = T.unsafe(nil)); end
2480
+
2481
+ protected
2482
+
2483
+ # @return [Boolean]
2484
+ #
2485
+ # source://thor//lib/thor/command.rb#114
2486
+ def handle_argument_error?(instance, error, caller); end
2487
+
2488
+ # @return [Boolean]
2489
+ #
2490
+ # source://thor//lib/thor/command.rb#121
2491
+ def handle_no_method_error?(instance, error, caller); end
2492
+
2493
+ # @return [Boolean]
2494
+ #
2495
+ # source://thor//lib/thor/command.rb#104
2496
+ def local_method?(instance, name); end
2497
+
2498
+ # @return [Boolean]
2499
+ #
2500
+ # source://thor//lib/thor/command.rb#87
2501
+ def not_debugging?(instance); end
2502
+
2503
+ # @return [Boolean]
2504
+ #
2505
+ # source://thor//lib/thor/command.rb#100
2506
+ def private_method?(instance); end
2507
+
2508
+ # Given a target, checks if this class name is a public method.
2509
+ #
2510
+ # @return [Boolean]
2511
+ #
2512
+ # source://thor//lib/thor/command.rb#96
2513
+ def public_method?(instance); end
2514
+
2515
+ # Add usage with required arguments
2516
+ #
2517
+ # source://thor//lib/thor/command.rb#77
2518
+ def required_arguments_for(klass, usage); end
2519
+
2520
+ # source://thor//lib/thor/command.rb#91
2521
+ def required_options; end
2522
+
2523
+ # source://thor//lib/thor/command.rb#109
2524
+ def sans_backtrace(backtrace, caller); end
2525
+
2526
+ private
2527
+
2528
+ # source://thor//lib/thor/command.rb#9
2529
+ def initialize_copy(other); end
2530
+ end
2531
+
2532
+ # source://thor//lib/thor/command.rb#3
2533
+ Thor::Command::FILE_REGEXP = T.let(T.unsafe(nil), Regexp)
2534
+
2535
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#2
2536
+ module Thor::CoreExt; end
2537
+
2538
+ # A hash with indifferent access and magic predicates.
2539
+ #
2540
+ # hash = Thor::CoreExt::HashWithIndifferentAccess.new 'foo' => 'bar', 'baz' => 'bee', 'force' => true
2541
+ #
2542
+ # hash[:foo] #=> 'bar'
2543
+ # hash['foo'] #=> 'bar'
2544
+ # hash.foo? #=> true
2545
+ #
2546
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#11
2547
+ class Thor::CoreExt::HashWithIndifferentAccess < ::Hash
2548
+ # @return [HashWithIndifferentAccess] a new instance of HashWithIndifferentAccess
2549
+ #
2550
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#12
2551
+ def initialize(hash = T.unsafe(nil)); end
2552
+
2553
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#19
2554
+ def [](key); end
2555
+
2556
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#23
2557
+ def []=(key, value); end
2558
+
2559
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#27
2560
+ def delete(key); end
2561
+
2562
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#31
2563
+ def except(*keys); end
2564
+
2565
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#37
2566
+ def fetch(key, *args); end
2567
+
2568
+ # @return [Boolean]
2569
+ #
2570
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#45
2571
+ def key?(key); end
2572
+
2573
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#53
2574
+ def merge(other); end
2575
+
2576
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#57
2577
+ def merge!(other); end
2578
+
2579
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#72
2580
+ def replace(other_hash); end
2581
+
2582
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#64
2583
+ def reverse_merge(other); end
2584
+
2585
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#68
2586
+ def reverse_merge!(other_hash); end
2587
+
2588
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#41
2589
+ def slice(*keys); end
2590
+
2591
+ # Convert to a Hash with String keys.
2592
+ #
2593
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#77
2594
+ def to_hash; end
2595
+
2596
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#49
2597
+ def values_at(*indices); end
2598
+
2599
+ protected
2600
+
2601
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#83
2602
+ def convert_key(key); end
2603
+
2604
+ # Magic predicates. For instance:
2605
+ #
2606
+ # options.force? # => !!options['force']
2607
+ # options.shebang # => "/usr/lib/local/ruby"
2608
+ # options.test_framework?(:rspec) # => options[:test_framework] == :rspec
2609
+ #
2610
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#93
2611
+ def method_missing(method, *args); end
2612
+ end
2613
+
2614
+ # source://thor//lib/thor/error.rb#3
2615
+ module Thor::Correctable
2616
+ # source://thor//lib/thor/error.rb#8
2617
+ def corrections; end
2618
+
2619
+ # source://thor//lib/thor/error.rb#4
2620
+ def to_s; end
2621
+ end
2622
+
2623
+ # A dynamic command that handles method missing scenarios.
2624
+ #
2625
+ # source://thor//lib/thor/command.rb#137
2626
+ class Thor::DynamicCommand < ::Thor::Command
2627
+ # @return [DynamicCommand] a new instance of DynamicCommand
2628
+ #
2629
+ # source://thor//lib/thor/command.rb#138
2630
+ def initialize(name, options = T.unsafe(nil)); end
2631
+
2632
+ # source://thor//lib/thor/command.rb#142
2633
+ def run(instance, args = T.unsafe(nil)); end
2634
+ end
2635
+
2636
+ # source://thor//lib/thor/command.rb#150
2637
+ Thor::DynamicTask = Thor::DynamicCommand
2638
+
2639
+ # Thor::Error is raised when it's caused by wrong usage of thor classes. Those
2640
+ # errors have their backtrace suppressed and are nicely shown to the user.
2641
+ #
2642
+ # Errors that are caused by the developer, like declaring a method which
2643
+ # overwrites a thor keyword, SHOULD NOT raise a Thor::Error. This way, we
2644
+ # ensure that developer errors are shown with full backtrace.
2645
+ #
2646
+ # source://thor//lib/thor/error.rb#20
2647
+ class Thor::Error < ::StandardError; end
2648
+
2649
+ # source://thor//lib/thor/error.rb#101
2650
+ class Thor::ExclusiveArgumentError < ::Thor::InvocationError; end
2651
+
2652
+ # Thor has a special class called Thor::Group. The main difference to Thor class
2653
+ # is that it invokes all commands at once. It also include some methods that allows
2654
+ # invocations to be done at the class method, which are not available to Thor
2655
+ # commands.
2656
+ #
2657
+ # source://thor//lib/thor/group.rb#7
2658
+ class Thor::Group
2659
+ include ::Thor::Base
2660
+ include ::Thor::Invocation
2661
+ include ::Thor::Shell
2662
+ extend ::Thor::Base::ClassMethods
2663
+ extend ::Thor::Invocation::ClassMethods
2664
+
2665
+ protected
2666
+
2667
+ # Shortcut to invoke with padding and block handling. Use internally by
2668
+ # invoke and invoke_from_option class methods.
2669
+ #
2670
+ # source://thor//lib/thor/group.rb#276
2671
+ def _invoke_for_class_method(klass, command = T.unsafe(nil), *args, &block); end
2672
+
2673
+ class << self
2674
+ # Overwrite class options help to allow invoked generators options to be
2675
+ # shown recursively when invoking a generator.
2676
+ #
2677
+ # source://thor//lib/thor/group.rb#161
2678
+ def class_options_help(shell, groups = T.unsafe(nil)); end
2679
+
2680
+ # Checks if a specified command exists.
2681
+ #
2682
+ # ==== Parameters
2683
+ # command_name<String>:: The name of the command to check for existence.
2684
+ #
2685
+ # ==== Returns
2686
+ # Boolean:: +true+ if the command exists, +false+ otherwise.
2687
+ #
2688
+ # @return [Boolean]
2689
+ #
2690
+ # source://thor//lib/thor/group.rb#221
2691
+ def command_exists?(command_name); end
2692
+
2693
+ # The description for this Thor::Group. If none is provided, but a source root
2694
+ # exists, tries to find the USAGE one folder above it, otherwise searches
2695
+ # in the superclass.
2696
+ #
2697
+ # ==== Parameters
2698
+ # description<String>:: The description for this Thor::Group.
2699
+ #
2700
+ # source://thor//lib/thor/group.rb#16
2701
+ def desc(description = T.unsafe(nil)); end
2702
+
2703
+ # Get invocations array and merge options from invocations. Those
2704
+ # options are added to group_options hash. Options that already exists
2705
+ # in base_options are not added twice.
2706
+ #
2707
+ # source://thor//lib/thor/group.rb#172
2708
+ def get_options_from_invocations(group_options, base_options); end
2709
+
2710
+ # @raise [error]
2711
+ #
2712
+ # source://thor//lib/thor/group.rb#207
2713
+ def handle_argument_error(command, error, _args, arity); end
2714
+
2715
+ # Prints help information.
2716
+ #
2717
+ # ==== Options
2718
+ # short:: When true, shows only usage.
2719
+ #
2720
+ # source://thor//lib/thor/group.rb#29
2721
+ def help(shell); end
2722
+
2723
+ # Stores invocation blocks used on invoke_from_option.
2724
+ #
2725
+ # source://thor//lib/thor/group.rb#45
2726
+ def invocation_blocks; end
2727
+
2728
+ # Stores invocations for this class merging with superclass values.
2729
+ #
2730
+ # source://thor//lib/thor/group.rb#39
2731
+ def invocations; end
2732
+
2733
+ # Invoke the given namespace or class given. It adds an instance
2734
+ # method that will invoke the klass and command. You can give a block to
2735
+ # configure how it will be invoked.
2736
+ #
2737
+ # The namespace/class given will have its options showed on the help
2738
+ # usage. Check invoke_from_option for more information.
2739
+ #
2740
+ # source://thor//lib/thor/group.rb#56
2741
+ def invoke(*names, &block); end
2742
+
2743
+ # Invoke a thor class based on the value supplied by the user to the
2744
+ # given option named "name". A class option must be created before this
2745
+ # method is invoked for each name given.
2746
+ #
2747
+ # ==== Examples
2748
+ #
2749
+ # class GemGenerator < Thor::Group
2750
+ # class_option :test_framework, :type => :string
2751
+ # invoke_from_option :test_framework
2752
+ # end
2753
+ #
2754
+ # ==== Boolean options
2755
+ #
2756
+ # In some cases, you want to invoke a thor class if some option is true or
2757
+ # false. This is automatically handled by invoke_from_option. Then the
2758
+ # option name is used to invoke the generator.
2759
+ #
2760
+ # ==== Preparing for invocation
2761
+ #
2762
+ # In some cases you want to customize how a specified hook is going to be
2763
+ # invoked. You can do that by overwriting the class method
2764
+ # prepare_for_invocation. The class method must necessarily return a klass
2765
+ # and an optional command.
2766
+ #
2767
+ # ==== Custom invocations
2768
+ #
2769
+ # You can also supply a block to customize how the option is going to be
2770
+ # invoked. The block receives two parameters, an instance of the current
2771
+ # class and the klass to be invoked.
2772
+ #
2773
+ # source://thor//lib/thor/group.rb#110
2774
+ def invoke_from_option(*names, &block); end
2775
+
2776
+ # Returns commands ready to be printed.
2777
+ #
2778
+ # source://thor//lib/thor/group.rb#199
2779
+ def printable_commands(*_arg0); end
2780
+
2781
+ # Returns commands ready to be printed.
2782
+ #
2783
+ # source://thor//lib/thor/group.rb#199
2784
+ def printable_tasks(*_arg0); end
2785
+
2786
+ # Remove a previously added invocation.
2787
+ #
2788
+ # ==== Examples
2789
+ #
2790
+ # remove_invocation :test_framework
2791
+ #
2792
+ # source://thor//lib/thor/group.rb#149
2793
+ def remove_invocation(*names); end
2794
+
2795
+ protected
2796
+
2797
+ # The banner for this class. You can customize it if you are invoking the
2798
+ # thor class by another ways which is not the Thor::Runner.
2799
+ #
2800
+ # source://thor//lib/thor/group.rb#249
2801
+ def banner; end
2802
+
2803
+ # source://thor//lib/thor/group.rb#259
2804
+ def baseclass; end
2805
+
2806
+ # source://thor//lib/thor/group.rb#263
2807
+ def create_command(meth); end
2808
+
2809
+ # source://thor//lib/thor/group.rb#263
2810
+ def create_task(meth); end
2811
+
2812
+ # The method responsible for dispatching given the args.
2813
+ #
2814
+ # @yield [instance]
2815
+ #
2816
+ # source://thor//lib/thor/group.rb#228
2817
+ def dispatch(command, given_args, given_opts, config); end
2818
+
2819
+ # Represents the whole class as a command.
2820
+ #
2821
+ # source://thor//lib/thor/group.rb#254
2822
+ def self_command; end
2823
+
2824
+ # Represents the whole class as a command.
2825
+ #
2826
+ # source://thor//lib/thor/group.rb#254
2827
+ def self_task; end
2828
+ end
2829
+ end
2830
+
2831
+ # Shortcuts for help.
2832
+ #
2833
+ # source://thor//lib/thor/base.rb#17
2834
+ Thor::HELP_MAPPINGS = T.let(T.unsafe(nil), Array)
2835
+
2836
+ # A command that is hidden in help messages but still invocable.
2837
+ #
2838
+ # source://thor//lib/thor/command.rb#129
2839
+ class Thor::HiddenCommand < ::Thor::Command
2840
+ # @return [Boolean]
2841
+ #
2842
+ # source://thor//lib/thor/command.rb#130
2843
+ def hidden?; end
2844
+ end
2845
+
2846
+ # source://thor//lib/thor/command.rb#134
2847
+ Thor::HiddenTask = Thor::HiddenCommand
2848
+
2849
+ # source://thor//lib/thor/invocation.rb#2
2850
+ module Thor::Invocation
2851
+ mixes_in_class_methods ::Thor::Invocation::ClassMethods
2852
+
2853
+ # Make initializer aware of invocations and the initialization args.
2854
+ #
2855
+ # source://thor//lib/thor/invocation.rb#23
2856
+ def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil), &block); end
2857
+
2858
+ # Make the current command chain accessible with in a Thor-(sub)command
2859
+ #
2860
+ # source://thor//lib/thor/invocation.rb#30
2861
+ def current_command_chain; end
2862
+
2863
+ # Receives a name and invokes it. The name can be a string (either "command" or
2864
+ # "namespace:command"), a Thor::Command, a Class or a Thor instance. If the
2865
+ # command cannot be guessed by name, it can also be supplied as second argument.
2866
+ #
2867
+ # You can also supply the arguments, options and configuration values for
2868
+ # the command to be invoked, if none is given, the same values used to
2869
+ # initialize the invoker are used to initialize the invoked.
2870
+ #
2871
+ # When no name is given, it will invoke the default command of the current class.
2872
+ #
2873
+ # ==== Examples
2874
+ #
2875
+ # class A < Thor
2876
+ # def foo
2877
+ # invoke :bar
2878
+ # invoke "b:hello", ["Erik"]
2879
+ # end
2880
+ #
2881
+ # def bar
2882
+ # invoke "b:hello", ["Erik"]
2883
+ # end
2884
+ # end
2885
+ #
2886
+ # class B < Thor
2887
+ # def hello(name)
2888
+ # puts "hello #{name}"
2889
+ # end
2890
+ # end
2891
+ #
2892
+ # You can notice that the method "foo" above invokes two commands: "bar",
2893
+ # which belongs to the same class and "hello" which belongs to the class B.
2894
+ #
2895
+ # By using an invocation system you ensure that a command is invoked only once.
2896
+ # In the example above, invoking "foo" will invoke "b:hello" just once, even
2897
+ # if it's invoked later by "bar" method.
2898
+ #
2899
+ # When class A invokes class B, all arguments used on A initialization are
2900
+ # supplied to B. This allows lazy parse of options. Let's suppose you have
2901
+ # some rspec commands:
2902
+ #
2903
+ # class Rspec < Thor::Group
2904
+ # class_option :mock_framework, :type => :string, :default => :rr
2905
+ #
2906
+ # def invoke_mock_framework
2907
+ # invoke "rspec:#{options[:mock_framework]}"
2908
+ # end
2909
+ # end
2910
+ #
2911
+ # As you noticed, it invokes the given mock framework, which might have its
2912
+ # own options:
2913
+ #
2914
+ # class Rspec::RR < Thor::Group
2915
+ # class_option :style, :type => :string, :default => :mock
2916
+ # end
2917
+ #
2918
+ # Since it's not rspec concern to parse mock framework options, when RR
2919
+ # is invoked all options are parsed again, so RR can extract only the options
2920
+ # that it's going to use.
2921
+ #
2922
+ # If you want Rspec::RR to be initialized with its own set of options, you
2923
+ # have to do that explicitly:
2924
+ #
2925
+ # invoke "rspec:rr", [], :style => :foo
2926
+ #
2927
+ # Besides giving an instance, you can also give a class to invoke:
2928
+ #
2929
+ # invoke Rspec::RR, [], :style => :foo
2930
+ #
2931
+ # source://thor//lib/thor/invocation.rb#102
2932
+ def invoke(name = T.unsafe(nil), *args); end
2933
+
2934
+ # Invoke all commands for the current instance.
2935
+ #
2936
+ # source://thor//lib/thor/invocation.rb#133
2937
+ def invoke_all; end
2938
+
2939
+ # Invoke the given command if the given args.
2940
+ #
2941
+ # source://thor//lib/thor/invocation.rb#122
2942
+ def invoke_command(command, *args); end
2943
+
2944
+ # Invoke the given command if the given args.
2945
+ #
2946
+ # source://thor//lib/thor/invocation.rb#122
2947
+ def invoke_task(command, *args); end
2948
+
2949
+ # Invokes using shell padding.
2950
+ #
2951
+ # source://thor//lib/thor/invocation.rb#138
2952
+ def invoke_with_padding(*args); end
2953
+
2954
+ protected
2955
+
2956
+ # Initialize klass using values stored in the @_initializer.
2957
+ #
2958
+ # source://thor//lib/thor/invocation.rb#166
2959
+ def _parse_initialization_options(args, opts, config); end
2960
+
2961
+ # This method simply retrieves the class and command to be invoked.
2962
+ # If the name is nil or the given name is a command in the current class,
2963
+ # use the given name and return self as class. Otherwise, call
2964
+ # prepare_for_invocation in the current class.
2965
+ #
2966
+ # source://thor//lib/thor/invocation.rb#153
2967
+ def _retrieve_class_and_command(name, sent_command = T.unsafe(nil)); end
2968
+
2969
+ # This method simply retrieves the class and command to be invoked.
2970
+ # If the name is nil or the given name is a command in the current class,
2971
+ # use the given name and return self as class. Otherwise, call
2972
+ # prepare_for_invocation in the current class.
2973
+ #
2974
+ # source://thor//lib/thor/invocation.rb#153
2975
+ def _retrieve_class_and_task(name, sent_command = T.unsafe(nil)); end
2976
+
2977
+ # Configuration values that are shared between invocations.
2978
+ #
2979
+ # source://thor//lib/thor/invocation.rb#145
2980
+ def _shared_configuration; end
2981
+
2982
+ class << self
2983
+ # source://thor//lib/thor/invocation.rb#3
2984
+ def included(base); end
2985
+ end
2986
+ end
2987
+
2988
+ # source://thor//lib/thor/invocation.rb#8
2989
+ module Thor::Invocation::ClassMethods
2990
+ # This method is responsible for receiving a name and find the proper
2991
+ # class and command for it. The key is an optional parameter which is
2992
+ # available only in class methods invocations (i.e. in Thor::Group).
2993
+ #
2994
+ # source://thor//lib/thor/invocation.rb#12
2995
+ def prepare_for_invocation(key, name); end
2996
+ end
2997
+
2998
+ # Raised when a command was found, but not invoked properly.
2999
+ #
3000
+ # source://thor//lib/thor/error.rb#62
3001
+ class Thor::InvocationError < ::Thor::Error; end
3002
+
3003
+ # source://thor//lib/thor/line_editor/basic.rb#2
3004
+ module Thor::LineEditor
3005
+ class << self
3006
+ # source://thor//lib/thor/line_editor.rb#10
3007
+ def best_available; end
3008
+
3009
+ # source://thor//lib/thor/line_editor.rb#6
3010
+ def readline(prompt, options = T.unsafe(nil)); end
3011
+ end
3012
+ end
3013
+
3014
+ # source://thor//lib/thor/line_editor/basic.rb#3
3015
+ class Thor::LineEditor::Basic
3016
+ # @return [Basic] a new instance of Basic
3017
+ #
3018
+ # source://thor//lib/thor/line_editor/basic.rb#10
3019
+ def initialize(prompt, options); end
3020
+
3021
+ # Returns the value of attribute options.
3022
+ #
3023
+ # source://thor//lib/thor/line_editor/basic.rb#4
3024
+ def options; end
3025
+
3026
+ # Returns the value of attribute prompt.
3027
+ #
3028
+ # source://thor//lib/thor/line_editor/basic.rb#4
3029
+ def prompt; end
3030
+
3031
+ # source://thor//lib/thor/line_editor/basic.rb#15
3032
+ def readline; end
3033
+
3034
+ private
3035
+
3036
+ # @return [Boolean]
3037
+ #
3038
+ # source://thor//lib/thor/line_editor/basic.rb#32
3039
+ def echo?; end
3040
+
3041
+ # source://thor//lib/thor/line_editor/basic.rb#22
3042
+ def get_input; end
3043
+
3044
+ class << self
3045
+ # @return [Boolean]
3046
+ #
3047
+ # source://thor//lib/thor/line_editor/basic.rb#6
3048
+ def available?; end
3049
+ end
3050
+ end
3051
+
3052
+ # source://thor//lib/thor/line_editor/readline.rb#3
3053
+ class Thor::LineEditor::Readline < ::Thor::LineEditor::Basic
3054
+ # source://thor//lib/thor/line_editor/readline.rb#13
3055
+ def readline; end
3056
+
3057
+ private
3058
+
3059
+ # @return [Boolean]
3060
+ #
3061
+ # source://thor//lib/thor/line_editor/readline.rb#28
3062
+ def add_to_history?; end
3063
+
3064
+ # source://thor//lib/thor/line_editor/readline.rb#42
3065
+ def completion_options; end
3066
+
3067
+ # source://thor//lib/thor/line_editor/readline.rb#32
3068
+ def completion_proc; end
3069
+
3070
+ # @return [Boolean]
3071
+ #
3072
+ # source://thor//lib/thor/line_editor/readline.rb#46
3073
+ def use_path_completion?; end
3074
+
3075
+ class << self
3076
+ # @return [Boolean]
3077
+ #
3078
+ # source://thor//lib/thor/line_editor/readline.rb#4
3079
+ def available?; end
3080
+ end
3081
+ end
3082
+
3083
+ # source://thor//lib/thor/line_editor/readline.rb#50
3084
+ class Thor::LineEditor::Readline::PathCompletion
3085
+ # @return [PathCompletion] a new instance of PathCompletion
3086
+ #
3087
+ # source://thor//lib/thor/line_editor/readline.rb#54
3088
+ def initialize(text); end
3089
+
3090
+ # source://thor//lib/thor/line_editor/readline.rb#58
3091
+ def matches; end
3092
+
3093
+ private
3094
+
3095
+ # source://thor//lib/thor/line_editor/readline.rb#68
3096
+ def absolute_matches; end
3097
+
3098
+ # source://thor//lib/thor/line_editor/readline.rb#82
3099
+ def base_path; end
3100
+
3101
+ # source://thor//lib/thor/line_editor/readline.rb#78
3102
+ def glob_pattern; end
3103
+
3104
+ # source://thor//lib/thor/line_editor/readline.rb#64
3105
+ def relative_matches; end
3106
+
3107
+ # Returns the value of attribute text.
3108
+ #
3109
+ # source://thor//lib/thor/line_editor/readline.rb#51
3110
+ def text; end
3111
+ end
3112
+
3113
+ # source://thor//lib/thor/error.rb#98
3114
+ class Thor::MalformattedArgumentError < ::Thor::InvocationError; end
3115
+
3116
+ # source://thor//lib/thor/nested_context.rb#2
3117
+ class Thor::NestedContext
3118
+ # @return [NestedContext] a new instance of NestedContext
3119
+ #
3120
+ # source://thor//lib/thor/nested_context.rb#3
3121
+ def initialize; end
3122
+
3123
+ # source://thor//lib/thor/nested_context.rb#7
3124
+ def enter; end
3125
+
3126
+ # @return [Boolean]
3127
+ #
3128
+ # source://thor//lib/thor/nested_context.rb#15
3129
+ def entered?; end
3130
+
3131
+ private
3132
+
3133
+ # source://thor//lib/thor/nested_context.rb#25
3134
+ def pop; end
3135
+
3136
+ # source://thor//lib/thor/nested_context.rb#21
3137
+ def push; end
3138
+ end
3139
+
3140
+ # source://thor//lib/thor/parser/option.rb#2
3141
+ class Thor::Option < ::Thor::Argument
3142
+ # @return [Option] a new instance of Option
3143
+ #
3144
+ # source://thor//lib/thor/parser/option.rb#7
3145
+ def initialize(name, options = T.unsafe(nil)); end
3146
+
3147
+ # Returns the value of attribute aliases.
3148
+ #
3149
+ # source://thor//lib/thor/parser/option.rb#3
3150
+ def aliases; end
3151
+
3152
+ # source://thor//lib/thor/parser/option.rb#99
3153
+ def aliases_for_usage; end
3154
+
3155
+ # source://thor//lib/thor/parser/option.rb#118
3156
+ def array?; end
3157
+
3158
+ # source://thor//lib/thor/parser/option.rb#118
3159
+ def boolean?; end
3160
+
3161
+ # Returns the value of attribute group.
3162
+ #
3163
+ # source://thor//lib/thor/parser/option.rb#3
3164
+ def group; end
3165
+
3166
+ # source://thor//lib/thor/parser/option.rb#118
3167
+ def hash?; end
3168
+
3169
+ # Returns the value of attribute hide.
3170
+ #
3171
+ # source://thor//lib/thor/parser/option.rb#3
3172
+ def hide; end
3173
+
3174
+ # source://thor//lib/thor/parser/option.rb#79
3175
+ def human_name; end
3176
+
3177
+ # Returns the value of attribute lazy_default.
3178
+ #
3179
+ # source://thor//lib/thor/parser/option.rb#3
3180
+ def lazy_default; end
3181
+
3182
+ # source://thor//lib/thor/parser/option.rb#118
3183
+ def numeric?; end
3184
+
3185
+ # Returns the value of attribute repeatable.
3186
+ #
3187
+ # source://thor//lib/thor/parser/option.rb#3
3188
+ def repeatable; end
3189
+
3190
+ # @return [Boolean]
3191
+ #
3192
+ # source://thor//lib/thor/parser/option.rb#107
3193
+ def show_default?; end
3194
+
3195
+ # source://thor//lib/thor/parser/option.rb#118
3196
+ def string?; end
3197
+
3198
+ # source://thor//lib/thor/parser/option.rb#75
3199
+ def switch_name; end
3200
+
3201
+ # source://thor//lib/thor/parser/option.rb#83
3202
+ def usage(padding = T.unsafe(nil)); end
3203
+
3204
+ protected
3205
+
3206
+ # source://thor//lib/thor/parser/option.rb#168
3207
+ def dasherize(str); end
3208
+
3209
+ # @return [Boolean]
3210
+ #
3211
+ # source://thor//lib/thor/parser/option.rb#160
3212
+ def dasherized?; end
3213
+
3214
+ # source://thor//lib/thor/parser/option.rb#164
3215
+ def undasherize(str); end
3216
+
3217
+ # @raise [ArgumentError]
3218
+ #
3219
+ # source://thor//lib/thor/parser/option.rb#126
3220
+ def validate!; end
3221
+
3222
+ # source://thor//lib/thor/parser/option.rb#131
3223
+ def validate_default_type!; end
3224
+
3225
+ private
3226
+
3227
+ # source://thor//lib/thor/parser/option.rb#174
3228
+ def normalize_aliases(aliases); end
3229
+
3230
+ class << self
3231
+ # This parse quick options given as method_options. It makes several
3232
+ # assumptions, but you can be more specific using the option method.
3233
+ #
3234
+ # parse :foo => "bar"
3235
+ # #=> Option foo with default value bar
3236
+ #
3237
+ # parse [:foo, :baz] => "bar"
3238
+ # #=> Option foo with default value bar and alias :baz
3239
+ #
3240
+ # parse :foo => :required
3241
+ # #=> Required option foo without default value
3242
+ #
3243
+ # parse :foo => 2
3244
+ # #=> Option foo with default value 2 and type numeric
3245
+ #
3246
+ # parse :foo => :numeric
3247
+ # #=> Option foo without default value and type numeric
3248
+ #
3249
+ # parse :foo => true
3250
+ # #=> Option foo with default value true and type boolean
3251
+ #
3252
+ # The valid types are :boolean, :numeric, :hash, :array and :string. If none
3253
+ # is given a default type is assumed. This default type accepts arguments as
3254
+ # string (--foo=value) or booleans (just --foo).
3255
+ #
3256
+ # By default all options are optional, unless :required is given.
3257
+ #
3258
+ # source://thor//lib/thor/parser/option.rb#45
3259
+ def parse(key, value); end
3260
+ end
3261
+ end
3262
+
3263
+ # source://thor//lib/thor/parser/option.rb#5
3264
+ Thor::Option::VALID_TYPES = T.let(T.unsafe(nil), Array)
3265
+
3266
+ # source://thor//lib/thor/parser/options.rb#2
3267
+ class Thor::Options < ::Thor::Arguments
3268
+ # Takes a hash of Thor::Option and a hash with defaults.
3269
+ #
3270
+ # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters
3271
+ # an unknown option or a regular argument.
3272
+ #
3273
+ # @return [Options] a new instance of Options
3274
+ #
3275
+ # source://thor//lib/thor/parser/options.rb#32
3276
+ def initialize(hash_options = T.unsafe(nil), defaults = T.unsafe(nil), stop_on_unknown = T.unsafe(nil), disable_required_check = T.unsafe(nil), relations = T.unsafe(nil)); end
3277
+
3278
+ # source://thor//lib/thor/parser/options.rb#156
3279
+ def check_at_least_one!; end
3280
+
3281
+ # source://thor//lib/thor/parser/options.rb#144
3282
+ def check_exclusive!; end
3283
+
3284
+ # @raise [UnknownArgumentError]
3285
+ #
3286
+ # source://thor//lib/thor/parser/options.rb#168
3287
+ def check_unknown!; end
3288
+
3289
+ # source://thor//lib/thor/parser/options.rb#89
3290
+ def parse(args); end
3291
+
3292
+ # source://thor//lib/thor/parser/options.rb#65
3293
+ def peek; end
3294
+
3295
+ # source://thor//lib/thor/parser/options.rb#61
3296
+ def remaining; end
3297
+
3298
+ # source://thor//lib/thor/parser/options.rb#79
3299
+ def shift; end
3300
+
3301
+ # source://thor//lib/thor/parser/options.rb#84
3302
+ def unshift(arg, is_value: T.unsafe(nil)); end
3303
+
3304
+ protected
3305
+
3306
+ # source://thor//lib/thor/parser/options.rb#189
3307
+ def assign_result!(option, result); end
3308
+
3309
+ # Check if the current value in peek is a registered switch.
3310
+ #
3311
+ # Two booleans are returned. The first is true if the current value
3312
+ # starts with a hyphen; the second is true if it is a registered switch.
3313
+ #
3314
+ # @return [Boolean]
3315
+ #
3316
+ # source://thor//lib/thor/parser/options.rb#203
3317
+ def current_is_switch?; end
3318
+
3319
+ # @return [Boolean]
3320
+ #
3321
+ # source://thor//lib/thor/parser/options.rb#215
3322
+ def current_is_switch_formatted?; end
3323
+
3324
+ # @return [Boolean]
3325
+ #
3326
+ # source://thor//lib/thor/parser/options.rb#225
3327
+ def current_is_value?; end
3328
+
3329
+ # Option names changes to swith name or human name
3330
+ #
3331
+ # source://thor//lib/thor/parser/options.rb#179
3332
+ def names_to_switch_names(names = T.unsafe(nil)); end
3333
+
3334
+ # Check if the given argument is actually a shortcut.
3335
+ #
3336
+ # source://thor//lib/thor/parser/options.rb#244
3337
+ def normalize_switch(arg); end
3338
+
3339
+ # Parse boolean values which can be given as --foo=true or --foo for true values, or
3340
+ # --foo=false, --no-foo or --skip-foo for false values.
3341
+ #
3342
+ # source://thor//lib/thor/parser/options.rb#256
3343
+ def parse_boolean(switch); end
3344
+
3345
+ # Parse the value at the peek analyzing if it requires an input or not.
3346
+ #
3347
+ # source://thor//lib/thor/parser/options.rb#274
3348
+ def parse_peek(switch, option); end
3349
+
3350
+ # @return [Boolean]
3351
+ #
3352
+ # source://thor//lib/thor/parser/options.rb#248
3353
+ def parsing_options?; end
3354
+
3355
+ # @return [Boolean]
3356
+ #
3357
+ # source://thor//lib/thor/parser/options.rb#230
3358
+ def switch?(arg); end
3359
+
3360
+ # source://thor//lib/thor/parser/options.rb#234
3361
+ def switch_option(arg); end
3362
+
3363
+ class << self
3364
+ # Receives a hash and makes it switches.
3365
+ #
3366
+ # source://thor//lib/thor/parser/options.rb#11
3367
+ def to_switches(options); end
3368
+ end
3369
+ end
3370
+
3371
+ # source://thor//lib/thor/parser/options.rb#5
3372
+ Thor::Options::EQ_RE = T.let(T.unsafe(nil), Regexp)
3373
+
3374
+ # source://thor//lib/thor/parser/options.rb#3
3375
+ Thor::Options::LONG_RE = T.let(T.unsafe(nil), Regexp)
3376
+
3377
+ # source://thor//lib/thor/parser/options.rb#8
3378
+ Thor::Options::OPTS_END = T.let(T.unsafe(nil), String)
3379
+
3380
+ # source://thor//lib/thor/parser/options.rb#7
3381
+ Thor::Options::SHORT_NUM = T.let(T.unsafe(nil), Regexp)
3382
+
3383
+ # source://thor//lib/thor/parser/options.rb#4
3384
+ Thor::Options::SHORT_RE = T.let(T.unsafe(nil), Regexp)
3385
+
3386
+ # Allow either -x -v or -xv style for single char args
3387
+ #
3388
+ # source://thor//lib/thor/parser/options.rb#6
3389
+ Thor::Options::SHORT_SQ_RE = T.let(T.unsafe(nil), Regexp)
3390
+
3391
+ # Adds a compatibility layer to your Thor classes which allows you to use
3392
+ # rake package tasks. For example, to use rspec rake tasks, one can do:
3393
+ #
3394
+ # require 'thor/rake_compat'
3395
+ # require 'rspec/core/rake_task'
3396
+ #
3397
+ # class Default < Thor
3398
+ # include Thor::RakeCompat
3399
+ #
3400
+ # RSpec::Core::RakeTask.new(:spec) do |t|
3401
+ # t.spec_opts = ['--options', './.rspec']
3402
+ # t.spec_files = FileList['spec/**/*_spec.rb']
3403
+ # end
3404
+ # end
3405
+ #
3406
+ # source://thor//lib/thor/rake_compat.rb#20
3407
+ module Thor::RakeCompat
3408
+ include ::FileUtils::StreamUtils_
3409
+ include ::FileUtils
3410
+ include ::Rake::FileUtilsExt
3411
+ include ::Rake::DSL
3412
+
3413
+ class << self
3414
+ # @private
3415
+ #
3416
+ # source://thor//lib/thor/rake_compat.rb#27
3417
+ def included(base); end
3418
+
3419
+ # source://thor//lib/thor/rake_compat.rb#23
3420
+ def rake_classes; end
3421
+ end
3422
+ end
3423
+
3424
+ # source://thor//lib/thor/error.rb#95
3425
+ class Thor::RequiredArgumentMissingError < ::Thor::InvocationError; end
3426
+
3427
+ # source://thor//lib/thor/util.rb#4
3428
+ module Thor::Sandbox; end
3429
+
3430
+ # source://thor//lib/thor/shell.rb#23
3431
+ module Thor::Shell
3432
+ # Add shell to initialize config values.
3433
+ #
3434
+ # ==== Configuration
3435
+ # shell<Object>:: An instance of the shell to be used.
3436
+ #
3437
+ # ==== Examples
3438
+ #
3439
+ # class MyScript < Thor
3440
+ # argument :first, :type => :numeric
3441
+ # end
3442
+ #
3443
+ # MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new
3444
+ #
3445
+ # source://thor//lib/thor/shell.rb#44
3446
+ def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end
3447
+
3448
+ # source://thor//lib/thor/shell.rb#59
3449
+ def ask(*args, &block); end
3450
+
3451
+ # source://thor//lib/thor/shell.rb#59
3452
+ def error(*args, &block); end
3453
+
3454
+ # source://thor//lib/thor/shell.rb#59
3455
+ def file_collision(*args, &block); end
3456
+
3457
+ # source://thor//lib/thor/shell.rb#59
3458
+ def no?(*args, &block); end
3459
+
3460
+ # source://thor//lib/thor/shell.rb#59
3461
+ def print_in_columns(*args, &block); end
3462
+
3463
+ # source://thor//lib/thor/shell.rb#59
3464
+ def print_table(*args, &block); end
3465
+
3466
+ # source://thor//lib/thor/shell.rb#59
3467
+ def print_wrapped(*args, &block); end
3468
+
3469
+ # source://thor//lib/thor/shell.rb#59
3470
+ def say(*args, &block); end
3471
+
3472
+ # source://thor//lib/thor/shell.rb#59
3473
+ def say_error(*args, &block); end
3474
+
3475
+ # source://thor//lib/thor/shell.rb#59
3476
+ def say_status(*args, &block); end
3477
+
3478
+ # source://thor//lib/thor/shell.rb#59
3479
+ def set_color(*args, &block); end
3480
+
3481
+ # Holds the shell for the given Thor instance. If no shell is given,
3482
+ # it gets a default shell from Thor::Base.shell.
3483
+ #
3484
+ # source://thor//lib/thor/shell.rb#52
3485
+ def shell; end
3486
+
3487
+ # Sets the attribute shell
3488
+ #
3489
+ # @param value the value to set the attribute shell to.
3490
+ #
3491
+ # source://thor//lib/thor/shell.rb#25
3492
+ def shell=(_arg0); end
3493
+
3494
+ # source://thor//lib/thor/shell.rb#59
3495
+ def terminal_width(*args, &block); end
3496
+
3497
+ # Yields the given block with padding.
3498
+ #
3499
+ # source://thor//lib/thor/shell.rb#66
3500
+ def with_padding; end
3501
+
3502
+ # source://thor//lib/thor/shell.rb#59
3503
+ def yes?(*args, &block); end
3504
+
3505
+ protected
3506
+
3507
+ # Allow shell to be shared between invocations.
3508
+ #
3509
+ # source://thor//lib/thor/shell.rb#77
3510
+ def _shared_configuration; end
3511
+ end
3512
+
3513
+ # source://thor//lib/thor/shell/basic.rb#7
3514
+ class Thor::Shell::Basic
3515
+ # Initialize base, mute and padding to nil.
3516
+ #
3517
+ # @return [Basic] a new instance of Basic
3518
+ #
3519
+ # source://thor//lib/thor/shell/basic.rb#13
3520
+ def initialize; end
3521
+
3522
+ # Asks something to the user and receives a response.
3523
+ #
3524
+ # If a default value is specified it will be presented to the user
3525
+ # and allows them to select that value with an empty response. This
3526
+ # option is ignored when limited answers are supplied.
3527
+ #
3528
+ # If asked to limit the correct responses, you can pass in an
3529
+ # array of acceptable answers. If one of those is not supplied,
3530
+ # they will be shown a message stating that one of those answers
3531
+ # must be given and re-asked the question.
3532
+ #
3533
+ # If asking for sensitive information, the :echo option can be set
3534
+ # to false to mask user input from $stdin.
3535
+ #
3536
+ # If the required input is a path, then set the path option to
3537
+ # true. This will enable tab completion for file paths relative
3538
+ # to the current working directory on systems that support
3539
+ # Readline.
3540
+ #
3541
+ # ==== Example
3542
+ # ask("What is your name?")
3543
+ #
3544
+ # ask("What is the planet furthest from the sun?", :default => "Neptune")
3545
+ #
3546
+ # ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
3547
+ #
3548
+ # ask("What is your password?", :echo => false)
3549
+ #
3550
+ # ask("Where should the file be saved?", :path => true)
3551
+ #
3552
+ # source://thor//lib/thor/shell/basic.rb#80
3553
+ def ask(statement, *args); end
3554
+
3555
+ # Returns the value of attribute base.
3556
+ #
3557
+ # source://thor//lib/thor/shell/basic.rb#8
3558
+ def base; end
3559
+
3560
+ # Sets the attribute base
3561
+ #
3562
+ # @param value the value to set the attribute base to.
3563
+ #
3564
+ # source://thor//lib/thor/shell/basic.rb#8
3565
+ def base=(_arg0); end
3566
+
3567
+ # Called if something goes wrong during the execution. This is used by Thor
3568
+ # internally and should not be used inside your scripts. If something went
3569
+ # wrong, you can always raise an exception. If you raise a Thor::Error, it
3570
+ # will be rescued and wrapped in the method below.
3571
+ #
3572
+ # source://thor//lib/thor/shell/basic.rb#251
3573
+ def error(statement); end
3574
+
3575
+ # Deals with file collision and returns true if the file should be
3576
+ # overwritten and false otherwise. If a block is given, it uses the block
3577
+ # response as the content for the diff.
3578
+ #
3579
+ # ==== Parameters
3580
+ # destination<String>:: the destination file to solve conflicts
3581
+ # block<Proc>:: an optional block that returns the value to be used in diff and merge
3582
+ #
3583
+ # source://thor//lib/thor/shell/basic.rb#207
3584
+ def file_collision(destination); end
3585
+
3586
+ # Sets the output padding while executing a block and resets it.
3587
+ #
3588
+ # source://thor//lib/thor/shell/basic.rb#43
3589
+ def indent(count = T.unsafe(nil)); end
3590
+
3591
+ # Mute everything that's inside given block
3592
+ #
3593
+ # source://thor//lib/thor/shell/basic.rb#22
3594
+ def mute; end
3595
+
3596
+ # Check if base is muted
3597
+ #
3598
+ # @return [Boolean]
3599
+ #
3600
+ # source://thor//lib/thor/shell/basic.rb#31
3601
+ def mute?; end
3602
+
3603
+ # Asks the user a question and returns true if the user replies "n" or
3604
+ # "no".
3605
+ #
3606
+ # @return [Boolean]
3607
+ #
3608
+ # source://thor//lib/thor/shell/basic.rb#156
3609
+ def no?(statement, color = T.unsafe(nil)); end
3610
+
3611
+ # Returns the value of attribute padding.
3612
+ #
3613
+ # source://thor//lib/thor/shell/basic.rb#9
3614
+ def padding; end
3615
+
3616
+ # Sets the output padding, not allowing less than zero values.
3617
+ #
3618
+ # source://thor//lib/thor/shell/basic.rb#37
3619
+ def padding=(value); end
3620
+
3621
+ # Prints values in columns
3622
+ #
3623
+ # ==== Parameters
3624
+ # Array[String, String, ...]
3625
+ #
3626
+ # source://thor//lib/thor/shell/basic.rb#165
3627
+ def print_in_columns(array); end
3628
+
3629
+ # Prints a table.
3630
+ #
3631
+ # ==== Parameters
3632
+ # Array[Array[String, String, ...]]
3633
+ #
3634
+ # ==== Options
3635
+ # indent<Integer>:: Indent the first column by indent value.
3636
+ # colwidth<Integer>:: Force the first column to colwidth spaces wide.
3637
+ # borders<Boolean>:: Adds ascii borders.
3638
+ #
3639
+ # source://thor//lib/thor/shell/basic.rb#180
3640
+ def print_table(array, options = T.unsafe(nil)); end
3641
+
3642
+ # Prints a long string, word-wrapping the text to the current width of the
3643
+ # terminal display. Ideal for printing heredocs.
3644
+ #
3645
+ # ==== Parameters
3646
+ # String
3647
+ #
3648
+ # ==== Options
3649
+ # indent<Integer>:: Indent each line of the printed paragraph by indent value.
3650
+ #
3651
+ # source://thor//lib/thor/shell/basic.rb#194
3652
+ def print_wrapped(message, options = T.unsafe(nil)); end
3653
+
3654
+ # Say (print) something to the user. If the sentence ends with a whitespace
3655
+ # or tab character, a new line is not appended (print + flush). Otherwise
3656
+ # are passed straight to puts (behavior got from Highline).
3657
+ #
3658
+ # ==== Example
3659
+ # say("I know you knew that.")
3660
+ #
3661
+ # source://thor//lib/thor/shell/basic.rb#98
3662
+ def say(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3663
+
3664
+ # Say (print) an error to the user. If the sentence ends with a whitespace
3665
+ # or tab character, a new line is not appended (print + flush). Otherwise
3666
+ # are passed straight to puts (behavior got from Highline).
3667
+ #
3668
+ # ==== Example
3669
+ # say_error("error: something went wrong")
3670
+ #
3671
+ # source://thor//lib/thor/shell/basic.rb#115
3672
+ def say_error(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3673
+
3674
+ # Say a status with the given color and appends the message. Since this
3675
+ # method is used frequently by actions, it allows nil or false to be given
3676
+ # in log_status, avoiding the message from being shown. If a Symbol is
3677
+ # given in log_status, it's used as the color.
3678
+ #
3679
+ # source://thor//lib/thor/shell/basic.rb#130
3680
+ def say_status(status, message, log_status = T.unsafe(nil)); end
3681
+
3682
+ # Apply color to the given string with optional bold. Disabled in the
3683
+ # Thor::Shell::Basic class.
3684
+ #
3685
+ # source://thor//lib/thor/shell/basic.rb#258
3686
+ def set_color(string, *_arg1); end
3687
+
3688
+ # Asks the user a question and returns true if the user replies "y" or
3689
+ # "yes".
3690
+ #
3691
+ # @return [Boolean]
3692
+ #
3693
+ # source://thor//lib/thor/shell/basic.rb#149
3694
+ def yes?(statement, color = T.unsafe(nil)); end
3695
+
3696
+ protected
3697
+
3698
+ # source://thor//lib/thor/shell/basic.rb#362
3699
+ def answer_match(possibilities, answer, case_insensitive); end
3700
+
3701
+ # source://thor//lib/thor/shell/basic.rb#349
3702
+ def ask_filtered(statement, color, options); end
3703
+
3704
+ # source://thor//lib/thor/shell/basic.rb#332
3705
+ def ask_simply(statement, color, options); end
3706
+
3707
+ # @return [Boolean]
3708
+ #
3709
+ # source://thor//lib/thor/shell/basic.rb#269
3710
+ def can_display_colors?; end
3711
+
3712
+ # source://thor//lib/thor/shell/basic.rb#296
3713
+ def file_collision_help(block_given); end
3714
+
3715
+ # @return [Boolean]
3716
+ #
3717
+ # source://thor//lib/thor/shell/basic.rb#286
3718
+ def is?(value); end
3719
+
3720
+ # source://thor//lib/thor/shell/basic.rb#273
3721
+ def lookup_color(color); end
3722
+
3723
+ # source://thor//lib/thor/shell/basic.rb#370
3724
+ def merge(destination, content); end
3725
+
3726
+ # source://thor//lib/thor/shell/basic.rb#379
3727
+ def merge_tool; end
3728
+
3729
+ # source://thor//lib/thor/shell/basic.rb#264
3730
+ def prepare_message(message, *color); end
3731
+
3732
+ # @return [Boolean]
3733
+ #
3734
+ # source://thor//lib/thor/shell/basic.rb#324
3735
+ def quiet?; end
3736
+
3737
+ # source://thor//lib/thor/shell/basic.rb#313
3738
+ def show_diff(destination, content); end
3739
+
3740
+ # source://thor//lib/thor/shell/basic.rb#282
3741
+ def stderr; end
3742
+
3743
+ # source://thor//lib/thor/shell/basic.rb#278
3744
+ def stdout; end
3745
+
3746
+ # @return [Boolean]
3747
+ #
3748
+ # source://thor//lib/thor/shell/basic.rb#328
3749
+ def unix?; end
3750
+ end
3751
+
3752
+ # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3753
+ # Thor::Shell::Basic to see all available methods.
3754
+ #
3755
+ # source://thor//lib/thor/shell/color.rb#9
3756
+ class Thor::Shell::Color < ::Thor::Shell::Basic
3757
+ include ::LCSDiff
3758
+
3759
+ # Set color by using a string or one of the defined constants. If a third
3760
+ # option is set to true, it also adds bold to the string. This is based
3761
+ # on Highline implementation and it automatically appends CLEAR to the end
3762
+ # of the returned String.
3763
+ #
3764
+ # Pass foreground, background and bold options to this method as
3765
+ # symbols.
3766
+ #
3767
+ # Example:
3768
+ #
3769
+ # set_color "Hi!", :red, :on_white, :bold
3770
+ #
3771
+ # The available colors are:
3772
+ #
3773
+ # :bold
3774
+ # :black
3775
+ # :red
3776
+ # :green
3777
+ # :yellow
3778
+ # :blue
3779
+ # :magenta
3780
+ # :cyan
3781
+ # :white
3782
+ # :on_black
3783
+ # :on_red
3784
+ # :on_green
3785
+ # :on_yellow
3786
+ # :on_blue
3787
+ # :on_magenta
3788
+ # :on_cyan
3789
+ # :on_white
3790
+ #
3791
+ # source://thor//lib/thor/shell/color.rb#82
3792
+ def set_color(string, *colors); end
3793
+
3794
+ protected
3795
+
3796
+ # @return [Boolean]
3797
+ #
3798
+ # source://thor//lib/thor/shell/color.rb#110
3799
+ def are_colors_disabled?; end
3800
+
3801
+ # @return [Boolean]
3802
+ #
3803
+ # source://thor//lib/thor/shell/color.rb#106
3804
+ def are_colors_supported?; end
3805
+
3806
+ # @return [Boolean]
3807
+ #
3808
+ # source://thor//lib/thor/shell/color.rb#102
3809
+ def can_display_colors?; end
3810
+ end
3811
+
3812
+ # Set the terminal's foreground ANSI color to black.
3813
+ #
3814
+ # source://thor//lib/thor/shell/color.rb#18
3815
+ Thor::Shell::Color::BLACK = T.let(T.unsafe(nil), String)
3816
+
3817
+ # Set the terminal's foreground ANSI color to blue.
3818
+ #
3819
+ # source://thor//lib/thor/shell/color.rb#26
3820
+ Thor::Shell::Color::BLUE = T.let(T.unsafe(nil), String)
3821
+
3822
+ # The start of an ANSI bold sequence.
3823
+ #
3824
+ # source://thor//lib/thor/shell/color.rb#15
3825
+ Thor::Shell::Color::BOLD = T.let(T.unsafe(nil), String)
3826
+
3827
+ # Embed in a String to clear all previous ANSI sequences.
3828
+ #
3829
+ # source://thor//lib/thor/shell/color.rb#13
3830
+ Thor::Shell::Color::CLEAR = T.let(T.unsafe(nil), String)
3831
+
3832
+ # Set the terminal's foreground ANSI color to cyan.
3833
+ #
3834
+ # source://thor//lib/thor/shell/color.rb#30
3835
+ Thor::Shell::Color::CYAN = T.let(T.unsafe(nil), String)
3836
+
3837
+ # Set the terminal's foreground ANSI color to green.
3838
+ #
3839
+ # source://thor//lib/thor/shell/color.rb#22
3840
+ Thor::Shell::Color::GREEN = T.let(T.unsafe(nil), String)
3841
+
3842
+ # Set the terminal's foreground ANSI color to magenta.
3843
+ #
3844
+ # source://thor//lib/thor/shell/color.rb#28
3845
+ Thor::Shell::Color::MAGENTA = T.let(T.unsafe(nil), String)
3846
+
3847
+ # Set the terminal's background ANSI color to black.
3848
+ #
3849
+ # source://thor//lib/thor/shell/color.rb#35
3850
+ Thor::Shell::Color::ON_BLACK = T.let(T.unsafe(nil), String)
3851
+
3852
+ # Set the terminal's background ANSI color to blue.
3853
+ #
3854
+ # source://thor//lib/thor/shell/color.rb#43
3855
+ Thor::Shell::Color::ON_BLUE = T.let(T.unsafe(nil), String)
3856
+
3857
+ # Set the terminal's background ANSI color to cyan.
3858
+ #
3859
+ # source://thor//lib/thor/shell/color.rb#47
3860
+ Thor::Shell::Color::ON_CYAN = T.let(T.unsafe(nil), String)
3861
+
3862
+ # Set the terminal's background ANSI color to green.
3863
+ #
3864
+ # source://thor//lib/thor/shell/color.rb#39
3865
+ Thor::Shell::Color::ON_GREEN = T.let(T.unsafe(nil), String)
3866
+
3867
+ # Set the terminal's background ANSI color to magenta.
3868
+ #
3869
+ # source://thor//lib/thor/shell/color.rb#45
3870
+ Thor::Shell::Color::ON_MAGENTA = T.let(T.unsafe(nil), String)
3871
+
3872
+ # Set the terminal's background ANSI color to red.
3873
+ #
3874
+ # source://thor//lib/thor/shell/color.rb#37
3875
+ Thor::Shell::Color::ON_RED = T.let(T.unsafe(nil), String)
3876
+
3877
+ # Set the terminal's background ANSI color to white.
3878
+ #
3879
+ # source://thor//lib/thor/shell/color.rb#49
3880
+ Thor::Shell::Color::ON_WHITE = T.let(T.unsafe(nil), String)
3881
+
3882
+ # Set the terminal's background ANSI color to yellow.
3883
+ #
3884
+ # source://thor//lib/thor/shell/color.rb#41
3885
+ Thor::Shell::Color::ON_YELLOW = T.let(T.unsafe(nil), String)
3886
+
3887
+ # Set the terminal's foreground ANSI color to red.
3888
+ #
3889
+ # source://thor//lib/thor/shell/color.rb#20
3890
+ Thor::Shell::Color::RED = T.let(T.unsafe(nil), String)
3891
+
3892
+ # Set the terminal's foreground ANSI color to white.
3893
+ #
3894
+ # source://thor//lib/thor/shell/color.rb#32
3895
+ Thor::Shell::Color::WHITE = T.let(T.unsafe(nil), String)
3896
+
3897
+ # Set the terminal's foreground ANSI color to yellow.
3898
+ #
3899
+ # source://thor//lib/thor/shell/color.rb#24
3900
+ Thor::Shell::Color::YELLOW = T.let(T.unsafe(nil), String)
3901
+
3902
+ # source://thor//lib/thor/shell/column_printer.rb#5
3903
+ class Thor::Shell::ColumnPrinter
3904
+ # @return [ColumnPrinter] a new instance of ColumnPrinter
3905
+ #
3906
+ # source://thor//lib/thor/shell/column_printer.rb#8
3907
+ def initialize(stdout, options = T.unsafe(nil)); end
3908
+
3909
+ # Returns the value of attribute options.
3910
+ #
3911
+ # source://thor//lib/thor/shell/column_printer.rb#6
3912
+ def options; end
3913
+
3914
+ # source://thor//lib/thor/shell/column_printer.rb#14
3915
+ def print(array); end
3916
+
3917
+ # Returns the value of attribute stdout.
3918
+ #
3919
+ # source://thor//lib/thor/shell/column_printer.rb#6
3920
+ def stdout; end
3921
+ end
3922
+
3923
+ # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3924
+ # Thor::Shell::Basic to see all available methods.
3925
+ #
3926
+ # source://thor//lib/thor/shell/html.rb#9
3927
+ class Thor::Shell::HTML < ::Thor::Shell::Basic
3928
+ include ::LCSDiff
3929
+
3930
+ # Ask something to the user and receives a response.
3931
+ #
3932
+ # ==== Example
3933
+ # ask("What is your name?")
3934
+ #
3935
+ # TODO: Implement #ask for Thor::Shell::HTML
3936
+ #
3937
+ # @raise [NotImplementedError]
3938
+ #
3939
+ # source://thor//lib/thor/shell/html.rb#73
3940
+ def ask(statement, color = T.unsafe(nil)); end
3941
+
3942
+ # Set color by using a string or one of the defined constants. If a third
3943
+ # option is set to true, it also adds bold to the string. This is based
3944
+ # on Highline implementation and it automatically appends CLEAR to the end
3945
+ # of the returned String.
3946
+ #
3947
+ # source://thor//lib/thor/shell/html.rb#54
3948
+ def set_color(string, *colors); end
3949
+
3950
+ protected
3951
+
3952
+ # @return [Boolean]
3953
+ #
3954
+ # source://thor//lib/thor/shell/html.rb#79
3955
+ def can_display_colors?; end
3956
+ end
3957
+
3958
+ # Set the terminal's foreground HTML color to black.
3959
+ #
3960
+ # source://thor//lib/thor/shell/html.rb#16
3961
+ Thor::Shell::HTML::BLACK = T.let(T.unsafe(nil), String)
3962
+
3963
+ # Set the terminal's foreground HTML color to blue.
3964
+ #
3965
+ # source://thor//lib/thor/shell/html.rb#24
3966
+ Thor::Shell::HTML::BLUE = T.let(T.unsafe(nil), String)
3967
+
3968
+ # The start of an HTML bold sequence.
3969
+ #
3970
+ # source://thor//lib/thor/shell/html.rb#13
3971
+ Thor::Shell::HTML::BOLD = T.let(T.unsafe(nil), String)
3972
+
3973
+ # Set the terminal's foreground HTML color to cyan.
3974
+ #
3975
+ # source://thor//lib/thor/shell/html.rb#28
3976
+ Thor::Shell::HTML::CYAN = T.let(T.unsafe(nil), String)
3977
+
3978
+ # Set the terminal's foreground HTML color to green.
3979
+ #
3980
+ # source://thor//lib/thor/shell/html.rb#20
3981
+ Thor::Shell::HTML::GREEN = T.let(T.unsafe(nil), String)
3982
+
3983
+ # Set the terminal's foreground HTML color to magenta.
3984
+ #
3985
+ # source://thor//lib/thor/shell/html.rb#26
3986
+ Thor::Shell::HTML::MAGENTA = T.let(T.unsafe(nil), String)
3987
+
3988
+ # Set the terminal's background HTML color to black.
3989
+ #
3990
+ # source://thor//lib/thor/shell/html.rb#33
3991
+ Thor::Shell::HTML::ON_BLACK = T.let(T.unsafe(nil), String)
3992
+
3993
+ # Set the terminal's background HTML color to blue.
3994
+ #
3995
+ # source://thor//lib/thor/shell/html.rb#41
3996
+ Thor::Shell::HTML::ON_BLUE = T.let(T.unsafe(nil), String)
3997
+
3998
+ # Set the terminal's background HTML color to cyan.
3999
+ #
4000
+ # source://thor//lib/thor/shell/html.rb#45
4001
+ Thor::Shell::HTML::ON_CYAN = T.let(T.unsafe(nil), String)
4002
+
4003
+ # Set the terminal's background HTML color to green.
4004
+ #
4005
+ # source://thor//lib/thor/shell/html.rb#37
4006
+ Thor::Shell::HTML::ON_GREEN = T.let(T.unsafe(nil), String)
4007
+
4008
+ # Set the terminal's background HTML color to magenta.
4009
+ #
4010
+ # source://thor//lib/thor/shell/html.rb#43
4011
+ Thor::Shell::HTML::ON_MAGENTA = T.let(T.unsafe(nil), String)
4012
+
4013
+ # Set the terminal's background HTML color to red.
4014
+ #
4015
+ # source://thor//lib/thor/shell/html.rb#35
4016
+ Thor::Shell::HTML::ON_RED = T.let(T.unsafe(nil), String)
4017
+
4018
+ # Set the terminal's background HTML color to white.
4019
+ #
4020
+ # source://thor//lib/thor/shell/html.rb#47
4021
+ Thor::Shell::HTML::ON_WHITE = T.let(T.unsafe(nil), String)
4022
+
4023
+ # Set the terminal's background HTML color to yellow.
4024
+ #
4025
+ # source://thor//lib/thor/shell/html.rb#39
4026
+ Thor::Shell::HTML::ON_YELLOW = T.let(T.unsafe(nil), String)
4027
+
4028
+ # Set the terminal's foreground HTML color to red.
4029
+ #
4030
+ # source://thor//lib/thor/shell/html.rb#18
4031
+ Thor::Shell::HTML::RED = T.let(T.unsafe(nil), String)
4032
+
4033
+ # Set the terminal's foreground HTML color to white.
4034
+ #
4035
+ # source://thor//lib/thor/shell/html.rb#30
4036
+ Thor::Shell::HTML::WHITE = T.let(T.unsafe(nil), String)
4037
+
4038
+ # Set the terminal's foreground HTML color to yellow.
4039
+ #
4040
+ # source://thor//lib/thor/shell/html.rb#22
4041
+ Thor::Shell::HTML::YELLOW = T.let(T.unsafe(nil), String)
4042
+
4043
+ # source://thor//lib/thor/shell.rb#24
4044
+ Thor::Shell::SHELL_DELEGATED_METHODS = T.let(T.unsafe(nil), Array)
4045
+
4046
+ # source://thor//lib/thor/shell/table_printer.rb#6
4047
+ class Thor::Shell::TablePrinter < ::Thor::Shell::ColumnPrinter
4048
+ # @return [TablePrinter] a new instance of TablePrinter
4049
+ #
4050
+ # source://thor//lib/thor/shell/table_printer.rb#9
4051
+ def initialize(stdout, options = T.unsafe(nil)); end
4052
+
4053
+ # source://thor//lib/thor/shell/table_printer.rb#18
4054
+ def print(array); end
4055
+
4056
+ private
4057
+
4058
+ # source://thor//lib/thor/shell/table_printer.rb#72
4059
+ def format_cell(column, row_size, index); end
4060
+
4061
+ # source://thor//lib/thor/shell/table_printer.rb#113
4062
+ def indentation; end
4063
+
4064
+ # source://thor//lib/thor/shell/table_printer.rb#47
4065
+ def prepare(array); end
4066
+
4067
+ # source://thor//lib/thor/shell/table_printer.rb#96
4068
+ def print_border_separator; end
4069
+
4070
+ # source://thor//lib/thor/shell/table_printer.rb#103
4071
+ def truncate(string); end
4072
+ end
4073
+
4074
+ # source://thor//lib/thor/shell/table_printer.rb#7
4075
+ Thor::Shell::TablePrinter::BORDER_SEPARATOR = T.let(T.unsafe(nil), Symbol)
4076
+
4077
+ # source://thor//lib/thor/shell/terminal.rb#3
4078
+ module Thor::Shell::Terminal
4079
+ class << self
4080
+ # source://thor//lib/thor/shell/terminal.rb#9
4081
+ def terminal_width; end
4082
+
4083
+ # @return [Boolean]
4084
+ #
4085
+ # source://thor//lib/thor/shell/terminal.rb#20
4086
+ def unix?; end
4087
+
4088
+ private
4089
+
4090
+ # Calculate the dynamic width of the terminal
4091
+ #
4092
+ # source://thor//lib/thor/shell/terminal.rb#27
4093
+ def dynamic_width; end
4094
+
4095
+ # source://thor//lib/thor/shell/terminal.rb#31
4096
+ def dynamic_width_stty; end
4097
+
4098
+ # source://thor//lib/thor/shell/terminal.rb#35
4099
+ def dynamic_width_tput; end
4100
+ end
4101
+ end
4102
+
4103
+ # source://thor//lib/thor/shell/terminal.rb#4
4104
+ Thor::Shell::Terminal::DEFAULT_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer)
4105
+
4106
+ # source://thor//lib/thor/shell/wrapped_printer.rb#6
4107
+ class Thor::Shell::WrappedPrinter < ::Thor::Shell::ColumnPrinter
4108
+ # source://thor//lib/thor/shell/wrapped_printer.rb#7
4109
+ def print(message); end
4110
+ end
4111
+
4112
+ # source://thor//lib/thor/base.rb#23
4113
+ Thor::TEMPLATE_EXTNAME = T.let(T.unsafe(nil), String)
4114
+
4115
+ # Thor methods that should not be overwritten by the user.
4116
+ #
4117
+ # source://thor//lib/thor/base.rb#20
4118
+ Thor::THOR_RESERVED_WORDS = T.let(T.unsafe(nil), Array)
4119
+
4120
+ # source://thor//lib/thor/command.rb#126
4121
+ Thor::Task = Thor::Command
4122
+
4123
+ # Raised when a command was not found.
4124
+ #
4125
+ # source://thor//lib/thor/error.rb#24
4126
+ class Thor::UndefinedCommandError < ::Thor::Error
4127
+ include ::Thor::Correctable
4128
+
4129
+ # @return [UndefinedCommandError] a new instance of UndefinedCommandError
4130
+ #
4131
+ # source://thor//lib/thor/error.rb#43
4132
+ def initialize(command, all_commands, namespace); end
4133
+
4134
+ # Returns the value of attribute all_commands.
4135
+ #
4136
+ # source://thor//lib/thor/error.rb#41
4137
+ def all_commands; end
4138
+
4139
+ # Returns the value of attribute command.
4140
+ #
4141
+ # source://thor//lib/thor/error.rb#41
4142
+ def command; end
4143
+ end
4144
+
4145
+ # source://thor//lib/thor/error.rb#25
4146
+ class Thor::UndefinedCommandError::SpellChecker
4147
+ # @return [SpellChecker] a new instance of SpellChecker
4148
+ #
4149
+ # source://thor//lib/thor/error.rb#28
4150
+ def initialize(error); end
4151
+
4152
+ # source://thor//lib/thor/error.rb#32
4153
+ def corrections; end
4154
+
4155
+ # Returns the value of attribute error.
4156
+ #
4157
+ # source://thor//lib/thor/error.rb#26
4158
+ def error; end
4159
+
4160
+ # source://thor//lib/thor/error.rb#36
4161
+ def spell_checker; end
4162
+ end
4163
+
4164
+ # source://thor//lib/thor/error.rb#55
4165
+ Thor::UndefinedTaskError = Thor::UndefinedCommandError
4166
+
4167
+ # source://thor//lib/thor/error.rb#65
4168
+ class Thor::UnknownArgumentError < ::Thor::Error
4169
+ include ::Thor::Correctable
4170
+
4171
+ # @return [UnknownArgumentError] a new instance of UnknownArgumentError
4172
+ #
4173
+ # source://thor//lib/thor/error.rb#85
4174
+ def initialize(switches, unknown); end
4175
+
4176
+ # Returns the value of attribute switches.
4177
+ #
4178
+ # source://thor//lib/thor/error.rb#83
4179
+ def switches; end
4180
+
4181
+ # Returns the value of attribute unknown.
4182
+ #
4183
+ # source://thor//lib/thor/error.rb#83
4184
+ def unknown; end
4185
+ end
4186
+
4187
+ # source://thor//lib/thor/error.rb#66
4188
+ class Thor::UnknownArgumentError::SpellChecker
4189
+ # @return [SpellChecker] a new instance of SpellChecker
4190
+ #
4191
+ # source://thor//lib/thor/error.rb#69
4192
+ def initialize(error); end
4193
+
4194
+ # source://thor//lib/thor/error.rb#73
4195
+ def corrections; end
4196
+
4197
+ # Returns the value of attribute error.
4198
+ #
4199
+ # source://thor//lib/thor/error.rb#67
4200
+ def error; end
4201
+
4202
+ # source://thor//lib/thor/error.rb#78
4203
+ def spell_checker; end
4204
+ end
4205
+
4206
+ # This module holds several utilities:
4207
+ #
4208
+ # 1) Methods to convert thor namespaces to constants and vice-versa.
4209
+ #
4210
+ # Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz"
4211
+ #
4212
+ # 2) Loading thor files and sandboxing:
4213
+ #
4214
+ # Thor::Util.load_thorfile("~/.thor/foo")
4215
+ #
4216
+ # source://thor//lib/thor/util.rb#17
4217
+ module Thor::Util
4218
+ class << self
4219
+ # Receives a string and convert it to camel case. camel_case returns CamelCase.
4220
+ #
4221
+ # ==== Parameters
4222
+ # String
4223
+ #
4224
+ # ==== Returns
4225
+ # String
4226
+ #
4227
+ # source://thor//lib/thor/util.rb#104
4228
+ def camel_case(str); end
4229
+
4230
+ # Returns a string that has had any glob characters escaped.
4231
+ # The glob characters are `* ? { } [ ]`.
4232
+ #
4233
+ # ==== Examples
4234
+ #
4235
+ # Thor::Util.escape_globs('[apps]') # => '\[apps\]'
4236
+ #
4237
+ # ==== Parameters
4238
+ # String
4239
+ #
4240
+ # ==== Returns
4241
+ # String
4242
+ #
4243
+ # source://thor//lib/thor/util.rb#264
4244
+ def escape_globs(path); end
4245
+
4246
+ # Returns a string that has had any HTML characters escaped.
4247
+ #
4248
+ # ==== Examples
4249
+ #
4250
+ # Thor::Util.escape_html('<div>') # => "&lt;div&gt;"
4251
+ #
4252
+ # ==== Parameters
4253
+ # String
4254
+ #
4255
+ # ==== Returns
4256
+ # String
4257
+ #
4258
+ # source://thor//lib/thor/util.rb#280
4259
+ def escape_html(string); end
4260
+
4261
+ # Receives a namespace and search for it in the Thor::Base subclasses.
4262
+ #
4263
+ # ==== Parameters
4264
+ # namespace<String>:: The namespace to search for.
4265
+ #
4266
+ # source://thor//lib/thor/util.rb#24
4267
+ def find_by_namespace(namespace); end
4268
+
4269
+ # Receives a namespace and tries to retrieve a Thor or Thor::Group class
4270
+ # from it. It first searches for a class using the all the given namespace,
4271
+ # if it's not found, removes the highest entry and searches for the class
4272
+ # again. If found, returns the highest entry as the class name.
4273
+ #
4274
+ # ==== Examples
4275
+ #
4276
+ # class Foo::Bar < Thor
4277
+ # def baz
4278
+ # end
4279
+ # end
4280
+ #
4281
+ # class Baz::Foo < Thor::Group
4282
+ # end
4283
+ #
4284
+ # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
4285
+ # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
4286
+ # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
4287
+ #
4288
+ # ==== Parameters
4289
+ # namespace<String>
4290
+ #
4291
+ # source://thor//lib/thor/util.rb#131
4292
+ def find_class_and_command_by_namespace(namespace, fallback = T.unsafe(nil)); end
4293
+
4294
+ # Receives a namespace and tries to retrieve a Thor or Thor::Group class
4295
+ # from it. It first searches for a class using the all the given namespace,
4296
+ # if it's not found, removes the highest entry and searches for the class
4297
+ # again. If found, returns the highest entry as the class name.
4298
+ #
4299
+ # ==== Examples
4300
+ #
4301
+ # class Foo::Bar < Thor
4302
+ # def baz
4303
+ # end
4304
+ # end
4305
+ #
4306
+ # class Baz::Foo < Thor::Group
4307
+ # end
4308
+ #
4309
+ # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
4310
+ # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
4311
+ # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
4312
+ #
4313
+ # ==== Parameters
4314
+ # namespace<String>
4315
+ #
4316
+ # source://thor//lib/thor/util.rb#131
4317
+ def find_class_and_task_by_namespace(namespace, fallback = T.unsafe(nil)); end
4318
+
4319
+ # Where to look for Thor files.
4320
+ #
4321
+ # source://thor//lib/thor/util.rb#213
4322
+ def globs_for(path); end
4323
+
4324
+ # Receives a path and load the thor file in the path. The file is evaluated
4325
+ # inside the sandbox to avoid namespacing conflicts.
4326
+ #
4327
+ # source://thor//lib/thor/util.rb#153
4328
+ def load_thorfile(path, content = T.unsafe(nil), debug = T.unsafe(nil)); end
4329
+
4330
+ # Receives a constant and converts it to a Thor namespace. Since Thor
4331
+ # commands can be added to a sandbox, this method is also responsible for
4332
+ # removing the sandbox namespace.
4333
+ #
4334
+ # This method should not be used in general because it's used to deal with
4335
+ # older versions of Thor. On current versions, if you need to get the
4336
+ # namespace from a class, just call namespace on it.
4337
+ #
4338
+ # ==== Parameters
4339
+ # constant<Object>:: The constant to be converted to the thor path.
4340
+ #
4341
+ # ==== Returns
4342
+ # String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz"
4343
+ #
4344
+ # source://thor//lib/thor/util.rb#43
4345
+ def namespace_from_thor_class(constant); end
4346
+
4347
+ # Given the contents, evaluate it inside the sandbox and returns the
4348
+ # namespaces defined in the sandbox.
4349
+ #
4350
+ # ==== Parameters
4351
+ # contents<String>
4352
+ #
4353
+ # ==== Returns
4354
+ # Array[Object]
4355
+ #
4356
+ # source://thor//lib/thor/util.rb#58
4357
+ def namespaces_in_content(contents, file = T.unsafe(nil)); end
4358
+
4359
+ # Return the path to the ruby interpreter taking into account multiple
4360
+ # installations and windows extensions.
4361
+ #
4362
+ # source://thor//lib/thor/util.rb#221
4363
+ def ruby_command; end
4364
+
4365
+ # Receives a string and convert it to snake case. SnakeCase returns snake_case.
4366
+ #
4367
+ # ==== Parameters
4368
+ # String
4369
+ #
4370
+ # ==== Returns
4371
+ # String
4372
+ #
4373
+ # source://thor//lib/thor/util.rb#90
4374
+ def snake_case(str); end
4375
+
4376
+ # Returns the thor classes declared inside the given class.
4377
+ #
4378
+ # source://thor//lib/thor/util.rb#74
4379
+ def thor_classes_in(klass); end
4380
+
4381
+ # Returns the root where thor files are located, depending on the OS.
4382
+ #
4383
+ # source://thor//lib/thor/util.rb#192
4384
+ def thor_root; end
4385
+
4386
+ # Returns the files in the thor root. On Windows thor_root will be something
4387
+ # like this:
4388
+ #
4389
+ # C:\Documents and Settings\james\.thor
4390
+ #
4391
+ # If we don't #gsub the \ character, Dir.glob will fail.
4392
+ #
4393
+ # source://thor//lib/thor/util.rb#203
4394
+ def thor_root_glob; end
4395
+
4396
+ # source://thor//lib/thor/util.rb#168
4397
+ def user_home; end
4398
+ end
4399
+ end