vident 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +103 -418
- data/Rakefile +1 -12
- data/lib/tasks/vident_tasks.rake +4 -0
- data/lib/vident/attributes/not_typed.rb +3 -0
- data/lib/vident/base.rb +8 -29
- data/lib/vident/caching.rb +120 -0
- data/lib/vident/component.rb +0 -2
- data/lib/vident/engine.rb +15 -0
- data/lib/vident/root_component.rb +235 -0
- data/lib/vident/version.rb +1 -1
- data/lib/vident.rb +3 -36
- metadata +12 -30
- data/.standard.yml +0 -3
- data/CHANGELOG.md +0 -79
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -35
- data/LICENSE.txt +0 -21
- data/examples/avatar.png +0 -0
- data/examples/ex1.gif +0 -0
- data/lib/tasks/vident.rake +0 -37
- data/lib/vident/attributes/typed.rb +0 -229
- data/lib/vident/attributes/typed_niling_struct.rb +0 -27
- data/lib/vident/attributes/types.rb +0 -16
- data/lib/vident/caching/cache_key.rb +0 -144
- data/lib/vident/railtie.rb +0 -10
- data/lib/vident/root_component/base.rb +0 -237
- data/lib/vident/root_component/using_better_html.rb +0 -41
- data/lib/vident/root_component/using_phlex_html.rb +0 -50
- data/lib/vident/root_component/using_view_component.rb +0 -51
- data/lib/vident/tailwind.rb +0 -12
- data/lib/vident/test_case.rb +0 -8
- data/lib/vident/testing/attributes_tester.rb +0 -176
- data/lib/vident/testing/auto_test.rb +0 -70
- data/lib/vident/typed_component.rb +0 -48
- data/sig/vident.rbs +0 -4
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
if Gem.loaded_specs.has_key? "dry-struct"
|
4
|
-
require_relative "./attributes/typed"
|
5
|
-
|
6
|
-
module Vident
|
7
|
-
module TypedComponent
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
|
10
|
-
included do
|
11
|
-
include Vident::Base
|
12
|
-
include Vident::Attributes::Typed
|
13
|
-
|
14
|
-
attribute :id, String, delegates: false
|
15
|
-
attribute :html_options, Hash, delegates: false
|
16
|
-
attribute :element_tag, Symbol, delegates: false
|
17
|
-
|
18
|
-
# StimulusJS support
|
19
|
-
attribute :controllers, Array, default: [], delegates: false
|
20
|
-
attribute :actions, Array, default: [], delegates: false
|
21
|
-
attribute :targets, Array, default: [], delegates: false
|
22
|
-
attribute :data_maps, Array, default: [], delegates: false
|
23
|
-
|
24
|
-
# TODO normalise the syntax of defining actions, controllers, etc
|
25
|
-
attribute :named_classes, Hash, delegates: false
|
26
|
-
end
|
27
|
-
|
28
|
-
def initialize(attrs = {})
|
29
|
-
before_initialise(attrs)
|
30
|
-
prepare_attributes(attrs)
|
31
|
-
# The attributes need to also be set as ivars
|
32
|
-
attributes.each do |attr_name, attr_value|
|
33
|
-
instance_variable_set(self.class.attribute_ivar_names[attr_name], attr_value)
|
34
|
-
end
|
35
|
-
after_initialise
|
36
|
-
super()
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
else
|
41
|
-
module Vident
|
42
|
-
module TypedComponent
|
43
|
-
def self.included(base)
|
44
|
-
raise "Vident::TypedComponent requires dry-struct to be installed"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
data/sig/vident.rbs
DELETED