git_compound 0.1.0 → 0.1.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 -10
- data/lib/git_compound/builder.rb +2 -2
- data/lib/git_compound/component/version/sha.rb +8 -6
- data/lib/git_compound/component.rb +1 -1
- data/lib/git_compound/logger/debug/repository.rb +4 -1
- data/lib/git_compound/repository/git_command.rb +2 -2
- data/lib/git_compound/repository/git_repository.rb +2 -2
- data/lib/git_compound/repository/repository_local.rb +1 -1
- data/lib/git_compound/version.rb +1 -1
- data/lib/git_compound/worker/{component_update_dispatcher.rb → component_dispatcher.rb} +1 -1
- data/lib/git_compound/worker/local_changes_guard.rb +2 -0
- data/lib/git_compound.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8db5466d0de881b83ca8d78cfbc1350bd93fe7c9
|
4
|
+
data.tar.gz: 39b0313d49ad5c93eb070249c38cd625c844575c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a99ef50db20399145c1c2fd42505ac01e419a18959539379eeaf5b0a1860b44c576626896483e7371d396a3afc0a4760da0aa40cfc82dad2a4d02a15b043d2a7
|
7
|
+
data.tar.gz: b9ec8115fa1839dfa4f2f3187ce4abfd215678331d100c70b8e21b7e7fd25300d6a255f0e1c7228d34dc45def26001c1a6c81421bccde70f17ae6492c637aad3
|
data/README.md
CHANGED
@@ -42,22 +42,18 @@ GitCompound will also process manifests found in dependencies.
|
|
42
42
|
|
43
43
|
## Core features
|
44
44
|
|
45
|
-
GitCompound
|
46
|
-
|
45
|
+
GitCompound has common features of both Git submodules and dependency managers like Bundler or Composer.
|
46
|
+
It is a distributed dependency manager and alternative to Git submodules that gives you more flexibility.
|
47
47
|
|
48
|
-
|
49
|
-
but you can have different composition depending on manifest you are using.
|
50
|
-
|
51
|
-
It has been created with Docker compatiblity in mind.
|
48
|
+
It is particularly useful when you need to develop your project dependencies at the same time as project itself.
|
52
49
|
|
53
50
|
Core features:
|
54
51
|
|
55
|
-
*
|
52
|
+
* GitCompound introduces Domain Specific Language desgined for writing manifests.
|
56
53
|
|
57
|
-
*
|
58
|
-
and build them when necessary.
|
54
|
+
* Manifest file is used to specify dependencies of your project.
|
59
55
|
|
60
|
-
*
|
56
|
+
* Manifest can declare dependencies on components using different version strategies
|
61
57
|
(Rubygems-like version, tag, branch or explicit SHA).
|
62
58
|
|
63
59
|
* Manifests will be processed in hierarchical way. Manifest that `gitcompound` command is run against
|
data/lib/git_compound/builder.rb
CHANGED
@@ -18,7 +18,7 @@ module GitCompound
|
|
18
18
|
def manifest_update
|
19
19
|
Logger.info 'Updating components ...'
|
20
20
|
@lock_new = Lock.new.clean
|
21
|
-
@manifest.process(Worker::
|
21
|
+
@manifest.process(Worker::ComponentDispatcher.new(@lock_new))
|
22
22
|
self
|
23
23
|
end
|
24
24
|
|
@@ -68,7 +68,7 @@ module GitCompound
|
|
68
68
|
|
69
69
|
def locked_components_build
|
70
70
|
Logger.info 'Building components from lockfile ...'
|
71
|
-
@lock.process(Worker::
|
71
|
+
@lock.process(Worker::ComponentDispatcher.new(@lock))
|
72
72
|
self
|
73
73
|
end
|
74
74
|
|
@@ -9,23 +9,25 @@ module GitCompound
|
|
9
9
|
@sha = sha
|
10
10
|
end
|
11
11
|
|
12
|
-
# If
|
12
|
+
# If sha matches ref in remote repository then
|
13
13
|
# this ref should be returned
|
14
|
-
# else return
|
14
|
+
# else return sha.
|
15
15
|
#
|
16
16
|
def ref
|
17
17
|
ref = @repository.refs.find { |refs_a| refs_a.include?(@sha) }
|
18
18
|
ref ? ref.last : @sha
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
# rubocop:disable Style/TrivialAccessors
|
22
|
+
def sha
|
22
23
|
@sha
|
23
24
|
end
|
25
|
+
# rubocop:enable Style/TrivialAccessors
|
24
26
|
|
25
27
|
def reachable?
|
26
|
-
#
|
27
|
-
# to clone repository and check
|
28
|
-
# to be changed
|
28
|
+
# TODO, we assume that SHA is always available as we do not want
|
29
|
+
# to clone repository and check if commit exists -- this probably
|
30
|
+
# needs to be changed when someone finds better solution for this.
|
29
31
|
true
|
30
32
|
end
|
31
33
|
|
@@ -4,7 +4,10 @@ module GitCompound
|
|
4
4
|
#
|
5
5
|
class GitCommand
|
6
6
|
extend Logger::Debugger
|
7
|
-
debug_before(:execute!)
|
7
|
+
debug_before(:execute!) do
|
8
|
+
"Running Git command `#{@command}`" +
|
9
|
+
(@workdir ? " in `#{@workdir.split(File::SEPARATOR).last}`" : '')
|
10
|
+
end
|
8
11
|
end
|
9
12
|
end
|
10
13
|
end
|
@@ -8,13 +8,13 @@ module GitCompound
|
|
8
8
|
attr_reader :output, :status, :command
|
9
9
|
|
10
10
|
def initialize(cmd, args, workdir = nil)
|
11
|
-
@command = "
|
11
|
+
@command = "git #{cmd} #{args}"
|
12
12
|
@workdir = workdir
|
13
13
|
end
|
14
14
|
|
15
15
|
def execute!
|
16
16
|
path = @workdir ? @workdir : Dir.pwd
|
17
|
-
Dir.chdir(path) { @output =
|
17
|
+
Dir.chdir(path) { @output = `(#{@command}) 2>&1` }
|
18
18
|
@status = $CHILD_STATUS.exitstatus
|
19
19
|
@output.sub!(/\n\Z/, '')
|
20
20
|
end
|
@@ -8,7 +8,7 @@ module GitCompound
|
|
8
8
|
def initialize(source)
|
9
9
|
super
|
10
10
|
@source = Pathname.new(@source).expand_path.to_s
|
11
|
-
raise RepositoryUnreachableError unless
|
11
|
+
raise RepositoryUnreachableError, "Invalid Git repository in #{@source}" unless
|
12
12
|
File.directory?("#{@source}/.git")
|
13
13
|
end
|
14
14
|
|
data/lib/git_compound/version.rb
CHANGED
data/lib/git_compound.rb
CHANGED
@@ -90,8 +90,8 @@ module GitCompound
|
|
90
90
|
'git_compound/worker/circular_dependency_checker'
|
91
91
|
autoload :ComponentBuilder,
|
92
92
|
'git_compound/worker/component_builder'
|
93
|
-
autoload :
|
94
|
-
'git_compound/worker/
|
93
|
+
autoload :ComponentDispatcher,
|
94
|
+
'git_compound/worker/component_dispatcher'
|
95
95
|
autoload :ComponentUpdater,
|
96
96
|
'git_compound/worker/component_updater'
|
97
97
|
autoload :ComponentReplacer,
|
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.1.
|
4
|
+
version: 0.1.1
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -157,8 +157,8 @@ files:
|
|
157
157
|
- lib/git_compound/version.rb
|
158
158
|
- lib/git_compound/worker/circular_dependency_checker.rb
|
159
159
|
- lib/git_compound/worker/component_builder.rb
|
160
|
+
- lib/git_compound/worker/component_dispatcher.rb
|
160
161
|
- lib/git_compound/worker/component_replacer.rb
|
161
|
-
- lib/git_compound/worker/component_update_dispatcher.rb
|
162
162
|
- lib/git_compound/worker/component_updater.rb
|
163
163
|
- lib/git_compound/worker/components_collector.rb
|
164
164
|
- lib/git_compound/worker/conflicting_dependency_checker.rb
|