fixture_kit 0.13.0 → 0.14.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/lib/fixture_kit/definition.rb +4 -0
- data/lib/fixture_kit/event.rb +19 -0
- data/lib/fixture_kit/fixture.rb +4 -3
- data/lib/fixture_kit/version.rb +1 -1
- data/lib/fixture_kit.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ec46a033864696a48fe4a196744b61dd142aeabee84a68f65554ccf698d4e72
|
|
4
|
+
data.tar.gz: 5e41645bf7246d12f8a0bbecb4bbad7bcb6f1f2dddab685fc6c32b459c2a3550
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd821fd991c0ded4d4d10f963ece4cde8740c55c88fce238cf0033adbb791e2e64b50b3257c82a6fecd93e8810cd068e49329361b26661dd4072c1287c618ae3
|
|
7
|
+
data.tar.gz: 416bed6e4889c63a5a860c55b45e3f525499682cd5367e712b365555361fd36bd561c3e0cd02259d32f969c9877a50d0f01c570f0159af68a01334f526968f2d
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module FixtureKit
|
|
4
|
+
class Event
|
|
5
|
+
attr_reader :fixture
|
|
6
|
+
|
|
7
|
+
def initialize(fixture)
|
|
8
|
+
@fixture = fixture
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def identifier
|
|
12
|
+
fixture.cache.identifier
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def path
|
|
16
|
+
fixture.definition.path
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
data/lib/fixture_kit/fixture.rb
CHANGED
|
@@ -46,9 +46,10 @@ module FixtureKit
|
|
|
46
46
|
!identifier.is_a?(String)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
def emit(
|
|
49
|
+
def emit(event_name)
|
|
50
|
+
fixture_event = Event.new(self)
|
|
50
51
|
unless block_given?
|
|
51
|
-
configuration.callbacks.run(
|
|
52
|
+
configuration.callbacks.run(event_name, fixture_event)
|
|
52
53
|
return
|
|
53
54
|
end
|
|
54
55
|
|
|
@@ -56,7 +57,7 @@ module FixtureKit
|
|
|
56
57
|
elapsed = Benchmark.realtime do
|
|
57
58
|
value = yield
|
|
58
59
|
end
|
|
59
|
-
configuration.callbacks.run(
|
|
60
|
+
configuration.callbacks.run(event_name, fixture_event, elapsed)
|
|
60
61
|
value
|
|
61
62
|
end
|
|
62
63
|
end
|
data/lib/fixture_kit/version.rb
CHANGED
data/lib/fixture_kit.rb
CHANGED
|
@@ -15,6 +15,7 @@ module FixtureKit
|
|
|
15
15
|
autoload :Callbacks, File.expand_path("fixture_kit/callbacks", __dir__)
|
|
16
16
|
autoload :ConfigurationHelper, File.expand_path("fixture_kit/configuration_helper", __dir__)
|
|
17
17
|
autoload :Singleton, File.expand_path("fixture_kit/singleton", __dir__)
|
|
18
|
+
autoload :Event, File.expand_path("fixture_kit/event", __dir__)
|
|
18
19
|
autoload :Fixture, File.expand_path("fixture_kit/fixture", __dir__)
|
|
19
20
|
autoload :Definition, File.expand_path("fixture_kit/definition", __dir__)
|
|
20
21
|
autoload :Registry, File.expand_path("fixture_kit/registry", __dir__)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fixture_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ngan Pham
|
|
@@ -163,6 +163,7 @@ files:
|
|
|
163
163
|
- lib/fixture_kit/configuration.rb
|
|
164
164
|
- lib/fixture_kit/configuration_helper.rb
|
|
165
165
|
- lib/fixture_kit/definition.rb
|
|
166
|
+
- lib/fixture_kit/event.rb
|
|
166
167
|
- lib/fixture_kit/file_cache.rb
|
|
167
168
|
- lib/fixture_kit/fixture.rb
|
|
168
169
|
- lib/fixture_kit/memory_cache.rb
|