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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6071bbfbe6292826de322859de484c8dd5dc0125
4
- data.tar.gz: e9a9b0dfab9190ff9e8ca5b11f680e0b372e84ce
3
+ metadata.gz: 02b5942cae91b0ee217f8afcf353b4066c9b16c6
4
+ data.tar.gz: a6ab5b4e297f82a818422506acffddb38384ecf7
5
5
  SHA512:
6
- metadata.gz: 9cfdbca1c0ffe16b272a8acd877aeb64f3f2f795610008d96ec960c2663ab8b0bede856f1548a3416a095055389d6accfbc7bb5d0098086ed9c9f598c46273cf
7
- data.tar.gz: 083669965c9746167e05117b178a60b50d249b6df0b21faad44e3680a28b70fe7f7fe7754be6d715a37e25da88679d9df2334b8942e074814388ceb8fb2c5cdf
6
+ metadata.gz: 6c25c8042fc4d700d3b0c94e56617ef38c4073588d7177d00f86e71976caeb301898dc5b0df94826d3d0c5e44597343ccc68b7604d82d6c272e8617cb8f122e0
7
+ data.tar.gz: a1c2af5372a9c6810be5c714375836712777d8eed4e98be44c4f4531dc69dfaca477330f87f9b8b07fc70c86c92e01edebaf3aa7d730872353ff54f5f6258939
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module MigrateVersion
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
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$})}
@@ -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.1
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-02-16 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard