fixtury 1.0.0.beta2 → 1.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fixtury/configuration.rb +17 -16
- data/lib/fixtury/version.rb +1 -1
- 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: e87073aed4eaadac63331ef0ca8613b5ed5534ad2d29886bc8c7a2a34a828d52
|
4
|
+
data.tar.gz: adf2bdb804f103bcafa7967bf47d7a405c9a05d1c2ac11f56826491c892133bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6e0314bbc8fbb13465d8cb1a27f7b431f1c9ba788a218bc9754926a2c18390d6ebbd95897e547cc675e002704954e6616cec3dc0375def04852f0a49070a4ea
|
7
|
+
data.tar.gz: d4cadd16d4aad50d5ec31d56eb5a66a8e2d3afc14d22d1bec298768bcf9af342bb13db0126a48d9b61e4fd19e1691f3d647b6213105e9f3f4b49791db4db5234
|
data/Gemfile.lock
CHANGED
@@ -69,6 +69,23 @@ module Fixtury
|
|
69
69
|
File.binwrite(filepath, file_data.to_yaml)
|
70
70
|
end
|
71
71
|
|
72
|
+
def files_changed?
|
73
|
+
return true if stored_data.nil?
|
74
|
+
|
75
|
+
stored_checksums = (stored_data[:dependencies] || {})
|
76
|
+
seen_filepaths = []
|
77
|
+
calculate_checksums do |filepath, checksum|
|
78
|
+
# Early return if the checksums don't match
|
79
|
+
return true unless stored_checksums[filepath] == checksum
|
80
|
+
|
81
|
+
seen_filepaths << filepath
|
82
|
+
end
|
83
|
+
|
84
|
+
# If we have a new file or a file has been removed, we need to report a change.
|
85
|
+
seen_filepaths.sort != stored_checksums.keys.sort
|
86
|
+
end
|
87
|
+
|
88
|
+
|
72
89
|
private
|
73
90
|
|
74
91
|
def file_data
|
@@ -90,22 +107,6 @@ module Fixtury
|
|
90
107
|
YAML.unsafe_load_file(filepath)
|
91
108
|
end
|
92
109
|
|
93
|
-
def files_changed?
|
94
|
-
return true if stored_data.nil?
|
95
|
-
|
96
|
-
stored_checksums = (stored_data[:dependencies] || {})
|
97
|
-
seen_filepaths = []
|
98
|
-
calculate_checksums do |filepath, checksum|
|
99
|
-
# Early return if the checksums don't match
|
100
|
-
return true unless stored_checksums[filepath] == checksum
|
101
|
-
|
102
|
-
seen_filepaths << filepath
|
103
|
-
end
|
104
|
-
|
105
|
-
# If we have a new file or a file has been removed, we need to report a change.
|
106
|
-
seen_filepaths.sort != stored_checksums.keys.sort
|
107
|
-
end
|
108
|
-
|
109
110
|
def calculate_checksums(&block)
|
110
111
|
(fixture_files.to_a | dependency_files.to_a).sort.each do |filepath|
|
111
112
|
yield filepath, Digest::MD5.file(filepath).hexdigest
|
data/lib/fixtury/version.rb
CHANGED