g_ 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +69 -0
- data/bin/g_ +9 -0
- data/g.gemspec +21 -0
- data/lib/g.rb +38 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0228212b1aaa9013ac08ab6c3385097752ef11ca
|
4
|
+
data.tar.gz: 8aea85c2054ad1357f56e5ead90b3daf39dc360b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 11a522fd8a4fc36b920cfb5e3061fc6427d764df39267864f3ad9054a97615e3985844ac381cc7a68d27fedce1122faa846059db44c0cdbae3fc96269494c3b6
|
7
|
+
data.tar.gz: 811e54aa004b7c5f35077ab6cfb38105588f794cf5309f8412cc0a0cc5527e2c79e405585ad2a12038cea8ce42195c3654fc24ea6646cd9e6c880da4221c8f3a
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# g_
|
2
|
+
The basic purpose is to provide some simple automations based upon common git workflows
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
From Rubygems:
|
6
|
+
```
|
7
|
+
$ gem install g_
|
8
|
+
```
|
9
|
+
|
10
|
+
From github:
|
11
|
+
```
|
12
|
+
$ gem "g_", :git => "git://github.com/Gioyik/g_.git"
|
13
|
+
```
|
14
|
+
|
15
|
+
From source:
|
16
|
+
```
|
17
|
+
$ gem build g.gemspec
|
18
|
+
$ gem install ./g_-X.X.X.gem
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Switch branches. If no branch is provided it will default to 'master'. If the provided branch does not exist, it is created.
|
24
|
+
```
|
25
|
+
$ g! switch [branch]
|
26
|
+
```
|
27
|
+
|
28
|
+
Rebase branch with in base of other branch. **DO NOT USE THIS FUNCTION, IS NOT COMPLETE**
|
29
|
+
```
|
30
|
+
$ g! rebase [branch1] [branch2]
|
31
|
+
```
|
32
|
+
|
33
|
+
Push all the commits in your current branch to remote.
|
34
|
+
```
|
35
|
+
$ g! push
|
36
|
+
```
|
37
|
+
|
38
|
+
Revert a commit.
|
39
|
+
```
|
40
|
+
$ g! revert [commit]
|
41
|
+
```
|
42
|
+
|
43
|
+
Update your from with original repo code.
|
44
|
+
```
|
45
|
+
$ g! fork [branch]
|
46
|
+
```
|
47
|
+
|
48
|
+
Log your git repository.
|
49
|
+
```
|
50
|
+
$ g! log
|
51
|
+
```
|
52
|
+
|
53
|
+
Delete a branch locally. If you want to delete it remotely too, do `g! push` after this commit. ** NOTE ** If the branch is not specified it will delete the current branch you are. Be carefull!
|
54
|
+
```
|
55
|
+
$ g! fork [branch]
|
56
|
+
```
|
57
|
+
|
58
|
+
Commit all the changes on your branch with a message.
|
59
|
+
```
|
60
|
+
$ g! commit ['message']
|
61
|
+
```
|
62
|
+
|
63
|
+
Squash in one commit all the commits you want.
|
64
|
+
```
|
65
|
+
$ g! squash [number-of-commits]
|
66
|
+
```
|
67
|
+
|
68
|
+
## License
|
69
|
+
This tool is licensed under MIT terms.
|
data/bin/g_
ADDED
data/g.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'g_'
|
3
|
+
s.version = '1.0'
|
4
|
+
s.summary = "Git workflow tool"
|
5
|
+
s.description = "The purpose of this Ruby gem is provide automated features for git workflows."
|
6
|
+
s.authors = ["Giovanny Andres Gongora Granada"]
|
7
|
+
s.licenses = ['MIT']
|
8
|
+
s.email = "gioyik@gmail.com"
|
9
|
+
s.homepage = "http://github.com/Gioyik/g_/"
|
10
|
+
|
11
|
+
s.files = %w[
|
12
|
+
README.md
|
13
|
+
g.gemspec
|
14
|
+
bin/g_
|
15
|
+
lib/g.rb
|
16
|
+
]
|
17
|
+
|
18
|
+
s.executables = ['g_']
|
19
|
+
s.extra_rdoc_files = %w[README.md]
|
20
|
+
s.require_paths = %w[lib]
|
21
|
+
end
|
data/lib/g.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
class GGIT
|
4
|
+
|
5
|
+
# init
|
6
|
+
def initialize(args, stdin)
|
7
|
+
parse_commands(args)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def parse_commands(args)
|
13
|
+
@commands = {}
|
14
|
+
display_usage("#!Error: No commands") if args.size == 0
|
15
|
+
args.each do |arg|
|
16
|
+
case arg
|
17
|
+
when "is-git"
|
18
|
+
`source ./thisfile.sh`
|
19
|
+
break
|
20
|
+
else
|
21
|
+
display_usage("#!Error: Uknown command")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# this piece of code is the most important
|
27
|
+
def set_current_branch
|
28
|
+
@current ||= `git branch | grep "*" | awk '{print $2}'`.strip
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
def display_usage(msg=nil)
|
33
|
+
puts "#{msg}\n\n" unless msg.nil?
|
34
|
+
puts "Usage:\n\n"
|
35
|
+
puts "g_ is-git? :Check if is a git repo.\n"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: g_
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Giovanny Andres Gongora Granada
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: The purpose of this Ruby gem is provide automated features for git workflows.
|
14
|
+
email: gioyik@gmail.com
|
15
|
+
executables:
|
16
|
+
- g_
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files:
|
19
|
+
- README.md
|
20
|
+
files:
|
21
|
+
- README.md
|
22
|
+
- bin/g_
|
23
|
+
- g.gemspec
|
24
|
+
- lib/g.rb
|
25
|
+
homepage: http://github.com/Gioyik/g_/
|
26
|
+
licenses:
|
27
|
+
- MIT
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 2.4.2
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: Git workflow tool
|
49
|
+
test_files: []
|