sfb_scripts 0.1.5 → 0.1.6

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: 040cc528b5e6a229fa6b9410e85610233421f773
4
- data.tar.gz: 7e6c87661337a595ce6c3bf3c879c45cd8b068ac
3
+ metadata.gz: f0464c1e7fede7cccf98042d942788add0dfae24
4
+ data.tar.gz: 0fca59a3f0c6b4722fdbc13d6319fc5576a7fef1
5
5
  SHA512:
6
- metadata.gz: ae6a576d2cf826975327162c7c1cc98534939e7b4b8b9b75d24a11ce11f644302f147e46cf86fcd0da1d508eab45598cceeb018a884d8c7fd81c8f55053e588e
7
- data.tar.gz: c59781c6bbd1316b5e949e3939b46d8271c70822cfb9bc870e4c4ac3ec42bf4e55b234a89959108daa92d0f0b120926dbc4043ca64861425807f21f4f012a8f7
6
+ metadata.gz: 8051d17a37e864aceb3fcae7f7812670d41d09254742e53ccbe5a1cc6c4f204f39c78f24e25f9990cb53a70693dab393bf653126ba3577f99f01022fc6bb2f80
7
+ data.tar.gz: 325b98013c47a1b60020128b23f6c71b4ddfd3396691b27dfb7a69155b9a18a813a4deb2bf71ee13c373d0fdf62972a7d86017cab9c6d03db1495249cafac723
data/bin/app_up CHANGED
@@ -9,12 +9,12 @@ class CLI < Thor
9
9
  # REBASE
10
10
  #
11
11
 
12
- desc "up", "Rebase your commits onto master. Bundle installs and migrates as needed. Will terminate if conflicts are found."
13
- option :loud, :type => :boolean, :desc => 'Pipe output to terminal or not (output is always piped to /tmp/up.log)'
12
+ desc "app_up", "Rebase your commits onto master. Bundle installs and migrates as needed. Will terminate if conflicts are found."
13
+ option :loud, :type => :boolean, :desc => 'Pipe output to terminal or not (output is always piped to /tmp/app_up.log)'
14
14
  option :no_git, aliases: :all, :type => :boolean, :desc => "Don't update the repo, just bundle and migrate everywhere."
15
15
  option :no_engines, type: :boolean, desc: "Don't migrate engines"
16
16
 
17
- def up
17
+ def app_up
18
18
  if options[:no_git]
19
19
  Upper.no_git(options)
20
20
  else
@@ -32,7 +32,7 @@ class CLI < Thor
32
32
  Upper.pre_push_hook(git_command, options)
33
33
  end
34
34
 
35
- default_task :up
35
+ default_task :app_up
36
36
  end
37
37
 
38
38
  CLI.start(ARGV)
data/lib/active_repo.rb CHANGED
@@ -3,6 +3,7 @@ require_relative 'repo'
3
3
  class ActiveRepo < Repo
4
4
 
5
5
  def rebase_on_master!
6
+ shell.notify "\nRebasing current branch on master:"
6
7
  up do
7
8
  # will raise an error with merge conflicts
8
9
  begin
@@ -21,9 +22,19 @@ class ActiveRepo < Repo
21
22
  end
22
23
 
23
24
  def up
24
- @old_sha = current_sha
25
+ old_sha = current_sha
25
26
  yield
26
- @new_sha = current_sha
27
+
28
+ set_files_changed(old_sha)
29
+ end
30
+
31
+ def set_files_changed(old_sha)
32
+ shell.notify "\nIdentifying changed files:"
33
+ @files_changed = (shell.run "git diff --name-only #{old_sha}").split("\n")
34
+ end
35
+
36
+ def files_changed
37
+ @files_changed
27
38
  end
28
39
 
29
40
  def pull_origin_master!
@@ -7,6 +7,7 @@ class BundleManager
7
7
  end
8
8
 
9
9
  def bundle_where_necessary
10
+ shell.notify "\nBundling:"
10
11
  find("Gemfile.lock").each do |gemfile_lock|
11
12
  if repo.changed?(gemfile_lock)
12
13
  bundle(directory_of(gemfile_lock))
data/lib/lazy_repo.rb CHANGED
@@ -2,8 +2,17 @@ require_relative 'repo'
2
2
 
3
3
  class LazyRepo < Repo
4
4
 
5
+ def initialize(*args)
6
+ super
7
+ set_all_files
8
+ end
9
+
5
10
  def files_changed
6
- all_files
11
+ @all_files
7
12
  end
8
13
 
14
+ def set_all_files
15
+ shell.notify "\nIdentifying all files:"
16
+ @all_files = shell.run("git ls-tree --full-tree -r HEAD --name-only").split("\n")
17
+ end
9
18
  end
data/lib/migrator.rb CHANGED
@@ -10,6 +10,7 @@ class Migrator
10
10
  end
11
11
 
12
12
  def migrate_where_necessary
13
+ shell.notify "\nMigrating:"
13
14
  directories_to_migrate.each do |dir|
14
15
  shell.run "bundle exec rake db:migrate", dir: dir
15
16
  shell.run "RAILS_ENV=test bundle exec rake db:migrate", dir: dir
data/lib/repo.rb CHANGED
@@ -10,17 +10,11 @@ class Repo
10
10
  @shell = shell
11
11
  end
12
12
 
13
- def files_changed
14
- @files_changed ||= (shell.run "git diff --name-only #{@old_sha}").split("\n")
15
- end
16
13
 
17
14
  def changed?(file_path)
18
15
  files_changed.include? file_path
19
16
  end
20
17
 
21
- def all_files
22
- @all_files ||= shell.run("git ls-tree --full-tree -r HEAD --name-only").split("\n")
23
- end
24
18
 
25
19
  def find_files(pattern)
26
20
  shell.run("git ls-files '*#{pattern}*'").split("\n")
data/lib/upper.rb CHANGED
@@ -55,6 +55,7 @@ class Upper
55
55
  end
56
56
 
57
57
  def no_git
58
+ env[:shell].notify "\nBundling and migrating all apps/engines:"
58
59
  bundler.bundle_where_necessary
59
60
  migrator.migrate_where_necessary
60
61
  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: 0.1.5
4
+ version: 0.1.6
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-07-16 00:00:00.000000000 Z
11
+ date: 2014-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -85,3 +85,4 @@ 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: