git_compound 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e127d67e2392d65dea06cf967be3770cba4144bc
4
- data.tar.gz: 46dd79cde5f328dd213e7a072cf27b7b69b95fc6
3
+ metadata.gz: 8db5466d0de881b83ca8d78cfbc1350bd93fe7c9
4
+ data.tar.gz: 39b0313d49ad5c93eb070249c38cd625c844575c
5
5
  SHA512:
6
- metadata.gz: 16e0fdc430743a2812def344af9efdae345886414853e0fe4f4566a51f3ff92828403d1c1921ee9d7413a1f6a106a6f3edd7adff96872f1dedad8054581569d8
7
- data.tar.gz: d17fba0fdfc018cebfd5fe0c7fcad60e5d9a42c334c3e58f9b345cc45b32ab2e3a32e0bb69740305aec26519308d3d994e5a410ec00921c432e7c9d53edda598
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 is more a distributed packaging system (dependency manager) than alternative to Git submodules,
46
- however it has common features of both Git submodules and dependency managers like Bundler or Composer.
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
- `GitCompound` makes sure your project composition is the same on all machines,
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
- * `GitCompound` introduces Domain Specific Language desgined for writing manifests.
52
+ * GitCompound introduces Domain Specific Language desgined for writing manifests.
56
53
 
57
- * It is possible to create multiple manifest files (`Compoundfile`, `.gitcompound` or something else)
58
- and build them when necessary.
54
+ * Manifest file is used to specify dependencies of your project.
59
55
 
60
- * Manifests can declare dependencies on different versions of components using different version strategies
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
@@ -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::ComponentUpdateDispatcher.new(@lock_new))
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::ComponentUpdateDispatcher.new(@lock))
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 @sha matches ref in remote repository then
12
+ # If sha matches ref in remote repository then
13
13
  # this ref should be returned
14
- # else return @sha.
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
- def sha # rubocop:disable Style/TrivialAccessors
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
- # We assume that SHA is always available as we do not want
27
- # to clone repository and check it -- this probably needs
28
- # to be changed, so -- TODO
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
 
@@ -44,7 +44,7 @@ module GitCompound
44
44
  @destination.repository do |repo|
45
45
  repo.fetch
46
46
  repo.checkout(@source.ref)
47
- repo.merge if repo.branches.include?(@source.ref)
47
+ repo.merge if repo.branch?(@source.ref)
48
48
  end
49
49
  end
50
50
 
@@ -4,7 +4,10 @@ module GitCompound
4
4
  #
5
5
  class GitCommand
6
6
  extend Logger::Debugger
7
- debug_before(:execute!) { "Running Git command `#{@command}`" }
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 = "(git #{cmd} #{args}) 2>&1"
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 = `#{@command}` }
17
+ Dir.chdir(path) { @output = `(#{@command}) 2>&1` }
18
18
  @status = $CHILD_STATUS.exitstatus
19
19
  @output.sub!(/\n\Z/, '')
20
20
  end
@@ -40,8 +40,8 @@ module GitCompound
40
40
  all
41
41
  end
42
42
 
43
- def ref_exists?(ref)
44
- matching = refs.select { |refs_a| refs_a.include?(ref.to_s) }
43
+ def branch?(branch)
44
+ matching = refs.select { |refs| refs.include?(branch.to_s) }
45
45
  matching.any?
46
46
  end
47
47
 
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # GitCompound
2
2
  #
3
3
  module GitCompound
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
@@ -3,7 +3,7 @@ module GitCompound
3
3
  # Worker that decides whether component
4
4
  # should be built, updated or replaced
5
5
  #
6
- class ComponentUpdateDispatcher < Worker
6
+ class ComponentDispatcher < Worker
7
7
  def initialize(lock)
8
8
  @lock = lock
9
9
  @print = PrettyPrint.new
@@ -9,6 +9,8 @@ module GitCompound
9
9
  end
10
10
 
11
11
  def visit_component(component)
12
+ return unless component.exists?
13
+
12
14
  @component = component
13
15
  @repository = component.repository
14
16
 
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 :ComponentUpdateDispatcher,
94
- 'git_compound/worker/component_update_dispatcher'
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.0
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-29 00:00:00.000000000 Z
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