gitti 0.2.0 → 0.2.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 +4 -4
- data/lib/gitti.rb +8 -4
- data/lib/gitti/lib.rb +42 -7
- data/lib/gitti/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36700d8747db810c4be1b9288ca6009191ac70e6
|
4
|
+
data.tar.gz: e79373dd7aa170865098a4329412e630e9253502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 650e82c5ae7676d1b75d7db6a87f8f2350b5602e649f5b80f181845ccacebafddc34d74c031d28d9e768f9a535bd5d0bc90bf9a485a9300313592752b0ed49c3
|
7
|
+
data.tar.gz: 7b9d0575c06da1267d00c247015c8a8f37c366c317ee0fe545f19dacd89b253741bf2485ad02f47c9f2ab350809bed8be3c25b9ee8ce2bff3153ac294c771616
|
data/lib/gitti.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require 'pp'
|
4
|
+
require 'json'
|
5
|
+
require 'yaml'
|
6
|
+
require 'date' ## e.g. Date.today etc.
|
7
|
+
|
3
8
|
require 'net/http'
|
4
9
|
require "net/https"
|
5
10
|
require 'uri'
|
6
11
|
|
7
|
-
require '
|
8
|
-
require 'json'
|
9
|
-
require 'yaml'
|
12
|
+
require 'fileutils' ## e.g. FileUtils.mkdir_p etc.
|
10
13
|
|
11
14
|
|
12
15
|
# 3rd party gems/libs
|
@@ -16,9 +19,10 @@ require 'logutils'
|
|
16
19
|
require 'gitti/version' # note: let version always go first
|
17
20
|
require 'gitti/lib'
|
18
21
|
|
22
|
+
|
19
23
|
## todo/check: move to its own gem e.g. gitti-support later - why? why not??
|
20
24
|
require 'gitti/support/reposet'
|
21
25
|
|
22
26
|
|
23
27
|
# say hello
|
24
|
-
puts Gitti.banner if defined?($RUBYLIBS_DEBUG)
|
28
|
+
puts Gitti.banner if defined?( $RUBYLIBS_DEBUG )
|
data/lib/gitti/lib.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
4
3
|
module Gitti
|
5
4
|
|
6
5
|
class GitError < StandardError
|
@@ -8,23 +7,52 @@ end
|
|
8
7
|
|
9
8
|
class GitLib
|
10
9
|
|
10
|
+
#######################
|
11
|
+
## "open" commands
|
12
|
+
|
11
13
|
def clone( repo, opts={} )
|
12
|
-
command
|
14
|
+
command "clone #{repo}"
|
13
15
|
end
|
14
16
|
|
15
17
|
def mirror( repo, opts={} )
|
16
|
-
command
|
18
|
+
command "clone --mirror #{repo}"
|
19
|
+
end
|
20
|
+
|
21
|
+
#########################
|
22
|
+
## more commands
|
23
|
+
|
24
|
+
def status( opts={} ) ## e.g. git status
|
25
|
+
command "status"
|
26
|
+
end
|
27
|
+
|
28
|
+
def pull( opts={} ) ## e.g. git pull
|
29
|
+
command "pull"
|
30
|
+
end
|
31
|
+
|
32
|
+
def remote_update( opts={} ) ## e.g. git remote update
|
33
|
+
command "remote update"
|
34
|
+
end
|
35
|
+
|
36
|
+
## todo/check: rename remote to shorthand/shortcut or something or to branch - why, why not??
|
37
|
+
def remote_show( name='origin', opts={}) ## e.g. git remote show origin
|
38
|
+
command "remote show #{name}"
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
def add( pathspec='.', opts={} ) ## e.g. git add .
|
43
|
+
command "add #{pathspec}"
|
17
44
|
end
|
18
45
|
|
19
|
-
def
|
20
|
-
command
|
46
|
+
def commit( message, opts={} ) ## e.g. git commit -m "up standings"
|
47
|
+
command "commit -m \"#{message}\""
|
21
48
|
end
|
22
49
|
|
23
|
-
def
|
24
|
-
command
|
50
|
+
def push( opts={} ) ## e.g. git push
|
51
|
+
command "push"
|
25
52
|
end
|
26
53
|
|
27
54
|
|
55
|
+
|
28
56
|
## todo/fix:
|
29
57
|
## add last_exit or something ?? why? why not??
|
30
58
|
|
@@ -72,6 +100,13 @@ module Git
|
|
72
100
|
|
73
101
|
def self.pull( opts={} ) GitLib.new.pull( opts ); end
|
74
102
|
def self.remote_update( opts={} ) GitLib.new.remote_update( opts ); end
|
103
|
+
def self.remote_show( name='origin', opts={}) GitLib.new.remote_show( name, opts ); end
|
104
|
+
|
105
|
+
def self.status( opts={} ) GitLib.new.status( opts ); end
|
106
|
+
def self.pull( opts={} ) GitLib.new.pull( opts ); end
|
107
|
+
def self.add( pathspec='.', opts={} ) GitLib.new.add( pathspec, opts ); end
|
108
|
+
def self.commit( message, opts={} ) GitLib.new.commit( message, opts ); end
|
109
|
+
def self.push( opts={} ) GitLib.new.push( opts ); end
|
75
110
|
end # module Git
|
76
111
|
|
77
112
|
end # module Gitti
|
data/lib/gitti/version.rb
CHANGED