gitti 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23b94ce3c7dbeb1eb816fc266a520ff277a74a06
4
- data.tar.gz: dff2e5ff8d5d961ae46cc4da765d75a1dfb6f92e
3
+ metadata.gz: 36700d8747db810c4be1b9288ca6009191ac70e6
4
+ data.tar.gz: e79373dd7aa170865098a4329412e630e9253502
5
5
  SHA512:
6
- metadata.gz: 740f8d8ca2e1f4e24c97458e3a47e947727613a12649c18d39d7ced494cb73d3c01a5cd64b682ea01563d4eff989d40789cee16441e68cac24b0bd006c6b2f03
7
- data.tar.gz: 1066b7918f78d9ea829e1a53fd9865df7cb3dc9a9a20b5085c2d05a1b1a1ba64b5dbb722f00bb40d104b1cae64aa62370a0171378e409d5818ccaf1fa816a344
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 'pp'
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( "clone #{repo}" )
14
+ command "clone #{repo}"
13
15
  end
14
16
 
15
17
  def mirror( repo, opts={} )
16
- command( "clone --mirror #{repo}" )
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 pull( opts={} )
20
- command( "pull" )
46
+ def commit( message, opts={} ) ## e.g. git commit -m "up standings"
47
+ command "commit -m \"#{message}\""
21
48
  end
22
49
 
23
- def remote_update( opts={} )
24
- command( "remote update" )
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
@@ -3,7 +3,7 @@
3
3
  module Gitti
4
4
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
5
5
  MINOR = 2
6
- PATCH = 0
6
+ PATCH = 1
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitti
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer