pro 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -14
- data/bin/pro +6 -6
- data/lib/pro.rb +5 -4
- data/lib/pro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88c563fe2053d87fa48f4e6cee7c524cb76fae67
|
4
|
+
data.tar.gz: e2870e0364138adfdbffa9a3d459560260485b93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a75815fa9f72220d7db560c20af9ec19611a4899c272e71825af478e078fff17e6bc608a8ac8abd88ad57b238938bd3bcab84699b3bc69646f9bb4b11d13f729
|
7
|
+
data.tar.gz: e57aec62751ac749b813bb12cb4b8c047f0bbc04e3d1882e1ab0062430da7be32a0c3f78b1aa136fa007b3f5e90f152a53dbe2be9cf412c1c007e74c588e13af
|
data/README.md
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
# Pro
|
2
2
|
|
3
|
-
`pro` is a
|
3
|
+
`pro` is a command to wrangle your git repositories.
|
4
4
|
It includes features like instantly cd'ing to your git repos and getting a
|
5
|
-
status overview
|
5
|
+
status overview, and running an arbitrary command in every git repo.
|
6
|
+
|
7
|
+
Note that pro only currently works on Unix systems. If you experience speed issues
|
8
|
+
see the section on setting a pro base.
|
6
9
|
|
7
10
|
## CD'ing to a project's repository
|
8
11
|
|
9
12
|
Cd'ing to your projects is harder than it should be.
|
10
|
-
There are [
|
13
|
+
There are [attempts](https://github.com/rupa/z) to solve this
|
11
14
|
problem using frequency and recency.
|
12
|
-
|
15
|
+
`pro` solves the problem by fuzzy searching only git repositories.
|
13
16
|
|
14
|
-
The `pd` command allows you to instantly CD to any git repo by
|
15
|
-
its name.
|
16
|
-
You can install
|
17
|
+
The supplementary `pd` command allows you to instantly CD to any git repo by
|
18
|
+
fuzzy matching its name. It is implemented as a shell function.
|
19
|
+
You can install `pd` (name configurable) by running `pro install`.
|
17
20
|
Once you have it you can do some pretty intense cd'ing:
|
18
21
|
|
19
22
|
![pd demo](http://thume.ca/assets/postassets/pro/pd_screen.png)
|
@@ -41,25 +44,35 @@ For example, searching all your repos for ruby files:
|
|
41
44
|
|
42
45
|
![pro run](http://thume.ca/assets/postassets/pro/pro_run.png)
|
43
46
|
|
44
|
-
Notice that it double checks before running so you don't accidentally run
|
45
|
-
your projects.
|
47
|
+
Notice that it double checks before running so you don't accidentally run
|
48
|
+
`rm -rf *` on all your projects.
|
49
|
+
|
50
|
+
## The Pro Base
|
51
|
+
|
52
|
+
`pro` can use a base directory to speed up its search for git repos. By default it
|
53
|
+
uses your home folder.
|
54
|
+
|
55
|
+
To set the base directory either create a file at `~/.proBase` containing the
|
56
|
+
base path or set the environment variable PRO_BASE.
|
46
57
|
|
47
58
|
## Installation
|
48
59
|
|
49
|
-
|
60
|
+
`pro` is bundled as a Ruby gem. To install run:
|
50
61
|
|
51
62
|
$ gem install pro
|
52
63
|
|
64
|
+
You may also want to set your Pro Base. See the above section.
|
65
|
+
|
53
66
|
## Usage
|
54
67
|
|
55
68
|
pro is a command to help you manage your git repositories.
|
56
69
|
|
57
70
|
Base Directory ==========
|
58
|
-
|
71
|
+
pro works from a base directory for efficiency.
|
59
72
|
This is the folder that contains all your other git repositories;
|
60
73
|
they don't have to be at the base level, just somewhere down the tree.
|
61
74
|
|
62
|
-
To set the base directory set the PRO_BASE environment variable or make
|
75
|
+
To set the base directory set the PRO_BASE environment variable or make
|
63
76
|
a ~/.proBase file containing the path.
|
64
77
|
|
65
78
|
Commands ===============
|
@@ -72,13 +85,13 @@ Pro is bundled as a Ruby gem. To install run:
|
|
72
85
|
pro help - display help
|
73
86
|
|
74
87
|
CD Command ============
|
75
|
-
You can use the 'pro install' command to install a wrapper function that allows
|
88
|
+
You can use the 'pro install' command to install a wrapper shell function that allows
|
76
89
|
you to cd to git repositories in your Pro Base wherever you are based on fuzzy matching.
|
77
90
|
|
78
91
|
Example:
|
79
92
|
|
80
93
|
~/randomFolder/ $ pd pro
|
81
|
-
pro/ $ pwd
|
94
|
+
pro/ $ pwd
|
82
95
|
/Users/tristan/Box/Dev/Projects/pro
|
83
96
|
|
84
97
|
|
data/bin/pro
CHANGED
@@ -7,11 +7,11 @@ HELP = <<END
|
|
7
7
|
pro is a command to help you manage your git repositories.
|
8
8
|
|
9
9
|
Base Directory ==========
|
10
|
-
|
10
|
+
pro works from a base directory for efficiency.
|
11
11
|
This is the folder that contains all your other git repositories;
|
12
12
|
they don't have to be at the base level, just somewhere down the tree.
|
13
13
|
|
14
|
-
To set the base directory set the PRO_BASE environment variable or make
|
14
|
+
To set the base directory set the PRO_BASE environment variable or make
|
15
15
|
a ~/.proBase file containing the path.
|
16
16
|
|
17
17
|
Commands ===============
|
@@ -24,13 +24,13 @@ pro install - Install the pro cd command. cd to a directory by fuzzy git repo ma
|
|
24
24
|
pro help - display help
|
25
25
|
|
26
26
|
CD Command ============
|
27
|
-
You can use the 'pro install' command to install a wrapper function that allows
|
27
|
+
You can use the 'pro install' command to install a wrapper shell function that allows
|
28
28
|
you to cd to git repositories in your Pro Base wherever you are based on fuzzy matching.
|
29
29
|
|
30
30
|
Example:
|
31
31
|
|
32
32
|
~/randomFolder/ $ pd pro
|
33
|
-
pro/ $ pwd
|
33
|
+
pro/ $ pwd
|
34
34
|
/Users/tristan/Box/Dev/Projects/pro
|
35
35
|
|
36
36
|
END
|
@@ -58,8 +58,8 @@ when 'run'
|
|
58
58
|
print "Command: "
|
59
59
|
command = STDIN.gets.chomp
|
60
60
|
end
|
61
|
-
Pro.run_command(command)
|
61
|
+
Pro.run_command(command)
|
62
62
|
when 'help'
|
63
|
-
puts HELP
|
63
|
+
puts HELP
|
64
64
|
end
|
65
65
|
|
data/lib/pro.rb
CHANGED
@@ -4,9 +4,10 @@ require "fuzzy_match"
|
|
4
4
|
require "colored"
|
5
5
|
|
6
6
|
SHELL_FUNCTION = <<END
|
7
|
+
|
7
8
|
# pro cd function
|
8
9
|
{{name}}() {
|
9
|
-
projDir=$(pro search $1)
|
10
|
+
local projDir=$(pro search $1)
|
10
11
|
cd ${projDir}
|
11
12
|
}
|
12
13
|
END
|
@@ -18,7 +19,7 @@ arbitrarily deep in your PRO_BASE based on fuzzy matching.
|
|
18
19
|
Example:
|
19
20
|
|
20
21
|
~/randomFolder/ $ pd pro
|
21
|
-
pro/ $ pwd
|
22
|
+
pro/ $ pwd
|
22
23
|
/Users/tristan/Box/Dev/Projects/pro
|
23
24
|
|
24
25
|
========
|
@@ -114,7 +115,7 @@ module Pro
|
|
114
115
|
Dir.chdir(path) do
|
115
116
|
status = `git status 2>/dev/null`
|
116
117
|
end
|
117
|
-
return status.end_with?("(working directory clean)\n")
|
118
|
+
return status.end_with?("(working directory clean)\n") || status.end_with?("working directory clean\n")
|
118
119
|
end
|
119
120
|
|
120
121
|
# Finds if there are any commits which have not been pushed to origin
|
@@ -140,7 +141,7 @@ module Pro
|
|
140
141
|
name = 'pd' if name.empty?
|
141
142
|
# sub into function
|
142
143
|
func = SHELL_FUNCTION.sub("{{name}}",name)
|
143
|
-
['~/.bashrc','~/.zshrc'].each do |rel_path|
|
144
|
+
['~/.profile', '~/.bashrc','~/.zshrc'].each do |rel_path|
|
144
145
|
# check if file exists
|
145
146
|
path = File.expand_path(rel_path)
|
146
147
|
next unless File.exists?(path)
|
data/lib/pro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Hume
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fuzzy_match
|