sfb_scripts 0.1.8 → 0.1.9

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: 3ad64628594616c16074cdf1dc8a025a2d788778
4
- data.tar.gz: 48f17df97550e050c646e3c15cae131a14a07a1c
3
+ metadata.gz: 1c4ffa5f6768611b201947a331bc2d19b6c4f33e
4
+ data.tar.gz: 1e12c961a87746e5887e2b816dd3fc9471b1a677
5
5
  SHA512:
6
- metadata.gz: 66862b0679ce60cd59bd4075627014fe2cc9c13228ce18c6e6d956687d757a7c067353287553917d5a688e39da8e133a82e959ffc85fd43ac96efae16b190377
7
- data.tar.gz: 0df73ca2bf1cb38a5444ff17ce152504d628bc2c3ee4466af52586f65b46064428120bac50e9a53bee22446bec0f745762512bc2b8d3beb116d11a6e8c652e6d
6
+ metadata.gz: 06b67e433f81d759194d524ea86ae36fabbd883ed5479f3de148c392d42ed0e289ba2e922bc59dcef4e75feddf07c81ba07bf1829495619e2ed210fce8338a49
7
+ data.tar.gz: 9317810f154b2ab142732c27c11e5855c38a00ae08175166961ff3718a52188300620d891e77ffa9b08f2054b70f308ff36cf2b6208d2ea9b55587060db27b4a
data/bin/app_up CHANGED
@@ -9,10 +9,10 @@ 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."
12
+ desc :up, "Rebase your commits onto master. Bundle installs and migrates as needed. Will terminate if conflicts are found. After conflicts are resolved, run again with --no-rebase."
13
13
  option :loud, :type => :boolean, :desc => 'Pipe output to terminal or not (output is always piped to /tmp/app_up.log)'
14
- option :no_git, aliases: ['--no-pull', '--no-rebase', '--all'], :type => :boolean, :desc => "Don't update the repo, just bundle and migrate everywhere."
15
- option :engines, type: :boolean, default: false, desc: "Perform actions in engines as well"
14
+ option :no_git, aliases: ['--no-pull', '--no-rebase'], :type => :boolean, :desc => "Don't update the repo, just bundle and migrate everywhere."
15
+ option :ignore, type: :array, desc: "Directories matching this pattern will be ignored. Example: 'app_up --ignore engines' will not bundle or migrate in a directory matching the word engines. You can specify multiple patterns: 'app_up --ignore dir1 dir2"
16
16
 
17
17
  def up
18
18
  if options[:no_git]
@@ -0,0 +1,19 @@
1
+ require 'work_queue'
2
+
3
+ # this is a bummer...
4
+ require_relative 'monkey_patches/string_extension'
5
+ require_relative 'bundler/bundle_manager'
6
+ require_relative 'hooks/pre_push_hook'
7
+ require_relative 'migrations/migrator'
8
+ require_relative 'repositories/repo'
9
+ require_relative 'repositories/active_repo'
10
+ require_relative 'repositories/lazy_repo'
11
+ require_relative 'shells/shell_runner'
12
+ require_relative 'shells/loud_shell_runner'
13
+ require_relative 'test_running/status_checker'
14
+ require_relative 'test_running/test_case'
15
+ require_relative 'test_running/test_collection'
16
+ require_relative 'test_running/test_file_runner'
17
+ require_relative 'test_running/test_method_runner'
18
+ require_relative 'test_running/test_runner'
19
+ require_relative 'folder_guard'
@@ -1,8 +1,6 @@
1
1
  class Migrator
2
2
  attr_accessor :shell, :repo, :queue, :folder_guard
3
3
 
4
- # hack: move engines flag into
5
- # another object that decides
6
4
  def initialize(repo: raise, shell: raise, queue: raise, folder_guard: raise)
7
5
  @shell = shell
8
6
  @repo = repo
@@ -14,7 +12,7 @@ class Migrator
14
12
  shell.notify "\nMigrating:"
15
13
  migrations.each do |migration|
16
14
  queue.enqueue_b do
17
- shell.run "RAILS_ENV=#{migration[:env]} bundle exec rake db:migrate", dir: migration[:dir]
15
+ shell.run "RAILS_ENV=#{migration[:env]} bundle exec rake db:create db:migrate", dir: migration[:dir]
18
16
  end
19
17
  end
20
18
  queue.join
@@ -1,23 +1,4 @@
1
- require 'work_queue'
2
-
3
- # this is a bummer...
4
- require_relative 'monkey_patches/string_extension'
5
- require_relative 'bundler/bundle_manager'
6
- require_relative 'hooks/pre_push_hook'
7
- require_relative 'migrations/migrator'
8
- require_relative 'repositories/repo'
9
- require_relative 'repositories/active_repo'
10
- require_relative 'repositories/lazy_repo'
11
- require_relative 'shells/shell_runner'
12
- require_relative 'shells/loud_shell_runner'
13
- require_relative 'test_running/status_checker'
14
- require_relative 'test_running/test_case'
15
- require_relative 'test_running/test_collection'
16
- require_relative 'test_running/test_file_runner'
17
- require_relative 'test_running/test_method_runner'
18
- require_relative 'test_running/test_runner'
19
- require_relative 'folder_guard'
20
-
1
+ require_relative 'dependency_loader'
21
2
 
22
3
  class NeedsManager
23
4
 
@@ -68,8 +49,7 @@ class NeedsManager
68
49
  end
69
50
 
70
51
  def create_folder_guard
71
- denied_folders = []
72
- denied_folders << 'engines' if ! options[:engines]
52
+ denied_folders = options[:ignore] || []
73
53
  env[:folder_guard] = FolderGuard.new(denied_folders)
74
54
  end
75
55
 
@@ -10,12 +10,10 @@ class Repo
10
10
  @shell = shell
11
11
  end
12
12
 
13
-
14
13
  def changed?(file_path)
15
14
  files_changed.include? file_path
16
15
  end
17
16
 
18
-
19
17
  def find_files(pattern)
20
18
  shell.run("git ls-files '*#{pattern}*'").split("\n")
21
19
  end
@@ -47,8 +45,16 @@ class Repo
47
45
 
48
46
  def interpret_grep_result(grep_result)
49
47
  splits = grep_result.split(/:/)
50
- file = splits.shift
51
- line = splits.join(':')
48
+ file = splits.shift.strip
49
+ # we rejoin on ':' because our
50
+ # code may have colons inside of it.
51
+ #
52
+ # example:
53
+ # path/to/file: run_method(a: A, b: B)
54
+ #
55
+ # so shift the first one out, then
56
+ # rejoin the rest
57
+ line = splits.join(':').strip
52
58
 
53
59
  {
54
60
  :file => file,
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.8
4
+ version: 0.1.9
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-08-20 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - lib/sfb_scripts/bundler/bundle_manager.rb
63
+ - lib/sfb_scripts/dependency_loader.rb
63
64
  - lib/sfb_scripts/folder_guard.rb
64
65
  - lib/sfb_scripts/hook_manager.rb
65
66
  - lib/sfb_scripts/hooks/pre_push_hook.rb
@@ -106,3 +107,4 @@ signing_key:
106
107
  specification_version: 4
107
108
  summary: Easily update your rails app and run tests from command line
108
109
  test_files: []
110
+ has_rdoc: