sfb_scripts 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/app_up +1 -1
- data/bin/test_runner +1 -1
- data/lib/{bundle_manager.rb → sfb_scripts/bundler/bundle_manager.rb} +6 -2
- data/lib/{hook_manager.rb → sfb_scripts/hook_manager.rb} +0 -0
- data/lib/{pre_push_hook.rb → sfb_scripts/hooks/pre_push_hook.rb} +0 -0
- data/lib/{migrator.rb → sfb_scripts/migrations/migrator.rb} +17 -4
- data/lib/{string_extension.rb → sfb_scripts/monkey_patches/string_extension.rb} +0 -0
- data/lib/{needs_manager.rb → sfb_scripts/needs_manager.rb} +19 -8
- data/lib/{active_repo.rb → sfb_scripts/repositories/active_repo.rb} +0 -2
- data/lib/{lazy_repo.rb → sfb_scripts/repositories/lazy_repo.rb} +0 -2
- data/lib/{repo.rb → sfb_scripts/repositories/repo.rb} +0 -0
- data/lib/{loud_shell_runner.rb → sfb_scripts/shells/loud_shell_runner.rb} +0 -2
- data/lib/{shell_runner.rb → sfb_scripts/shells/shell_runner.rb} +0 -2
- data/lib/{status_checker.rb → sfb_scripts/test_running/status_checker.rb} +0 -0
- data/lib/{test_case.rb → sfb_scripts/test_running/test_case.rb} +0 -0
- data/lib/{test_collection.rb → sfb_scripts/test_running/test_collection.rb} +0 -2
- data/lib/{test_file_runner.rb → sfb_scripts/test_running/test_file_runner.rb} +0 -2
- data/lib/{test_method_runner.rb → sfb_scripts/test_running/test_method_runner.rb} +0 -3
- data/lib/{test_runner.rb → sfb_scripts/test_running/test_runner.rb} +0 -2
- data/lib/{tester.rb → sfb_scripts/tester.rb} +0 -4
- data/lib/{upper.rb → sfb_scripts/upper.rb} +0 -2
- metadata +41 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3d6009dbd443b1c3afcf0e214ecf245ceae4f49
|
4
|
+
data.tar.gz: 9f67a07cc0cb014d5b50456536746fce0f3aa16e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6df2ec87740289436c430aaf8f425f3d4ea4c31411ceadb9a43d50d583134c18b9b65ec80ec461c57c373e402b633f657c038d6fc3768774ceda2dcd29e90a1
|
7
|
+
data.tar.gz: 809299b62276b552ba6ffaf310eea2cc91f1e2fc10575aa1f3874f33bdb4b3dbf578f5df1289eebf2dcab6c469fbd696a28e0083c25897eeed961c866ecaf8d0
|
data/bin/app_up
CHANGED
data/bin/test_runner
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
class BundleManager
|
2
|
-
attr_accessor :shell, :repo
|
2
|
+
attr_accessor :shell, :repo, :queue
|
3
3
|
|
4
4
|
def initialize(repo: raise, shell: raise)
|
5
5
|
@shell = shell
|
6
6
|
@repo = repo
|
7
|
+
@queue = WorkQueue.new(2, nil)
|
7
8
|
end
|
8
9
|
|
9
10
|
def bundle_where_necessary
|
10
11
|
shell.notify "\nBundling:"
|
11
12
|
find("Gemfile.lock").each do |gemfile_lock|
|
12
13
|
if repo.changed?(gemfile_lock)
|
13
|
-
|
14
|
+
queue.enqueue_b do
|
15
|
+
bundle(directory_of(gemfile_lock))
|
16
|
+
end
|
14
17
|
end
|
15
18
|
end
|
19
|
+
queue.join
|
16
20
|
end
|
17
21
|
|
18
22
|
def bundle(gemfile_directory)
|
File without changes
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class Migrator
|
2
|
-
attr_accessor :shell, :repo
|
2
|
+
attr_accessor :shell, :repo, :queue
|
3
3
|
|
4
4
|
# hack: move engines flag into
|
5
5
|
# another object that decides
|
@@ -7,14 +7,18 @@ class Migrator
|
|
7
7
|
@shell = shell
|
8
8
|
@repo = repo
|
9
9
|
@migrate_engines = migrate_engines
|
10
|
+
# should be passed in
|
11
|
+
@queue = WorkQueue.new(8, nil)
|
10
12
|
end
|
11
13
|
|
12
14
|
def migrate_where_necessary
|
13
15
|
shell.notify "\nMigrating:"
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
migrations.each do |migration|
|
17
|
+
queue.enqueue_b do
|
18
|
+
shell.run "RAILS_ENV=#{migration[:env]} bundle exec rake db:migrate", dir: migration[:dir]
|
19
|
+
end
|
17
20
|
end
|
21
|
+
queue.join
|
18
22
|
end
|
19
23
|
|
20
24
|
def directories_to_migrate
|
@@ -24,6 +28,15 @@ class Migrator
|
|
24
28
|
|
25
29
|
private
|
26
30
|
|
31
|
+
def migrations
|
32
|
+
directories_to_migrate.map do |dir|
|
33
|
+
[
|
34
|
+
{env: "development",dir: dir},
|
35
|
+
{env: "test", dir: dir}
|
36
|
+
]
|
37
|
+
end.flatten
|
38
|
+
end
|
39
|
+
|
27
40
|
def in_rack_application?(migrate_dir)
|
28
41
|
if migrate_engines?
|
29
42
|
true
|
File without changes
|
@@ -1,11 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
require_relative '
|
5
|
-
require_relative '
|
6
|
-
require_relative '
|
7
|
-
require_relative '
|
8
|
-
require_relative '
|
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
|
+
|
9
20
|
|
10
21
|
class NeedsManager
|
11
22
|
|
File without changes
|
File without changes
|
File without changes
|
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
|
+
version: 0.1.7
|
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-
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,6 +30,26 @@ dependencies:
|
|
30
30
|
- - <
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '1.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: work_queue
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 2.5.3
|
40
|
+
- - <
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '3.0'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 2.5.3
|
50
|
+
- - <
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '3.0'
|
33
53
|
description: Easily update your rails app and run tests from command line
|
34
54
|
email:
|
35
55
|
- pete.kinnecom@gmail.com
|
@@ -39,25 +59,25 @@ executables:
|
|
39
59
|
extensions: []
|
40
60
|
extra_rdoc_files: []
|
41
61
|
files:
|
42
|
-
- lib/
|
43
|
-
- lib/
|
44
|
-
- lib/
|
45
|
-
- lib/
|
46
|
-
- lib/
|
47
|
-
- lib/
|
48
|
-
- lib/
|
49
|
-
- lib/
|
50
|
-
- lib/repo.rb
|
51
|
-
- lib/
|
52
|
-
- lib/
|
53
|
-
- lib/
|
54
|
-
- lib/test_case.rb
|
55
|
-
- lib/test_collection.rb
|
56
|
-
- lib/test_file_runner.rb
|
57
|
-
- lib/test_method_runner.rb
|
58
|
-
- lib/test_runner.rb
|
59
|
-
- lib/tester.rb
|
60
|
-
- lib/upper.rb
|
62
|
+
- lib/sfb_scripts/bundler/bundle_manager.rb
|
63
|
+
- lib/sfb_scripts/hook_manager.rb
|
64
|
+
- lib/sfb_scripts/hooks/pre_push_hook.rb
|
65
|
+
- lib/sfb_scripts/migrations/migrator.rb
|
66
|
+
- lib/sfb_scripts/monkey_patches/string_extension.rb
|
67
|
+
- lib/sfb_scripts/needs_manager.rb
|
68
|
+
- lib/sfb_scripts/repositories/active_repo.rb
|
69
|
+
- lib/sfb_scripts/repositories/lazy_repo.rb
|
70
|
+
- lib/sfb_scripts/repositories/repo.rb
|
71
|
+
- lib/sfb_scripts/shells/loud_shell_runner.rb
|
72
|
+
- lib/sfb_scripts/shells/shell_runner.rb
|
73
|
+
- lib/sfb_scripts/test_running/status_checker.rb
|
74
|
+
- lib/sfb_scripts/test_running/test_case.rb
|
75
|
+
- lib/sfb_scripts/test_running/test_collection.rb
|
76
|
+
- lib/sfb_scripts/test_running/test_file_runner.rb
|
77
|
+
- lib/sfb_scripts/test_running/test_method_runner.rb
|
78
|
+
- lib/sfb_scripts/test_running/test_runner.rb
|
79
|
+
- lib/sfb_scripts/tester.rb
|
80
|
+
- lib/sfb_scripts/upper.rb
|
61
81
|
- bin/test_runner
|
62
82
|
- bin/app_up
|
63
83
|
homepage: http://github.com/petekinnecom/sfb_scripts/
|