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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d7f04907bb50bacd416534ed78dbe5205e639cb9
4
- data.tar.gz: eac0e4498d2170e42572ceab300a7a4fe5aff477
2
+ SHA256:
3
+ metadata.gz: 151ea3c40b12fc39c767101d6a5c31594d1f4bf18db09c6185d9c0761a13390f
4
+ data.tar.gz: be61abe2ac1a24349c0e20743b77c36754a786b135a4fc962be318bb0a61e4b3
5
5
  SHA512:
6
- metadata.gz: a621c179c474fb230b93577b77cb4d5a681b85e9fe133d0e95df7d6b9be929e9a03c2f71d4bfc079abdaf7eb14a410ac5d92612f02ecc416f0f42d63997ddceb
7
- data.tar.gz: '07581f2633f211d575e9490d391064aba08e7be4ff5650d4a3cb3f8a94a3152ea6cf8242e4278d589f4fc2a5f13dd31c68d36d0ba4025d80adc3e07db0d1c265'
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.
@@ -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 .yml fixture files.
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
 
@@ -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
- Dir["#{path}/{**,*}/*.yml"].each do |pathname|
19
- basename = pathname[path.size + 1..-5]
20
- load_fixture_file(pathname, basename, connection) if ::File.file?(pathname)
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
 
@@ -1,3 +1,3 @@
1
1
  module Fixation
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
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.2.0
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: 2017-11-20 00:00:00.000000000 Z
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.5.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: