lunchmoney 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a66d419d272f25d940cb0ad8a5f5962b85aa3cb74deee1486e3f7ed9caf9f8ac
4
- data.tar.gz: bd656eac78fd93d9979e3a86ab639f7f880f2e74fd2fb3a0e64889a7df8e6086
3
+ metadata.gz: 86b24d3bbcd5e93161548921e2c39deac79d1b4970352a702c8386cf4e7f6f7b
4
+ data.tar.gz: 3c9277f552499d51bee728241fca6ad0c2aeba7224d4819d2dc1df8456ab8adb
5
5
  SHA512:
6
- metadata.gz: d756dda147ed0c8cb492c2be68d40772a0d182513fbef4cdc326c7a5644b16f23e8a7ee5bb0228e030d6f16b9c8b396b1fd3cedc9bdfd9d389bdd9bddef37721
7
- data.tar.gz: c9899675f397835b813d864db59db9e311cb1f99422349c901f8676a409bd22ce8be0a42e8bdc8c6ad77f341c23f7b67436966c4e10b09cc95eb9d8838dd3432
6
+ metadata.gz: 5791261da74adce58b20ea6d554777ea05ce3f9c170677284e5226575f5a90a5900ed2b29d0f9367cb718da12ce979020b676aa372441a0b0380771577960703
7
+ data.tar.gz: 46bab5cdf01ef0aae51ee89650257c237467a95ddde546c7772c907aa43ca43ad09743c466f363cd0c984109f23993b84900d708aab8e9b5485c1e22e67011d1
data/.codeclimate.yml ADDED
@@ -0,0 +1,7 @@
1
+ version: "2" # required to adjust maintainability checks
2
+ plugins:
3
+ flog:
4
+ enabled: true
5
+ channel: flog-4-6-6
6
+ config:
7
+ score_threshold: 20.0
@@ -13,12 +13,12 @@ on:
13
13
  jobs:
14
14
  update-rbis:
15
15
  name: RBI Updater
16
- uses: mmenanno/lunchmoney/.github/workflows/dependabot-rbi-updater.yml@main
16
+ uses: ./.github/workflows/dependabot-rbi-updater.yml
17
17
  secrets: inherit
18
18
 
19
19
  ci:
20
20
  needs: update-rbis
21
21
  if: always() && contains(needs.*.result, 'skipped')
22
22
  name: "CI"
23
- uses: mmenanno/lunchmoney/.github/workflows/ci.yml@main
23
+ uses: ./.github/workflows/ci.yml
24
24
  secrets: inherit
@@ -41,15 +41,23 @@ jobs:
41
41
  -
42
42
  name: Check for DSL rbi updates
43
43
  run: bin/tapioca dsl --verify
44
+ -
45
+ name: Markdown Lint
46
+ run: bin/toys mdl
44
47
  -
45
48
  name: Run Tests (Using Cassettes)
46
49
  if: ${{ ! endsWith(matrix.ruby-version, '3.3') }}
47
50
  run: bin/toys test
48
51
  -
49
- name: Run Tests (With Remote Calls)
52
+ name: Run Tests (With Remote Calls & Coverage Report)
50
53
  if: ${{ endsWith(matrix.ruby-version, '3.3') }}
51
- run: bin/toys test
54
+ uses: paambaati/codeclimate-action@v5.0.0
52
55
  env:
56
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
53
57
  REMOTE_TESTS_ENABLED: ${{ vars.REMOTE_TESTS_ENABLED }}
54
58
  LUNCHMONEY_TOKEN: ${{ secrets.LUNCHMONEY_TOKEN }}
59
+ with:
60
+ coverageCommand: bin/toys test
61
+ coverageLocations: |
62
+ ${{ github.workspace }}/coverage/coverage.json:simplecov
55
63
 
@@ -9,7 +9,7 @@ on:
9
9
  jobs:
10
10
  ci:
11
11
  name: "CI"
12
- uses: mmenanno/lunchmoney/.github/workflows/ci.yml@main
12
+ uses: ./.github/workflows/ci.yml
13
13
  secrets: inherit
14
14
  release:
15
15
  needs: ci
data/.mdlrc ADDED
@@ -0,0 +1,4 @@
1
+ all
2
+ rule 'ol-prefix', :style => "ordered"
3
+
4
+ exclude_rule 'line-length'
data/.rubocop.yml CHANGED
@@ -11,6 +11,7 @@ AllCops:
11
11
  NewCops: enable
12
12
  Exclude:
13
13
  - "sorbet/**/*"
14
+ - ".mdlrc"
14
15
 
15
16
  Sorbet:
16
17
  Enabled: true
data/.simplecov ADDED
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "simplecov_json_formatter"
4
+
5
+ SimpleCov.formatter = if ENV.fetch("CI", false)
6
+ SimpleCov::Formatter::JSONFormatter
7
+ else
8
+ SimpleCov::Formatter::HTMLFormatter
9
+ end
10
+
11
+ SimpleCov.minimum_coverage(95)
12
+ SimpleCov.maximum_coverage_drop(1)
13
+ SimpleCov.start do
14
+ enable_coverage :branch
15
+ primary_coverage :branch
16
+
17
+ add_filter "/test/"
18
+
19
+ add_group "Calls", "lib/lunchmoney/calls"
20
+ add_group "Objects", "lib/lunchmoney/objects"
21
+ add_group "Core Files", [
22
+ "lib/lunchmoney.rb",
23
+ "lib/lunchmoney/api.rb",
24
+ "lib/lunchmoney/configuration.rb",
25
+ "lib/lunchmoney/errors.rb",
26
+ "lib/lunchmoney/exceptions.rb",
27
+ "lib/lunchmoney/validators.rb",
28
+ "lib/lunchmoney/version.rb",
29
+ ]
30
+ end
data/.toys/.toys.rb CHANGED
@@ -8,3 +8,4 @@ expand :gem_build, name: "release", push_gem: true
8
8
  alias_tool :style, :rubocop
9
9
  alias_tool :tapioca, :rbi
10
10
  alias_tool :tc, :typecheck
11
+ alias_tool :cov, :coverage
data/.toys/coverage.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ def run
4
+ exec("open coverage/index.html")
5
+ end
data/.toys/mdl.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ def run
4
+ exec("mdl -s ./.mdlrc --git-recurse --show-aliases .")
5
+ end
data/Gemfile CHANGED
@@ -23,3 +23,6 @@ gem "dotenv"
23
23
  gem "yard", require: false
24
24
  gem "yard-sorbet", require: false
25
25
  gem "appraisal", require: false
26
+ gem "simplecov", require: false
27
+ gem "simplecov_json_formatter", require: false
28
+ gem "mdl", require: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lunchmoney (1.1.1)
4
+ lunchmoney (1.1.2)
5
5
  activesupport (>= 6.1)
6
6
  faraday (>= 1.0.0)
7
7
  sorbet-runtime (>= 0.5)
@@ -28,12 +28,15 @@ GEM
28
28
  ast (2.4.2)
29
29
  base64 (0.2.0)
30
30
  bigdecimal (3.1.6)
31
+ chef-utils (18.4.2)
32
+ concurrent-ruby
31
33
  coderay (1.1.3)
32
34
  concurrent-ruby (1.2.3)
33
35
  connection_pool (2.4.1)
34
36
  crack (1.0.0)
35
37
  bigdecimal
36
38
  rexml
39
+ docile (1.4.0)
37
40
  dotenv (2.8.1)
38
41
  drb (2.2.0)
39
42
  ruby2_keywords
@@ -46,9 +49,24 @@ GEM
46
49
  i18n (1.14.1)
47
50
  concurrent-ruby (~> 1.0)
48
51
  json (2.7.1)
52
+ kramdown (2.4.0)
53
+ rexml
54
+ kramdown-parser-gfm (1.1.0)
55
+ kramdown (~> 2.0)
49
56
  language_server-protocol (3.17.0.3)
57
+ mdl (0.13.0)
58
+ kramdown (~> 2.3)
59
+ kramdown-parser-gfm (~> 1.1)
60
+ mixlib-cli (~> 2.1, >= 2.1.1)
61
+ mixlib-config (>= 2.2.1, < 4)
62
+ mixlib-shellout
50
63
  method_source (1.0.0)
51
64
  minitest (5.22.2)
65
+ mixlib-cli (2.1.8)
66
+ mixlib-config (3.0.27)
67
+ tomlrb
68
+ mixlib-shellout (3.2.7)
69
+ chef-utils
52
70
  mocha (2.1.0)
53
71
  ruby2_keywords (>= 0.0.5)
54
72
  mutex_m (0.2.0)
@@ -103,6 +121,12 @@ GEM
103
121
  rubocop (>= 0.90.0)
104
122
  ruby-progressbar (1.13.0)
105
123
  ruby2_keywords (0.0.5)
124
+ simplecov (0.22.0)
125
+ docile (~> 1.1)
126
+ simplecov-html (~> 0.11)
127
+ simplecov_json_formatter (~> 0.1)
128
+ simplecov-html (0.12.3)
129
+ simplecov_json_formatter (0.1.4)
106
130
  sorbet (0.5.11247)
107
131
  sorbet-static (= 0.5.11247)
108
132
  sorbet-runtime (0.5.11247)
@@ -128,6 +152,7 @@ GEM
128
152
  thor (>= 1.2.0)
129
153
  yard-sorbet
130
154
  thor (1.3.0)
155
+ tomlrb (2.0.3)
131
156
  toys (0.15.5)
132
157
  toys-core (= 0.15.5)
133
158
  toys-core (0.15.5)
@@ -155,6 +180,7 @@ DEPENDENCIES
155
180
  appraisal
156
181
  dotenv
157
182
  lunchmoney!
183
+ mdl
158
184
  minitest (~> 5.22)
159
185
  mocha (~> 2.1.0)
160
186
  pry-sorbet (~> 0.2)
@@ -162,6 +188,8 @@ DEPENDENCIES
162
188
  rubocop-rails
163
189
  rubocop-shopify
164
190
  rubocop-sorbet
191
+ simplecov
192
+ simplecov_json_formatter
165
193
  sorbet-static-and-runtime
166
194
  spoom
167
195
  tapioca
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) 2021 mmenanno
3
+ Copyright (c) Michael Menanno
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # lunchmoney
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/lunchmoney.svg)](https://badge.fury.io/rb/lunchmoney)
4
- [![CI](https://github.com/halorrr/lunchmoney/actions/workflows/ci.yml/badge.svg)](https://github.com/halorrr/lunchmoney/actions/workflows/ci.yml)
5
- [![Yard Docs](https://github.com/halorrr/lunchmoney/actions/workflows/build_and_publish_yard_docs.yml/badge.svg)](https://github.com/halorrr/lunchmoney/actions/workflows/build_and_publish_yard_docs.yml)
4
+ [![CI](https://github.com/mmenanno/lunchmoney/actions/workflows/ci.yml/badge.svg)](https://github.com/mmenanno/lunchmoney/actions/workflows/ci.yml)
5
+ [![Yard Docs](https://github.com/mmenanno/lunchmoney/actions/workflows/build_and_publish_yard_docs.yml/badge.svg)](https://github.com/mmenanno/lunchmoney/actions/workflows/build_and_publish_yard_docs.yml)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/6e84458e8cf831e6a6fa/maintainability)](https://codeclimate.com/github/mmenanno/lunchmoney/maintainability)
7
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/6e84458e8cf831e6a6fa/test_coverage)](https://codeclimate.com/github/mmenanno/lunchmoney/test_coverage)
6
8
 
7
9
  This gem is a API client library of the [LunchMoney API](https://lunchmoney.dev/) for the wonderful [LunchMoney](http://lunchmoney.app/) web app for personal finance & budgeting.
8
10
 
9
- Documentation is still a work in process, but you can find the yard docs for this gem [here](https://halorrr.github.io/lunchmoney/) as well as some write ups of the basics below. An example of every call is listed on the [Api class in the yard docs](https://halorrr.github.io/lunchmoney/LunchMoney/Api.html).
11
+ Documentation is still a work in process, but you can find the yard docs for this gem [here](https://mmenanno.github.io/lunchmoney/) as well as some write ups of the basics below. An example of every call is listed on the [Api class in the yard docs](https://mmenanno.github.io/lunchmoney/LunchMoney/Api.html).
10
12
 
11
13
  ## Usage
12
14
 
@@ -6,7 +6,7 @@ module LunchMoney
6
6
  module Objects
7
7
  # Base data object for the objects returned and used when calling the LunchMoney API
8
8
  class Object
9
- sig { params(symbolize_keys: T::Boolean).returns(T::Hash[String, T.untyped]) }
9
+ sig { params(symbolize_keys: T::Boolean).returns(T::Hash[T.any(String, Symbol), T.untyped]) }
10
10
  def serialize(symbolize_keys: false)
11
11
  ivars = instance_variables
12
12
 
@@ -23,6 +23,8 @@ module LunchMoney
23
23
 
24
24
  output
25
25
  end
26
+
27
+ delegate :to_h, to: :serialize
26
28
  end
27
29
  end
28
30
  end
@@ -3,5 +3,5 @@
3
3
 
4
4
  module LunchMoney
5
5
  # Current version of the gem
6
- VERSION = "1.1.1"
6
+ VERSION = "1.1.2"
7
7
  end
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `chef-utils` gem.
5
+ # Please instead update this file by running `bin/tapioca gem chef-utils`.
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
@@ -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)