hank 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.clodignore +32 -0
- data/.rubocop.yml +59 -0
- data/CLAUDE.md +22 -0
- data/Gemfile +11 -0
- data/LICENSE +21 -0
- data/README.md +70 -0
- data/Rakefile +17 -0
- data/bin/hank +7 -0
- data/hank.gemspec +55 -0
- data/lib/hank/cli.rb +162 -0
- data/lib/hank/file_selector.rb +204 -0
- data/lib/hank/hankfile.rb +70 -0
- data/lib/hank/path_utils.rb +47 -0
- data/lib/hank/symlink_manager.rb +94 -0
- data/lib/hank/validator.rb +65 -0
- data/lib/hank/version.rb +6 -0
- data/lib/hank.rb +25 -0
- data/sorbet/config +5 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/colorize.rbi +121 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/ansi.rbi +398 -0
- data/sorbet/rbi/gems/ansi@1.5.0.rbi +688 -0
- data/sorbet/rbi/gems/ast.rbi +49 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
- data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
- data/sorbet/rbi/gems/builder.rbi +58 -0
- data/sorbet/rbi/gems/builder@3.3.0.rbi +502 -0
- data/sorbet/rbi/gems/citrus.rbi +238 -0
- data/sorbet/rbi/gems/citrus@3.0.2.rbi +1234 -0
- data/sorbet/rbi/gems/colorize.rbi +82 -0
- data/sorbet/rbi/gems/colorize@0.8.1.rbi +152 -0
- data/sorbet/rbi/gems/curses.rbi +327 -0
- data/sorbet/rbi/gems/curses@1.4.7.rbi +894 -0
- data/sorbet/rbi/gems/diffy.rbi +56 -0
- data/sorbet/rbi/gems/diffy@3.4.3.rbi +184 -0
- data/sorbet/rbi/gems/docile.rbi +36 -0
- data/sorbet/rbi/gems/docile@1.4.1.rbi +377 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
- data/sorbet/rbi/gems/fiddle.rbi +120 -0
- data/sorbet/rbi/gems/fiddle@1.1.6.rbi +9 -0
- data/sorbet/rbi/gems/hank.rbi +15 -0
- data/sorbet/rbi/gems/json@2.10.2.rbi +2112 -0
- data/sorbet/rbi/gems/language_server-protocol.rbi +2868 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.4.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller.rbi +75 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +86 -0
- data/sorbet/rbi/gems/logger.rbi +94 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
- data/sorbet/rbi/gems/minitest-reporters.rbi +104 -0
- data/sorbet/rbi/gems/minitest-reporters@1.7.1.rbi +1018 -0
- data/sorbet/rbi/gems/minitest.rbi +440 -0
- data/sorbet/rbi/gems/minitest@5.25.5.rbi +1547 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/parallel.rbi +88 -0
- data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
- data/sorbet/rbi/gems/parser.rbi +1545 -0
- data/sorbet/rbi/gems/parser@3.3.7.4.rbi +5535 -0
- data/sorbet/rbi/gems/prism.rbi +4090 -0
- data/sorbet/rbi/gems/prism@1.4.0.rbi +41732 -0
- data/sorbet/rbi/gems/racc.rbi +41 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +160 -0
- data/sorbet/rbi/gems/rainbow.rbi +122 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
- data/sorbet/rbi/gems/rake.rbi +649 -0
- data/sorbet/rbi/gems/rake@13.2.1.rbi +3033 -0
- data/sorbet/rbi/gems/rbi@0.3.1.rbi +6599 -0
- data/sorbet/rbi/gems/rbs@3.9.2.rbi +6978 -0
- data/sorbet/rbi/gems/regexp_parser.rbi +1039 -0
- data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3795 -0
- data/sorbet/rbi/gems/rubocop-ast.rbi +1470 -0
- data/sorbet/rbi/gems/rubocop-ast@1.44.0.rbi +7716 -0
- data/sorbet/rbi/gems/rubocop.rbi +10557 -0
- data/sorbet/rbi/gems/rubocop@1.75.2.rbi +61860 -0
- data/sorbet/rbi/gems/ruby-filemagic.rbi +46 -0
- data/sorbet/rbi/gems/ruby-filemagic@0.7.3.rbi +168 -0
- data/sorbet/rbi/gems/ruby-progressbar.rbi +321 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
- data/sorbet/rbi/gems/simplecov-html.rbi +36 -0
- data/sorbet/rbi/gems/simplecov-html@0.13.1.rbi +225 -0
- data/sorbet/rbi/gems/simplecov.rbi +435 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2149 -0
- data/sorbet/rbi/gems/simplecov_json_formatter.rbi +47 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
- data/sorbet/rbi/gems/spoom@1.6.1.rbi +7274 -0
- data/sorbet/rbi/gems/tapioca@0.16.11.rbi +3628 -0
- data/sorbet/rbi/gems/thor.rbi +583 -0
- data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
- data/sorbet/rbi/gems/toml-rb.rbi +136 -0
- data/sorbet/rbi/gems/toml-rb@2.2.0.rbi +419 -0
- data/sorbet/rbi/gems/unicode-display_width.rbi +28 -0
- data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
- data/sorbet/rbi/gems/unicode-emoji.rbi +18 -0
- data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.37.rbi +18379 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +399 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
2
|
+
# srb rbi gems
|
3
|
+
|
4
|
+
# typed: true
|
5
|
+
#
|
6
|
+
# If you would like to make changes to this file, great! Please create the gem's shim here:
|
7
|
+
#
|
8
|
+
# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/diffy/all/diffy.rbi
|
9
|
+
#
|
10
|
+
# diffy-3.4.3
|
11
|
+
|
12
|
+
module Diffy
|
13
|
+
end
|
14
|
+
module Diffy::Format
|
15
|
+
def color; end
|
16
|
+
def html; end
|
17
|
+
def html_simple; end
|
18
|
+
def text; end
|
19
|
+
end
|
20
|
+
class Diffy::HtmlFormatter
|
21
|
+
def clean_line(line); end
|
22
|
+
def highlight(lines); end
|
23
|
+
def highlighted_words; end
|
24
|
+
def initialize(diff, options = nil); end
|
25
|
+
def reconstruct_characters(line_diff, type); end
|
26
|
+
def split_characters(chunk); end
|
27
|
+
def to_s; end
|
28
|
+
def wrap_line(line); end
|
29
|
+
def wrap_lines(lines); end
|
30
|
+
end
|
31
|
+
class Diffy::Diff
|
32
|
+
def diff; end
|
33
|
+
def diff_bin; end
|
34
|
+
def diff_options; end
|
35
|
+
def each; end
|
36
|
+
def each_chunk; end
|
37
|
+
def initialize(string1, string2, options = nil); end
|
38
|
+
def options; end
|
39
|
+
def self.default_format; end
|
40
|
+
def self.default_format=(arg0); end
|
41
|
+
def self.default_options; end
|
42
|
+
def self.default_options=(arg0); end
|
43
|
+
def string1; end
|
44
|
+
def string2; end
|
45
|
+
def tempfile(string); end
|
46
|
+
def to_s(format = nil); end
|
47
|
+
include Enumerable
|
48
|
+
end
|
49
|
+
class Diffy::SplitDiff
|
50
|
+
def initialize(left, right, options = nil); end
|
51
|
+
def left; end
|
52
|
+
def right; end
|
53
|
+
def split; end
|
54
|
+
def split_left; end
|
55
|
+
def split_right; end
|
56
|
+
end
|
@@ -0,0 +1,184 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `diffy` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem diffy`.
|
6
|
+
|
7
|
+
|
8
|
+
# source://diffy//lib/diffy.rb#6
|
9
|
+
module Diffy; end
|
10
|
+
|
11
|
+
# source://diffy//lib/diffy/css.rb#2
|
12
|
+
Diffy::CSS = T.let(T.unsafe(nil), String)
|
13
|
+
|
14
|
+
# source://diffy//lib/diffy/css.rb#18
|
15
|
+
Diffy::CSS_COLORBLIND_1 = T.let(T.unsafe(nil), String)
|
16
|
+
|
17
|
+
# source://diffy//lib/diffy/diff.rb#2
|
18
|
+
class Diffy::Diff
|
19
|
+
include ::Enumerable
|
20
|
+
|
21
|
+
# supported options
|
22
|
+
# +:diff+:: A cli options string passed to diff
|
23
|
+
# +:source+:: Either _strings_ or _files_. Determines whether string1
|
24
|
+
# and string2 should be interpreted as strings or file paths.
|
25
|
+
# +:include_diff_info+:: Include diff header info
|
26
|
+
# +:include_plus_and_minus_in_html+:: Show the +, -, ' ' at the
|
27
|
+
# beginning of lines in html output.
|
28
|
+
#
|
29
|
+
# @return [Diff] a new instance of Diff
|
30
|
+
#
|
31
|
+
# source://diffy//lib/diffy/diff.rb#35
|
32
|
+
def initialize(string1, string2, options = T.unsafe(nil)); end
|
33
|
+
|
34
|
+
# source://diffy//lib/diffy/diff.rb#43
|
35
|
+
def diff; end
|
36
|
+
|
37
|
+
# source://diffy//lib/diffy/diff.rb#79
|
38
|
+
def each; end
|
39
|
+
|
40
|
+
# source://diffy//lib/diffy/diff.rb#102
|
41
|
+
def each_chunk; end
|
42
|
+
|
43
|
+
# Returns the value of attribute options.
|
44
|
+
#
|
45
|
+
# source://diffy//lib/diffy/diff.rb#26
|
46
|
+
def options; end
|
47
|
+
|
48
|
+
# Returns the value of attribute string1.
|
49
|
+
#
|
50
|
+
# source://diffy//lib/diffy/diff.rb#26
|
51
|
+
def string1; end
|
52
|
+
|
53
|
+
# Returns the value of attribute string2.
|
54
|
+
#
|
55
|
+
# source://diffy//lib/diffy/diff.rb#26
|
56
|
+
def string2; end
|
57
|
+
|
58
|
+
# source://diffy//lib/diffy/diff.rb#122
|
59
|
+
def tempfile(string); end
|
60
|
+
|
61
|
+
# source://diffy//lib/diffy/diff.rb#134
|
62
|
+
def to_s(format = T.unsafe(nil)); end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
# source://diffy//lib/diffy/diff.rb#149
|
67
|
+
def diff_bin; end
|
68
|
+
|
69
|
+
# options pass to diff program
|
70
|
+
#
|
71
|
+
# source://diffy//lib/diffy/diff.rb#170
|
72
|
+
def diff_options; end
|
73
|
+
|
74
|
+
class << self
|
75
|
+
# source://diffy//lib/diffy/diff.rb#14
|
76
|
+
def default_format; end
|
77
|
+
|
78
|
+
# Sets the attribute default_format
|
79
|
+
#
|
80
|
+
# @param value the value to set the attribute default_format to.
|
81
|
+
#
|
82
|
+
# source://diffy//lib/diffy/diff.rb#13
|
83
|
+
def default_format=(_arg0); end
|
84
|
+
|
85
|
+
# source://diffy//lib/diffy/diff.rb#20
|
86
|
+
def default_options; end
|
87
|
+
|
88
|
+
# default options passed to new Diff objects
|
89
|
+
#
|
90
|
+
# source://diffy//lib/diffy/diff.rb#19
|
91
|
+
def default_options=(_arg0); end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# source://diffy//lib/diffy/diff.rb#3
|
96
|
+
Diffy::Diff::ORIGINAL_DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
97
|
+
|
98
|
+
# source://diffy//lib/diffy/format.rb#2
|
99
|
+
module Diffy::Format
|
100
|
+
# ANSI color output suitable for terminal output
|
101
|
+
#
|
102
|
+
# source://diffy//lib/diffy/format.rb#4
|
103
|
+
def color; end
|
104
|
+
|
105
|
+
# Html output which does inline highlighting of changes between two lines.
|
106
|
+
#
|
107
|
+
# source://diffy//lib/diffy/format.rb#33
|
108
|
+
def html; end
|
109
|
+
|
110
|
+
# Basic html output which does not attempt to highlight the changes
|
111
|
+
# between lines, and is more performant.
|
112
|
+
#
|
113
|
+
# source://diffy//lib/diffy/format.rb#28
|
114
|
+
def html_simple; end
|
115
|
+
|
116
|
+
# Basic text output
|
117
|
+
#
|
118
|
+
# source://diffy//lib/diffy/format.rb#22
|
119
|
+
def text; end
|
120
|
+
end
|
121
|
+
|
122
|
+
# source://diffy//lib/diffy/html_formatter.rb#2
|
123
|
+
class Diffy::HtmlFormatter
|
124
|
+
# @return [HtmlFormatter] a new instance of HtmlFormatter
|
125
|
+
#
|
126
|
+
# source://diffy//lib/diffy/html_formatter.rb#4
|
127
|
+
def initialize(diff, options = T.unsafe(nil)); end
|
128
|
+
|
129
|
+
# source://diffy//lib/diffy/html_formatter.rb#9
|
130
|
+
def to_s; end
|
131
|
+
|
132
|
+
private
|
133
|
+
|
134
|
+
# remove +/- or wrap in html
|
135
|
+
#
|
136
|
+
# source://diffy//lib/diffy/html_formatter.rb#35
|
137
|
+
def clean_line(line); end
|
138
|
+
|
139
|
+
# source://diffy//lib/diffy/html_formatter.rb#124
|
140
|
+
def highlight(lines); end
|
141
|
+
|
142
|
+
# source://diffy//lib/diffy/html_formatter.rb#51
|
143
|
+
def highlighted_words; end
|
144
|
+
|
145
|
+
# source://diffy//lib/diffy/html_formatter.rb#104
|
146
|
+
def reconstruct_characters(line_diff, type); end
|
147
|
+
|
148
|
+
# source://diffy//lib/diffy/html_formatter.rb#91
|
149
|
+
def split_characters(chunk); end
|
150
|
+
|
151
|
+
# source://diffy//lib/diffy/html_formatter.rb#18
|
152
|
+
def wrap_line(line); end
|
153
|
+
|
154
|
+
# source://diffy//lib/diffy/html_formatter.rb#43
|
155
|
+
def wrap_lines(lines); end
|
156
|
+
end
|
157
|
+
|
158
|
+
# source://diffy//lib/diffy/split_diff.rb#2
|
159
|
+
class Diffy::SplitDiff
|
160
|
+
# @return [SplitDiff] a new instance of SplitDiff
|
161
|
+
#
|
162
|
+
# source://diffy//lib/diffy/split_diff.rb#3
|
163
|
+
def initialize(left, right, options = T.unsafe(nil)); end
|
164
|
+
|
165
|
+
# source://diffy//lib/diffy/split_diff.rb#16
|
166
|
+
def left; end
|
167
|
+
|
168
|
+
# source://diffy//lib/diffy/split_diff.rb#16
|
169
|
+
def right; end
|
170
|
+
|
171
|
+
private
|
172
|
+
|
173
|
+
# source://diffy//lib/diffy/split_diff.rb#23
|
174
|
+
def split; end
|
175
|
+
|
176
|
+
# source://diffy//lib/diffy/split_diff.rb#27
|
177
|
+
def split_left; end
|
178
|
+
|
179
|
+
# source://diffy//lib/diffy/split_diff.rb#38
|
180
|
+
def split_right; end
|
181
|
+
end
|
182
|
+
|
183
|
+
# source://diffy//lib/diffy.rb#7
|
184
|
+
Diffy::WINDOWS = T.let(T.unsafe(nil), T.untyped)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
2
|
+
# srb rbi gems
|
3
|
+
|
4
|
+
# typed: true
|
5
|
+
#
|
6
|
+
# If you would like to make changes to this file, great! Please create the gem's shim here:
|
7
|
+
#
|
8
|
+
# https://github.com/sorbet/sorbet-typed/new/master?filename=lib/docile/all/docile.rbi
|
9
|
+
#
|
10
|
+
# docile-1.4.1
|
11
|
+
|
12
|
+
module Docile
|
13
|
+
def dsl_eval(dsl, *args, **, &block); end
|
14
|
+
def dsl_eval_immutable(dsl, *args, **, &block); end
|
15
|
+
def dsl_eval_with_block_return(dsl, *args, **, &block); end
|
16
|
+
def self.dsl_eval(dsl, *args, **, &block); end
|
17
|
+
def self.dsl_eval_immutable(dsl, *args, **, &block); end
|
18
|
+
def self.dsl_eval_with_block_return(dsl, *args, **, &block); end
|
19
|
+
extend Docile::Execution
|
20
|
+
end
|
21
|
+
module Docile::Execution
|
22
|
+
def exec_in_proxy_context(dsl, proxy_type, *args, **, &block); end
|
23
|
+
def self.exec_in_proxy_context(dsl, proxy_type, *args, **, &block); end
|
24
|
+
end
|
25
|
+
class Docile::FallbackContextProxy
|
26
|
+
def initialize(receiver, fallback); end
|
27
|
+
def instance_variables; end
|
28
|
+
def method_missing(method, *args, **, &block); end
|
29
|
+
end
|
30
|
+
class Docile::ChainingFallbackContextProxy < Docile::FallbackContextProxy
|
31
|
+
def method_missing(method, *args, **, &block); end
|
32
|
+
end
|
33
|
+
module Docile::BacktraceFilter
|
34
|
+
def backtrace; end
|
35
|
+
def backtrace_locations; end
|
36
|
+
end
|
@@ -0,0 +1,377 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `docile` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem docile`.
|
6
|
+
|
7
|
+
|
8
|
+
# Docile keeps your Ruby DSLs tame and well-behaved.
|
9
|
+
#
|
10
|
+
# source://docile//lib/docile/version.rb#3
|
11
|
+
module Docile
|
12
|
+
extend ::Docile::Execution
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
# Execute a block in the context of an object whose methods represent the
|
17
|
+
# commands in a DSL.
|
18
|
+
#
|
19
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
20
|
+
#
|
21
|
+
# 1. Each command mutates the state of the DSL context object
|
22
|
+
# 2. The return value of each command is ignored
|
23
|
+
# 3. The final return value is the original context object
|
24
|
+
#
|
25
|
+
# @example Use a String as a DSL
|
26
|
+
# Docile.dsl_eval("Hello, world!") do
|
27
|
+
# reverse!
|
28
|
+
# upcase!
|
29
|
+
# end
|
30
|
+
# #=> "!DLROW ,OLLEH"
|
31
|
+
# @example Use an Array as a DSL
|
32
|
+
# Docile.dsl_eval([]) do
|
33
|
+
# push 1
|
34
|
+
# push 2
|
35
|
+
# pop
|
36
|
+
# push 3
|
37
|
+
# end
|
38
|
+
# #=> [1, 3]
|
39
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
40
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
41
|
+
# @param args [Array] arguments to be passed to the block
|
42
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
43
|
+
# `dsl` context object
|
44
|
+
# @return [Object] the `dsl` context object after executing the block
|
45
|
+
#
|
46
|
+
# source://docile//lib/docile.rb#45
|
47
|
+
def dsl_eval(dsl, *args, **_arg2, &block); end
|
48
|
+
|
49
|
+
# Execute a block in the context of an immutable object whose methods,
|
50
|
+
# and the methods of their return values, represent the commands in a DSL.
|
51
|
+
#
|
52
|
+
# Use this method to execute a *functional* DSL, which means that:
|
53
|
+
#
|
54
|
+
# 1. The original DSL context object is never mutated
|
55
|
+
# 2. Each command returns the next DSL context object
|
56
|
+
# 3. The final return value is the value returned by the last command
|
57
|
+
#
|
58
|
+
# @example Use a frozen String as a DSL
|
59
|
+
# Docile.dsl_eval_immutable("I'm immutable!".freeze) do
|
60
|
+
# reverse
|
61
|
+
# upcase
|
62
|
+
# end
|
63
|
+
# #=> "!ELBATUMMI M'I"
|
64
|
+
# @example Use a Float as a DSL
|
65
|
+
# Docile.dsl_eval_immutable(84.5) do
|
66
|
+
# fdiv(2)
|
67
|
+
# floor
|
68
|
+
# end
|
69
|
+
# #=> 42
|
70
|
+
# @note Use with a *functional* DSL (commands return successor
|
71
|
+
# context objects)
|
72
|
+
# @param dsl [Object] immutable context object whose methods make up the
|
73
|
+
# initial DSL
|
74
|
+
# @param args [Array] arguments to be passed to the block
|
75
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
76
|
+
# `dsl` context object and successor return values
|
77
|
+
# @return [Object] the return value of the final command in the block
|
78
|
+
#
|
79
|
+
# source://docile//lib/docile.rb#128
|
80
|
+
def dsl_eval_immutable(dsl, *args, **_arg2, &block); end
|
81
|
+
|
82
|
+
# Execute a block in the context of an object whose methods represent the
|
83
|
+
# commands in a DSL, and return *the block's return value*.
|
84
|
+
#
|
85
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
86
|
+
#
|
87
|
+
# 1. Each command mutates the state of the DSL context object
|
88
|
+
# 2. The return value of each command is ignored
|
89
|
+
# 3. The final return value is the original context object
|
90
|
+
#
|
91
|
+
# @example Use a String as a DSL
|
92
|
+
# Docile.dsl_eval_with_block_return("Hello, world!") do
|
93
|
+
# reverse!
|
94
|
+
# upcase!
|
95
|
+
# first
|
96
|
+
# end
|
97
|
+
# #=> "!"
|
98
|
+
# @example Use an Array as a DSL
|
99
|
+
# Docile.dsl_eval_with_block_return([]) do
|
100
|
+
# push "a"
|
101
|
+
# push "b"
|
102
|
+
# pop
|
103
|
+
# push "c"
|
104
|
+
# length
|
105
|
+
# end
|
106
|
+
# #=> 2
|
107
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
108
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
109
|
+
# @param args [Array] arguments to be passed to the block
|
110
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
111
|
+
# `dsl` context object
|
112
|
+
# @return [Object] the return value from executing the block
|
113
|
+
#
|
114
|
+
# source://docile//lib/docile.rb#87
|
115
|
+
def dsl_eval_with_block_return(dsl, *args, **_arg2, &block); end
|
116
|
+
|
117
|
+
class << self
|
118
|
+
# Execute a block in the context of an object whose methods represent the
|
119
|
+
# commands in a DSL.
|
120
|
+
#
|
121
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
122
|
+
#
|
123
|
+
# 1. Each command mutates the state of the DSL context object
|
124
|
+
# 2. The return value of each command is ignored
|
125
|
+
# 3. The final return value is the original context object
|
126
|
+
#
|
127
|
+
# @example Use a String as a DSL
|
128
|
+
# Docile.dsl_eval("Hello, world!") do
|
129
|
+
# reverse!
|
130
|
+
# upcase!
|
131
|
+
# end
|
132
|
+
# #=> "!DLROW ,OLLEH"
|
133
|
+
# @example Use an Array as a DSL
|
134
|
+
# Docile.dsl_eval([]) do
|
135
|
+
# push 1
|
136
|
+
# push 2
|
137
|
+
# pop
|
138
|
+
# push 3
|
139
|
+
# end
|
140
|
+
# #=> [1, 3]
|
141
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
142
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
143
|
+
# @param args [Array] arguments to be passed to the block
|
144
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
145
|
+
# `dsl` context object
|
146
|
+
# @return [Object] the `dsl` context object after executing the block
|
147
|
+
#
|
148
|
+
# source://docile//lib/docile.rb#45
|
149
|
+
def dsl_eval(dsl, *args, **_arg2, &block); end
|
150
|
+
|
151
|
+
# Execute a block in the context of an immutable object whose methods,
|
152
|
+
# and the methods of their return values, represent the commands in a DSL.
|
153
|
+
#
|
154
|
+
# Use this method to execute a *functional* DSL, which means that:
|
155
|
+
#
|
156
|
+
# 1. The original DSL context object is never mutated
|
157
|
+
# 2. Each command returns the next DSL context object
|
158
|
+
# 3. The final return value is the value returned by the last command
|
159
|
+
#
|
160
|
+
# @example Use a frozen String as a DSL
|
161
|
+
# Docile.dsl_eval_immutable("I'm immutable!".freeze) do
|
162
|
+
# reverse
|
163
|
+
# upcase
|
164
|
+
# end
|
165
|
+
# #=> "!ELBATUMMI M'I"
|
166
|
+
# @example Use a Float as a DSL
|
167
|
+
# Docile.dsl_eval_immutable(84.5) do
|
168
|
+
# fdiv(2)
|
169
|
+
# floor
|
170
|
+
# end
|
171
|
+
# #=> 42
|
172
|
+
# @note Use with a *functional* DSL (commands return successor
|
173
|
+
# context objects)
|
174
|
+
# @param dsl [Object] immutable context object whose methods make up the
|
175
|
+
# initial DSL
|
176
|
+
# @param args [Array] arguments to be passed to the block
|
177
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
178
|
+
# `dsl` context object and successor return values
|
179
|
+
# @return [Object] the return value of the final command in the block
|
180
|
+
#
|
181
|
+
# source://docile//lib/docile.rb#128
|
182
|
+
def dsl_eval_immutable(dsl, *args, **_arg2, &block); end
|
183
|
+
|
184
|
+
# Execute a block in the context of an object whose methods represent the
|
185
|
+
# commands in a DSL, and return *the block's return value*.
|
186
|
+
#
|
187
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
188
|
+
#
|
189
|
+
# 1. Each command mutates the state of the DSL context object
|
190
|
+
# 2. The return value of each command is ignored
|
191
|
+
# 3. The final return value is the original context object
|
192
|
+
#
|
193
|
+
# @example Use a String as a DSL
|
194
|
+
# Docile.dsl_eval_with_block_return("Hello, world!") do
|
195
|
+
# reverse!
|
196
|
+
# upcase!
|
197
|
+
# first
|
198
|
+
# end
|
199
|
+
# #=> "!"
|
200
|
+
# @example Use an Array as a DSL
|
201
|
+
# Docile.dsl_eval_with_block_return([]) do
|
202
|
+
# push "a"
|
203
|
+
# push "b"
|
204
|
+
# pop
|
205
|
+
# push "c"
|
206
|
+
# length
|
207
|
+
# end
|
208
|
+
# #=> 2
|
209
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
210
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
211
|
+
# @param args [Array] arguments to be passed to the block
|
212
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
213
|
+
# `dsl` context object
|
214
|
+
# @return [Object] the return value from executing the block
|
215
|
+
#
|
216
|
+
# source://docile//lib/docile.rb#87
|
217
|
+
def dsl_eval_with_block_return(dsl, *args, **_arg2, &block); end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
# This is used to remove entries pointing to Docile's source files
|
222
|
+
# from {Exception#backtrace} and {Exception#backtrace_locations}.
|
223
|
+
#
|
224
|
+
# If {NoMethodError} is caught then the exception object will be extended
|
225
|
+
# by this module to add filter functionalities.
|
226
|
+
#
|
227
|
+
# @api private
|
228
|
+
#
|
229
|
+
# source://docile//lib/docile/backtrace_filter.rb#11
|
230
|
+
module Docile::BacktraceFilter
|
231
|
+
# @api private
|
232
|
+
#
|
233
|
+
# source://docile//lib/docile/backtrace_filter.rb#14
|
234
|
+
def backtrace; end
|
235
|
+
|
236
|
+
# @api private
|
237
|
+
#
|
238
|
+
# source://docile//lib/docile/backtrace_filter.rb#19
|
239
|
+
def backtrace_locations; end
|
240
|
+
end
|
241
|
+
|
242
|
+
# @api private
|
243
|
+
#
|
244
|
+
# source://docile//lib/docile/backtrace_filter.rb#12
|
245
|
+
Docile::BacktraceFilter::FILTER_PATTERN = T.let(T.unsafe(nil), Regexp)
|
246
|
+
|
247
|
+
# Operates in the same manner as {FallbackContextProxy}, but replacing
|
248
|
+
# the primary `receiver` object with the result of each proxied method.
|
249
|
+
#
|
250
|
+
# This is useful for implementing DSL evaluation for immutable context
|
251
|
+
# objects.
|
252
|
+
#
|
253
|
+
#
|
254
|
+
# @api private
|
255
|
+
# @see Docile.dsl_eval_immutable
|
256
|
+
#
|
257
|
+
# source://docile//lib/docile/chaining_fallback_context_proxy.rb#17
|
258
|
+
class Docile::ChainingFallbackContextProxy < ::Docile::FallbackContextProxy
|
259
|
+
# Proxy methods as in {FallbackContextProxy#method_missing}, replacing
|
260
|
+
# `receiver` with the returned value.
|
261
|
+
#
|
262
|
+
# @api private
|
263
|
+
#
|
264
|
+
# source://docile//lib/docile/chaining_fallback_context_proxy.rb#20
|
265
|
+
def method_missing(method, *args, **_arg2, &block); end
|
266
|
+
end
|
267
|
+
|
268
|
+
# A namespace for functions relating to the execution of a block against a
|
269
|
+
# proxy object.
|
270
|
+
#
|
271
|
+
# @api private
|
272
|
+
#
|
273
|
+
# source://docile//lib/docile/execution.rb#8
|
274
|
+
module Docile::Execution
|
275
|
+
private
|
276
|
+
|
277
|
+
# Execute a block in the context of an object whose methods represent the
|
278
|
+
# commands in a DSL, using a specific proxy class.
|
279
|
+
#
|
280
|
+
# @api private
|
281
|
+
# @param dsl [Object] context object whose methods make up the
|
282
|
+
# (initial) DSL
|
283
|
+
# @param proxy_type [FallbackContextProxy, ChainingFallbackContextProxy] which class to instantiate as proxy context
|
284
|
+
# @param args [Array] arguments to be passed to the block
|
285
|
+
# @param block [Proc] the block of DSL commands to be executed
|
286
|
+
# @return [Object] the return value of the block
|
287
|
+
#
|
288
|
+
# source://docile//lib/docile/execution.rb#19
|
289
|
+
def exec_in_proxy_context(dsl, proxy_type, *args, **_arg3, &block); end
|
290
|
+
|
291
|
+
class << self
|
292
|
+
# Execute a block in the context of an object whose methods represent the
|
293
|
+
# commands in a DSL, using a specific proxy class.
|
294
|
+
#
|
295
|
+
# @api private
|
296
|
+
# @param dsl [Object] context object whose methods make up the
|
297
|
+
# (initial) DSL
|
298
|
+
# @param proxy_type [FallbackContextProxy, ChainingFallbackContextProxy] which class to instantiate as proxy context
|
299
|
+
# @param args [Array] arguments to be passed to the block
|
300
|
+
# @param block [Proc] the block of DSL commands to be executed
|
301
|
+
# @return [Object] the return value of the block
|
302
|
+
#
|
303
|
+
# source://docile//lib/docile/execution.rb#19
|
304
|
+
def exec_in_proxy_context(dsl, proxy_type, *args, **_arg3, &block); end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
# A proxy object with a primary receiver as well as a secondary
|
309
|
+
# fallback receiver.
|
310
|
+
#
|
311
|
+
# Will attempt to forward all method calls first to the primary receiver,
|
312
|
+
# and then to the fallback receiver if the primary does not handle that
|
313
|
+
# method.
|
314
|
+
#
|
315
|
+
# This is useful for implementing DSL evaluation in the context of an object.
|
316
|
+
#
|
317
|
+
#
|
318
|
+
# @api private
|
319
|
+
# @see Docile.dsl_eval
|
320
|
+
#
|
321
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#20
|
322
|
+
class Docile::FallbackContextProxy
|
323
|
+
# @api private
|
324
|
+
# @param receiver [Object] the primary proxy target to which all methods
|
325
|
+
# initially will be forwarded
|
326
|
+
# @param fallback [Object] the fallback proxy target to which any methods
|
327
|
+
# not handled by `receiver` will be forwarded
|
328
|
+
# @return [FallbackContextProxy] a new instance of FallbackContextProxy
|
329
|
+
#
|
330
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#46
|
331
|
+
def initialize(receiver, fallback); end
|
332
|
+
|
333
|
+
# @api private
|
334
|
+
# @return [Array<Symbol>] Instance variable names, excluding
|
335
|
+
# {NON_PROXIED_INSTANCE_VARIABLES}
|
336
|
+
#
|
337
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#85
|
338
|
+
def instance_variables; end
|
339
|
+
|
340
|
+
# Proxy all methods, excluding {NON_PROXIED_METHODS}, first to `receiver`
|
341
|
+
# and then to `fallback` if not found.
|
342
|
+
#
|
343
|
+
# @api private
|
344
|
+
#
|
345
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#91
|
346
|
+
def method_missing(method, *args, **_arg2, &block); end
|
347
|
+
end
|
348
|
+
|
349
|
+
# The set of methods which will **not** fallback from the block's context
|
350
|
+
# to the dsl object.
|
351
|
+
#
|
352
|
+
# @api private
|
353
|
+
#
|
354
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#30
|
355
|
+
Docile::FallbackContextProxy::NON_FALLBACK_METHODS = T.let(T.unsafe(nil), Set)
|
356
|
+
|
357
|
+
# The set of instance variables which are local to this object and hidden.
|
358
|
+
# All other instance variables will be copied in and out of this object
|
359
|
+
# from the scope in which this proxy was created.
|
360
|
+
#
|
361
|
+
# @api private
|
362
|
+
#
|
363
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#35
|
364
|
+
Docile::FallbackContextProxy::NON_PROXIED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Set)
|
365
|
+
|
366
|
+
# The set of methods which will **not** be proxied, but instead answered
|
367
|
+
# by this object directly.
|
368
|
+
#
|
369
|
+
# @api private
|
370
|
+
#
|
371
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#23
|
372
|
+
Docile::FallbackContextProxy::NON_PROXIED_METHODS = T.let(T.unsafe(nil), Set)
|
373
|
+
|
374
|
+
# The current version of this library
|
375
|
+
#
|
376
|
+
# source://docile//lib/docile/version.rb#5
|
377
|
+
Docile::VERSION = T.let(T.unsafe(nil), String)
|