lunchmoney 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.github/dependabot.yml +18 -0
  4. data/.github/workflows/build_and_publish_yard_docs.yml +47 -0
  5. data/.github/workflows/ci.yml +58 -0
  6. data/.github/workflows/dependabot-rbi-updater.yml +43 -0
  7. data/.github/workflows/publish_gem.yml +31 -0
  8. data/.gitignore +62 -0
  9. data/.rubocop.yml +45 -0
  10. data/.ruby-version +1 -0
  11. data/.toys/.toys.rb +10 -0
  12. data/.toys/ci.rb +22 -0
  13. data/.toys/rbi.rb +60 -0
  14. data/.toys/rubocop.rb +10 -0
  15. data/.toys/spoom.rb +15 -0
  16. data/.toys/typecheck.rb +5 -0
  17. data/.yardopts +2 -0
  18. data/Appraisals +22 -0
  19. data/Gemfile +25 -0
  20. data/Gemfile.lock +174 -0
  21. data/LICENSE +21 -0
  22. data/README.md +57 -0
  23. data/bin/console +16 -0
  24. data/bin/rubocop +27 -0
  25. data/bin/setup +8 -0
  26. data/bin/spoom +27 -0
  27. data/bin/srb +27 -0
  28. data/bin/tapioca +27 -0
  29. data/bin/toys +27 -0
  30. data/bin/yard +27 -0
  31. data/lib/lunchmoney/api.rb +147 -0
  32. data/lib/lunchmoney/api_call.rb +109 -0
  33. data/lib/lunchmoney/assets/asset.rb +89 -0
  34. data/lib/lunchmoney/assets/asset_calls.rb +96 -0
  35. data/lib/lunchmoney/budget/budget.rb +74 -0
  36. data/lib/lunchmoney/budget/budget_calls.rb +82 -0
  37. data/lib/lunchmoney/budget/config.rb +38 -0
  38. data/lib/lunchmoney/budget/data.rb +42 -0
  39. data/lib/lunchmoney/categories/category/category.rb +52 -0
  40. data/lib/lunchmoney/categories/category/child_category.rb +42 -0
  41. data/lib/lunchmoney/categories/category_calls.rb +195 -0
  42. data/lib/lunchmoney/configuration.rb +26 -0
  43. data/lib/lunchmoney/crypto/crypto/crypto.rb +43 -0
  44. data/lib/lunchmoney/crypto/crypto/crypto_base.rb +65 -0
  45. data/lib/lunchmoney/crypto/crypto_calls.rb +49 -0
  46. data/lib/lunchmoney/data_object.rb +25 -0
  47. data/lib/lunchmoney/errors.rb +19 -0
  48. data/lib/lunchmoney/exceptions.rb +19 -0
  49. data/lib/lunchmoney/plaid_accounts/plaid_account.rb +73 -0
  50. data/lib/lunchmoney/plaid_accounts/plaid_account_calls.rb +38 -0
  51. data/lib/lunchmoney/recurring_expenses/recurring_expense/recurring_expense.rb +65 -0
  52. data/lib/lunchmoney/recurring_expenses/recurring_expense/recurring_expense_base.rb +29 -0
  53. data/lib/lunchmoney/recurring_expenses/recurring_expense_calls.rb +28 -0
  54. data/lib/lunchmoney/tags/tag/tag.rb +20 -0
  55. data/lib/lunchmoney/tags/tag/tag_base.rb +21 -0
  56. data/lib/lunchmoney/tags/tag_calls.rb +20 -0
  57. data/lib/lunchmoney/transactions/transaction/child_transaction.rb +31 -0
  58. data/lib/lunchmoney/transactions/transaction/split.rb +24 -0
  59. data/lib/lunchmoney/transactions/transaction/transaction.rb +156 -0
  60. data/lib/lunchmoney/transactions/transaction/transaction_base.rb +52 -0
  61. data/lib/lunchmoney/transactions/transaction/transaction_modification_base.rb +30 -0
  62. data/lib/lunchmoney/transactions/transaction/update_transaction.rb +43 -0
  63. data/lib/lunchmoney/transactions/transaction_calls.rb +218 -0
  64. data/lib/lunchmoney/user/user.rb +36 -0
  65. data/lib/lunchmoney/user/user_calls.rb +19 -0
  66. data/lib/lunchmoney/validators.rb +43 -0
  67. data/lib/lunchmoney/version.rb +7 -0
  68. data/lib/lunchmoney.rb +54 -0
  69. data/lunchmoney.gemspec +34 -0
  70. data/sorbet/config +5 -0
  71. data/sorbet/rbi/annotations/.gitattributes +1 -0
  72. data/sorbet/rbi/annotations/activesupport.rbi +410 -0
  73. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  74. data/sorbet/rbi/annotations/mocha.rbi +34 -0
  75. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  76. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  77. data/sorbet/rbi/dsl/.gitattributes +1 -0
  78. data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
  79. data/sorbet/rbi/gems/.gitattributes +1 -0
  80. data/sorbet/rbi/gems/activesupport@7.1.3.rbi +18004 -0
  81. data/sorbet/rbi/gems/addressable@2.8.6.rbi +1993 -0
  82. data/sorbet/rbi/gems/appraisal@2.5.0.rbi +621 -0
  83. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  84. data/sorbet/rbi/gems/base64@0.2.0.rbi +508 -0
  85. data/sorbet/rbi/gems/bigdecimal@3.1.6.rbi +77 -0
  86. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
  87. data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +11590 -0
  88. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +8 -0
  89. data/sorbet/rbi/gems/crack@0.4.5.rbi +144 -0
  90. data/sorbet/rbi/gems/dotenv@2.8.1.rbi +234 -0
  91. data/sorbet/rbi/gems/drb@2.2.0.rbi +1346 -0
  92. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  93. data/sorbet/rbi/gems/faraday-net_http@3.1.0.rbi +146 -0
  94. data/sorbet/rbi/gems/faraday@2.9.0.rbi +2911 -0
  95. data/sorbet/rbi/gems/hashdiff@1.1.0.rbi +352 -0
  96. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2325 -0
  97. data/sorbet/rbi/gems/json@2.7.1.rbi +1561 -0
  98. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  99. data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
  100. data/sorbet/rbi/gems/minitest@5.21.2.rbi +2197 -0
  101. data/sorbet/rbi/gems/mocha@2.1.0.rbi +3934 -0
  102. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +93 -0
  103. data/sorbet/rbi/gems/net-http@0.4.1.rbi +4068 -0
  104. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  105. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  106. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  107. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  108. data/sorbet/rbi/gems/prism@0.19.0.rbi +29883 -0
  109. data/sorbet/rbi/gems/pry-sorbet@0.2.1.rbi +966 -0
  110. data/sorbet/rbi/gems/pry@0.14.2.rbi +10077 -0
  111. data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +935 -0
  112. data/sorbet/rbi/gems/racc@1.7.3.rbi +161 -0
  113. data/sorbet/rbi/gems/rack@3.0.8.rbi +5183 -0
  114. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  115. data/sorbet/rbi/gems/rake@13.1.0.rbi +3027 -0
  116. data/sorbet/rbi/gems/rbi@0.1.6.rbi +2922 -0
  117. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  118. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  119. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7117 -0
  120. data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +2576 -0
  121. data/sorbet/rbi/gems/rubocop-rails@2.23.1.rbi +9175 -0
  122. data/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi +8 -0
  123. data/sorbet/rbi/gems/rubocop-sorbet@0.7.6.rbi +1510 -0
  124. data/sorbet/rbi/gems/rubocop@1.60.1.rbi +57356 -0
  125. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  126. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  127. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  128. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
  129. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3506 -0
  130. data/sorbet/rbi/gems/thor@1.3.0.rbi +4312 -0
  131. data/sorbet/rbi/gems/toys-core@0.15.4.rbi +9462 -0
  132. data/sorbet/rbi/gems/toys@0.15.4.rbi +243 -0
  133. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  134. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  135. data/sorbet/rbi/gems/uri@0.13.0.rbi +2327 -0
  136. data/sorbet/rbi/gems/vcr@6.2.0.rbi +3036 -0
  137. data/sorbet/rbi/gems/webmock@3.19.1.rbi +1768 -0
  138. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  139. data/sorbet/rbi/gems/yard@0.9.34.rbi +18084 -0
  140. data/sorbet/shims/module.rbi +6 -0
  141. data/sorbet/tapioca/require.rb +10 -0
  142. metadata +228 -0
@@ -0,0 +1,272 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `method_source` gem.
5
+ # Please instead update this file by running `bin/tapioca gem method_source`.
6
+
7
+ # source://method_source//lib/method_source.rb#127
8
+ class Method
9
+ include ::MethodSource::SourceLocation::MethodExtensions
10
+ include ::MethodSource::MethodExtensions
11
+ end
12
+
13
+ # source://method_source//lib/method_source/version.rb#1
14
+ module MethodSource
15
+ extend ::MethodSource::CodeHelpers
16
+
17
+ class << self
18
+ # Helper method responsible for opening source file and buffering up
19
+ # the comments for a specified method. Defined here to avoid polluting
20
+ # `Method` class.
21
+ #
22
+ # @param source_location [Array] The array returned by Method#source_location
23
+ # @param method_name [String]
24
+ # @raise [SourceNotFoundError]
25
+ # @return [String] The comments up to the point of the method.
26
+ #
27
+ # source://method_source//lib/method_source.rb#38
28
+ def comment_helper(source_location, name = T.unsafe(nil)); end
29
+
30
+ # @deprecated — use MethodSource::CodeHelpers#expression_at
31
+ #
32
+ # source://method_source//lib/method_source.rb#66
33
+ def extract_code(source_location); end
34
+
35
+ # Load a memoized copy of the lines in a file.
36
+ #
37
+ # @param file_name [String]
38
+ # @param method_name [String]
39
+ # @raise [SourceNotFoundError]
40
+ # @return [Array<String>] the contents of the file
41
+ #
42
+ # source://method_source//lib/method_source.rb#51
43
+ def lines_for(file_name, name = T.unsafe(nil)); end
44
+
45
+ # Helper method responsible for extracting method body.
46
+ # Defined here to avoid polluting `Method` class.
47
+ #
48
+ # @param source_location [Array] The array returned by Method#source_location
49
+ # @param method_name [String]
50
+ # @return [String] The method body
51
+ #
52
+ # source://method_source//lib/method_source.rb#23
53
+ def source_helper(source_location, name = T.unsafe(nil)); end
54
+
55
+ # @deprecated — use MethodSource::CodeHelpers#complete_expression?
56
+ # @return [Boolean]
57
+ #
58
+ # source://method_source//lib/method_source.rb#59
59
+ def valid_expression?(str); end
60
+ end
61
+ end
62
+
63
+ # source://method_source//lib/method_source/code_helpers.rb#3
64
+ module MethodSource::CodeHelpers
65
+ # Retrieve the comment describing the expression on the given line of the given file.
66
+ #
67
+ # This is useful to get module or method documentation.
68
+ #
69
+ # @param file [Array<String>, File, String] The file to parse, either as a File or as
70
+ # a String or an Array of lines.
71
+ # @param line_number [Integer] The line number at which to look.
72
+ # NOTE: The first line in a file is line 1!
73
+ # @return [String] The comment
74
+ #
75
+ # source://method_source//lib/method_source/code_helpers.rb#52
76
+ def comment_describing(file, line_number); end
77
+
78
+ # Determine if a string of code is a complete Ruby expression.
79
+ #
80
+ # @example
81
+ # complete_expression?("class Hello") #=> false
82
+ # complete_expression?("class Hello; end") #=> true
83
+ # complete_expression?("class 123") #=> SyntaxError: unexpected tINTEGER
84
+ # @param code [String] The code to validate.
85
+ # @raise [SyntaxError] Any SyntaxError that does not represent incompleteness.
86
+ # @return [Boolean] Whether or not the code is a complete Ruby expression.
87
+ #
88
+ # source://method_source//lib/method_source/code_helpers.rb#66
89
+ def complete_expression?(str); end
90
+
91
+ # Retrieve the first expression starting on the given line of the given file.
92
+ #
93
+ # This is useful to get module or method source code.
94
+ #
95
+ # line 1!
96
+ #
97
+ # @option options
98
+ # @option options
99
+ # @param file [Array<String>, File, String] The file to parse, either as a File or as
100
+ # @param line_number [Integer] The line number at which to look.
101
+ # NOTE: The first line in a file is
102
+ # @param options [Hash] The optional configuration parameters.
103
+ # @raise [SyntaxError] If the first complete expression can't be identified
104
+ # @return [String] The first complete expression
105
+ #
106
+ # source://method_source//lib/method_source/code_helpers.rb#20
107
+ def expression_at(file, line_number, options = T.unsafe(nil)); end
108
+
109
+ private
110
+
111
+ # Get the first expression from the input.
112
+ #
113
+ # @param lines [Array<String>]
114
+ # @param consume [Integer] A number of lines to automatically
115
+ # consume (add to the expression buffer) without checking for validity.
116
+ # @raise [SyntaxError]
117
+ # @return [String] a valid ruby expression
118
+ # @yield a clean-up function to run before checking for complete_expression
119
+ #
120
+ # source://method_source//lib/method_source/code_helpers.rb#92
121
+ def extract_first_expression(lines, consume = T.unsafe(nil), &block); end
122
+
123
+ # Get the last comment from the input.
124
+ #
125
+ # @param lines [Array<String>]
126
+ # @return [String]
127
+ #
128
+ # source://method_source//lib/method_source/code_helpers.rb#106
129
+ def extract_last_comment(lines); end
130
+ end
131
+
132
+ # An exception matcher that matches only subsets of SyntaxErrors that can be
133
+ # fixed by adding more input to the buffer.
134
+ #
135
+ # source://method_source//lib/method_source/code_helpers.rb#124
136
+ module MethodSource::CodeHelpers::IncompleteExpression
137
+ class << self
138
+ # source://method_source//lib/method_source/code_helpers.rb#137
139
+ def ===(ex); end
140
+
141
+ # @return [Boolean]
142
+ #
143
+ # source://method_source//lib/method_source/code_helpers.rb#149
144
+ def rbx?; end
145
+ end
146
+ end
147
+
148
+ # source://method_source//lib/method_source/code_helpers.rb#125
149
+ MethodSource::CodeHelpers::IncompleteExpression::GENERIC_REGEXPS = T.let(T.unsafe(nil), Array)
150
+
151
+ # source://method_source//lib/method_source/code_helpers.rb#133
152
+ MethodSource::CodeHelpers::IncompleteExpression::RBX_ONLY_REGEXPS = T.let(T.unsafe(nil), Array)
153
+
154
+ # This module is to be included by `Method` and `UnboundMethod` and
155
+ # provides the `#source` functionality
156
+ #
157
+ # source://method_source//lib/method_source.rb#72
158
+ module MethodSource::MethodExtensions
159
+ # Return the comments associated with the method as a string.
160
+ #
161
+ # @example
162
+ # Set.instance_method(:clear).comment.display
163
+ # =>
164
+ # # Removes all elements and returns self.
165
+ # @raise SourceNotFoundException
166
+ # @return [String] The method's comments as a string
167
+ #
168
+ # source://method_source//lib/method_source.rb#121
169
+ def comment; end
170
+
171
+ # Return the sourcecode for the method as a string
172
+ #
173
+ # @example
174
+ # Set.instance_method(:clear).source.display
175
+ # =>
176
+ # def clear
177
+ # @hash.clear
178
+ # self
179
+ # end
180
+ # @raise SourceNotFoundException
181
+ # @return [String] The method sourcecode as a string
182
+ #
183
+ # source://method_source//lib/method_source.rb#109
184
+ def source; end
185
+
186
+ class << self
187
+ # We use the included hook to patch Method#source on rubinius.
188
+ # We need to use the included hook as Rubinius defines a `source`
189
+ # on Method so including a module will have no effect (as it's
190
+ # higher up the MRO).
191
+ #
192
+ # @param klass [Class] The class that includes the module.
193
+ #
194
+ # source://method_source//lib/method_source.rb#79
195
+ def included(klass); end
196
+ end
197
+ end
198
+
199
+ # source://method_source//lib/method_source/source_location.rb#2
200
+ module MethodSource::ReeSourceLocation
201
+ # Ruby enterprise edition provides all the information that's
202
+ # needed, in a slightly different way.
203
+ #
204
+ # source://method_source//lib/method_source/source_location.rb#5
205
+ def source_location; end
206
+ end
207
+
208
+ # source://method_source//lib/method_source/source_location.rb#10
209
+ module MethodSource::SourceLocation; end
210
+
211
+ # source://method_source//lib/method_source/source_location.rb#11
212
+ module MethodSource::SourceLocation::MethodExtensions
213
+ # Return the source location of a method for Ruby 1.8.
214
+ #
215
+ # @return [Array] A two element array. First element is the
216
+ # file, second element is the line in the file where the
217
+ # method definition is found.
218
+ #
219
+ # source://method_source//lib/method_source/source_location.rb#40
220
+ def source_location; end
221
+
222
+ private
223
+
224
+ # source://method_source//lib/method_source/source_location.rb#26
225
+ def trace_func(event, file, line, id, binding, classname); end
226
+ end
227
+
228
+ # source://method_source//lib/method_source/source_location.rb#54
229
+ module MethodSource::SourceLocation::ProcExtensions
230
+ # Return the source location for a Proc (in implementations
231
+ # without Proc#source_location)
232
+ #
233
+ # @return [Array] A two element array. First element is the
234
+ # file, second element is the line in the file where the
235
+ # proc definition is found.
236
+ #
237
+ # source://method_source//lib/method_source/source_location.rb#74
238
+ def source_location; end
239
+ end
240
+
241
+ # source://method_source//lib/method_source/source_location.rb#81
242
+ module MethodSource::SourceLocation::UnboundMethodExtensions
243
+ # Return the source location of an instance method for Ruby 1.8.
244
+ #
245
+ # @return [Array] A two element array. First element is the
246
+ # file, second element is the line in the file where the
247
+ # method definition is found.
248
+ #
249
+ # source://method_source//lib/method_source/source_location.rb#101
250
+ def source_location; end
251
+ end
252
+
253
+ # An Exception to mark errors that were raised trying to find the source from
254
+ # a given source_location.
255
+ #
256
+ # source://method_source//lib/method_source.rb#16
257
+ class MethodSource::SourceNotFoundError < ::StandardError; end
258
+
259
+ # source://method_source//lib/method_source/version.rb#2
260
+ MethodSource::VERSION = T.let(T.unsafe(nil), String)
261
+
262
+ # source://method_source//lib/method_source.rb#137
263
+ class Proc
264
+ include ::MethodSource::SourceLocation::ProcExtensions
265
+ include ::MethodSource::MethodExtensions
266
+ end
267
+
268
+ # source://method_source//lib/method_source.rb#132
269
+ class UnboundMethod
270
+ include ::MethodSource::SourceLocation::UnboundMethodExtensions
271
+ include ::MethodSource::MethodExtensions
272
+ end