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 +4 -4
- data/.gitignore +1 -0
- data/fixture_builder.gemspec +1 -0
- data/lib/fixture_builder/configuration.rb +15 -1
- data/lib/fixture_builder/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c86b3325f334daf08be3fd9635c973893ccdad34
|
4
|
+
data.tar.gz: 3aa152fb4a495183f2e059eb48682e45fd9fcf04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04fb9eb40c4a7ae966d7e95fe16696a2dda9092f34aab960955bb53fecc95944ba541d612d32bee66f49291c14f94e38830ee532352141db6191cb6f3a0826c7
|
7
|
+
data.tar.gz: 4f4ef5a551c3aa89de18356493e5d56ac469b758f1dd64709d0ad8f3409e8b18b2fb9f5c9d5223ddfeb74168f39dadb81d7702536dd52c56f072889532731d69
|
data/.gitignore
CHANGED
data/fixture_builder.gemspec
CHANGED
@@ -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
|
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
|
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.
|
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
|