git_cli 0.1.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/git_cli.gemspec +2 -1
- data/lib/git_cli.rb +3 -4
- data/lib/git_cli/add_commit.rb +6 -1
- data/lib/git_cli/git_core.rb +25 -16
- data/lib/git_cli/global.rb +8 -1
- data/lib/git_cli/version.rb +1 -1
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d1a8df0f367e6bab1d2104b430a26afe853504a567c1ec5b4f8ec75a42007ec
|
4
|
+
data.tar.gz: f5b2c424923b04ecc56db1d5d70edcfcebd2feb71803f6f9c4505f7afa8ff01b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28dc72d776c060413be663d0481c32bc4bdbdc8d51bceb8d93b7578a621bd57ecc838cff0cc95b7ad114a0b55e9441d60aec238c51ffd211f322e8b9b551ca66
|
7
|
+
data.tar.gz: 2e6a4a9613268dfc56946e58ace954caabe77f7413664baaf74ad74859dc779ada0ef1f18bfa1ae6c87796f6771c13ca37c0dba6c225c53636c3f168a73cdcef
|
data/.gitignore
CHANGED
data/git_cli.gemspec
CHANGED
@@ -29,5 +29,6 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency "tlogger", "~> 0.21"
|
31
31
|
spec.add_dependency "toolrack", "~> 0.4.0"
|
32
|
-
spec.add_dependency "
|
32
|
+
spec.add_dependency "gvcs", "~> 0.1.0"
|
33
|
+
spec.add_dependency "ptools", "~> 1.4.0"
|
33
34
|
end
|
data/lib/git_cli.rb
CHANGED
@@ -16,8 +16,8 @@
|
|
16
16
|
|
17
17
|
require "git_cli/version"
|
18
18
|
|
19
|
+
require 'gvcs'
|
19
20
|
require 'toolrack'
|
20
|
-
require 'version_utils'
|
21
21
|
|
22
22
|
require_relative "git_cli/git_core"
|
23
23
|
require_relative "git_cli/init"
|
@@ -82,8 +82,7 @@ module GitCli
|
|
82
82
|
# version check
|
83
83
|
vst, tver = version
|
84
84
|
if vst
|
85
|
-
|
86
|
-
if st == -1 # 1st val > 2nd val == current version is smaller than installed
|
85
|
+
if (tver <=> MIN_GIT_VERSION) == -1
|
87
86
|
log_warn("Min required version of GIT is #{MIN_GIT_VERSION}. System installed GIT is version #{tver}. The output might not be correct.")
|
88
87
|
end
|
89
88
|
|
@@ -91,7 +90,7 @@ module GitCli
|
|
91
90
|
end
|
92
91
|
|
93
92
|
end
|
94
|
-
end
|
93
|
+
end # Gvcs::Vcs
|
95
94
|
|
96
95
|
module WsCommon
|
97
96
|
def check_vcs
|
data/lib/git_cli/add_commit.rb
CHANGED
@@ -93,9 +93,11 @@ module GitCli
|
|
93
93
|
|
94
94
|
end # remove_from_vcs
|
95
95
|
|
96
|
-
def commit(message)
|
96
|
+
def commit(message, opts = { })
|
97
97
|
check_vcs
|
98
98
|
|
99
|
+
files = opts[:files] || []
|
100
|
+
[files] if not files.is_a?(Array)
|
99
101
|
# have to escape the message for command line purposes
|
100
102
|
msg = message.gsub("\"","\\\"").gsub("\\","\\\\")
|
101
103
|
|
@@ -105,6 +107,9 @@ module GitCli
|
|
105
107
|
cmd << "&&"
|
106
108
|
cmd << @vcs.exe_path
|
107
109
|
cmd << "commit"
|
110
|
+
if not_empty?(files)
|
111
|
+
cmd << files.join(" ")
|
112
|
+
end
|
108
113
|
cmd << "-m"
|
109
114
|
cmd << "\"#{msg}\""
|
110
115
|
|
data/lib/git_cli/git_core.rb
CHANGED
@@ -17,6 +17,8 @@
|
|
17
17
|
|
18
18
|
require_relative 'global'
|
19
19
|
|
20
|
+
require 'ptools'
|
21
|
+
|
20
22
|
module GitCli
|
21
23
|
module GitCore
|
22
24
|
|
@@ -58,26 +60,33 @@ module GitCli
|
|
58
60
|
private
|
59
61
|
def is_installed?
|
60
62
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
gpath = File.which('git')
|
64
|
+
if is_empty?(gpath)
|
65
|
+
[false, ""]
|
66
|
+
else
|
67
|
+
[true, gpath]
|
68
|
+
end
|
69
|
+
|
70
|
+
#if Antrapol::ToolRack::RuntimeUtils.on_linux?
|
71
|
+
# require_relative 'os/linux/utils'
|
72
|
+
# GitCli::Global.instance.logger.debug "Running on Linux is detected"
|
73
|
+
# st, path = GitCli::OS::Linux::Utils.is_installed?("git")
|
74
|
+
# GitCli::Global.instance.logger.debug "'git' install check return [#{st},#{path}]"
|
66
75
|
|
67
|
-
|
76
|
+
# [st, path]
|
68
77
|
|
69
|
-
elsif Antrapol::ToolRack::RuntimeUtils.on_mac?
|
70
|
-
|
71
|
-
|
78
|
+
#elsif Antrapol::ToolRack::RuntimeUtils.on_mac?
|
79
|
+
# GitCli::Global.instance.logger.debug "Running on MacOS is detected"
|
80
|
+
# require_relative 'os/macos/utils'
|
72
81
|
|
73
|
-
elsif Antrapol::ToolRack::RuntimeUtils.on_window?
|
74
|
-
|
75
|
-
|
82
|
+
#elsif Antrapol::ToolRack::RuntimeUtils.on_window?
|
83
|
+
# GitCli::Global.instance.logger.debug "Running on MS Window is detected"
|
84
|
+
# require_relative 'os/win/utils'
|
76
85
|
|
77
|
-
else
|
78
|
-
|
79
|
-
|
80
|
-
end
|
86
|
+
#else
|
87
|
+
# GitCli::Global.instance.logger.debug "Cannot determine which OS am i running...Confused"
|
88
|
+
# raise RuntimeError, "Unknown platform"
|
89
|
+
#end
|
81
90
|
|
82
91
|
end # is_installed?
|
83
92
|
|
data/lib/git_cli/global.rb
CHANGED
@@ -24,8 +24,15 @@ module GitCli
|
|
24
24
|
|
25
25
|
attr_reader :logger
|
26
26
|
def initialize
|
27
|
-
|
27
|
+
debug = ENV['GitCli_Debug']
|
28
|
+
debugOut = ENV['GitCli_DebugOut'] || STDOUT
|
29
|
+
if debug.nil?
|
30
|
+
@logger = Tlogger.new('git_cli.log', 5, 1024*1024*10)
|
31
|
+
else
|
32
|
+
@logger = Tlogger.new(debugOut)
|
33
|
+
end
|
28
34
|
end
|
35
|
+
|
29
36
|
end
|
30
37
|
|
31
38
|
class GitCliException < StandardError; end
|
data/lib/git_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Liaw
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tlogger
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: gvcs
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.1.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: ptools
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.4.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.4.0
|
55
69
|
description: Interface to GIT via command line interface instead of some sor of library
|
56
70
|
email:
|
57
71
|
- chrisliaw@antrapol.com
|
@@ -93,7 +107,7 @@ homepage: https://github.com/chrisliaw/git_cli
|
|
93
107
|
licenses:
|
94
108
|
- GPL-3.0
|
95
109
|
metadata: {}
|
96
|
-
post_install_message:
|
110
|
+
post_install_message:
|
97
111
|
rdoc_options: []
|
98
112
|
require_paths:
|
99
113
|
- lib
|
@@ -108,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
122
|
- !ruby/object:Gem::Version
|
109
123
|
version: '0'
|
110
124
|
requirements: []
|
111
|
-
rubygems_version: 3.1.
|
112
|
-
signing_key:
|
125
|
+
rubygems_version: 3.1.4
|
126
|
+
signing_key:
|
113
127
|
specification_version: 4
|
114
128
|
summary: GIT command line interface
|
115
129
|
test_files: []
|