git_explorer 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d85943fa3ed3be2c1c61ba9574f880d6cd5426c4
4
- data.tar.gz: dd8dfc3e9f0b195e8c4a29d99371d8ffe8203731
3
+ metadata.gz: 50b2d8701738f9df86cb4f46116b13acdaab252b
4
+ data.tar.gz: 769c62496ef053a69a9a9a446c3350d71abaadb0
5
5
  SHA512:
6
- metadata.gz: bf197cc356f2ee702fc10a7a60a379195ada0108a3ac75f1a10b250c682270bcb0052675c65f4177d4a20d65cb860c91731ce2c7b63c93aa5d1c30a1ad91e036
7
- data.tar.gz: f73f6024142728325be6390b2738e2b51f55af05a719320a5ff380242d0747f36730aee88b8518cdbd7f9fc03ddae3982b762d8468a2fbfd87441af2c0daed21
6
+ metadata.gz: 03346d5a722f9c410b078452cd9d98c1b63fc1bac70283bb7143657ee72898ae3858bd9ed201ea992547b3cacc657f0b68edf6a6e19bbb039dd018e558b2eaac
7
+ data.tar.gz: 9294ad5a09a04eefcbe5f918e42e42fd366998658e717462549c4c339448f0ce47378729fb202a9dbdc79f223bbd4f559aeae52fbac4ff352728014158645a6c
data/README.md CHANGED
@@ -1,41 +1,35 @@
1
- # Gitexplorer
1
+ # GitExplorer
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gitexplorer`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ 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.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
7
+ Linux:
10
8
 
11
- ```ruby
12
- gem 'gitexplorer'
9
+ ```sh
10
+ ~$ gem install git_explorer
13
11
  ```
14
12
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install gitexplorer
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
13
+ ## Usage example
26
14
 
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
15
+ Start explore with:
16
+ ```bash
17
+ ~$ git-explore <root_path>
18
+ ```
32
19
 
33
- ## Contributing
20
+ All your git repositories from <root_path> will be scanned and the output will be similar to:
21
+ ```
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>"]
25
+ ```
34
26
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gitexplorer.
27
+ ## Release History
36
28
 
29
+ * 0.1.0
30
+ * Work in progress.
37
31
 
38
- ## License
32
+ ## Meta
39
33
 
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
34
+ Alex Rocha - [about.me](http://about.me/alex.rochas)
41
35
 
data/lib/git_explorer.rb CHANGED
@@ -26,14 +26,13 @@ module GitExplorer
26
26
  class Explorer < Thor
27
27
  include Thor::Actions
28
28
 
29
- # TODO receive root path by parameter
30
29
  # TODO refactor and extract maps to lambdas
31
30
  desc "use for explore recursively directories and show actual status of git repositories", "gitx explore ."
32
- def explore(root_dir)
33
- run("find #{root_dir} -type f -name .gitignore", config={:capture=>true})
31
+ def explore(root_dir="./")
32
+ run("find #{root_dir} -type f -name .gitignore", config={:capture=>true, :verbose=>false})
34
33
  .split("\n")
35
34
  .map{|file| file.gsub(/\.gitignore/,'')}
36
- .map{|dir| run("basename `git -C #{dir} rev-parse --show-toplevel`; git -C #{dir} status", config={:capture=>true})}
35
+ .map{|dir| run("basename `git -C #{dir} rev-parse --show-toplevel`; git -C #{dir} status", config={:capture=>true, :verbose=>false})}
37
36
  .map{|status| status >> GitExplorer::extract_status}
38
37
  .map{|status| say "project #{status.project_name} is #{status.status} on branch #{status.branch} -> #{status.files}"}
39
38
  end
@@ -1,3 +1,3 @@
1
1
  module GitExplorer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_explorer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rocha