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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcb6a4593af9b6e65c0c66416661f0e83b8e90e302a5cae7bda3814f877a35df
4
- data.tar.gz: c27a87f54ac741f46e539389a4e28083fc1a85ea3e770a1d5b1785d994f4c614
3
+ metadata.gz: 6960984d23f57205013cfbeb21f7ca1f261b112a5fccdd1b6d08f6fc2dcc2e90
4
+ data.tar.gz: b484db209790fb4926306f42906ad706a7c548d50020d8883cab58536440213f
5
5
  SHA512:
6
- metadata.gz: c08a939256623c0f800a097bd061f6ba05a9a2025b327216ae463c08df7b90e76b3437d202178cde20b668993b8ad13ee8383616c43167c11b5bce3fa6130f72
7
- data.tar.gz: '084e3cfc6b326b0d77e2dfa93e5a9740850298375e933a045c035ddbf6565b5dd06d9d12bba82def4e154196fa6cd1bf6a20b067c97419b2c27f5f346911d88b'
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, :use_sha1_digests]
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
@@ -1,3 +1,3 @@
1
1
  module FixtureBuilder
2
- VERSION = '0.5.3.rc1'
2
+ VERSION = '0.5.3.rc2'
3
3
  end
@@ -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',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixture_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3.rc1
4
+ version: 0.5.3.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Dy