fixture_builder 0.5.1 → 0.5.2.rc1

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
  SHA1:
3
- metadata.gz: 499d1a3d06e5d9732242c5ad93180428b5096c0f
4
- data.tar.gz: 314a0687affb10304071948600b16be784b86522
3
+ metadata.gz: c86b3325f334daf08be3fd9635c973893ccdad34
4
+ data.tar.gz: 3aa152fb4a495183f2e059eb48682e45fd9fcf04
5
5
  SHA512:
6
- metadata.gz: eb6dba58db8919c5505aab4e195dc1a9893f8694b5f890769f9181a3f2029b9445d49c903684f6b4e416db0dc628bdde78d8164b303c4353e9f26f739ed52324
7
- data.tar.gz: 15bd4e3b6cb7a7500637ed77e0e5822be2d90b0207b13b21bd76a54127c089e282cd847ae50c857421fa6dd24faf3072341b9c6545a3123d4ebb23b4c57bbe29
6
+ metadata.gz: 04fb9eb40c4a7ae966d7e95fe16696a2dda9092f34aab960955bb53fecc95944ba541d612d32bee66f49291c14f94e38830ee532352141db6191cb6f3a0826c7
7
+ data.tar.gz: 4f4ef5a551c3aa89de18356493e5d56ac469b758f1dd64709d0ad8f3409e8b18b2fb9f5c9d5223ddfeb74168f39dadb81d7702536dd52c56f072889532731d69
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ pkg/
5
5
  tmp/fixture_builder.yml
6
6
  test/fixtures/magical_creatures.yml
7
7
  Gemfile.lock
8
+ *.gem
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
 
26
26
  s.add_dependency %q{activerecord}, '>= 2'
27
27
  s.add_dependency %q{activesupport}, '>= 2'
28
+ s.add_dependency %q{hashdiff}
28
29
  s.add_development_dependency %q{rake}
29
30
  s.add_development_dependency %q{rails}, '>= 2'
30
31
  s.add_development_dependency %q{test-unit}
@@ -2,6 +2,7 @@ require 'active_support/core_ext'
2
2
  require 'active_support/core_ext/string'
3
3
  require 'digest/md5'
4
4
  require 'fileutils'
5
+ require 'hashdiff'
5
6
 
6
7
  module FixtureBuilder
7
8
  class Configuration
@@ -124,7 +125,20 @@ module FixtureBuilder
124
125
  end
125
126
 
126
127
  def rebuild_fixtures?
127
- @file_hashes != read_config
128
+ file_hashes_from_disk= @file_hashes
129
+ file_hashes_from_config= read_config
130
+ if Dir.glob('spec/fixtures/*.yml').blank?
131
+ puts '=> rebuilding fixtures because spec/fixtures has no *.yml files'
132
+ return true
133
+ elsif !::File.exists?(::File.expand_path('../../../tmp/fixture_builder.yml', __FILE__))
134
+ puts '=> rebuilding fixtures because tmp/fixture_builder.yml does not exist'
135
+ return true
136
+ elsif file_hashes_from_disk != file_hashes_from_config
137
+ puts '=> rebuilding fixtures because one or more of the following files have changed:'
138
+ HashDiff.diff(file_hashes_from_disk, file_hashes_from_config).map {|diff| print ' '; p diff}
139
+ return true
140
+ end
141
+ false
128
142
  end
129
143
  end
130
144
  end
@@ -1,3 +1,3 @@
1
1
  module FixtureBuilder
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2.rc1'
3
3
  end
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.1
4
+ version: 0.5.2.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Dy
@@ -40,6 +40,20 @@ dependencies:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '2'
43
+ - !ruby/object:Gem::Dependency
44
+ name: hashdiff
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
43
57
  - !ruby/object:Gem::Dependency
44
58
  name: rake
45
59
  requirement: !ruby/object:Gem::Requirement