vident 0.3.0 → 0.3.1

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: c2f2d014f440bdd33f9910c04ba79846825afb4c8a61bd6e5079079fd07c0473
4
- data.tar.gz: fb730836ba6c63a582f97afcaceed12467a1b8ac92f2f5d9a0d871a4791c3de4
3
+ metadata.gz: 24963e09fb8ecd09d22f1254eecc8f2d8bf255123e92976f12d224531003b42a
4
+ data.tar.gz: 3b280628d9aa0ee62ad7b92b5ea58e628d3817e74567cfafb4ef22eadedd707e
5
5
  SHA512:
6
- metadata.gz: da7e90adb10d5301803cde48f06685983478c01eec44bfe0c8db9a0909734572ccc1ee72490850655bc915f4c2de17d27b1191d3d649c53d7a23d2d1e40b83a2
7
- data.tar.gz: 2626db1242b53e3abe20c75a8269125e564e1bc89a178f6e76feccda869ef2c41d671d0ece1a48f55441d6e4483e4962c76118ba48beba991529fe2e0ed322cc
6
+ metadata.gz: fe03e658c1d0ca0e537b66cf465c9628566507053aaf7fbd2d03125a98c1f5f829a1a7c51fb2751314aa38648f3119337ebfa2df932d462dd4e2ab31a235b730
7
+ data.tar.gz: 100fb3cbe9fce6cb5083ebd95237796f57d73f44a02385e274d0e433763c0037cbad8d257994aa059e5ab6e137fb781309ea24f2cf277e22ec59f79d3f370343
data/lib/vident/base.rb CHANGED
@@ -29,7 +29,7 @@ module Vident
29
29
 
30
30
  # stimulus controller identifier
31
31
  def stimulus_identifier
32
- stimulus_identifier_from_path(identifier_name_path)
32
+ ::Vident::Base.stimulus_identifier_from_path(identifier_name_path)
33
33
  end
34
34
 
35
35
  def identifier_name_path
@@ -40,10 +40,6 @@ module Vident
40
40
  end
41
41
  end
42
42
 
43
- def stimulus_identifier_from_path(path)
44
- path.split("/").map { |p| p.to_s.dasherize }.join("--")
45
- end
46
-
47
43
  def phlex_component?
48
44
  @phlex_component ||= ancestors.map(&:name).include?("Phlex::HTML")
49
45
  end
@@ -147,6 +143,11 @@ module Vident
147
143
  self.class.identifier_name_path
148
144
  end
149
145
 
146
+ def stimulus_identifier_from_path(path)
147
+ path.split("/").map { |p| p.to_s.dasherize }.join("--")
148
+ end
149
+ module_function :stimulus_identifier_from_path
150
+
150
151
  protected
151
152
 
152
153
  # Prepare the stimulus attributes for a StimulusComponent
@@ -100,6 +100,9 @@ module Vident
100
100
  else
101
101
  @cache_key ||= {}
102
102
  end
103
+
104
+ # TODO: remove the benchmarking code here
105
+
103
106
  if @enable_cache_key_benchmarking
104
107
  time = ::Benchmark.measure { generate_cache_key(n) }
105
108
  ::Logging::Log.debug "Cache key #{self.class.name}: #{time.real}"
@@ -45,7 +45,7 @@ module Vident
45
45
  def test_renders_with_valid_attrs_#{index}
46
46
  test_attrs = #{test}
47
47
  begin
48
- render_inline(#{class_under_test}.new(**test_attrs))
48
+ @results_content << render_inline(#{class_under_test}.new(**test_attrs))
49
49
  rescue => error
50
50
  assert(false, "Should not raise with #{test.to_s.tr("\"", "'")} but did raise \#{error}")
51
51
  end
@@ -58,7 +58,7 @@ module Vident
58
58
  def test_raises_with_invalid_attrs_#{index}
59
59
  test_attrs = #{test}
60
60
  assert_raises(StandardError, "Should raise with #{test.to_s.tr("\"", "'")}") do
61
- render_inline(#{class_under_test}.new(**test_attrs))
61
+ @results_content << render_inline(#{class_under_test}.new(**test_attrs))
62
62
  end
63
63
  end
64
64
  RUBY
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vident
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vident
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Ierodiaconou
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-05 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport