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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f63a2272d919b6734ab471ffc5a8ea087c7ddbf7e0f67087837e20338b3475f9
4
- data.tar.gz: b4136958dd42cd0d47e3ea98eaf73a4cbc0e65841a1015c84da3c82c75618112
3
+ metadata.gz: 8d1a8df0f367e6bab1d2104b430a26afe853504a567c1ec5b4f8ec75a42007ec
4
+ data.tar.gz: f5b2c424923b04ecc56db1d5d70edcfcebd2feb71803f6f9c4505f7afa8ff01b
5
5
  SHA512:
6
- metadata.gz: 475d4c2702b87ef98f317302632489bb08873d0dfb9416e8cc503ab8cee67c8eccc08e5510e6b1a85513d4a47fd6b13368874a8ad24432535022ba1efd14d8ca
7
- data.tar.gz: 121e66ffdf28f06ed960e2452852bb539e611121c1278750f59a77f4f72f7b7f5a9e63536c1761c49857c7bc01846f6f0e3f8fe116d4f20c8a662ef25105e7bb
6
+ metadata.gz: 28dc72d776c060413be663d0481c32bc4bdbdc8d51bceb8d93b7578a621bd57ecc838cff0cc95b7ad114a0b55e9441d60aec238c51ffd211f322e8b9b551ca66
7
+ data.tar.gz: 2e6a4a9613268dfc56946e58ace954caabe77f7413664baaf74ad74859dc779ada0ef1f18bfa1ae6c87796f6771c13ca37c0dba6c225c53636c3f168a73cdcef
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /tmp/
9
9
  Gemfile.lock
10
10
  tags
11
+ git_cli-0.1.0.gem
12
+ toolrack.log
@@ -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 "version_utils", "~> 0.1.0"
32
+ spec.add_dependency "gvcs", "~> 0.1.0"
33
+ spec.add_dependency "ptools", "~> 1.4.0"
33
34
  end
@@ -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
- st = VersionUtils.new.compare(MIN_GIT_VERSION, tver)
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
@@ -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
 
@@ -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
- if Antrapol::ToolRack::RuntimeUtils.on_linux?
62
- require_relative 'os/linux/utils'
63
- GitCli::Global.instance.logger.debug "Running on Linux is detected"
64
- st, path = GitCli::OS::Linux::Utils.is_installed?("git")
65
- GitCli::Global.instance.logger.debug "'git' install check return [#{st},#{path}]"
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
- [st, path]
76
+ # [st, path]
68
77
 
69
- elsif Antrapol::ToolRack::RuntimeUtils.on_mac?
70
- GitCli::Global.instance.logger.debug "Running on MacOS is detected"
71
- require_relative 'os/macos/utils'
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
- GitCli::Global.instance.logger.debug "Running on MS Window is detected"
75
- require_relative 'os/win/utils'
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
- GitCli::Global.instance.logger.debug "Cannot determine which OS am i running...Confused"
79
- raise RuntimeError, "Unknown platform"
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
 
@@ -24,8 +24,15 @@ module GitCli
24
24
 
25
25
  attr_reader :logger
26
26
  def initialize
27
- @logger = Tlogger.new
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
@@ -15,5 +15,5 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
  module GitCli
18
- VERSION = "0.1.0"
18
+ VERSION = "0.6.0"
19
19
  end
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.1.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-10-31 00:00:00.000000000 Z
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: version_utils
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.2
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: []