guard-migrate 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/guard/migrate.rb +1 -1
- data/lib/guard/migrate/version.rb +1 -1
- data/spec/guard/migrate_spec.rb +7 -7
- 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: 3978c547f56536dc0f65401d70e8f11b2736f66a
|
4
|
+
data.tar.gz: 31200b8768ef823b1479bf16ffa0e1cbe94ea78b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 542cac950167cbb5e950118f72d32bdad76b6016be0a5ab5bc8c9b61e52c3f4b88b74bdfc96791f0ce1856a126487a5e66c55e29c20567270aba72cd4cb8150b
|
7
|
+
data.tar.gz: 31cadc7674043cf7512b776baf4332726cf55803a33e0e64e3b8666d94ad52251afe489bf9a349615a7fa358051e5f82d72deea329f61c7ed92fd020eabb0d89
|
data/lib/guard/migrate.rb
CHANGED
@@ -70,7 +70,7 @@ module Guard
|
|
70
70
|
end
|
71
71
|
|
72
72
|
# Called on file(s) modifications
|
73
|
-
def
|
73
|
+
def run_on_modifications(paths)
|
74
74
|
if paths.any?{|path| path.match(%r{^db/migrate/(\d+).+\.rb})} || reset?
|
75
75
|
migrations = paths.map {|path| Migration.new(path)}
|
76
76
|
migrate(migrations)
|
data/spec/guard/migrate_spec.rb
CHANGED
@@ -215,7 +215,7 @@ describe Guard::Migrate do
|
|
215
215
|
|
216
216
|
it "runs the rake command with seed only" do
|
217
217
|
subject.should_receive(:system).with(subject.seed_only_string)
|
218
|
-
subject.
|
218
|
+
subject.run_on_modifications paths
|
219
219
|
end
|
220
220
|
|
221
221
|
context "When reset is set to true" do
|
@@ -232,7 +232,7 @@ describe Guard::Migrate do
|
|
232
232
|
let(:paths){ [create_valid_up_and_down_migration('1234_i_like_cheese').path] }
|
233
233
|
it "should run the rake command" do
|
234
234
|
subject.should_receive(:system).with(subject.rake_string('1234'))
|
235
|
-
subject.
|
235
|
+
subject.run_on_modifications paths
|
236
236
|
end
|
237
237
|
end
|
238
238
|
|
@@ -241,7 +241,7 @@ describe Guard::Migrate do
|
|
241
241
|
let(:options){ {:reset => true, :test_clone => true} }
|
242
242
|
it "should run the rake command" do
|
243
243
|
subject.should_receive(:system).with(subject.rake_string('1234'))
|
244
|
-
subject.
|
244
|
+
subject.run_on_modifications paths
|
245
245
|
end
|
246
246
|
end
|
247
247
|
|
@@ -251,28 +251,28 @@ describe Guard::Migrate do
|
|
251
251
|
migration = create_valid_up_and_down_migration('1234_i_like_cheese')
|
252
252
|
|
253
253
|
subject.should_receive(:system).with(subject.rake_string('1234'))
|
254
|
-
subject.
|
254
|
+
subject.run_on_modifications [migration.path]
|
255
255
|
end
|
256
256
|
|
257
257
|
it "should keep valid change migrations" do
|
258
258
|
migration = create_valid_change_migration('1234_i_like_cheese')
|
259
259
|
|
260
260
|
subject.should_receive(:system).with(subject.rake_string('1234'))
|
261
|
-
subject.
|
261
|
+
subject.run_on_modifications [migration.path]
|
262
262
|
end
|
263
263
|
|
264
264
|
it "should remove empty up/down migrations" do
|
265
265
|
migration = create_invalid_up_and_down_migration('1234_i_like_cheese')
|
266
266
|
|
267
267
|
subject.should_not_receive(:system).with(subject.rake_string('1234'))
|
268
|
-
subject.
|
268
|
+
subject.run_on_modifications [migration.path]
|
269
269
|
end
|
270
270
|
|
271
271
|
it "should remove empty change migrations" do
|
272
272
|
migration = create_invalid_change_migration('1234_i_like_cheese')
|
273
273
|
|
274
274
|
subject.should_not_receive(:system).with(subject.rake_string('1234'))
|
275
|
-
subject.
|
275
|
+
subject.run_on_modifications [migration.path]
|
276
276
|
end
|
277
277
|
end
|
278
278
|
|
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.4
|
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-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|