fixation 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +10 -0
- data/lib/fixation.rb +5 -1
- data/lib/fixation/fixtures.rb +5 -3
- data/lib/fixation/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 151ea3c40b12fc39c767101d6a5c31594d1f4bf18db09c6185d9c0761a13390f
|
4
|
+
data.tar.gz: be61abe2ac1a24349c0e20743b77c36754a786b135a4fc962be318bb0a61e4b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '076234591186bc2ecf779c89378905d43585b4b0c127f0a1f190e146c11a6b158e0d14a4860726f7cc8d49655b28ec5f8b42cd5cd27656ea0e03133329ecd137'
|
7
|
+
data.tar.gz: 787a3bec0d590b865245eb2dc1b4df1e913faeb4814fa7de357019503489614722454f4e4c88d39cd459b95a1eb09f0a5c2140264dec687044cfd9b539e545fe
|
data/README.md
CHANGED
@@ -76,6 +76,16 @@ if Rails.env.test? && Fixation.running_under_spring?
|
|
76
76
|
end
|
77
77
|
```
|
78
78
|
|
79
|
+
## Included fixture file extensions
|
80
|
+
|
81
|
+
Fixation will load files with either the `.yml` or `.yml.erb` extension from the configured fixture paths. You can change this in your initializer in a similar fashion to the fixture paths:
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
if Rails.env.test?
|
85
|
+
Fixation.extensions = %w(.yml .other.extension)
|
86
|
+
end
|
87
|
+
```
|
88
|
+
|
79
89
|
## Auto-clearing other tables
|
80
90
|
|
81
91
|
By default Fixation will only reset those tables that have a fixture file, like Rails. Optionally, you can tell it to clear all other tables so that you don't need to make empty fixture files.
|
data/lib/fixation.rb
CHANGED
@@ -8,10 +8,14 @@ require_relative "fixation/fixture_table"
|
|
8
8
|
require_relative "fixation/fixtures"
|
9
9
|
|
10
10
|
module Fixation
|
11
|
-
# The list of paths to look in to find
|
11
|
+
# The list of paths to look in to find fixture files.
|
12
12
|
cattr_accessor :paths
|
13
13
|
self.paths = %w(test/fixtures spec/fixtures)
|
14
14
|
|
15
|
+
# The list of extensions to look for in fixture directories.
|
16
|
+
cattr_accessor :extensions
|
17
|
+
self.extensions = %w(.yml .yml.erb)
|
18
|
+
|
15
19
|
# Set to true to clear any tables found in the database that do *not* have a fixture file.
|
16
20
|
cattr_accessor :clear_other_tables
|
17
21
|
|
data/lib/fixation/fixtures.rb
CHANGED
@@ -15,9 +15,11 @@ module Fixation
|
|
15
15
|
@loaded_at = ActiveRecord::Base.default_timezone == :utc ? Time.now.utc : Time.now
|
16
16
|
|
17
17
|
Fixation.paths.each do |path|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
Fixation.extensions.each do |extension|
|
19
|
+
Dir["#{path}/{**,*}/*#{extension}"].each do |pathname|
|
20
|
+
basename = pathname[path.size + 1..-(extension.size + 1)]
|
21
|
+
load_fixture_file(pathname, basename, connection) if ::File.file?(pathname)
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
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.3.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:
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,9 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.7.6
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: 10x faster fixture startup under spring.
|
87
87
|
test_files: []
|
88
|
-
has_rdoc:
|