git_compound 0.1.1 → 0.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fcf9e29c1abe4d4c3fe2287e8559cd84035b8a7
|
4
|
+
data.tar.gz: b2746150e9f9fc1dfe86a5a12287606a85411302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0ab07e4b756841e02a71a62043bc67292a6de43b6e8c2abc811c0b6cf05c9f3fa9a2d305db945a7a625c5e563c38263af4de7be899e8b6d133b36edc9bcde21
|
7
|
+
data.tar.gz: 4b9f4a83e653c1f9c1e6ed5b1c69e558617e9537e29d13f588a7f1c67c7d253a28b59281f81e6831f3a7c3ab5e14915946557655950842f434545f8e0a5b4f2a
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@ Create `Compoundfile` or `.gitcompound` manifest:
|
|
10
10
|
|
11
11
|
```ruby
|
12
12
|
name :base_component
|
13
|
+
maintainer 'Your Name <your.email@example.com>'
|
13
14
|
|
14
15
|
component :vendor_1 do
|
15
16
|
version '~>1.1'
|
@@ -107,15 +108,22 @@ and name constraints
|
|
107
108
|
|
108
109
|
1. Use `name` method to specify **name** of manifest or component that this manifest is included in.
|
109
110
|
|
110
|
-
2.
|
111
|
+
2. Use `maintainer` method to specify maintainer of component. This can take more arguments (separated
|
112
|
+
by comma), for example:
|
111
113
|
|
112
|
-
|
114
|
+
```ruby
|
115
|
+
maintaner 'First maintaner', 'Second maintaner'
|
116
|
+
```
|
117
|
+
|
118
|
+
3. Add dependency to required **component** using `component` method.
|
119
|
+
|
120
|
+
This method takes two arguments -- name of component (as symbol) and implicit or explicit block.
|
113
121
|
|
114
122
|
Beware that `GitCompound` checks name constraints, so if you rely on component
|
115
123
|
with name `:component_1`, and this component has `Compoundfile` inside that declares
|
116
124
|
it's name as something else than `:component_1` -- `GitCompound` will raise exception.
|
117
125
|
|
118
|
-
|
126
|
+
4. Components can use following **version strategies**:
|
119
127
|
|
120
128
|
* `version` -- Rubygems-like **version** strategy
|
121
129
|
|
@@ -134,18 +142,18 @@ and name constraints
|
|
134
142
|
This will prevent going into detached state. If SHA does not point to any HEAD of existing branch,
|
135
143
|
component destination repository will be left in detached state.
|
136
144
|
|
137
|
-
|
145
|
+
5. Provide path to **source** repository using `source` method of manifest domain specific language.
|
138
146
|
|
139
147
|
It will be used as source to clone repository into destination directory.
|
140
148
|
|
141
|
-
This can take `:shallow`
|
149
|
+
This can take `:shallow` argument. When `:shallow` is set, shallow clone will be
|
142
150
|
performed (`--branch #{ref} --depth 1`):
|
143
151
|
|
144
152
|
```ruby
|
145
153
|
component :bootstrap do
|
146
154
|
version '~>3.3.5'
|
147
155
|
source 'git@github.com:twbs/bootstrap', :shallow
|
148
|
-
destination '/vendor/bootstrap
|
156
|
+
destination '/vendor/bootstrap'
|
149
157
|
end
|
150
158
|
```
|
151
159
|
|
@@ -156,7 +164,7 @@ and name constraints
|
|
156
164
|
Use it with caution !
|
157
165
|
|
158
166
|
|
159
|
-
|
167
|
+
6. Use `destination` method to specify **destination** path where component will be cloned into.
|
160
168
|
|
161
169
|
This should be relative path in most cases.
|
162
170
|
|
@@ -175,7 +183,7 @@ and name constraints
|
|
175
183
|
Ceraintly components that are libraries should not use it at all. If component is project --
|
176
184
|
it can take benefit from using absolute paths in component destination.
|
177
185
|
|
178
|
-
|
186
|
+
7. Running tasks
|
179
187
|
|
180
188
|
It is possible to use `task` method to define new **task**. `task` method takes 2 or 3 arguments.
|
181
189
|
First one is task name (symbol). Second one is optional task type that define how, and
|
@@ -202,8 +210,8 @@ and name constraints
|
|
202
210
|
```ruby
|
203
211
|
task :print_component_name, :each do |dir, component|
|
204
212
|
puts "Current component name: #{component.name}"
|
205
|
-
puts "Current component source: #{component.origin}
|
206
|
-
puts "Current component destination: #{component.destination_path}
|
213
|
+
puts "Current component source: #{component.origin}"
|
214
|
+
puts "Current component destination: #{component.destination_path}"
|
207
215
|
|
208
216
|
puts "Component directory: #{dir}"
|
209
217
|
end
|
@@ -281,7 +289,7 @@ and name constraints
|
|
281
289
|
* replaced (remove & clone) -- if component exists but doesn't match origin remote
|
282
290
|
|
283
291
|
When invoking update process via `gitcompound update` command, versions specified in manifest file
|
284
|
-
will be
|
292
|
+
will be used.
|
285
293
|
|
286
294
|
## Roadmap
|
287
295
|
|
@@ -14,6 +14,10 @@ module GitCompound
|
|
14
14
|
@manifest.name = component_name.to_sym
|
15
15
|
end
|
16
16
|
|
17
|
+
def maintainer(*component_maintainer)
|
18
|
+
@manifest.maintainer = component_maintainer
|
19
|
+
end
|
20
|
+
|
17
21
|
def component(name, &block)
|
18
22
|
@manifest.components.store(name.to_sym, Component.new(name, @manifest, &block))
|
19
23
|
end
|
@@ -4,7 +4,7 @@ module GitCompound
|
|
4
4
|
# Manifest
|
5
5
|
#
|
6
6
|
class Manifest < Node
|
7
|
-
attr_accessor :name, :components, :tasks
|
7
|
+
attr_accessor :name, :maintainer, :components, :tasks
|
8
8
|
|
9
9
|
FILENAMES = %w(Compoundfile .gitcompound)
|
10
10
|
|
@@ -12,6 +12,7 @@ module GitCompound
|
|
12
12
|
@contents = contents
|
13
13
|
@parent = parent
|
14
14
|
@name = ''
|
15
|
+
@maintainer = []
|
15
16
|
@components = {}
|
16
17
|
@tasks = {}
|
17
18
|
DSL::ManifestDSL.new(self, contents) if contents
|
data/lib/git_compound/version.rb
CHANGED
@@ -4,14 +4,26 @@ module GitCompound
|
|
4
4
|
#
|
5
5
|
class PrettyPrint < Worker
|
6
6
|
def visit_component(component)
|
7
|
-
|
7
|
+
pretty_print(component, " `#{component.name}` component, #{component.version}")
|
8
|
+
end
|
9
|
+
|
10
|
+
def visit_manifest(manifest)
|
11
|
+
details = []
|
12
|
+
details << "Component: #{manifest.name}" unless manifest.name.empty?
|
13
|
+
details << "Maintainer: #{manifest.maintainer.join(', ')}" unless
|
14
|
+
manifest.maintainer.empty?
|
15
|
+
details << 'Dependencies:' unless manifest.components.empty?
|
16
|
+
|
17
|
+
pretty_print(manifest, *details)
|
8
18
|
end
|
9
19
|
|
10
20
|
private
|
11
21
|
|
12
|
-
def
|
13
|
-
|
14
|
-
|
22
|
+
def pretty_print(element, *messages)
|
23
|
+
messages.each do |message|
|
24
|
+
Logger.inline ' ' * element.ancestors.count
|
25
|
+
Logger.info message
|
26
|
+
end
|
15
27
|
end
|
16
28
|
end
|
17
29
|
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.1.
|
4
|
+
version: 0.1.2
|
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-
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|