git_compound 0.2.0 → 0.2.1
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 +4 -4
- data/README.md +6 -3
- data/lib/git_compound/command/procedure/build.rb +1 -1
- data/lib/git_compound/command/procedure/build_lock.rb +6 -13
- data/lib/git_compound/command/procedure/build_manifest.rb +5 -12
- data/lib/git_compound/command/procedure/check.rb +2 -2
- data/lib/git_compound/command/procedure/help.rb +2 -6
- data/lib/git_compound/command/procedure/procedure.rb +35 -10
- data/lib/git_compound/command/procedure/show.rb +2 -2
- data/lib/git_compound/command/procedure/tasks.rb +1 -2
- data/lib/git_compound/command/procedure/update.rb +7 -16
- data/lib/git_compound/logger/debug/procedure.rb +15 -0
- data/lib/git_compound/logger.rb +1 -0
- data/lib/git_compound/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e4d0926ddcd0f190333508583f38a8f2460089d
|
4
|
+
data.tar.gz: 52d2af0cf79c22a69f97b51ba6a090d3debef4dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b357d8c1bbc8b91caf86928fa51415b757614117ec35a4b928650fa39c990969f59a2025de35eb1a00aca7436a6efaa058d884a8fea2080176909a0449d86e7
|
7
|
+
data.tar.gz: 082737730b0039af37388af337798e931e4623f6a363598de1a4bc804f673d3e00e1fa60cbc8d395fe299eec9b23eb5144f4aacfc305d7d404b774af7203418d
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ It is particularly useful when you need to develop your project dependencies at
|
|
50
50
|
|
51
51
|
Core features:
|
52
52
|
|
53
|
-
* GitCompound introduces Domain Specific Language
|
53
|
+
* GitCompound introduces Domain Specific Language designed for writing manifests.
|
54
54
|
|
55
55
|
* Manifest file is used to specify dependencies of your project.
|
56
56
|
|
@@ -102,6 +102,9 @@ and name constraints
|
|
102
102
|
## Global options
|
103
103
|
|
104
104
|
1. `--verbose` -- turns debug mode on
|
105
|
+
|
106
|
+
This will show you what happens under the hood. All Git commands, procedure steps and tasks being executed will be printed.
|
107
|
+
|
105
108
|
2. `--disable-colors` -- disables ANSI colors in output
|
106
109
|
|
107
110
|
## Details
|
@@ -211,13 +214,13 @@ and name constraints
|
|
211
214
|
task :print_component_name, :each do |dir, component|
|
212
215
|
puts "Current component name: #{component.name}"
|
213
216
|
puts "Current component source: #{component.origin}"
|
214
|
-
puts "Current component destination: #{component.
|
217
|
+
puts "Current component destination: #{component.path}"
|
215
218
|
|
216
219
|
puts "Component directory: #{dir}"
|
217
220
|
end
|
218
221
|
```
|
219
222
|
|
220
|
-
Note that `dir` here is the same as `component.
|
223
|
+
Note that `dir` here is the same as `component.path`.
|
221
224
|
|
222
225
|
* `:all` type -- run task for all child components of this manifest
|
223
226
|
|
@@ -10,28 +10,21 @@ module GitCompound
|
|
10
10
|
|
11
11
|
add_subprocedure :tasks_runner, Tasks
|
12
12
|
|
13
|
-
|
13
|
+
step :build_info do
|
14
14
|
Logger.info 'Building components from lockfile ...'
|
15
|
-
|
16
|
-
verify_manifest
|
17
|
-
build_locked_components
|
18
|
-
execute_tasks
|
19
15
|
end
|
20
16
|
|
21
|
-
|
22
|
-
|
23
|
-
def verify_manifest
|
24
|
-
return if @manifest.md5sum == @lock.manifest
|
25
|
-
|
17
|
+
step :verify_manifest do
|
26
18
|
raise GitCompoundError,
|
27
|
-
'Manifest md5sum has changed ! Use `update` command.'
|
19
|
+
'Manifest md5sum has changed ! Use `update` command.' unless
|
20
|
+
@manifest.md5sum == @lock.manifest
|
28
21
|
end
|
29
22
|
|
30
|
-
|
23
|
+
step :build_lock do
|
31
24
|
@lock.process(Worker::ComponentDispatcher.new(@lock))
|
32
25
|
end
|
33
26
|
|
34
|
-
|
27
|
+
step :execute_tasks do
|
35
28
|
subprocedure(:tasks_runner)
|
36
29
|
end
|
37
30
|
end
|
@@ -11,30 +11,23 @@ module GitCompound
|
|
11
11
|
add_subprocedure :check_dependencies, Check
|
12
12
|
add_subprocedure :tasks_runner, Tasks
|
13
13
|
|
14
|
-
|
14
|
+
step :build_info do
|
15
15
|
Logger.info 'Building components ...'
|
16
|
-
|
17
|
-
check_dependencies
|
18
|
-
build_manifest
|
19
|
-
execute_tasks
|
20
|
-
lock_manifest
|
21
16
|
end
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
def check_dependencies
|
18
|
+
step :check do
|
26
19
|
subprocedure(:check_dependencies)
|
27
20
|
end
|
28
21
|
|
29
|
-
|
22
|
+
step :build_manifest do
|
30
23
|
@manifest.process(Worker::ComponentBuilder.new(@lock))
|
31
24
|
end
|
32
25
|
|
33
|
-
|
26
|
+
step :execute_tasks do
|
34
27
|
subprocedure(:tasks_runner)
|
35
28
|
end
|
36
29
|
|
37
|
-
|
30
|
+
step :lock_manifest do
|
38
31
|
@lock.lock_manifest(@manifest)
|
39
32
|
@lock.write
|
40
33
|
end
|
@@ -4,12 +4,8 @@ module GitCompound
|
|
4
4
|
# Help command procedure
|
5
5
|
#
|
6
6
|
class Help < Procedure
|
7
|
-
|
8
|
-
Logger.info(message)
|
9
|
-
end
|
10
|
-
|
11
|
-
def message
|
12
|
-
self.class.message
|
7
|
+
step :print_help do
|
8
|
+
Logger.info(self.class.message)
|
13
9
|
end
|
14
10
|
|
15
11
|
# rubocop:disable Metrics/AbcSize
|
@@ -16,20 +16,45 @@ module GitCompound
|
|
16
16
|
# Main procedure entry point
|
17
17
|
#
|
18
18
|
def execute
|
19
|
-
|
19
|
+
self.class.steps.to_h.keys.each do |name|
|
20
|
+
execute_step(name)
|
21
|
+
end
|
20
22
|
end
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
def self.options
|
26
|
-
{}
|
24
|
+
def execute_step(name)
|
25
|
+
step_proc = self.class.steps.to_h[name]
|
26
|
+
instance_eval(&step_proc) if step_proc
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
class << self
|
30
|
+
attr_reader :steps
|
31
|
+
|
32
|
+
# Valid options available for this procedure
|
33
|
+
# see Element::Option
|
34
|
+
#
|
35
|
+
def options
|
36
|
+
{}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Name of procedure
|
40
|
+
#
|
41
|
+
def to_s
|
42
|
+
name.split('::').last
|
43
|
+
.gsub(/::/, '/')
|
44
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
45
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
46
|
+
.tr('-', '_')
|
47
|
+
.downcase
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def step(name, &block)
|
53
|
+
raise GitCompoundError, 'No block given !' unless block
|
54
|
+
|
55
|
+
@steps = {} unless @steps
|
56
|
+
@steps.store(name, block)
|
57
|
+
end
|
33
58
|
end
|
34
59
|
end
|
35
60
|
end
|
@@ -8,9 +8,8 @@ module GitCompound
|
|
8
8
|
include Element::Option
|
9
9
|
|
10
10
|
add_parameter :allow_nested_subtasks, type: :boolean, scope: :global
|
11
|
-
# add_parameter :list, type: Argument::StringBoolean
|
12
11
|
|
13
|
-
|
12
|
+
step :tasks do
|
14
13
|
Logger.info 'Running tasks ...'
|
15
14
|
|
16
15
|
if @opts[:allow_nested_subtasks]
|
@@ -11,44 +11,35 @@ module GitCompound
|
|
11
11
|
add_subprocedure :check_dependencies, Check
|
12
12
|
add_subprocedure :tasks_runner, Tasks
|
13
13
|
|
14
|
-
|
14
|
+
step :check_lockfile do
|
15
15
|
raise GitCompoundError,
|
16
16
|
"Lockfile `#{Lock::FILENAME}` does not exist ! " \
|
17
17
|
'You should use `build` command.' unless locked?
|
18
|
-
|
19
|
-
protect_local_modifications
|
20
|
-
check_dependencies
|
21
|
-
update
|
22
|
-
execute_tasks
|
23
|
-
lock_updated_manifest
|
24
|
-
remove_dormant_components
|
25
18
|
end
|
26
19
|
|
27
|
-
|
28
|
-
|
29
|
-
def protect_local_modifications
|
20
|
+
step :protect_local_modifications do
|
30
21
|
@lock.process(Worker::LocalChangesGuard.new(@lock))
|
31
22
|
end
|
32
23
|
|
33
|
-
|
24
|
+
step :check_dependencies do
|
34
25
|
subprocedure(:check_dependencies)
|
35
26
|
end
|
36
27
|
|
37
|
-
|
28
|
+
step :update do
|
38
29
|
Logger.info 'Updating components ...'
|
39
30
|
@manifest.process(Worker::ComponentDispatcher.new(@lock_new))
|
40
31
|
end
|
41
32
|
|
42
|
-
|
33
|
+
step :execute_tasks do
|
43
34
|
subprocedure(:tasks_runner)
|
44
35
|
end
|
45
36
|
|
46
|
-
|
37
|
+
step :lock_updated_manifest do
|
47
38
|
@lock_new.lock_manifest(@manifest)
|
48
39
|
@lock_new.write
|
49
40
|
end
|
50
41
|
|
51
|
-
|
42
|
+
step :remove_dormant_components do
|
52
43
|
dormant_components = @lock.components.reject do |component|
|
53
44
|
@lock_new.find(component) ? true : false
|
54
45
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module GitCompound
|
2
|
+
module Command
|
3
|
+
module Procedure
|
4
|
+
# Debug cases for Procedure
|
5
|
+
#
|
6
|
+
class Procedure
|
7
|
+
extend Logger::Debugger
|
8
|
+
|
9
|
+
debug_before(:execute_step) do |name|
|
10
|
+
"Executing step `#{name}` in `#{self.class}` procedure"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/git_compound/logger.rb
CHANGED
data/lib/git_compound/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_compound
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Bizon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- lib/git_compound/logger/colors.rb
|
156
156
|
- lib/git_compound/logger/core_ext/string.rb
|
157
157
|
- lib/git_compound/logger/debug/command.rb
|
158
|
+
- lib/git_compound/logger/debug/procedure.rb
|
158
159
|
- lib/git_compound/logger/debug/repository.rb
|
159
160
|
- lib/git_compound/logger/debug/task.rb
|
160
161
|
- lib/git_compound/logger/debugger.rb
|