latest_branch 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/bin/alias_all_projects +11 -2
- data/bin/latest_branch +2 -2
- data/lib/latest_branch/version.rb +1 -1
- data/website/index.html +7 -4
- metadata +1 -1
data/History.txt
CHANGED
data/bin/alias_all_projects
CHANGED
@@ -9,7 +9,8 @@ default_root = ENV['RAILS_APPS'] if ENV['RAILS_APPS']
|
|
9
9
|
default_root ||= File.join(ENV['HOME'], 'rails_apps') if ENV['HOME']
|
10
10
|
OPTIONS = {
|
11
11
|
:path => default_root,
|
12
|
-
:prefix => ''
|
12
|
+
:prefix => '',
|
13
|
+
:ignore => 'pkg,vendor,template,tags'
|
13
14
|
}
|
14
15
|
parser = OptionParser.new do |opts|
|
15
16
|
opts.banner = <<BANNER
|
@@ -34,6 +35,10 @@ BANNER
|
|
34
35
|
opts.on("--prefix=PREFIX", String,
|
35
36
|
"Prefix for all aliases created.",
|
36
37
|
"Default: None") { |OPTIONS[:prefix]| }
|
38
|
+
opts.on("-i", "--ignore=IGNORE1[,IGNORE2]", String,
|
39
|
+
"Paths that contain IGNORE1 or IGNORE2, etc, will not be included",
|
40
|
+
"E.g. --ignore=pkg will ignore pkg folders generated when building gems",
|
41
|
+
"Default: pkg,vendor,template,tags") { |OPTIONS[:ignore]| }
|
37
42
|
opts.on("-h", "--help",
|
38
43
|
"Show this help message.") { puts opts; exit }
|
39
44
|
opts.parse!(ARGV)
|
@@ -45,7 +50,11 @@ end
|
|
45
50
|
path = File.expand_path OPTIONS[:path]
|
46
51
|
prefix = OPTIONS[:prefix]
|
47
52
|
|
48
|
-
|
53
|
+
folders = Dir["#{path}/**/Rakefile"].map {|folder| folder.gsub(path + '/','').gsub('/Rakefile','')}
|
54
|
+
OPTIONS[:ignore].split(',').each do |ignore_me|
|
55
|
+
folders.reject! { |folder| folder =~ /#{ignore_me}/ }
|
56
|
+
end
|
57
|
+
projects = folders.map { |folder| folder.split('/').last }.uniq
|
49
58
|
cmds = []
|
50
59
|
projects.each do |project|
|
51
60
|
cmds << "alias #{prefix}#{project}='cd \`latest_branch --app=#{project} --path=#{path}\`'"
|
data/bin/latest_branch
CHANGED
@@ -10,7 +10,7 @@ default_path ||= File.join(ENV['HOME'], 'rails_apps') if ENV['HOME']
|
|
10
10
|
OPTIONS = {
|
11
11
|
:app => nil,
|
12
12
|
:path => default_path,
|
13
|
-
:ignore => 'pkg,vendor,template'
|
13
|
+
:ignore => 'pkg,vendor,template,tags'
|
14
14
|
}
|
15
15
|
parser = OptionParser.new do |opts|
|
16
16
|
opts.banner = <<BANNER
|
@@ -37,7 +37,7 @@ BANNER
|
|
37
37
|
opts.on("-i", "--ignore=IGNORE1[,IGNORE2]", String,
|
38
38
|
"Paths that contain IGNORE1 or IGNORE2, etc, will not be included",
|
39
39
|
"E.g. --ignore=pkg will ignore pkg folders generated when building gems",
|
40
|
-
"Default: pkg,vendor,template") { |OPTIONS[:ignore]| }
|
40
|
+
"Default: pkg,vendor,template,tags") { |OPTIONS[:ignore]| }
|
41
41
|
opts.on("-h", "--help",
|
42
42
|
"Show this help message.") { puts opts; exit }
|
43
43
|
opts.parse!(ARGV)
|
data/website/index.html
CHANGED
@@ -33,9 +33,12 @@
|
|
33
33
|
<h1>latest_branch</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/dr_nic_utilities"; return false'>
|
35
35
|
Get Version
|
36
|
-
<a href="http://rubyforge.org/projects/dr_nic_utilities" class="numbers">1.0.
|
36
|
+
<a href="http://rubyforge.org/projects/dr_nic_utilities" class="numbers">1.0.2</a>
|
37
37
|
</div>
|
38
|
-
<h2>→
|
38
|
+
<h2>→ latest_branch -a <proj_name></h2>
|
39
|
+
|
40
|
+
|
41
|
+
<h2>→ alias_all_projects</h2>
|
39
42
|
|
40
43
|
|
41
44
|
<h2>What</h2>
|
@@ -47,7 +50,7 @@ This is useful where your project branches all start with the same name as the p
|
|
47
50
|
|
48
51
|
<ul>
|
49
52
|
<li>/path/to/wizzo —trunk</li>
|
50
|
-
<li>/path/to/wizzo_feature1 —branch for feature1</li>
|
53
|
+
<li>/path/to/wizzo_feature1 —branch for feature1 <strong>Last touched</strong></li>
|
51
54
|
<li>/path/to/wizzo_feature2 —branch for feature2</li>
|
52
55
|
</ul>
|
53
56
|
|
@@ -62,7 +65,7 @@ $ latest_branch --app=wizzo --path=/path/to
|
|
62
65
|
|
63
66
|
|
64
67
|
<ul>
|
65
|
-
<li>/path/to/booya/trunk —trunk</li>
|
68
|
+
<li>/path/to/booya/trunk —trunk <strong>Last touched</strong></li>
|
66
69
|
<li>/path/to/booya/branches/feature1 —branch for feature1</li>
|
67
70
|
<li>/path/to/booya/branches/feature2 —branch for feature2</li>
|
68
71
|
</ul>
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: latest_branch
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
6
|
+
version: 1.0.2
|
7
7
|
date: 2007-04-15 00:00:00 +02:00
|
8
8
|
summary: Return the most-recently-updated folder starting with a common prefix.
|
9
9
|
require_paths:
|