sfb_scripts 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f85e393c87cefd7c1457d0cdb1ef0e4701619a34
4
- data.tar.gz: d6dfb9262c26a4914f92a6bb0aa4cb7ee0830c84
3
+ metadata.gz: 6756a959f1dc2f7edce5f49820219c7804611f3e
4
+ data.tar.gz: 29147f3ab81b1e3c21a1fe79e2db36634831c85f
5
5
  SHA512:
6
- metadata.gz: d350584195bd7d960fb1c635a3e72f0c7de42fbffeecf8332fc987d80176b58a68d3230dae49152431903ae85808f05b97e8f9d2e9ad99242a9f954f6a73319b
7
- data.tar.gz: eedf607c18f39d291863208cf6d777a5fbc1d7f834236060b416fe536f104f2c77a08173aa57cbd8a001960539a720499965084bf87c851d5ffc907115aa330b
6
+ metadata.gz: 2697d7ce36b4d07ba9321393f4b7b7f2c084a9f7759bf5b1405ae626cda50902da2b7c333e243a2c7face31ea31868895b797e7d83012e7c5c483dd6deb8cf74
7
+ data.tar.gz: ff7b5220d2c84f17ef0ebc96e2bfa6ae774b5eb6476f000c07a0993ab6f21ac9ded3907bb16f4f1c98dd1a8c46f3af8a7bebccc0cf9a1d11c967c3eba2a2b74c
data/bin/app_up CHANGED
@@ -41,6 +41,7 @@ class CLI < Thor
41
41
  option :on_branch, desc: "Rebase the current branch onto it's upstream counterpart. [Example: While on branch (feature_branch), using the --on-branch flag will yield the git command: 'git pull --rebase origin feature_branch'", default: 'master', default: false
42
42
  option :git_action, aliases: ['--action', '-g'], type: :array, desc: "Specify what command to pass to git [Example: app_up --git-action 'pull --rebase origin branch_name']. Defaults to 'pull --rebase origin master'."
43
43
  option :finish_rebase, aliases: ['--finish-merge'], type: :boolean, desc: "Recovers from rebase or merge conflicts"
44
+ option :reset, aliases: ['--drop-dbs'], type: :boolean, desc: "Drop and recreate all databases"
44
45
 
45
46
  def up
46
47
  if options[:no_git]
@@ -1,10 +1,11 @@
1
1
  class Migrator
2
- attr_accessor :shell, :repo, :queue, :folder_guard
2
+ attr_accessor :shell, :repo, :queue, :folder_guard, :drop_dbs
3
3
 
4
- def initialize(repo: raise, shell: raise, queue: raise, folder_guard: raise)
4
+ def initialize(repo:, shell:, queue:, folder_guard:, drop_dbs: false)
5
5
  @shell = shell
6
6
  @repo = repo
7
7
  @queue = queue
8
+ @drop_dbs = drop_dbs
8
9
  @folder_guard = folder_guard
9
10
  end
10
11
 
@@ -12,7 +13,7 @@ class Migrator
12
13
  shell.notify "\nMigrating:"
13
14
  migrations.each do |migration|
14
15
  queue.enqueue_b do
15
- shell.run "RAILS_ENV=#{migration[:env]} bundle exec rake db:create db:migrate", dir: migration[:dir]
16
+ shell.run "RAILS_ENV=#{migration[:env]} bundle exec rake #{drop_dbs ? 'db:drop' : ''} db:create 2> /dev/null;\n RAILS_ENV=#{migration[:env]} bundle exec rake db:migrate", dir: migration[:dir]
16
17
  end
17
18
  end
18
19
  queue.join
@@ -77,7 +77,7 @@ class NeedsManager
77
77
 
78
78
  def create_migrator
79
79
  queue = WorkQueue.new(MIGRATOR_MAX_THREAD_COUNT, nil)
80
- env[:migrator] = Migrator.new(shell: env[:shell], repo: env[:repo], queue: queue, folder_guard: env[:folder_guard])
80
+ env[:migrator] = Migrator.new(shell: env[:shell], repo: env[:repo], queue: queue, folder_guard: env[:folder_guard], drop_dbs: options[:reset])
81
81
  end
82
82
 
83
83
  def create_test_runner
@@ -1,3 +1,3 @@
1
1
  module SfbScripts
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfb_scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-14 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.2.2
110
+ rubygems_version: 2.4.3
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Easily update your rails app and run tests from command line