ianwhite-garlic 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/README.textile +26 -0
- data/lib/garlic/session.rb +5 -0
- data/lib/garlic/target.rb +2 -2
- data/lib/garlic.rb +1 -1
- data/sh/garlic.sh +34 -0
- metadata +4 -3
data/History.txt
CHANGED
data/README.textile
CHANGED
@@ -99,6 +99,32 @@ h2. Rake tasks
|
|
99
99
|
If you prefer to use garlic via rake tasks, then just require 'garlic/tasks' and you'll get a bunch of em.
|
100
100
|
Once required, do rake -T to see descriptions.
|
101
101
|
|
102
|
+
h2. garlic workflow shell commands
|
103
|
+
|
104
|
+
If you add the following line to your .profile
|
105
|
+
|
106
|
+
source `gem environment gemdir`/gems/ianwhite-garlic*/sh/garlic.sh
|
107
|
+
|
108
|
+
Then you'll get these 4 new shell commands:
|
109
|
+
|
110
|
+
gcd [target] cds into the specified target working repo
|
111
|
+
gcdp [target] cds into the specified target plugin in the working repo
|
112
|
+
gup cds back up to the garlic'd repo from within a working path
|
113
|
+
gpush [branch] from within a working repo, pushes changes back to the local garlic target, and resets
|
114
|
+
local changes in that target to HEAD.
|
115
|
+
|
116
|
+
This means you might have a workflow as follows (example is for a plugin):
|
117
|
+
|
118
|
+
# run garlic, see probs in '2-2-stable'
|
119
|
+
|
120
|
+
gcdp 2-2 # => takes you into the working repo in the '2-2-stable' target
|
121
|
+
|
122
|
+
# fix the changes, make some commits
|
123
|
+
|
124
|
+
gpush # => pushes the changes back to the enclosing garlic'd repo
|
125
|
+
gup # => go back up there
|
126
|
+
garlic # => rerun garlic to see how the changes affect the other targets
|
127
|
+
|
102
128
|
h2. Lend a hand
|
103
129
|
|
104
130
|
This is an early release, so there is plenty of scope for changes and improvement
|
data/lib/garlic/session.rb
CHANGED
@@ -104,6 +104,11 @@ module Garlic
|
|
104
104
|
shell.run
|
105
105
|
end
|
106
106
|
|
107
|
+
define_command :path, "return the work dir for the specified target" do |*path_target|
|
108
|
+
self.run_targets = path_target.first if path_target.any?
|
109
|
+
puts determine_targets.first.path
|
110
|
+
end
|
111
|
+
|
107
112
|
define_command :run, "Run each garlic TARGET" do
|
108
113
|
these_targets = determine_targets
|
109
114
|
target_names, failed_names = these_targets.map{|t| t.name}, []
|
data/lib/garlic/target.rb
CHANGED
@@ -81,9 +81,9 @@ module Garlic
|
|
81
81
|
old_tree_ish = repo.head_sha
|
82
82
|
repo.checkout(tree_ish) if tree_ish
|
83
83
|
if read_sha(install_path) == repo.head_sha
|
84
|
-
puts "#{install_path} is up to date at #{tree_ish ||
|
84
|
+
puts "#{install_path} is up to date at #{tree_ish || repo.head_sha[0..6]}"
|
85
85
|
else
|
86
|
-
puts "#{install_path} needs update to #{tree_ish ||
|
86
|
+
puts "#{install_path} needs update to #{tree_ish || repo.head_sha[0..6]}, exporting archive from #{repo.name}..."
|
87
87
|
repo.export_to(File.join(path, install_path))
|
88
88
|
cd(path) { garlic.instance_eval(&block) } if block_given?
|
89
89
|
write_sha(install_path, repo.head_sha)
|
data/lib/garlic.rb
CHANGED
data/sh/garlic.sh
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# garlic shell helpers
|
2
|
+
|
3
|
+
# cd into the work path of a garlic target
|
4
|
+
gcd ()
|
5
|
+
{
|
6
|
+
cd `garlic path $1`
|
7
|
+
}
|
8
|
+
|
9
|
+
# cd into probable plugin dir of a garlic target
|
10
|
+
gcdp ()
|
11
|
+
{
|
12
|
+
here=`pwd | sed 's/.*\///'`
|
13
|
+
cd `garlic path $1`/vendor/plugins/$here
|
14
|
+
}
|
15
|
+
|
16
|
+
# cd back up to enclosing garlic project
|
17
|
+
gup ()
|
18
|
+
{
|
19
|
+
cd `pwd | sed 's/\.garlic.*//'`
|
20
|
+
}
|
21
|
+
|
22
|
+
# push changes back to local garlic origin, resetting the origin
|
23
|
+
gpush ()
|
24
|
+
{
|
25
|
+
if [ `pwd | sed 's/\.garlic//'` == `pwd` ]; then
|
26
|
+
echo "gpush can only be used in a garlic work repo";
|
27
|
+
else
|
28
|
+
git push origin $1 2>&1 | grep -v warning;
|
29
|
+
here=`pwd`;
|
30
|
+
gup;
|
31
|
+
git reset --hard;
|
32
|
+
cd $here;
|
33
|
+
fi
|
34
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ianwhite-garlic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian White
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-27 00:00:00 -07:00
|
13
13
|
default_executable: garlic
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -34,12 +34,13 @@ files:
|
|
34
34
|
- templates/default.rb
|
35
35
|
- templates/rspec.rb
|
36
36
|
- templates/shoulda.rb
|
37
|
+
- bin/garlic
|
38
|
+
- sh/garlic.sh
|
37
39
|
- License.txt
|
38
40
|
- README.textile
|
39
41
|
- Todo.txt
|
40
42
|
- History.txt
|
41
43
|
- spec/garlic/repo_spec.rb
|
42
|
-
- bin/garlic
|
43
44
|
has_rdoc: true
|
44
45
|
homepage: http://github.com/ianwhite/garlic/tree
|
45
46
|
post_install_message:
|