fixture_builder 0.5.3.rc1 → 0.5.3.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fixture_builder/configuration.rb +3 -6
- data/lib/fixture_builder/version.rb +1 -1
- data/test/fixture_builder_test.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6960984d23f57205013cfbeb21f7ca1f261b112a5fccdd1b6d08f6fc2dcc2e90
|
4
|
+
data.tar.gz: b484db209790fb4926306f42906ad706a7c548d50020d8883cab58536440213f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b73f1cad2d377dff0238ab09d049288e7c9133716d79ff82bf054a5ac559b2e7a8baadd0b343231b31815baa46d7eb2950d9c3b1222e1a300fe083e8e06caa3
|
7
|
+
data.tar.gz: 6e5af6db6d0597e7b2a7437bd0bf964d19ef34795d506367d0f9c583375b1948af3c364ec2ebd7d04a6e30d32e086877b5ec523fffa67a9cbf957c150cfc805e
|
@@ -17,13 +17,14 @@ module FixtureBuilder
|
|
17
17
|
|
18
18
|
ACCESSIBLE_ATTRIBUTES = [:select_sql, :delete_sql, :skip_tables, :files_to_check, :record_name_fields,
|
19
19
|
:fixture_builder_file, :fixture_directory, :after_build, :legacy_fixtures, :model_name_procs,
|
20
|
-
:write_empty_files
|
20
|
+
:write_empty_files]
|
21
21
|
attr_accessor(*ACCESSIBLE_ATTRIBUTES)
|
22
22
|
|
23
23
|
SCHEMA_FILES = ['db/schema.rb', 'db/development_structure.sql', 'db/test_structure.sql', 'db/production_structure.sql']
|
24
24
|
|
25
25
|
def initialize(opts={})
|
26
26
|
@namer = Namer.new(self)
|
27
|
+
@use_sha1_digests = opts[:use_sha1_digests] || false
|
27
28
|
@file_hashes = file_hashes
|
28
29
|
@write_empty_files = true
|
29
30
|
end
|
@@ -100,10 +101,6 @@ module FixtureBuilder
|
|
100
101
|
@namer.name_model_with(model_class, &block)
|
101
102
|
end
|
102
103
|
|
103
|
-
def use_sha1_digests
|
104
|
-
@use_sha1_digests ||= false
|
105
|
-
end
|
106
|
-
|
107
104
|
def tables
|
108
105
|
ActiveRecord::Base.connection.tables - skip_tables
|
109
106
|
end
|
@@ -119,7 +116,7 @@ module FixtureBuilder
|
|
119
116
|
private
|
120
117
|
|
121
118
|
def file_hashes
|
122
|
-
algorithm = use_sha1_digests ? Digest::SHA1 : Digest::MD5
|
119
|
+
algorithm = @use_sha1_digests ? Digest::SHA1 : Digest::MD5
|
123
120
|
files_to_check.inject({}) do |hash, filename|
|
124
121
|
hash[filename] = algorithm.hexdigest(File.read(filename))
|
125
122
|
hash
|
@@ -102,8 +102,7 @@ class FixtureBuilderTest < Test::Unit::TestCase
|
|
102
102
|
create_and_blow_away_old_db
|
103
103
|
force_fixture_generation_due_to_differing_file_hashes
|
104
104
|
|
105
|
-
FixtureBuilder.configure do |fbuilder|
|
106
|
-
fbuilder.use_sha1_digests = true
|
105
|
+
FixtureBuilder.configure(use_sha1_digests: true) do |fbuilder|
|
107
106
|
fbuilder.files_to_check += Dir[test_path("*.rb")]
|
108
107
|
fbuilder.factory do
|
109
108
|
@enty = MagicalCreature.create(:name => 'Enty', :species => 'ent',
|