git_compound 0.0.9 → 0.0.10
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 +14 -9
- data/lib/git_compound.rb +2 -1
- data/lib/git_compound/builder.rb +4 -2
- data/lib/git_compound/command.rb +28 -29
- data/lib/git_compound/command/options.rb +2 -1
- data/lib/git_compound/component.rb +6 -12
- data/lib/git_compound/component/destination.rb +19 -17
- data/lib/git_compound/lock.rb +1 -1
- data/lib/git_compound/logger.rb +29 -10
- data/lib/git_compound/logger/debug/command.rb +12 -0
- data/lib/git_compound/logger/debug/repository.rb +10 -0
- data/lib/git_compound/logger/debug/task.rb +16 -0
- data/lib/git_compound/logger/debugger.rb +33 -0
- data/lib/git_compound/repository/git_command.rb +1 -1
- data/lib/git_compound/task/task.rb +4 -1
- data/lib/git_compound/task/task_all.rb +1 -1
- data/lib/git_compound/task/task_each.rb +1 -1
- data/lib/git_compound/task/task_single.rb +1 -1
- data/lib/git_compound/version.rb +1 -1
- data/lib/git_compound/worker/component_builder.rb +5 -5
- data/lib/git_compound/worker/component_replacer.rb +2 -2
- data/lib/git_compound/worker/component_update_dispatcher.rb +5 -7
- data/lib/git_compound/worker/component_updater.rb +2 -2
- data/lib/git_compound/worker/conflicting_dependency_checker.rb +2 -5
- data/lib/git_compound/worker/local_changes_guard.rb +4 -4
- data/lib/git_compound/worker/task_runner.rb +1 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9364d9375f8d63441e365cf7ddcdbd841de74be3
|
4
|
+
data.tar.gz: 1f7d07c9aabc1626404e73dc6995749c952d48bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9455c25a7672dd3cff14035bddef0c697695a1378ce6e8f72bc40b4f6582113e9407a815b750d72bd09904bf18578191a39ffede8adeac79903ee84972980f3
|
7
|
+
data.tar.gz: 0911ffa0e74ec12bd5a1d97215eed5936d1e18a1ec3630fb9850ce171fba690a6cc101b7d869db146e6afbe85680b601528669811c8f9b8d751ebda1de5d6321
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# GitCompound
|
2
2
|
|
3
|
-
Compose your project using git repositories and
|
3
|
+
Compose your project using git repositories and Ruby tasks.
|
4
|
+
|
5
|
+
GitCompound combines features of Git submodules and common dependency managers like Bundler or Composer.
|
4
6
|
|
5
7
|
## Status
|
6
8
|
|
@@ -36,14 +38,16 @@ Create `Compoundfile` or `.gitcompound` manifest:
|
|
36
38
|
end
|
37
39
|
```
|
38
40
|
|
39
|
-
GitCompound will also process similar manifests found in required components in hierarchical way.
|
40
|
-
|
41
41
|
Then run `gitcompound build`.
|
42
42
|
|
43
|
+
GitCompound will also process manifests found in dependencies.
|
44
|
+
|
45
|
+
|
43
46
|
|
44
47
|
## Core features
|
45
48
|
|
46
|
-
|
49
|
+
GitCompound is more a distributed packaging system (dependency manager) than alternative to Git submodules,
|
50
|
+
however it has common features of both Git submodules and dependency managers like Bundler or Composer.
|
47
51
|
|
48
52
|
`GitCompound` makes sure your project composition is the same on all machines,
|
49
53
|
but you can have different composition depending on manifest you are using.
|
@@ -57,9 +61,6 @@ Core features:
|
|
57
61
|
* It is possible to create multiple manifest files (`Compoundfile`, `.gitcompound` or something else)
|
58
62
|
and build them when necessary.
|
59
63
|
|
60
|
-
* Building manifest create lockfile (locking components on specific commit SHA). When lockfile is present if will
|
61
|
-
be used each time `build` command is invoked.
|
62
|
-
|
63
64
|
* Manifests can declare dependencies on different versions of components using different version strategies
|
64
65
|
(Rubygems-like version, tag, branch or explicit SHA).
|
65
66
|
|
@@ -67,7 +68,7 @@ Core features:
|
|
67
68
|
is root manifest. `GitCompound` processes all subsequent manifests found in dependencies using depth-first
|
68
69
|
search of dependency graph.
|
69
70
|
|
70
|
-
* Root manifest and
|
71
|
+
* Root manifest and manifests of each subsequent component can declare Ruby tasks that will be executed
|
71
72
|
when component is built or updated.
|
72
73
|
|
73
74
|
* It is possible to install dependencies in root directory (`Dir.pwd` where `gitcompound` command is invoked).
|
@@ -75,6 +76,10 @@ Core features:
|
|
75
76
|
|
76
77
|
* Build process creates lockfile in `.gitcompound.lock`. It locks components on specific commit SHAs.
|
77
78
|
It is then possible to build components directly, depending on versions (SHAs) from lockfile.
|
79
|
+
When lockfile is present if will be used each time `build` command is invoked.
|
80
|
+
|
81
|
+
* It is possible to use repositories, that has been used as dependencies, for development (like in Git submodules).
|
82
|
+
|
78
83
|
|
79
84
|
## Commands
|
80
85
|
|
data/lib/git_compound.rb
CHANGED
@@ -47,7 +47,8 @@ module GitCompound
|
|
47
47
|
# GitCompound Logger
|
48
48
|
#
|
49
49
|
module Logger
|
50
|
-
autoload :Colors,
|
50
|
+
autoload :Colors, 'git_compound/logger/colors'
|
51
|
+
autoload :Debugger, 'git_compound/logger/debugger'
|
51
52
|
require 'git_compound/logger/core_ext/string'
|
52
53
|
end
|
53
54
|
|
data/lib/git_compound/builder.rb
CHANGED
@@ -53,7 +53,9 @@ module GitCompound
|
|
53
53
|
if @opts.include?(:allow_nested_subtasks)
|
54
54
|
@manifest.process(Worker::TaskRunner.new)
|
55
55
|
else
|
56
|
-
@manifest.tasks.each_value
|
56
|
+
@manifest.tasks.each_value do |task|
|
57
|
+
Worker::TaskRunner.new.visit_task(task)
|
58
|
+
end
|
57
59
|
end
|
58
60
|
self
|
59
61
|
end
|
@@ -84,7 +86,7 @@ module GitCompound
|
|
84
86
|
|
85
87
|
dormant_components.each do |component|
|
86
88
|
Logger.warn "Removing dormant component `#{component.name}` " \
|
87
|
-
"from `#{component.
|
89
|
+
"from `#{component.path}` !"
|
88
90
|
|
89
91
|
component.remove!
|
90
92
|
end
|
data/lib/git_compound/command.rb
CHANGED
@@ -46,19 +46,16 @@ module GitCompound
|
|
46
46
|
|
47
47
|
def run(command, args)
|
48
48
|
abort(usage) unless methods.include?(command.to_sym)
|
49
|
-
|
50
|
-
Logger.debug("GitCompound v#{GitCompound::VERSION}")
|
51
|
-
Logger.debug("Running command '#{command}'")
|
52
|
-
|
53
49
|
public_send(command, *args)
|
54
50
|
rescue GitCompoundError => e
|
55
|
-
abort Logger.
|
51
|
+
abort Logger.parse("Error: #{e.message}".on_red.white.bold)
|
56
52
|
end
|
57
53
|
|
58
54
|
private
|
59
55
|
|
60
56
|
def builder(args)
|
61
|
-
|
57
|
+
filename = args.find { |arg| arg.is_a? String }
|
58
|
+
Builder.new(manifest(filename), Lock.new, args)
|
62
59
|
end
|
63
60
|
|
64
61
|
def manifest(filename)
|
@@ -74,39 +71,41 @@ module GitCompound
|
|
74
71
|
|
75
72
|
# rubocop:disable Metrics/AbcSize
|
76
73
|
def usage
|
77
|
-
<<-EOS
|
78
|
-
|
74
|
+
msg = <<-EOS
|
75
|
+
#{'GitCompound version'.bold.yellow} #{GitCompound::VERSION.bold}
|
79
76
|
|
80
|
-
|
81
|
-
|
77
|
+
Usage: #{'gitcompound'.bold.green} #{
|
78
|
+
'[options]'.green} #{'command'.bold} #{'[manifest_file]'.green}
|
82
79
|
|
83
|
-
|
84
|
-
|
85
|
-
|
80
|
+
Commands:
|
81
|
+
#{'build'.bold}
|
82
|
+
builds project from manifest (or lockfile if present)
|
86
83
|
|
87
|
-
|
88
|
-
|
84
|
+
If manifest is not specified it uses one of
|
85
|
+
#{Manifest::FILENAMES.inspect}
|
89
86
|
|
90
|
-
|
91
|
-
|
87
|
+
#{'update'.bold}
|
88
|
+
updates project
|
92
89
|
|
93
|
-
|
94
|
-
|
95
|
-
|
90
|
+
#{'check'.bold}
|
91
|
+
detects circular depenencies, conflicting dependencies
|
92
|
+
and checks for name contraints
|
96
93
|
|
97
|
-
|
98
|
-
|
94
|
+
#{'show'.bold}
|
95
|
+
prints structure of project
|
99
96
|
|
100
|
-
|
101
|
-
|
97
|
+
#{'help'.bold}
|
98
|
+
prints this help
|
102
99
|
|
103
|
-
|
104
|
-
|
105
|
-
|
100
|
+
Options:'
|
101
|
+
#{'--verbose'.bold}
|
102
|
+
prints verbose log info
|
106
103
|
|
107
|
-
|
108
|
-
|
104
|
+
#{'--disable-colors'.bold}
|
105
|
+
disable ANSI colors in output
|
109
106
|
EOS
|
107
|
+
|
108
|
+
Logger.parse(msg)
|
110
109
|
end
|
111
110
|
# rubocop:enable Metrics/AbcSize
|
112
111
|
end
|
@@ -8,6 +8,7 @@ module GitCompound
|
|
8
8
|
def initialize(args)
|
9
9
|
@command, @args = parse_options(args)
|
10
10
|
|
11
|
+
self.class.disable_colors = false
|
11
12
|
set_global_options
|
12
13
|
end
|
13
14
|
|
@@ -32,7 +33,7 @@ module GitCompound
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def self.disable_colors=(mode)
|
35
|
-
|
36
|
+
GitCompound::Logger.colors = !mode
|
36
37
|
end
|
37
38
|
|
38
39
|
private
|
@@ -6,6 +6,8 @@ module GitCompound
|
|
6
6
|
#
|
7
7
|
class Component < Node
|
8
8
|
extend Forwardable
|
9
|
+
delegate [:sha, :ref, :origin, :repository, :version] => :@source
|
10
|
+
delegate [:path, :exists?, :repository] => :@destination
|
9
11
|
|
10
12
|
attr_reader :name
|
11
13
|
attr_accessor :source, :destination
|
@@ -31,14 +33,14 @@ module GitCompound
|
|
31
33
|
@manifest ||= @source.manifest
|
32
34
|
end
|
33
35
|
|
34
|
-
def build
|
35
|
-
@source.clone(
|
36
|
+
def build!
|
37
|
+
@source.clone(path)
|
36
38
|
@destination.repository do |repo|
|
37
39
|
repo.checkout(@source.ref)
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
41
|
-
def update
|
43
|
+
def update!
|
42
44
|
@destination.repository do |repo|
|
43
45
|
repo.fetch
|
44
46
|
repo.checkout(@source.ref)
|
@@ -47,7 +49,6 @@ module GitCompound
|
|
47
49
|
end
|
48
50
|
|
49
51
|
def remove!
|
50
|
-
path = destination_path
|
51
52
|
raise GitCompoundError, 'Risky directory !' if
|
52
53
|
path.start_with?('/') || path.include?('..')
|
53
54
|
raise GitCompoundError, 'Not a directory !' unless
|
@@ -64,15 +65,8 @@ module GitCompound
|
|
64
65
|
{ name: @name,
|
65
66
|
sha: @source.sha,
|
66
67
|
source: @source.origin,
|
67
|
-
destination: @destination.
|
68
|
+
destination: @destination.path
|
68
69
|
}
|
69
70
|
end
|
70
|
-
|
71
|
-
# delegators
|
72
|
-
|
73
|
-
delegate [:sha, :origin, :repository, :version] => :@source
|
74
|
-
def_delegator :@destination, :expanded_path, :destination_path
|
75
|
-
def_delegator :@destination, :exists?, :destination_exists?
|
76
|
-
def_delegator :@destination, :repository, :destination_repository
|
77
71
|
end
|
78
72
|
end
|
@@ -7,39 +7,41 @@ module GitCompound
|
|
7
7
|
class Destination
|
8
8
|
attr_reader :path
|
9
9
|
|
10
|
-
def initialize(
|
10
|
+
def initialize(component_path, component)
|
11
11
|
raise CompoundSyntaxError, 'Destination cannot be empty' if
|
12
|
-
|
12
|
+
component_path.nil? || component_path.empty?
|
13
13
|
|
14
14
|
raise CompoundSyntaxError,
|
15
15
|
'Destination should contain at least one directory' unless
|
16
|
-
Pathname.new(
|
16
|
+
Pathname.new(component_path).each_filename.count > 0
|
17
17
|
|
18
|
-
@path = path
|
19
18
|
@component = component
|
20
|
-
|
21
|
-
|
22
|
-
def expanded_path
|
23
|
-
pathname = Pathname.new(@path)
|
24
|
-
|
25
|
-
unless pathname.absolute?
|
26
|
-
ancestor_paths = @component.ancestors.map(&:destination_path)
|
27
|
-
pathname = Pathname.new('.').join(*ancestor_paths) + pathname
|
28
|
-
end
|
29
|
-
|
30
|
-
Pathname.new("./#{pathname}").cleanpath.to_s + '/'
|
19
|
+
@path = expand_path(component_path)
|
31
20
|
end
|
32
21
|
|
33
22
|
def exists?
|
34
|
-
FileTest.exist?(
|
23
|
+
FileTest.exist?(@path)
|
35
24
|
end
|
36
25
|
|
37
26
|
def repository
|
38
27
|
destination_repository =
|
39
|
-
Repository::RepositoryLocal.new(
|
28
|
+
Repository::RepositoryLocal.new(@path)
|
40
29
|
yield destination_repository if block_given?
|
41
30
|
destination_repository
|
42
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def expand_path(component_path)
|
36
|
+
pathname = Pathname.new(component_path)
|
37
|
+
|
38
|
+
unless pathname.absolute?
|
39
|
+
ancestor_paths = @component.ancestors.map(&:path)
|
40
|
+
pathname = Pathname.new('.').join(*ancestor_paths) + pathname
|
41
|
+
end
|
42
|
+
|
43
|
+
Pathname.new("./#{pathname}").cleanpath.to_s + '/'
|
44
|
+
end
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
data/lib/git_compound/lock.rb
CHANGED
data/lib/git_compound/logger.rb
CHANGED
@@ -5,6 +5,7 @@ module GitCompound
|
|
5
5
|
extend self
|
6
6
|
|
7
7
|
def verbose=(value)
|
8
|
+
load_debug_messages if value
|
8
9
|
@verbose = value && true
|
9
10
|
end
|
10
11
|
|
@@ -12,32 +13,50 @@ module GitCompound
|
|
12
13
|
@verbose ||= false
|
13
14
|
end
|
14
15
|
|
16
|
+
def colors=(value)
|
17
|
+
String.disable_colors = !(@colors = value)
|
18
|
+
end
|
19
|
+
|
20
|
+
def colors
|
21
|
+
@colors ||= true
|
22
|
+
end
|
23
|
+
|
15
24
|
def inline(inline_message)
|
16
25
|
print inline_message
|
17
26
|
inline_message
|
18
27
|
end
|
19
28
|
|
20
|
-
def debug(debug_message
|
21
|
-
log
|
29
|
+
def debug(debug_message)
|
30
|
+
log debug_message.cyan
|
22
31
|
end
|
23
32
|
|
24
|
-
def info(information_message
|
25
|
-
log
|
33
|
+
def info(information_message)
|
34
|
+
log information_message
|
26
35
|
end
|
27
36
|
|
28
|
-
def warn(warning_message
|
29
|
-
log
|
37
|
+
def warn(warning_message)
|
38
|
+
log warning_message.red.bold
|
30
39
|
end
|
31
40
|
|
32
|
-
def error(error_message
|
33
|
-
log
|
41
|
+
def error(error_message)
|
42
|
+
log error_message.on_red.white.bold
|
43
|
+
end
|
44
|
+
|
45
|
+
def parse(message)
|
46
|
+
message
|
34
47
|
end
|
35
48
|
|
36
49
|
private
|
37
50
|
|
38
|
-
def log(message
|
39
|
-
puts message
|
51
|
+
def log(message)
|
52
|
+
puts message
|
40
53
|
message
|
41
54
|
end
|
55
|
+
|
56
|
+
def load_debug_messages
|
57
|
+
require 'git_compound/logger/debug/command'
|
58
|
+
require 'git_compound/logger/debug/repository'
|
59
|
+
require 'git_compound/logger/debug/task'
|
60
|
+
end
|
42
61
|
end
|
43
62
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module GitCompound
|
2
|
+
module Task
|
3
|
+
# Debug messages for Task
|
4
|
+
#
|
5
|
+
class Task
|
6
|
+
extend Logger::Debugger
|
7
|
+
|
8
|
+
debug_before(:execute_on) do |directory|
|
9
|
+
"Executing task `#{@name}` " \
|
10
|
+
"defined in manifest `#{@manifest.name}`, " \
|
11
|
+
"in line `#{@block.source_location.last}`, " \
|
12
|
+
"with directory arg `#{directory}`"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module GitCompound
|
2
|
+
module Logger
|
3
|
+
# Debugger mixin
|
4
|
+
#
|
5
|
+
module Debugger
|
6
|
+
def debug_before(method, &block)
|
7
|
+
debug(method, :before, &block)
|
8
|
+
end
|
9
|
+
|
10
|
+
def debug_after(method, &block)
|
11
|
+
debug(method, :after, &block)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def debug(method, moment, &block)
|
17
|
+
raise GitCompoundError, 'No block given !' unless block
|
18
|
+
|
19
|
+
method_old = "#{method}_old_debugged".to_sym
|
20
|
+
alias_method(method_old, method)
|
21
|
+
private method_old
|
22
|
+
|
23
|
+
define_method(method) do |*args|
|
24
|
+
Logger.debug(instance_exec(*args, &block)) if moment == :before
|
25
|
+
args.insert(0, send(method_old, *args))
|
26
|
+
Logger.debug(instance_exec(*args, &block)) if moment == :after
|
27
|
+
|
28
|
+
args.first
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
1
3
|
module GitCompound
|
2
4
|
module Task
|
3
5
|
# Base abstract class for task
|
@@ -21,7 +23,8 @@ module GitCompound
|
|
21
23
|
private
|
22
24
|
|
23
25
|
def execute_on(directory, component)
|
24
|
-
|
26
|
+
path = Pathname.new(directory).expand_path.to_s
|
27
|
+
@block.call(path, component)
|
25
28
|
end
|
26
29
|
end
|
27
30
|
end
|
data/lib/git_compound/version.rb
CHANGED
@@ -10,17 +10,17 @@ module GitCompound
|
|
10
10
|
|
11
11
|
def visit_component(component)
|
12
12
|
raise GitCompoundError,
|
13
|
-
"Destination directory `#{component.
|
14
|
-
'already exists !' if component.
|
13
|
+
"Destination directory `#{component.path}` " \
|
14
|
+
'already exists !' if component.exists?
|
15
15
|
|
16
16
|
Logger.inline 'Building: '
|
17
17
|
@print.visit_component(component)
|
18
18
|
|
19
|
-
component.build
|
19
|
+
component.build!
|
20
20
|
|
21
21
|
raise GitCompoundError,
|
22
|
-
"Destination `#{component.
|
23
|
-
'verification failed !' unless component.
|
22
|
+
"Destination `#{component.path}` " \
|
23
|
+
'verification failed !' unless component.exists?
|
24
24
|
|
25
25
|
return unless @lock
|
26
26
|
@lock.lock_component(component) unless @lock.find(component)
|
@@ -10,13 +10,13 @@ module GitCompound
|
|
10
10
|
|
11
11
|
def visit_component(component)
|
12
12
|
raise "Component `#{component.name}` is not built !" unless
|
13
|
-
component.
|
13
|
+
component.exists?
|
14
14
|
|
15
15
|
Logger.inline 'Replacing: '
|
16
16
|
@print.visit_component(component)
|
17
17
|
|
18
18
|
component.remove!
|
19
|
-
component.build
|
19
|
+
component.build!
|
20
20
|
|
21
21
|
@lock.lock_component(component)
|
22
22
|
end
|
@@ -13,10 +13,8 @@ module GitCompound
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def visit_component(component)
|
16
|
-
@component
|
17
|
-
@
|
18
|
-
@repository = component.destination_repository if
|
19
|
-
@component_exists
|
16
|
+
@component = component
|
17
|
+
@repository = component.repository if component.exists?
|
20
18
|
|
21
19
|
case
|
22
20
|
when component_needs_building? then strategy = @build
|
@@ -38,14 +36,14 @@ module GitCompound
|
|
38
36
|
# does not exist
|
39
37
|
#
|
40
38
|
def component_needs_building?
|
41
|
-
!@
|
39
|
+
!@component.exists?
|
42
40
|
end
|
43
41
|
|
44
42
|
# Component needs updating if it exists, remote origin matches
|
45
43
|
# new component origin and HEAD sha has changed
|
46
44
|
#
|
47
45
|
def component_needs_updating?
|
48
|
-
return false unless @
|
46
|
+
return false unless @component.exists?
|
49
47
|
|
50
48
|
@repository.origin_remote =~ /#{@component.origin}$/ &&
|
51
49
|
@repository.head_sha != @component.sha
|
@@ -55,7 +53,7 @@ module GitCompound
|
|
55
53
|
# remote origin does not match new component origin
|
56
54
|
#
|
57
55
|
def component_needs_replacing?
|
58
|
-
return false unless @
|
56
|
+
return false unless @component.exists?
|
59
57
|
|
60
58
|
!(@repository.origin_remote =~ /#{@component.origin}$/)
|
61
59
|
end
|
@@ -10,12 +10,12 @@ module GitCompound
|
|
10
10
|
|
11
11
|
def visit_component(component)
|
12
12
|
raise "Component `#{component.name}` is not built !" unless
|
13
|
-
component.
|
13
|
+
component.exists?
|
14
14
|
|
15
15
|
Logger.inline 'Updating: '
|
16
16
|
@print.visit_component(component)
|
17
17
|
|
18
|
-
component.update
|
18
|
+
component.update!
|
19
19
|
|
20
20
|
@lock.lock_component(component)
|
21
21
|
end
|
@@ -3,9 +3,6 @@ module GitCompound
|
|
3
3
|
# Worker that detects conflicting dependencies
|
4
4
|
#
|
5
5
|
class ConflictingDependencyChecker < Worker
|
6
|
-
# TODO: this should collect all components first
|
7
|
-
# using ComponentsCollector worker
|
8
|
-
#
|
9
6
|
def initialize
|
10
7
|
@components = []
|
11
8
|
end
|
@@ -22,8 +19,8 @@ module GitCompound
|
|
22
19
|
|
23
20
|
def conflict_exists?(component)
|
24
21
|
@components.any? do |other|
|
25
|
-
component.
|
26
|
-
|
22
|
+
!(component == other && component.version == other.version) &&
|
23
|
+
component.path == other.path
|
27
24
|
end
|
28
25
|
end
|
29
26
|
end
|
@@ -10,7 +10,7 @@ module GitCompound
|
|
10
10
|
|
11
11
|
def visit_component(component)
|
12
12
|
@component = component
|
13
|
-
@repository = component.
|
13
|
+
@repository = component.repository
|
14
14
|
|
15
15
|
check_uncommited_changes!
|
16
16
|
check_untracked_files!
|
@@ -33,13 +33,13 @@ module GitCompound
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def subcomponents_dirs
|
36
|
-
locked_dirs = @lock.components.map { |locked| "#{locked.
|
36
|
+
locked_dirs = @lock.components.map { |locked| "#{locked.path}".chop }
|
37
37
|
component_subdirs = locked_dirs.select do |locked_dir|
|
38
|
-
locked_dir.start_with?(@component.
|
38
|
+
locked_dir.start_with?(@component.path)
|
39
39
|
end
|
40
40
|
|
41
41
|
component_subdirs.collect do |subdir|
|
42
|
-
subdir.sub(/^#{@component.
|
42
|
+
subdir.sub(/^#{@component.path}/, '').split(File::SEPARATOR).first
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_compound
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Bizon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -133,6 +133,10 @@ files:
|
|
133
133
|
- lib/git_compound/logger.rb
|
134
134
|
- lib/git_compound/logger/colors.rb
|
135
135
|
- lib/git_compound/logger/core_ext/string.rb
|
136
|
+
- lib/git_compound/logger/debug/command.rb
|
137
|
+
- lib/git_compound/logger/debug/repository.rb
|
138
|
+
- lib/git_compound/logger/debug/task.rb
|
139
|
+
- lib/git_compound/logger/debugger.rb
|
136
140
|
- lib/git_compound/manifest.rb
|
137
141
|
- lib/git_compound/node.rb
|
138
142
|
- lib/git_compound/repository.rb
|