git_explorer 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +12 -3
- data/gitexplorer.gemspec +1 -0
- data/lib/git_explorer.rb +8 -10
- data/lib/gitexplorer/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ea26f10406e31880cdef123e3860d43e779a7f1
|
4
|
+
data.tar.gz: c0d284df4df1cde2346f7deda58a26537b48cb7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 753e7853e4c673913c77cb1c266c60592827db4596ad8f4198b0f32b2b3eec45a12fad122c024ccced571189d20fed40726b95d7c107a12daed9d96d221539a9
|
7
|
+
data.tar.gz: 47d1c591c3f6a3f4977e2075d3599d9af558a45128ceba10c9e1ac6e0443b26a70ddb7001db14284f473e53e166f5e0875c932c64cfaa349730b72912690d69a
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# GitExplorer
|
2
2
|
|
3
|
+
[](https://travis-ci.org/alexrochas/git-explorer)
|
4
|
+
[](https://badge.fury.io/rb/git_explorer)
|
5
|
+

|
6
|
+
|
7
|
+
|
3
8
|
GitExplorer comes from the necessity of get the status of all my local repositories. This tool will scan all your projects searching for git repositories and extract the project name, status and files unstaged.
|
4
9
|
|
5
10
|
## Installation
|
@@ -19,9 +24,13 @@ Start explore with:
|
|
19
24
|
|
20
25
|
All your git repositories from <root_path> will be scanned and the output will be similar to:
|
21
26
|
```
|
22
|
-
|
23
|
-
|
24
|
-
|
27
|
+
<project_name> is up_to_date on branch master
|
28
|
+
<project_name> is up_to_date on branch master
|
29
|
+
<project_name> is not_staged on branch master
|
30
|
+
path/to/file
|
31
|
+
path/to/file
|
32
|
+
path/to/file
|
33
|
+
path/to/file
|
25
34
|
```
|
26
35
|
|
27
36
|
## Release History
|
data/gitexplorer.gemspec
CHANGED
data/lib/git_explorer.rb
CHANGED
@@ -1,12 +1,6 @@
|
|
1
1
|
require "gitexplorer/version"
|
2
2
|
require "thor"
|
3
|
-
|
4
|
-
# TODO extract to a separated gem
|
5
|
-
class Object
|
6
|
-
def >>(proc)
|
7
|
-
proc.(self)
|
8
|
-
end
|
9
|
-
end
|
3
|
+
require "pipeme"
|
10
4
|
|
11
5
|
module GitExplorer
|
12
6
|
|
@@ -23,18 +17,22 @@ module GitExplorer
|
|
23
17
|
}
|
24
18
|
end
|
25
19
|
|
20
|
+
def self.extract_dir_name
|
21
|
+
-> (dot_git_file_path) { dot_git_file_path.gsub(/\.git$/,'') }
|
22
|
+
end
|
23
|
+
|
26
24
|
class Explorer < Thor
|
27
25
|
include Thor::Actions
|
28
26
|
|
29
27
|
# TODO refactor and extract maps to lambdas
|
30
28
|
desc "use for explore recursively directories and show actual status of git repositories", "gitx explore ."
|
31
29
|
def explore(root_dir="./")
|
32
|
-
run("find #{root_dir} -type
|
30
|
+
run("find #{root_dir} -type d -name .git", config={:capture=>true, :verbose=>false})
|
33
31
|
.split("\n")
|
34
|
-
.map{|file| file
|
32
|
+
.map{|file| file >> GitExplorer::extract_dir_name}
|
35
33
|
.map{|dir| run("basename `git -C #{dir} rev-parse --show-toplevel`; git -C #{dir} status", config={:capture=>true, :verbose=>false})}
|
36
34
|
.map{|status| status >> GitExplorer::extract_status}
|
37
|
-
.map{|status| say
|
35
|
+
.map{|status| say(message="#{status.project_name} is #{status.status} on branch #{status.branch}\n#{status.files.map{|f| "\t#{f}\n"}.join}", color=(:red if status.status.equal?(:not_staged)))}
|
38
36
|
end
|
39
37
|
|
40
38
|
end
|
data/lib/gitexplorer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_explorer
|
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
|
- Alex Rocha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.19.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pipeme
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.0
|
69
83
|
description: Will explore and return information about all your git repo
|
70
84
|
email:
|
71
85
|
- alex.rochas@yahoo.com.br
|