guard-migrate 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/guard/migrate/version.rb +1 -1
- data/lib/guard/migrate.rb +1 -1
- data/spec/guard/migrate_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 02b5942cae91b0ee217f8afcf353b4066c9b16c6
|
|
4
|
+
data.tar.gz: a6ab5b4e297f82a818422506acffddb38384ecf7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c25c8042fc4d700d3b0c94e56617ef38c4073588d7177d00f86e71976caeb301898dc5b0df94826d3d0c5e44597343ccc68b7604d82d6c272e8617cb8f122e0
|
|
7
|
+
data.tar.gz: a1c2af5372a9c6810be5c714375836712777d8eed4e98be44c4f4531dc69dfaca477330f87f9b8b07fc70c86c92e01edebaf3aa7d730872353ff54f5f6258939
|
data/lib/guard/migrate.rb
CHANGED
|
@@ -70,7 +70,7 @@ module Guard
|
|
|
70
70
|
|
|
71
71
|
# Called on file(s) modifications
|
|
72
72
|
def run_on_changes(paths)
|
|
73
|
-
if paths.any?{|path| path.match(%r{^db/migrate/(\d+).+\.rb})}
|
|
73
|
+
if paths.any?{|path| path.match(%r{^db/migrate/(\d+).+\.rb})} || reset?
|
|
74
74
|
migrations = paths.map {|path| Migration.new(path)}
|
|
75
75
|
migrate(migrations)
|
|
76
76
|
elsif paths.any?{|path| path.match(%r{^db/seeds\.rb$})}
|
data/spec/guard/migrate_spec.rb
CHANGED
|
@@ -206,10 +206,18 @@ describe Guard::Migrate do
|
|
|
206
206
|
let(:paths){ ['db/seeds.rb'] }
|
|
207
207
|
let(:options){ {:seed => true, :test_clone => true} }
|
|
208
208
|
its(:seed_only_string){ should match(/db:seed db:test:clone/) }
|
|
209
|
+
|
|
209
210
|
it "runs the rake command with seed only" do
|
|
210
211
|
subject.should_receive(:system).with(subject.seed_only_string)
|
|
211
212
|
subject.run_on_changes paths
|
|
212
213
|
end
|
|
214
|
+
|
|
215
|
+
context "When reset is set to true" do
|
|
216
|
+
let(:options){ {:seed => true, :reset => true} }
|
|
217
|
+
|
|
218
|
+
its(:rake_string){ should match(/db:seed/)}
|
|
219
|
+
its(:rake_string){ should match(/db:migrate:reset/)}
|
|
220
|
+
end
|
|
213
221
|
end
|
|
214
222
|
end
|
|
215
223
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: guard-migrate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Geoff Lanotte
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: guard
|