lunchmoney 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +7 -0
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/check_pipeline.yml +2 -2
- data/.github/workflows/ci.yml +10 -2
- data/.github/workflows/release_pipeline.yml +1 -1
- data/.mdlrc +5 -0
- data/.rubocop.yml +1 -0
- data/.simplecov +30 -0
- data/.toys/.toys.rb +1 -0
- data/.toys/coverage.rb +5 -0
- data/.toys/mdl.rb +5 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +64 -37
- data/LICENSE +1 -1
- data/README.md +7 -3
- data/lib/lunchmoney/objects/crypto.rb +6 -1
- data/lib/lunchmoney/objects/object.rb +3 -1
- data/lib/lunchmoney/version.rb +1 -1
- data/sorbet/rbi/annotations/activesupport.rbi +11 -0
- data/sorbet/rbi/gems/{activesupport@7.1.3.rbi → activesupport@7.1.3.2.rbi} +23 -23
- data/sorbet/rbi/gems/chef-utils@18.4.2.rbi +8 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +376 -0
- data/sorbet/rbi/gems/dotenv@3.1.0.rbi +300 -0
- data/sorbet/rbi/gems/{i18n@1.14.1.rbi → i18n@1.14.4.rbi} +48 -43
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +127 -0
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +3271 -0
- data/sorbet/rbi/gems/mdl@0.13.0.rbi +444 -0
- data/sorbet/rbi/gems/{minitest@5.22.2.rbi → minitest@5.22.3.rbi} +19 -18
- data/sorbet/rbi/gems/mixlib-cli@2.1.8.rbi +313 -0
- data/sorbet/rbi/gems/mixlib-config@3.0.27.rbi +580 -0
- data/sorbet/rbi/gems/mixlib-shellout@3.2.7.rbi +628 -0
- data/sorbet/rbi/gems/{prism@0.19.0.rbi → prism@0.24.0.rbi} +8266 -7109
- data/sorbet/rbi/gems/{rack@3.0.8.rbi → rack@3.0.10.rbi} +83 -83
- data/sorbet/rbi/gems/{rbi@0.1.6.rbi → rbi@0.1.9.rbi} +114 -13
- data/sorbet/rbi/gems/{rubocop-ast@1.30.0.rbi → rubocop-ast@1.31.2.rbi} +61 -50
- data/sorbet/rbi/gems/{rubocop-minitest@0.34.5.rbi → rubocop-minitest@0.35.0.rbi} +34 -0
- data/sorbet/rbi/gems/{rubocop-rails@2.23.1.rbi → rubocop-rails@2.24.1.rbi} +159 -147
- data/sorbet/rbi/gems/{rubocop-sorbet@0.7.7.rbi → rubocop-sorbet@0.8.0.rbi} +24 -42
- data/sorbet/rbi/gems/{rubocop@1.60.2.rbi → rubocop@1.62.1.rbi} +807 -646
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +216 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2148 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +238 -0
- data/sorbet/rbi/gems/{tapioca@0.12.0.rbi → tapioca@0.13.1.rbi} +83 -62
- data/sorbet/rbi/gems/{thor@1.3.0.rbi → thor@1.3.1.rbi} +89 -50
- data/sorbet/rbi/gems/tomlrb@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/{webmock@3.20.0.rbi → webmock@3.23.0.rbi} +25 -25
- data/sorbet/rbi/gems/{yard@0.9.34.rbi → yard@0.9.36.rbi} +194 -58
- data/sorbet/tapioca/require.rb +1 -0
- metadata +39 -23
- data/.DS_Store +0 -0
- data/.github/workflows/publish_gem.yml +0 -29
- data/sorbet/rbi/gems/dotenv@2.8.1.rbi +0 -234
- /data/sorbet/rbi/gems/{bigdecimal@3.1.6.rbi → bigdecimal@3.1.7.rbi} +0 -0
- /data/sorbet/rbi/gems/{drb@2.2.0.rbi → drb@2.2.1.rbi} +0 -0
- /data/sorbet/rbi/gems/{rubocop-shopify@2.14.0.rbi → rubocop-shopify@2.15.1.rbi} +0 -0
@@ -0,0 +1,376 @@
|
|
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
|
+
# Docile keeps your Ruby DSLs tame and well-behaved.
|
8
|
+
#
|
9
|
+
# source://docile//lib/docile/version.rb#3
|
10
|
+
module Docile
|
11
|
+
extend ::Docile::Execution
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
# Execute a block in the context of an object whose methods represent the
|
16
|
+
# commands in a DSL.
|
17
|
+
#
|
18
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
19
|
+
#
|
20
|
+
# 1. Each command mutates the state of the DSL context object
|
21
|
+
# 2. The return value of each command is ignored
|
22
|
+
# 3. The final return value is the original context object
|
23
|
+
#
|
24
|
+
# @example Use a String as a DSL
|
25
|
+
# Docile.dsl_eval("Hello, world!") do
|
26
|
+
# reverse!
|
27
|
+
# upcase!
|
28
|
+
# end
|
29
|
+
# #=> "!DLROW ,OLLEH"
|
30
|
+
# @example Use an Array as a DSL
|
31
|
+
# Docile.dsl_eval([]) do
|
32
|
+
# push 1
|
33
|
+
# push 2
|
34
|
+
# pop
|
35
|
+
# push 3
|
36
|
+
# end
|
37
|
+
# #=> [1, 3]
|
38
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
39
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
40
|
+
# @param args [Array] arguments to be passed to the block
|
41
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
42
|
+
# `dsl` context object
|
43
|
+
# @return [Object] the `dsl` context object after executing the block
|
44
|
+
#
|
45
|
+
# source://docile//lib/docile.rb#45
|
46
|
+
def dsl_eval(dsl, *args, **_arg2, &block); end
|
47
|
+
|
48
|
+
# Execute a block in the context of an immutable object whose methods,
|
49
|
+
# and the methods of their return values, represent the commands in a DSL.
|
50
|
+
#
|
51
|
+
# Use this method to execute a *functional* DSL, which means that:
|
52
|
+
#
|
53
|
+
# 1. The original DSL context object is never mutated
|
54
|
+
# 2. Each command returns the next DSL context object
|
55
|
+
# 3. The final return value is the value returned by the last command
|
56
|
+
#
|
57
|
+
# @example Use a frozen String as a DSL
|
58
|
+
# Docile.dsl_eval_immutable("I'm immutable!".freeze) do
|
59
|
+
# reverse
|
60
|
+
# upcase
|
61
|
+
# end
|
62
|
+
# #=> "!ELBATUMMI M'I"
|
63
|
+
# @example Use a Float as a DSL
|
64
|
+
# Docile.dsl_eval_immutable(84.5) do
|
65
|
+
# fdiv(2)
|
66
|
+
# floor
|
67
|
+
# end
|
68
|
+
# #=> 42
|
69
|
+
# @note Use with a *functional* DSL (commands return successor
|
70
|
+
# context objects)
|
71
|
+
# @param dsl [Object] immutable context object whose methods make up the
|
72
|
+
# initial DSL
|
73
|
+
# @param args [Array] arguments to be passed to the block
|
74
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
75
|
+
# `dsl` context object and successor return values
|
76
|
+
# @return [Object] the return value of the final command in the block
|
77
|
+
#
|
78
|
+
# source://docile//lib/docile.rb#128
|
79
|
+
def dsl_eval_immutable(dsl, *args, **_arg2, &block); end
|
80
|
+
|
81
|
+
# Execute a block in the context of an object whose methods represent the
|
82
|
+
# commands in a DSL, and return *the block's return value*.
|
83
|
+
#
|
84
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
85
|
+
#
|
86
|
+
# 1. Each command mutates the state of the DSL context object
|
87
|
+
# 2. The return value of each command is ignored
|
88
|
+
# 3. The final return value is the original context object
|
89
|
+
#
|
90
|
+
# @example Use a String as a DSL
|
91
|
+
# Docile.dsl_eval_with_block_return("Hello, world!") do
|
92
|
+
# reverse!
|
93
|
+
# upcase!
|
94
|
+
# first
|
95
|
+
# end
|
96
|
+
# #=> "!"
|
97
|
+
# @example Use an Array as a DSL
|
98
|
+
# Docile.dsl_eval_with_block_return([]) do
|
99
|
+
# push "a"
|
100
|
+
# push "b"
|
101
|
+
# pop
|
102
|
+
# push "c"
|
103
|
+
# length
|
104
|
+
# end
|
105
|
+
# #=> 2
|
106
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
107
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
108
|
+
# @param args [Array] arguments to be passed to the block
|
109
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
110
|
+
# `dsl` context object
|
111
|
+
# @return [Object] the return value from executing the block
|
112
|
+
#
|
113
|
+
# source://docile//lib/docile.rb#87
|
114
|
+
def dsl_eval_with_block_return(dsl, *args, **_arg2, &block); end
|
115
|
+
|
116
|
+
class << self
|
117
|
+
# Execute a block in the context of an object whose methods represent the
|
118
|
+
# commands in a DSL.
|
119
|
+
#
|
120
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
121
|
+
#
|
122
|
+
# 1. Each command mutates the state of the DSL context object
|
123
|
+
# 2. The return value of each command is ignored
|
124
|
+
# 3. The final return value is the original context object
|
125
|
+
#
|
126
|
+
# @example Use a String as a DSL
|
127
|
+
# Docile.dsl_eval("Hello, world!") do
|
128
|
+
# reverse!
|
129
|
+
# upcase!
|
130
|
+
# end
|
131
|
+
# #=> "!DLROW ,OLLEH"
|
132
|
+
# @example Use an Array as a DSL
|
133
|
+
# Docile.dsl_eval([]) do
|
134
|
+
# push 1
|
135
|
+
# push 2
|
136
|
+
# pop
|
137
|
+
# push 3
|
138
|
+
# end
|
139
|
+
# #=> [1, 3]
|
140
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
141
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
142
|
+
# @param args [Array] arguments to be passed to the block
|
143
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
144
|
+
# `dsl` context object
|
145
|
+
# @return [Object] the `dsl` context object after executing the block
|
146
|
+
#
|
147
|
+
# source://docile//lib/docile.rb#45
|
148
|
+
def dsl_eval(dsl, *args, **_arg2, &block); end
|
149
|
+
|
150
|
+
# Execute a block in the context of an immutable object whose methods,
|
151
|
+
# and the methods of their return values, represent the commands in a DSL.
|
152
|
+
#
|
153
|
+
# Use this method to execute a *functional* DSL, which means that:
|
154
|
+
#
|
155
|
+
# 1. The original DSL context object is never mutated
|
156
|
+
# 2. Each command returns the next DSL context object
|
157
|
+
# 3. The final return value is the value returned by the last command
|
158
|
+
#
|
159
|
+
# @example Use a frozen String as a DSL
|
160
|
+
# Docile.dsl_eval_immutable("I'm immutable!".freeze) do
|
161
|
+
# reverse
|
162
|
+
# upcase
|
163
|
+
# end
|
164
|
+
# #=> "!ELBATUMMI M'I"
|
165
|
+
# @example Use a Float as a DSL
|
166
|
+
# Docile.dsl_eval_immutable(84.5) do
|
167
|
+
# fdiv(2)
|
168
|
+
# floor
|
169
|
+
# end
|
170
|
+
# #=> 42
|
171
|
+
# @note Use with a *functional* DSL (commands return successor
|
172
|
+
# context objects)
|
173
|
+
# @param dsl [Object] immutable context object whose methods make up the
|
174
|
+
# initial DSL
|
175
|
+
# @param args [Array] arguments to be passed to the block
|
176
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
177
|
+
# `dsl` context object and successor return values
|
178
|
+
# @return [Object] the return value of the final command in the block
|
179
|
+
#
|
180
|
+
# source://docile//lib/docile.rb#128
|
181
|
+
def dsl_eval_immutable(dsl, *args, **_arg2, &block); end
|
182
|
+
|
183
|
+
# Execute a block in the context of an object whose methods represent the
|
184
|
+
# commands in a DSL, and return *the block's return value*.
|
185
|
+
#
|
186
|
+
# Use this method to execute an *imperative* DSL, which means that:
|
187
|
+
#
|
188
|
+
# 1. Each command mutates the state of the DSL context object
|
189
|
+
# 2. The return value of each command is ignored
|
190
|
+
# 3. The final return value is the original context object
|
191
|
+
#
|
192
|
+
# @example Use a String as a DSL
|
193
|
+
# Docile.dsl_eval_with_block_return("Hello, world!") do
|
194
|
+
# reverse!
|
195
|
+
# upcase!
|
196
|
+
# first
|
197
|
+
# end
|
198
|
+
# #=> "!"
|
199
|
+
# @example Use an Array as a DSL
|
200
|
+
# Docile.dsl_eval_with_block_return([]) do
|
201
|
+
# push "a"
|
202
|
+
# push "b"
|
203
|
+
# pop
|
204
|
+
# push "c"
|
205
|
+
# length
|
206
|
+
# end
|
207
|
+
# #=> 2
|
208
|
+
# @note Use with an *imperative* DSL (commands modify the context object)
|
209
|
+
# @param dsl [Object] context object whose methods make up the DSL
|
210
|
+
# @param args [Array] arguments to be passed to the block
|
211
|
+
# @param block [Proc] the block of DSL commands to be executed against the
|
212
|
+
# `dsl` context object
|
213
|
+
# @return [Object] the return value from executing the block
|
214
|
+
#
|
215
|
+
# source://docile//lib/docile.rb#87
|
216
|
+
def dsl_eval_with_block_return(dsl, *args, **_arg2, &block); end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
# This is used to remove entries pointing to Docile's source files
|
221
|
+
# from {Exception#backtrace} and {Exception#backtrace_locations}.
|
222
|
+
#
|
223
|
+
# If {NoMethodError} is caught then the exception object will be extended
|
224
|
+
# by this module to add filter functionalities.
|
225
|
+
#
|
226
|
+
# @api private
|
227
|
+
#
|
228
|
+
# source://docile//lib/docile/backtrace_filter.rb#11
|
229
|
+
module Docile::BacktraceFilter
|
230
|
+
# @api private
|
231
|
+
#
|
232
|
+
# source://docile//lib/docile/backtrace_filter.rb#14
|
233
|
+
def backtrace; end
|
234
|
+
|
235
|
+
# @api private
|
236
|
+
#
|
237
|
+
# source://docile//lib/docile/backtrace_filter.rb#19
|
238
|
+
def backtrace_locations; end
|
239
|
+
end
|
240
|
+
|
241
|
+
# @api private
|
242
|
+
#
|
243
|
+
# source://docile//lib/docile/backtrace_filter.rb#12
|
244
|
+
Docile::BacktraceFilter::FILTER_PATTERN = T.let(T.unsafe(nil), Regexp)
|
245
|
+
|
246
|
+
# Operates in the same manner as {FallbackContextProxy}, but replacing
|
247
|
+
# the primary `receiver` object with the result of each proxied method.
|
248
|
+
#
|
249
|
+
# This is useful for implementing DSL evaluation for immutable context
|
250
|
+
# objects.
|
251
|
+
#
|
252
|
+
#
|
253
|
+
# @api private
|
254
|
+
# @see Docile.dsl_eval_immutable
|
255
|
+
#
|
256
|
+
# source://docile//lib/docile/chaining_fallback_context_proxy.rb#17
|
257
|
+
class Docile::ChainingFallbackContextProxy < ::Docile::FallbackContextProxy
|
258
|
+
# Proxy methods as in {FallbackContextProxy#method_missing}, replacing
|
259
|
+
# `receiver` with the returned value.
|
260
|
+
#
|
261
|
+
# @api private
|
262
|
+
#
|
263
|
+
# source://docile//lib/docile/chaining_fallback_context_proxy.rb#20
|
264
|
+
def method_missing(method, *args, **_arg2, &block); end
|
265
|
+
end
|
266
|
+
|
267
|
+
# A namespace for functions relating to the execution of a block against a
|
268
|
+
# proxy object.
|
269
|
+
#
|
270
|
+
# @api private
|
271
|
+
#
|
272
|
+
# source://docile//lib/docile/execution.rb#8
|
273
|
+
module Docile::Execution
|
274
|
+
private
|
275
|
+
|
276
|
+
# Execute a block in the context of an object whose methods represent the
|
277
|
+
# commands in a DSL, using a specific proxy class.
|
278
|
+
#
|
279
|
+
# @api private
|
280
|
+
# @param dsl [Object] context object whose methods make up the
|
281
|
+
# (initial) DSL
|
282
|
+
# @param proxy_type [FallbackContextProxy, ChainingFallbackContextProxy] which class to instantiate as proxy context
|
283
|
+
# @param args [Array] arguments to be passed to the block
|
284
|
+
# @param block [Proc] the block of DSL commands to be executed
|
285
|
+
# @return [Object] the return value of the block
|
286
|
+
#
|
287
|
+
# source://docile//lib/docile/execution.rb#19
|
288
|
+
def exec_in_proxy_context(dsl, proxy_type, *args, **_arg3, &block); end
|
289
|
+
|
290
|
+
class << self
|
291
|
+
# Execute a block in the context of an object whose methods represent the
|
292
|
+
# commands in a DSL, using a specific proxy class.
|
293
|
+
#
|
294
|
+
# @api private
|
295
|
+
# @param dsl [Object] context object whose methods make up the
|
296
|
+
# (initial) DSL
|
297
|
+
# @param proxy_type [FallbackContextProxy, ChainingFallbackContextProxy] which class to instantiate as proxy context
|
298
|
+
# @param args [Array] arguments to be passed to the block
|
299
|
+
# @param block [Proc] the block of DSL commands to be executed
|
300
|
+
# @return [Object] the return value of the block
|
301
|
+
#
|
302
|
+
# source://docile//lib/docile/execution.rb#19
|
303
|
+
def exec_in_proxy_context(dsl, proxy_type, *args, **_arg3, &block); end
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
# A proxy object with a primary receiver as well as a secondary
|
308
|
+
# fallback receiver.
|
309
|
+
#
|
310
|
+
# Will attempt to forward all method calls first to the primary receiver,
|
311
|
+
# and then to the fallback receiver if the primary does not handle that
|
312
|
+
# method.
|
313
|
+
#
|
314
|
+
# This is useful for implementing DSL evaluation in the context of an object.
|
315
|
+
#
|
316
|
+
#
|
317
|
+
# @api private
|
318
|
+
# @see Docile.dsl_eval
|
319
|
+
#
|
320
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#20
|
321
|
+
class Docile::FallbackContextProxy
|
322
|
+
# @api private
|
323
|
+
# @param receiver [Object] the primary proxy target to which all methods
|
324
|
+
# initially will be forwarded
|
325
|
+
# @param fallback [Object] the fallback proxy target to which any methods
|
326
|
+
# not handled by `receiver` will be forwarded
|
327
|
+
# @return [FallbackContextProxy] a new instance of FallbackContextProxy
|
328
|
+
#
|
329
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#46
|
330
|
+
def initialize(receiver, fallback); end
|
331
|
+
|
332
|
+
# @api private
|
333
|
+
# @return [Array<Symbol>] Instance variable names, excluding
|
334
|
+
# {NON_PROXIED_INSTANCE_VARIABLES}
|
335
|
+
#
|
336
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#85
|
337
|
+
def instance_variables; end
|
338
|
+
|
339
|
+
# Proxy all methods, excluding {NON_PROXIED_METHODS}, first to `receiver`
|
340
|
+
# and then to `fallback` if not found.
|
341
|
+
#
|
342
|
+
# @api private
|
343
|
+
#
|
344
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#91
|
345
|
+
def method_missing(method, *args, **_arg2, &block); end
|
346
|
+
end
|
347
|
+
|
348
|
+
# The set of methods which will **not** fallback from the block's context
|
349
|
+
# to the dsl object.
|
350
|
+
#
|
351
|
+
# @api private
|
352
|
+
#
|
353
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#30
|
354
|
+
Docile::FallbackContextProxy::NON_FALLBACK_METHODS = T.let(T.unsafe(nil), Set)
|
355
|
+
|
356
|
+
# The set of instance variables which are local to this object and hidden.
|
357
|
+
# All other instance variables will be copied in and out of this object
|
358
|
+
# from the scope in which this proxy was created.
|
359
|
+
#
|
360
|
+
# @api private
|
361
|
+
#
|
362
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#35
|
363
|
+
Docile::FallbackContextProxy::NON_PROXIED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Set)
|
364
|
+
|
365
|
+
# The set of methods which will **not** be proxied, but instead answered
|
366
|
+
# by this object directly.
|
367
|
+
#
|
368
|
+
# @api private
|
369
|
+
#
|
370
|
+
# source://docile//lib/docile/fallback_context_proxy.rb#23
|
371
|
+
Docile::FallbackContextProxy::NON_PROXIED_METHODS = T.let(T.unsafe(nil), Set)
|
372
|
+
|
373
|
+
# The current version of this library
|
374
|
+
#
|
375
|
+
# source://docile//lib/docile/version.rb#5
|
376
|
+
Docile::VERSION = T.let(T.unsafe(nil), String)
|
@@ -0,0 +1,300 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `dotenv` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem dotenv`.
|
6
|
+
|
7
|
+
# Shim to load environment variables from `.env files into `ENV`.
|
8
|
+
#
|
9
|
+
# source://dotenv//lib/dotenv/substitutions/variable.rb#3
|
10
|
+
module Dotenv
|
11
|
+
extend ::Dotenv
|
12
|
+
|
13
|
+
# Returns the value of attribute instrumenter.
|
14
|
+
#
|
15
|
+
# source://dotenv//lib/dotenv.rb#14
|
16
|
+
def instrumenter; end
|
17
|
+
|
18
|
+
# Sets the attribute instrumenter
|
19
|
+
#
|
20
|
+
# @param value the value to set the attribute instrumenter to.
|
21
|
+
#
|
22
|
+
# source://dotenv//lib/dotenv.rb#14
|
23
|
+
def instrumenter=(_arg0); end
|
24
|
+
|
25
|
+
# Loads environment variables from one or more `.env` files. See `#parse` for more details.
|
26
|
+
#
|
27
|
+
# source://dotenv//lib/dotenv.rb#17
|
28
|
+
def load(*filenames, overwrite: T.unsafe(nil), ignore: T.unsafe(nil)); end
|
29
|
+
|
30
|
+
# Same as `#load`, but raises Errno::ENOENT if any files don't exist
|
31
|
+
#
|
32
|
+
# source://dotenv//lib/dotenv.rb#26
|
33
|
+
def load!(*filenames); end
|
34
|
+
|
35
|
+
# Modify `ENV` for the block and restore it to its previous state afterwards.
|
36
|
+
#
|
37
|
+
# Note that the block is synchronized to prevent concurrent modifications to `ENV`,
|
38
|
+
# so multiple threads will be executed serially.
|
39
|
+
#
|
40
|
+
# @param env [Hash] Hash of keys and values to set in `ENV`
|
41
|
+
#
|
42
|
+
# source://dotenv//lib/dotenv.rb#112
|
43
|
+
def modify(env = T.unsafe(nil), &block); end
|
44
|
+
|
45
|
+
# same as `#load`, but will overwrite existing values in `ENV`
|
46
|
+
#
|
47
|
+
# source://dotenv//lib/dotenv.rb#31
|
48
|
+
def overload(*filenames); end
|
49
|
+
|
50
|
+
# same as `#overwrite`, but raises Errno::ENOENT if any files don't exist
|
51
|
+
#
|
52
|
+
# source://dotenv//lib/dotenv.rb#37
|
53
|
+
def overload!(*filenames); end
|
54
|
+
|
55
|
+
# same as `#load`, but will overwrite existing values in `ENV`
|
56
|
+
#
|
57
|
+
# source://dotenv//lib/dotenv.rb#31
|
58
|
+
def overwrite(*filenames); end
|
59
|
+
|
60
|
+
# same as `#overwrite`, but raises Errno::ENOENT if any files don't exist
|
61
|
+
#
|
62
|
+
# source://dotenv//lib/dotenv.rb#37
|
63
|
+
def overwrite!(*filenames); end
|
64
|
+
|
65
|
+
# Parses the given files, yielding for each file if a block is given.
|
66
|
+
#
|
67
|
+
# @param filenames [String, Array<String>] Files to parse
|
68
|
+
# @param overwrite [Boolean] Overwrite existing `ENV` values
|
69
|
+
# @param ignore [Boolean] Ignore non-existent files
|
70
|
+
# @param block [Proc] Block to yield for each parsed `Dotenv::Environment`
|
71
|
+
# @return [Hash] parsed key/value pairs
|
72
|
+
#
|
73
|
+
# source://dotenv//lib/dotenv.rb#49
|
74
|
+
def parse(*filenames, overwrite: T.unsafe(nil), ignore: T.unsafe(nil), &block); end
|
75
|
+
|
76
|
+
# @raise [MissingKeys]
|
77
|
+
#
|
78
|
+
# source://dotenv//lib/dotenv.rb#122
|
79
|
+
def require_keys(*keys); end
|
80
|
+
|
81
|
+
# Restore `ENV` to a given state
|
82
|
+
#
|
83
|
+
# @param env [Hash] Hash of keys and values to restore, defaults to the last saved state
|
84
|
+
# @param safe [Boolean] Is it safe to modify `ENV`? Defaults to `true` in the main thread, otherwise raises an error.
|
85
|
+
#
|
86
|
+
# source://dotenv//lib/dotenv.rb#76
|
87
|
+
def restore(env = T.unsafe(nil), safe: T.unsafe(nil)); end
|
88
|
+
|
89
|
+
# Save the current `ENV` to be restored later
|
90
|
+
#
|
91
|
+
# source://dotenv//lib/dotenv.rb#66
|
92
|
+
def save; end
|
93
|
+
|
94
|
+
# Update `ENV` with the given hash of keys and values
|
95
|
+
#
|
96
|
+
# @param env [Hash] Hash of keys and values to set in `ENV`
|
97
|
+
# @param overwrite [Boolean] Overwrite existing `ENV` values
|
98
|
+
#
|
99
|
+
# source://dotenv//lib/dotenv.rb#94
|
100
|
+
def update(env = T.unsafe(nil), overwrite: T.unsafe(nil)); end
|
101
|
+
|
102
|
+
private
|
103
|
+
|
104
|
+
# source://dotenv//lib/dotenv.rb#130
|
105
|
+
def instrument(name, payload = T.unsafe(nil), &block); end
|
106
|
+
end
|
107
|
+
|
108
|
+
# A diff between multiple states of ENV.
|
109
|
+
#
|
110
|
+
# source://dotenv//lib/dotenv/diff.rb#3
|
111
|
+
class Dotenv::Diff
|
112
|
+
# Create a new diff. If given a block, the state of ENV after the block will be preserved as
|
113
|
+
# the final state for comparison. Otherwise, the current ENV will be the final state.
|
114
|
+
#
|
115
|
+
# @param a [Hash] the initial state, defaults to a snapshot of current ENV
|
116
|
+
# @param b [Hash] the final state, defaults to the current ENV
|
117
|
+
# @return [Diff] a new instance of Diff
|
118
|
+
# @yield [diff] a block to execute before recording the final state
|
119
|
+
#
|
120
|
+
# source://dotenv//lib/dotenv/diff.rb#16
|
121
|
+
def initialize(a: T.unsafe(nil), b: T.unsafe(nil), &block); end
|
122
|
+
|
123
|
+
# The initial state
|
124
|
+
#
|
125
|
+
# source://dotenv//lib/dotenv/diff.rb#5
|
126
|
+
def a; end
|
127
|
+
|
128
|
+
# Return a Hash of keys added with their new values
|
129
|
+
#
|
130
|
+
# source://dotenv//lib/dotenv/diff.rb#24
|
131
|
+
def added; end
|
132
|
+
|
133
|
+
# Returns true if any keys were added, removed, or changed
|
134
|
+
#
|
135
|
+
# @return [Boolean]
|
136
|
+
#
|
137
|
+
# source://dotenv//lib/dotenv/diff.rb#46
|
138
|
+
def any?; end
|
139
|
+
|
140
|
+
# The final or current state
|
141
|
+
#
|
142
|
+
# source://dotenv//lib/dotenv/diff.rb#8
|
143
|
+
def b; end
|
144
|
+
|
145
|
+
# Returns of Hash of keys changed with an array of their previous and new values
|
146
|
+
#
|
147
|
+
# source://dotenv//lib/dotenv/diff.rb#34
|
148
|
+
def changed; end
|
149
|
+
|
150
|
+
# Returns a Hash of all added, changed, and removed keys and their new values
|
151
|
+
#
|
152
|
+
# source://dotenv//lib/dotenv/diff.rb#41
|
153
|
+
def env; end
|
154
|
+
|
155
|
+
# Returns a Hash of keys removed with their previous values
|
156
|
+
#
|
157
|
+
# source://dotenv//lib/dotenv/diff.rb#29
|
158
|
+
def removed; end
|
159
|
+
|
160
|
+
private
|
161
|
+
|
162
|
+
# source://dotenv//lib/dotenv/diff.rb#52
|
163
|
+
def snapshot; end
|
164
|
+
end
|
165
|
+
|
166
|
+
# A `.env` file that will be read and parsed into a Hash
|
167
|
+
#
|
168
|
+
# source://dotenv//lib/dotenv/environment.rb#3
|
169
|
+
class Dotenv::Environment < ::Hash
|
170
|
+
# Create a new Environment
|
171
|
+
#
|
172
|
+
# @param filename [String] the path to the file to read
|
173
|
+
# @param overwrite [Boolean] whether the parser should assume existing values will be overwritten
|
174
|
+
# @return [Environment] a new instance of Environment
|
175
|
+
#
|
176
|
+
# source://dotenv//lib/dotenv/environment.rb#10
|
177
|
+
def initialize(filename, overwrite: T.unsafe(nil)); end
|
178
|
+
|
179
|
+
# Returns the value of attribute filename.
|
180
|
+
#
|
181
|
+
# source://dotenv//lib/dotenv/environment.rb#4
|
182
|
+
def filename; end
|
183
|
+
|
184
|
+
# source://dotenv//lib/dotenv/environment.rb#17
|
185
|
+
def load; end
|
186
|
+
|
187
|
+
# Returns the value of attribute overwrite.
|
188
|
+
#
|
189
|
+
# source://dotenv//lib/dotenv/environment.rb#4
|
190
|
+
def overwrite; end
|
191
|
+
|
192
|
+
# source://dotenv//lib/dotenv/environment.rb#21
|
193
|
+
def read; end
|
194
|
+
end
|
195
|
+
|
196
|
+
# source://dotenv//lib/dotenv/missing_keys.rb#2
|
197
|
+
class Dotenv::Error < ::StandardError; end
|
198
|
+
|
199
|
+
# Error raised when encountering a syntax error while parsing a .env file.
|
200
|
+
#
|
201
|
+
# source://dotenv//lib/dotenv/parser.rb#6
|
202
|
+
class Dotenv::FormatError < ::SyntaxError; end
|
203
|
+
|
204
|
+
# source://dotenv//lib/dotenv/missing_keys.rb#4
|
205
|
+
class Dotenv::MissingKeys < ::Dotenv::Error
|
206
|
+
# @return [MissingKeys] a new instance of MissingKeys
|
207
|
+
#
|
208
|
+
# source://dotenv//lib/dotenv/missing_keys.rb#5
|
209
|
+
def initialize(keys); end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Parses the `.env` file format into key/value pairs.
|
213
|
+
# It allows for variable substitutions, command substitutions, and exporting of variables.
|
214
|
+
#
|
215
|
+
# source://dotenv//lib/dotenv/parser.rb#10
|
216
|
+
class Dotenv::Parser
|
217
|
+
# @return [Parser] a new instance of Parser
|
218
|
+
#
|
219
|
+
# source://dotenv//lib/dotenv/parser.rb#40
|
220
|
+
def initialize(string, overwrite: T.unsafe(nil)); end
|
221
|
+
|
222
|
+
# source://dotenv//lib/dotenv/parser.rb#46
|
223
|
+
def call; end
|
224
|
+
|
225
|
+
private
|
226
|
+
|
227
|
+
# source://dotenv//lib/dotenv/parser.rb#82
|
228
|
+
def expand_newlines(value); end
|
229
|
+
|
230
|
+
# source://dotenv//lib/dotenv/parser.rb#62
|
231
|
+
def parse_line(line); end
|
232
|
+
|
233
|
+
# source://dotenv//lib/dotenv/parser.rb#70
|
234
|
+
def parse_value(value); end
|
235
|
+
|
236
|
+
# source://dotenv//lib/dotenv/parser.rb#104
|
237
|
+
def perform_substitutions(value, maybe_quote); end
|
238
|
+
|
239
|
+
# source://dotenv//lib/dotenv/parser.rb#78
|
240
|
+
def unescape_characters(value); end
|
241
|
+
|
242
|
+
# source://dotenv//lib/dotenv/parser.rb#94
|
243
|
+
def unescape_value(value, maybe_quote); end
|
244
|
+
|
245
|
+
# @return [Boolean]
|
246
|
+
#
|
247
|
+
# source://dotenv//lib/dotenv/parser.rb#90
|
248
|
+
def variable_not_set?(line); end
|
249
|
+
|
250
|
+
class << self
|
251
|
+
# source://dotenv//lib/dotenv/parser.rb#35
|
252
|
+
def call(*_arg0, **_arg1, &_arg2); end
|
253
|
+
|
254
|
+
# Returns the value of attribute substitutions.
|
255
|
+
#
|
256
|
+
# source://dotenv//lib/dotenv/parser.rb#33
|
257
|
+
def substitutions; end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# source://dotenv//lib/dotenv/parser.rb#14
|
262
|
+
Dotenv::Parser::LINE = T.let(T.unsafe(nil), Regexp)
|
263
|
+
|
264
|
+
# An internal monitor to synchronize access to ENV in multi-threaded environments.
|
265
|
+
#
|
266
|
+
# source://dotenv//lib/dotenv.rb#11
|
267
|
+
Dotenv::SEMAPHORE = T.let(T.unsafe(nil), Monitor)
|
268
|
+
|
269
|
+
# source://dotenv//lib/dotenv/substitutions/variable.rb#4
|
270
|
+
module Dotenv::Substitutions; end
|
271
|
+
|
272
|
+
# Substitute shell commands in a value.
|
273
|
+
#
|
274
|
+
# SHA=$(git rev-parse HEAD)
|
275
|
+
#
|
276
|
+
# source://dotenv//lib/dotenv/substitutions/command.rb#9
|
277
|
+
module Dotenv::Substitutions::Command
|
278
|
+
class << self
|
279
|
+
# source://dotenv//lib/dotenv/substitutions/command.rb#23
|
280
|
+
def call(value, _env, overwrite: T.unsafe(nil)); end
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
# Substitute variables in a value.
|
285
|
+
#
|
286
|
+
# HOST=example.com
|
287
|
+
# URL="https://$HOST"
|
288
|
+
#
|
289
|
+
# source://dotenv//lib/dotenv/substitutions/variable.rb#10
|
290
|
+
module Dotenv::Substitutions::Variable
|
291
|
+
class << self
|
292
|
+
# source://dotenv//lib/dotenv/substitutions/variable.rb#21
|
293
|
+
def call(value, env, overwrite: T.unsafe(nil)); end
|
294
|
+
|
295
|
+
private
|
296
|
+
|
297
|
+
# source://dotenv//lib/dotenv/substitutions/variable.rb#31
|
298
|
+
def substitute(match, variable, env); end
|
299
|
+
end
|
300
|
+
end
|