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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50b2d8701738f9df86cb4f46116b13acdaab252b
4
- data.tar.gz: 769c62496ef053a69a9a9a446c3350d71abaadb0
3
+ metadata.gz: 5ea26f10406e31880cdef123e3860d43e779a7f1
4
+ data.tar.gz: c0d284df4df1cde2346f7deda58a26537b48cb7e
5
5
  SHA512:
6
- metadata.gz: 03346d5a722f9c410b078452cd9d98c1b63fc1bac70283bb7143657ee72898ae3858bd9ed201ea992547b3cacc657f0b68edf6a6e19bbb039dd018e558b2eaac
7
- data.tar.gz: 9294ad5a09a04eefcbe5f918e42e42fd366998658e717462549c4c339448f0ce47378729fb202a9dbdc79f223bbd4f559aeae52fbac4ff352728014158645a6c
6
+ metadata.gz: 753e7853e4c673913c77cb1c266c60592827db4596ad8f4198b0f32b2b3eec45a12fad122c024ccced571189d20fed40726b95d7c107a12daed9d96d221539a9
7
+ data.tar.gz: 47d1c591c3f6a3f4977e2075d3599d9af558a45128ceba10c9e1ac6e0443b26a70ddb7001db14284f473e53e166f5e0875c932c64cfaa349730b72912690d69a
data/.travis.yml CHANGED
@@ -2,4 +2,5 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.3.0
5
- before_install: gem install bundler -v 1.12.5
5
+ script:
6
+ - bundle exec rspec
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # GitExplorer
2
2
 
3
+ [![Build Status](https://travis-ci.org/alexrochas/git-explorer.svg?branch=master)](https://travis-ci.org/alexrochas/git-explorer)
4
+ [![Gem Version](https://badge.fury.io/rb/git_explorer.svg)](https://badge.fury.io/rb/git_explorer)
5
+ ![](http://ruby-gem-downloads-badge.herokuapp.com/git_explorer)
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
- project <project_name> is up_to_date on branch master -> []
23
- project <project_name> is up_to_date on branch master -> []
24
- project <project_name> is not_staged on branch -> ["<file_name>", "<file_name>", "<file_name>"]
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
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency "rspec", "~> 3.0"
25
25
  spec.add_dependency "thor", "~> 0.19.1"
26
+ spec.add_dependency "pipeme", "~> 0.1.0"
26
27
  end
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 f -name .gitignore", config={:capture=>true, :verbose=>false})
30
+ run("find #{root_dir} -type d -name .git", config={:capture=>true, :verbose=>false})
33
31
  .split("\n")
34
- .map{|file| file.gsub(/\.gitignore/,'')}
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 "project #{status.project_name} is #{status.status} on branch #{status.branch} -> #{status.files}"}
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
@@ -1,3 +1,3 @@
1
1
  module GitExplorer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-07-24 00:00:00.000000000 Z
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