sfb_scripts 0.1.4 → 0.1.5

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: c25478096a96443654c5b18730012c7bd085d8c1
4
- data.tar.gz: 590320e8848c363e490860e0ef2c90dc89938479
3
+ metadata.gz: 040cc528b5e6a229fa6b9410e85610233421f773
4
+ data.tar.gz: 7e6c87661337a595ce6c3bf3c879c45cd8b068ac
5
5
  SHA512:
6
- metadata.gz: 8817e13fc7f3fbc658314c3d45e353059adda7608b34f960f21b732d0e35031fe4a99aceb80a509fc773c874c6d80545e92eda351136d03fce0df9428cbc4ced
7
- data.tar.gz: c351955dd31c31cc70b9124522b689b29231cf547487e3063a0ebf1946b4fec307b9e8b1f2986f7a7b5e5f0901df5b60d746e33849f22b8c2ea9987566e08481
6
+ metadata.gz: ae6a576d2cf826975327162c7c1cc98534939e7b4b8b9b75d24a11ce11f644302f147e46cf86fcd0da1d508eab45598cceeb018a884d8c7fd81c8f55053e588e
7
+ data.tar.gz: c59781c6bbd1316b5e949e3939b46d8271c70822cfb9bc870e4c4ac3ec42bf4e55b234a89959108daa92d0f0b120926dbc4043ca64861425807f21f4f012a8f7
data/bin/app_up CHANGED
@@ -11,10 +11,11 @@ class CLI < Thor
11
11
 
12
12
  desc "up", "Rebase your commits onto master. Bundle installs and migrates as needed. Will terminate if conflicts are found."
13
13
  option :loud, :type => :boolean, :desc => 'Pipe output to terminal or not (output is always piped to /tmp/up.log)'
14
- option :all, :type => :boolean, :desc => "Don't update the repo, just bundle and migrate everywhere."
14
+ option :no_git, aliases: :all, :type => :boolean, :desc => "Don't update the repo, just bundle and migrate everywhere."
15
+ option :no_engines, type: :boolean, desc: "Don't migrate engines"
15
16
 
16
17
  def up
17
- if options[:all]
18
+ if options[:no_git]
18
19
  Upper.no_git(options)
19
20
  else
20
21
  Upper.rebase_on_master!(options)
data/lib/migrator.rb CHANGED
@@ -1,9 +1,12 @@
1
1
  class Migrator
2
2
  attr_accessor :shell, :repo
3
3
 
4
- def initialize(repo: raise, shell: raise)
4
+ # hack: move engines flag into
5
+ # another object that decides
6
+ def initialize(repo: raise, shell: raise, migrate_engines: raise)
5
7
  @shell = shell
6
8
  @repo = repo
9
+ @migrate_engines = migrate_engines
7
10
  end
8
11
 
9
12
  def migrate_where_necessary
@@ -14,15 +17,21 @@ class Migrator
14
17
  end
15
18
 
16
19
  def directories_to_migrate
17
- migrate_dirs = repo.files_changed.select {|f| f.match("/migrate/") }.map {|f| File.dirname(f) }.uniq
20
+ migrate_dirs = repo.files_changed.select {|f| f.match("/migrate/") }.map {|f| File.dirname(f) }.map {|dir| dir.gsub(/\/db\/migrate$/, '')}.uniq
18
21
  migrate_dirs.select {|d| in_rack_application?(d) };
19
22
  end
20
23
 
21
24
  private
22
25
 
23
26
  def in_rack_application?(migrate_dir)
24
- root_dir = migrate_dir.gsub(/db\/migrate$/, '')
25
- true
27
+ if migrate_engines?
28
+ true
29
+ else
30
+ ! migrate_dir.match(/engines/)
31
+ end
26
32
  end
27
33
 
34
+ def migrate_engines?
35
+ @migrate_engines
36
+ end
28
37
  end
data/lib/needs_manager.rb CHANGED
@@ -69,7 +69,7 @@ class NeedsManager
69
69
  end
70
70
 
71
71
  def create_migrator
72
- env[:migrator] = Migrator.new(shell: env[:shell], repo: env[:repo])
72
+ env[:migrator] = Migrator.new(shell: env[:shell], repo: env[:repo], migrate_engines: ! options[:no_engines])
73
73
  end
74
74
 
75
75
  def create_test_runner
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: 0.1.4
4
+ version: 0.1.5
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-05-15 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -85,4 +85,3 @@ signing_key:
85
85
  specification_version: 4
86
86
  summary: Easily update your rails app and run tests from command line
87
87
  test_files: []
88
- has_rdoc: