zelkova 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rubocop.yml +57 -0
  4. data/.travis.yml +6 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +19 -0
  7. data/Gemfile.lock +173 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +53 -0
  10. data/Rakefile +10 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/bin/tapioca +27 -0
  14. data/lib/zelkova/edge.rb +26 -0
  15. data/lib/zelkova/graph.rb +104 -0
  16. data/lib/zelkova/node.rb +32 -0
  17. data/lib/zelkova/version.rb +4 -0
  18. data/lib/zelkova.rb +10 -0
  19. data/sorbet/config +3 -0
  20. data/sorbet/rbi/gems/byebug.rbi +1041 -0
  21. data/sorbet/rbi/gems/climate_control.rbi +46 -0
  22. data/sorbet/rbi/gems/coderay.rbi +92 -0
  23. data/sorbet/rbi/gems/eikon.rbi +48 -0
  24. data/sorbet/rbi/gems/ffi.rbi +560 -0
  25. data/sorbet/rbi/gems/method_source.rbi +64 -0
  26. data/sorbet/rbi/gems/minitest.rbi +422 -0
  27. data/sorbet/rbi/gems/pry.rbi +1949 -0
  28. data/sorbet/rbi/gems/rake.rbi +645 -0
  29. data/sorbet/rbi/gems/ruby-vips.rbi +656 -0
  30. data/sorbet/rbi/gems/ruby_jard.rbi +681 -0
  31. data/sorbet/rbi/gems/terrapin.rbi +116 -0
  32. data/sorbet/rbi/gems/tty-screen.rbi +66 -0
  33. data/sorbet/rbi/gems/zelkova.rbi +15 -0
  34. data/sorbet/rbi/hidden-definitions/errors.txt +34600 -0
  35. data/sorbet/rbi/hidden-definitions/hidden.rbi +17564 -0
  36. data/sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi +1138 -0
  37. data/sorbet/rbi/sorbet-typed/lib/actionview/all/actionview.rbi +408 -0
  38. data/sorbet/rbi/sorbet-typed/lib/activesupport/>=6/activesupport.rbi +37 -0
  39. data/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1850 -0
  40. data/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +108 -0
  41. data/sorbet/rbi/sorbet-typed/lib/railties/>=6.1/railties.rbi +15 -0
  42. data/sorbet/rbi/sorbet-typed/lib/railties/all/railties.rbi +110 -0
  43. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +276 -0
  44. data/sorbet/rbi/sorbet-typed/lib/rake/all/rake.rbi +645 -0
  45. data/sorbet/rbi/sorbet-typed/lib/rubocop/>=1.8/rubocop.rbi +12 -0
  46. data/sorbet/rbi/sorbet-typed/lib/rubocop-performance/~>1.6/rubocop-performance.rbi +149 -0
  47. data/sorbet/rbi/sorbet-typed/lib/rubocop-rails/~>2.5/rubocop-rails.rbi +328 -0
  48. data/sorbet/rbi/sorbet-typed/lib/thor/all/thor.rbi +905 -0
  49. data/sorbet/rbi/sorbet-typed/lib/yard/all/yard.rbi +32 -0
  50. data/sorbet/rbi/todo.rbi +15 -0
  51. data/sorbet/tapioca/config.yml +13 -0
  52. data/sorbet/tapioca/require.rb +4 -0
  53. data/zelkova.gemspec +31 -0
  54. metadata +110 -0
@@ -0,0 +1,408 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi sorbet-typed
3
+ #
4
+ # If you would like to make changes to this file, great! Please upstream any changes you make here:
5
+ #
6
+ # https://github.com/sorbet/sorbet-typed/edit/master/lib/actionview/all/actionview.rbi
7
+ #
8
+ # typed: strong
9
+
10
+ module ActionView
11
+ class ActionViewError < StandardError; end
12
+ class EncodingError < StandardError; end
13
+ class WrongEncodingError < EncodingError; end
14
+
15
+ class MissingTemplate < ActionViewError
16
+ sig { returns(String) }
17
+ def path; end
18
+ end
19
+
20
+ class Template
21
+ class Error < ActionViewError; end
22
+ end
23
+
24
+ TemplateError = T.type_alias {Template::Error}
25
+
26
+ class SyntaxErrorInTemplate < Template::Error; end
27
+ end
28
+
29
+
30
+ ActionView::Base::NULL = T.let(T.unsafe(nil), Object)
31
+
32
+ ActionView::Helpers::AssetUrlHelper::ASSET_EXTENSIONS = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
33
+
34
+ ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
35
+
36
+ ActionView::Helpers::AssetUrlHelper::URI_REGEXP = T.let(T.unsafe(nil), Regexp)
37
+
38
+ ActionView::Helpers::AtomFeedHelper::AtomBuilder::XHTML_TAG_NAMES = T.let(T.unsafe(nil), T::Set[T.untyped])
39
+
40
+ ActionView::Helpers::ControllerHelper::CONTROLLER_DELEGATES = T.let(T.unsafe(nil), T::Array[T.untyped])
41
+
42
+ ActionView::Helpers::DateHelper::MINUTES_IN_QUARTER_YEAR = T.let(T.unsafe(nil), Integer)
43
+
44
+ ActionView::Helpers::DateHelper::MINUTES_IN_THREE_QUARTERS_YEAR = T.let(T.unsafe(nil), Integer)
45
+
46
+ ActionView::Helpers::DateHelper::MINUTES_IN_YEAR = T.let(T.unsafe(nil), Integer)
47
+
48
+ ActionView::Helpers::DateTimeSelector::AMPM_TRANSLATION = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
49
+
50
+ ActionView::Helpers::DateTimeSelector::DEFAULT_PREFIX = T.let(T.unsafe(nil), String)
51
+
52
+ ActionView::Helpers::DateTimeSelector::POSITION = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
53
+
54
+ ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
55
+
56
+ class ActionView::Helpers::FormBuilder
57
+ sig { returns(T.untyped) }
58
+ def object; end
59
+ end
60
+
61
+ module ActionView::Helpers::NumberHelper
62
+ # These will return nil if given nil and a string otherwise. Ideally we'd be able to encode
63
+ # that via sig overload but that's only supported for ruby stdlib.
64
+
65
+ sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
66
+ def number_to_currency(number, options = T.unsafe(nil)); end
67
+
68
+ sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
69
+ def number_to_human(number, options = T.unsafe(nil)); end
70
+
71
+ sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
72
+ def number_to_human_size(number, options = T.unsafe(nil)); end
73
+
74
+ sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
75
+ def number_to_percentage(number, options = T.unsafe(nil)); end
76
+
77
+ sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
78
+ def number_to_phone(number, options = T.unsafe(nil)); end
79
+
80
+ sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
81
+ def number_with_delimiter(number, options = T.unsafe(nil)); end
82
+
83
+ sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
84
+ def number_with_precision(number, options = T.unsafe(nil)); end
85
+ end
86
+
87
+ module ActionView::Helpers::SanitizeHelper
88
+ mixes_in_class_methods(::ActionView::Helpers::SanitizeHelper::ClassMethods)
89
+ end
90
+
91
+ module ActionView::Helpers::SanitizeHelper::ClassMethods; end
92
+
93
+ ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES = T.let(T.unsafe(nil), T::Array[T.untyped])
94
+
95
+ ActionView::Helpers::TagHelper::PRE_CONTENT_STRINGS = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
96
+
97
+ ActionView::Helpers::TagHelper::TAG_PREFIXES = T.let(T.unsafe(nil), T::Array[T.untyped])
98
+
99
+ ActionView::Helpers::TagHelper::TagBuilder::VOID_ELEMENTS = T.let(T.unsafe(nil), T::Array[T.untyped])
100
+
101
+ # Provides a set of methods for making links and getting URLs that
102
+ # depend on the routing subsystem (see ActionDispatch::Routing).
103
+ # This allows you to use the same format for links in views
104
+ # and controllers.
105
+ module ActionView::Helpers::UrlHelper
106
+ extend(::ActiveSupport::Concern)
107
+
108
+ include(::ActionView::Helpers::TagHelper)
109
+
110
+ mixes_in_class_methods(::ActionView::Helpers::UrlHelper::ClassMethods)
111
+
112
+ # True if the current request URI was generated by the given `options`.
113
+ #
114
+ # #### Examples
115
+ # Let's say we're in the `http://www.example.com/shop/checkout?order=desc&page=1` action.
116
+ #
117
+ # ```ruby
118
+ # current_page?(action: 'process')
119
+ # # => false
120
+ #
121
+ # current_page?(action: 'checkout')
122
+ # # => true
123
+ #
124
+ # current_page?(controller: 'library', action: 'checkout')
125
+ # # => false
126
+ #
127
+ # current_page?(controller: 'shop', action: 'checkout')
128
+ # # => true
129
+ #
130
+ # current_page?(controller: 'shop', action: 'checkout', order: 'asc')
131
+ # # => false
132
+ #
133
+ # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1')
134
+ # # => true
135
+ #
136
+ # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2')
137
+ # # => false
138
+ #
139
+ # current_page?('http://www.example.com/shop/checkout')
140
+ # # => true
141
+ #
142
+ # current_page?('http://www.example.com/shop/checkout', check_parameters: true)
143
+ # # => false
144
+ #
145
+ # current_page?('/shop/checkout')
146
+ # # => true
147
+ #
148
+ # current_page?('http://www.example.com/shop/checkout?order=desc&page=1')
149
+ # # => true
150
+ # ```
151
+ #
152
+ # Let's say we're in the `http://www.example.com/products` action with method POST in case of invalid product.
153
+ #
154
+ # ```ruby
155
+ # current_page?(controller: 'product', action: 'index')
156
+ # # => false
157
+ # ```
158
+ #
159
+ # We can also pass in the symbol arguments instead of strings.
160
+ sig { params(options: T.untyped, check_parameters: T::Boolean).returns(T::Boolean) }
161
+ def current_page?(options, check_parameters: false); end
162
+
163
+ # Creates an anchor element of the given `name` using a URL created by the set of `options`.
164
+ # See the valid options in the documentation for `url_for`. It's also possible to
165
+ # pass a String instead of an options hash, which generates an anchor element that uses the
166
+ # value of the String as the href for the link. Using a `:back` Symbol instead
167
+ # of an options hash will generate a link to the referrer (a JavaScript back link
168
+ # will be used in place of a referrer if none exists). If `nil` is passed as the name
169
+ # the value of the link itself will become the name.
170
+ #
171
+ # #### Signatures
172
+ #
173
+ # ```ruby
174
+ # link_to(body, url, html_options = {})
175
+ # # url is a String; you can use URL helpers like
176
+ # # posts_path
177
+ #
178
+ # link_to(body, url_options = {}, html_options = {})
179
+ # # url_options, except :method, is passed to url_for
180
+ #
181
+ # link_to(options = {}, html_options = {}) do
182
+ # # name
183
+ # end
184
+ #
185
+ # link_to(url, html_options = {}) do
186
+ # # name
187
+ # end
188
+ # ```
189
+ #
190
+ # #### Options
191
+ # * `:data` - This option can be used to add custom data attributes.
192
+ # * `method: symbol of HTTP verb` - This modifier will dynamically
193
+ # create an HTML form and immediately submit the form for processing using
194
+ # the HTTP verb specified. Useful for having links perform a POST operation
195
+ # in dangerous actions like deleting a record (which search bots can follow
196
+ # while spidering your site). Supported verbs are `:post`, `:delete`, `:patch`, and `:put`.
197
+ # Note that if the user has JavaScript disabled, the request will fall back
198
+ # to using GET. If `href: '#'` is used and the user has JavaScript
199
+ # disabled clicking the link will have no effect. If you are relying on the
200
+ # POST behavior, you should check for it in your controller's action by using
201
+ # the request object's methods for `post?`, `delete?`, `patch?`, or `put?`.
202
+ # * `remote: true` - This will allow the unobtrusive JavaScript
203
+ # driver to make an Ajax request to the URL in question instead of following
204
+ # the link. The drivers each provide mechanisms for listening for the
205
+ # completion of the Ajax request and performing JavaScript operations once
206
+ # they're complete
207
+ #
208
+ # #### Data attributes
209
+ #
210
+ # * `confirm: 'question?'` - This will allow the unobtrusive JavaScript
211
+ # driver to prompt with the question specified (in this case, the
212
+ # resulting text would be `question?`. If the user accepts, the
213
+ # link is processed normally, otherwise no action is taken.
214
+ # * `:disable_with` - Value of this parameter will be used as the
215
+ # name for a disabled version of the link. This feature is provided by
216
+ # the unobtrusive JavaScript driver.
217
+ #
218
+ # #### Examples
219
+ # Because it relies on `url_for`, `link_to` supports both older-style controller/action/id arguments
220
+ # and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base
221
+ # your application on resources and use
222
+ #
223
+ # ```ruby
224
+ # link_to "Profile", profile_path(@profile)
225
+ # # => <a href="/profiles/1">Profile</a>
226
+ # ```
227
+ #
228
+ # or the even pithier
229
+ #
230
+ # ```ruby
231
+ # link_to "Profile", @profile
232
+ # # => <a href="/profiles/1">Profile</a>
233
+ # ```
234
+ #
235
+ # in place of the older more verbose, non-resource-oriented
236
+ #
237
+ # ```ruby
238
+ # link_to "Profile", controller: "profiles", action: "show", id: @profile
239
+ # # => <a href="/profiles/show/1">Profile</a>
240
+ # ```
241
+ #
242
+ # Similarly,
243
+ #
244
+ # ```ruby
245
+ # link_to "Profiles", profiles_path
246
+ # # => <a href="/profiles">Profiles</a>
247
+ # ```
248
+ #
249
+ # is better than
250
+ #
251
+ # ```ruby
252
+ # link_to "Profiles", controller: "profiles"
253
+ # # => <a href="/profiles">Profiles</a>
254
+ # ```
255
+ #
256
+ # When name is `nil` the href is presented instead
257
+ #
258
+ # ```ruby
259
+ # link_to nil, "http://example.com"
260
+ # # => <a href="http://www.example.com">http://www.example.com</a>
261
+ # ```
262
+ #
263
+ # You can use a block as well if your link target is hard to fit into the name parameter. ERB example:
264
+ #
265
+ # ```html
266
+ # <%= link_to(@profile) do %>
267
+ # <strong><%= @profile.name %></strong> -- <span>Check it out!</span>
268
+ # <% end %>
269
+ # # => <a href="/profiles/1">
270
+ # <strong>David</strong> -- <span>Check it out!</span>
271
+ # </a>
272
+ # ```
273
+ #
274
+ # Classes and ids for CSS are easy to produce:
275
+ #
276
+ # ```ruby
277
+ # link_to "Articles", articles_path, id: "news", class: "article"
278
+ # # => <a href="/articles" class="article" id="news">Articles</a>
279
+ # ```
280
+ #
281
+ # Be careful when using the older argument style, as an extra literal hash is needed:
282
+ #
283
+ # ```ruby
284
+ # link_to "Articles", { controller: "articles" }, id: "news", class: "article"
285
+ # # => <a href="/articles" class="article" id="news">Articles</a>
286
+ # ```
287
+ #
288
+ # Leaving the hash off gives the wrong link:
289
+ #
290
+ # ```ruby
291
+ # link_to "WRONG!", controller: "articles", id: "news", class: "article"
292
+ # # => <a href="/articles/index/news?class=article">WRONG!</a>
293
+ # ```
294
+ #
295
+ # `link_to` can also produce links with anchors or query strings:
296
+ #
297
+ # ```ruby
298
+ # link_to "Comment wall", profile_path(@profile, anchor: "wall")
299
+ # # => <a href="/profiles/1#wall">Comment wall</a>
300
+ #
301
+ # link_to "Ruby on Rails search", controller: "searches", query: "ruby on rails"
302
+ # # => <a href="/searches?query=ruby+on+rails">Ruby on Rails search</a>
303
+ #
304
+ # link_to "Nonsense search", searches_path(foo: "bar", baz: "quux")
305
+ # # => <a href="/searches?foo=bar&amp;baz=quux">Nonsense search</a>
306
+ # ```
307
+ #
308
+ # The only option specific to `link_to` (`:method`) is used as follows:
309
+ #
310
+ # ```ruby
311
+ # link_to("Destroy", "http://www.example.com", method: :delete)
312
+ # # => <a href='http://www.example.com' rel="nofollow" data-method="delete">Destroy</a>
313
+ # ```
314
+ #
315
+ # You can also use custom data attributes using the `:data` option:
316
+ #
317
+ # ```ruby
318
+ # link_to "Visit Other Site", "http://www.rubyonrails.org/", data: { confirm: "Are you sure?" }
319
+ # # => <a href="http://www.rubyonrails.org/" data-confirm="Are you sure?">Visit Other Site</a>
320
+ # ```
321
+ #
322
+ # Also you can set any link attributes such as `target`, `rel`, `type`:
323
+ #
324
+ # ```ruby
325
+ # link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow"
326
+ # # => <a href="http://www.rubyonrails.org/" target="_blank" rel="nofollow">External link</a>
327
+ # ```
328
+ sig do
329
+ params(
330
+ name: String,
331
+ options: T.untyped,
332
+ html_options: T.untyped,
333
+ block: T.untyped
334
+ ).returns(ActiveSupport::SafeBuffer)
335
+ end
336
+ def link_to(name = nil, options = nil, html_options = nil, &block); end
337
+
338
+ # Creates a link tag of the given `name` using a URL created by the set of
339
+ # `options` if `condition` is true, otherwise only the name is
340
+ # returned. To specialize the default behavior, you can pass a block that
341
+ # accepts the name or the full argument list for `link_to_unless` (see the examples
342
+ # in `link_to_unless`).
343
+ #
344
+ # #### Examples
345
+ # ```ruby
346
+ # <%= link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) %>
347
+ # # If the user isn't logged in...
348
+ # # => <a href="/sessions/new/">Login</a>
349
+ # ```
350
+ #
351
+ # ```ruby
352
+ # <%=
353
+ # link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do
354
+ # link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user })
355
+ # end
356
+ # %>
357
+ # # If the user isn't logged in...
358
+ # # => <a href="/sessions/new/">Login</a>
359
+ # # If they are logged in...
360
+ # # => <a href="/accounts/show/3">my_username</a>
361
+ # ```
362
+ sig do
363
+ params(
364
+ condition: T.untyped,
365
+ name: String,
366
+ options: T.untyped,
367
+ html_options: T.untyped,
368
+ block: T.untyped
369
+ ).returns(T.untyped)
370
+ end
371
+ def link_to_if(condition, name, options = {}, html_options = {}, &block); end
372
+ end
373
+
374
+ module ActionView::Helpers::UrlHelper::ClassMethods; end
375
+
376
+ ActionView::Helpers::UrlHelper::BUTTON_TAG_METHOD_VERBS = T.let(T.unsafe(nil), T::Array[T.untyped])
377
+
378
+ ActionView::Helpers::UrlHelper::STRINGIFIED_COMMON_METHODS = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
379
+
380
+ module ActionView::Layouts
381
+ mixes_in_class_methods(::ActionView::Layouts::ClassMethods)
382
+ end
383
+
384
+ module ActionView::Layouts::ClassMethods; end
385
+
386
+ ActionView::RecordIdentifier::JOIN = T.let(T.unsafe(nil), String)
387
+
388
+ ActionView::RecordIdentifier::NEW = T.let(T.unsafe(nil), String)
389
+
390
+ module ActionView::Rendering
391
+ mixes_in_class_methods(ActionView::Rendering::ClassMethods)
392
+ end
393
+
394
+ module ActionView::Rendering::ClassMethods
395
+ end
396
+
397
+ module ActionView::ViewPaths
398
+ mixes_in_class_methods(ActionView::ViewPaths::ClassMethods)
399
+ end
400
+
401
+ module ActionView::ViewPaths::ClassMethods
402
+ sig do
403
+ params(
404
+ value: T.any(String, T::Array[String])
405
+ ).void
406
+ end
407
+ def append_view_path(value); end
408
+ end
@@ -0,0 +1,37 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi sorbet-typed
3
+ #
4
+ # If you would like to make changes to this file, great! Please upstream any changes you make here:
5
+ #
6
+ # https://github.com/sorbet/sorbet-typed/edit/master/lib/activesupport/>=6/activesupport.rbi
7
+ #
8
+ # typed: strong
9
+
10
+ class Array
11
+ sig { params(elements: T.untyped).returns(T::Array[T.untyped]) }
12
+ def excluding(*elements); end
13
+
14
+ sig do
15
+ params(
16
+ blk: T.nilable(T.proc.params(arg0: Elem).returns(T::Boolean))
17
+ ).returns(T.any(T::Array[Elem], T::Enumerable[Elem]))
18
+ end
19
+ def extract!(&blk); end
20
+
21
+ sig { params(elements: T.untyped).returns(T::Array[T.untyped]) }
22
+ def including(*elements); end
23
+ end
24
+
25
+ module Enumerable
26
+ # https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/enumerable.rb#L70..L82
27
+ # the case where a block isn't given isn't handled - that seems like an unlikely case
28
+ sig do
29
+ type_parameters(:key).params(
30
+ default: T.untyped,
31
+ block: T.proc.params(o: Enumerable::Elem).returns(T.type_parameter(:key))
32
+ ).returns(
33
+ T::Hash[Enumerable::Elem, T.type_parameter(:key)]
34
+ )
35
+ end
36
+ def index_with(default = T.unsafe(nil), &block); end
37
+ end