fixation 2.3.0 → 2.4.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/fixation/fixture_table.rb +7 -7
- data/lib/fixation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '08d3f0b4a0bebfaae98d5ff58865a6c2836d24a8739ab8de176cbcf752eec6fe'
|
|
4
|
+
data.tar.gz: 1a326185780f5fbaecff539b4e21f13f9a4ed1c245e93f2f1e38e10c1391b40e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d243dbc5164455511a2c103bccf4d90b98657b1cb5a2a2e5a965e05490e78771f0cb7d19276cef42821cd3184c040c4ea1a2db642298dd160ff77bd2bf37fd5f
|
|
7
|
+
data.tar.gz: 1d87ce1996a76958674f106f17f20cfe736d07d04bc907b5375ee895c34818e268d31ca9d3c2f63cd3d64101ade95c59b3e54f8c6ff3edfee29b5f585057d364
|
|
@@ -2,6 +2,12 @@ module Fixation
|
|
|
2
2
|
class FixtureTable
|
|
3
3
|
attr_reader :filename, :fixture_name, :class_name, :table_name, :connection, :loaded_at
|
|
4
4
|
|
|
5
|
+
def self.erb_content(filename)
|
|
6
|
+
template = File.read(filename)
|
|
7
|
+
render_context = ActiveRecord::FixtureSet::RenderContext.create_subclass.new.get_binding
|
|
8
|
+
ERB.new(template).result(render_context)
|
|
9
|
+
end
|
|
10
|
+
|
|
5
11
|
def initialize(filename, basename, connection, loaded_at)
|
|
6
12
|
@filename = filename
|
|
7
13
|
@connection = connection
|
|
@@ -31,14 +37,8 @@ module Fixation
|
|
|
31
37
|
@columns_hash ||= connection.columns(table_name).index_by(&:name)
|
|
32
38
|
end
|
|
33
39
|
|
|
34
|
-
def content
|
|
35
|
-
template = File.read(filename)
|
|
36
|
-
render_context = ActiveRecord::FixtureSet::RenderContext.create_subclass.new.get_binding
|
|
37
|
-
ERB.new(template).result(render_context)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
40
|
def parsed_rows
|
|
41
|
-
result = YAML.load(
|
|
41
|
+
result = YAML.load(self.class.erb_content(filename))
|
|
42
42
|
result ||= {} # for completely empty files
|
|
43
43
|
|
|
44
44
|
unless (result.is_a?(Hash) || result.is_a?(YAML::Omap)) && result.all? { |name, attributes| name.is_a?(String) && attributes.is_a?(Hash) }
|
data/lib/fixation/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fixation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Will Bryant
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-05-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|