pro 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -14
  3. data/bin/pro +6 -6
  4. data/lib/pro.rb +5 -4
  5. data/lib/pro/version.rb +1 -1
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ac15f737100200ff1b897182f49139736a8e876
4
- data.tar.gz: 5ba1a872a3126ea296df0156936b393395920df6
3
+ metadata.gz: 88c563fe2053d87fa48f4e6cee7c524cb76fae67
4
+ data.tar.gz: e2870e0364138adfdbffa9a3d459560260485b93
5
5
  SHA512:
6
- metadata.gz: 5ce52738f6186ed0d640c11761c76eeaf699d1c1993880fa0f1193897409775d32e7e37ff4f9447158c6f0d829623182d910e37bde8aaa8061b0dba5fe039ab3
7
- data.tar.gz: 9fc044be29999b50daea1bf481899557c2503fa3f9d60e5b7c9a6ca6d816f33572d2780a6533ef456f1a2ff19757188d10f41b12ddd891f56b17977fb82f5913
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 little utility to wrangle your git repositories.
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. You can also run commands in every git repository.
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 [many tools](https://github.com/rupa/z) that try and solve this
13
+ There are [attempts](https://github.com/rupa/z) to solve this
11
14
  problem using frequency and recency.
12
- Pro solves the problem by fuzzy searching only git repositories.
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 fuzzy matching
15
- its name.
16
- You can install the `pd` tool (name configurable) by running `pro 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 `rm -rf *` on all
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
- Pro is bundled as a Ruby gem. To install run:
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
- Pro works from a base directory for efficiency.
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
- Pro works from a base directory for efficiency.
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)
@@ -1,3 +1,3 @@
1
1
  module Pro
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
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.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-01 00:00:00.000000000 Z
11
+ date: 2013-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fuzzy_match