docman 0.0.20 → 0.0.21

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: 2ab28b4d09d14091fa0a8e14cdaebd4c90213448
4
- data.tar.gz: 52d56c9c9c70599041e70288f5b0a96fe37090b2
3
+ metadata.gz: d4c50dbfd87dade81189504fa7e32d506b7122ee
4
+ data.tar.gz: 46856e9a4d984dbf04378e0499f229bfa9b3b04f
5
5
  SHA512:
6
- metadata.gz: c5bc615576cbb21fc0d0d53f26088001fa2dafad22242dafda1e1da3c4c70047ad20c745f5e2139bd08ce2c4ed04f519565ae9b7910a58d2dfd2d45e32a71ed4
7
- data.tar.gz: 89a71cd7263864e6cebde5b2b687f33ea57b986533e68dcbec20f7ae7982e864676930188fb5a1c7132620d6aae766f5478c27c6b677dc2c557df043390aad67
6
+ metadata.gz: e508ebe5e3a8730ccccfee87d6e85d264780b260a9b55f1995b2f3dbb85faf18826a3e61b1c7fdbf4cf21bf2714f97410f89ac7ad676537ab41c33c2306527b3
7
+ data.tar.gz: 9254c6dca2694a1f9ba5ff45d40ebbfccf836c7c6b303d9e6ff568eeef9a86f10a4606dbb04acb9770cf6e5e77c261f0d76c6131d084c800b9ec6bfec5c853ee
@@ -6,9 +6,14 @@ module Docman
6
6
 
7
7
  @logger = Logger.new(STDOUT)
8
8
 
9
+ def self.git
10
+ result = ENV['GIT_CMD'] ? ENV['git_cmd'] : 'git'
11
+ result
12
+ end
13
+
9
14
  def self.exec(command)
10
15
  @logger.info command
11
- result = `#{command}`.delete!("\n")
16
+ result = `#{git} #{command}`.delete!("\n")
12
17
  @logger.info result if result
13
18
  raise "ERROR: #{result}" unless $?.exitstatus == 0
14
19
  result
@@ -16,8 +21,8 @@ module Docman
16
21
 
17
22
  def self.reset_repo(path)
18
23
  Dir.chdir path
19
- exec 'git reset --hard'
20
- exec 'git clean -f -d'
24
+ exec 'reset --hard'
25
+ exec 'clean -f -d'
21
26
  end
22
27
 
23
28
  def self.get(repo, path, type, version, single_branch = nil, depth = nil, reset = false)
@@ -26,13 +31,13 @@ module Docman
26
31
  Dir.chdir path
27
32
  self.reset_repo(path) #if self.repo_changed?(path)
28
33
  if type == 'branch'
29
- exec "git fetch"
30
- exec "git checkout #{version}"
31
- exec "git pull origin #{version}"
34
+ exec "fetch"
35
+ exec "checkout #{version}"
36
+ exec "pull origin #{version}"
32
37
  end
33
38
  if type == 'tag'
34
- exec 'git fetch --tags'
35
- exec "git checkout tags/#{version}"
39
+ exec 'fetch --tags'
40
+ exec "checkout tags/#{version}"
36
41
  end
37
42
  else
38
43
  FileUtils.rm_rf path if File.directory? path
@@ -43,9 +48,9 @@ module Docman
43
48
  single_branch=''
44
49
  depth=''
45
50
  end
46
- exec "git clone #{single_branch} #{depth} #{repo} #{path}"
51
+ exec "clone #{single_branch} #{depth} #{repo} #{path}"
47
52
  Dir.chdir path
48
- exec "git checkout #{version}"
53
+ exec "checkout #{version}"
49
54
  end
50
55
  result = type == 'branch' ? self.last_revision(path) : version
51
56
  result
@@ -70,15 +75,15 @@ module Docman
70
75
  if repo_changed? path
71
76
  # puts message
72
77
  pull root_path
73
- exec %Q(git add --all #{path.slice "#{root_path}/"})
74
- exec %Q(git commit -m "#{message}") if repo_changed? path
78
+ exec %Q(add --all #{path.slice "#{root_path}/"})
79
+ exec %Q(commit -m "#{message}") if repo_changed? path
75
80
  self.tag(root_path, tag) if tag
76
81
  end
77
82
  end
78
83
 
79
84
  def self.pull(path)
80
85
  Dir.chdir path
81
- exec 'git pull'
86
+ exec 'pull'
82
87
  end
83
88
 
84
89
  def self.repo?(path)
@@ -97,14 +102,14 @@ module Docman
97
102
 
98
103
  def self.push(root_path, version)
99
104
  Dir.chdir root_path
100
- exec "git pull origin #{version}"
101
- exec "git push origin #{version}"
105
+ exec "pull origin #{version}"
106
+ exec "push origin #{version}"
102
107
  end
103
108
 
104
109
  def self.tag(root_path, tag)
105
110
  Dir.chdir root_path
106
- exec %Q(git tag -a -m "Tagged to #{tag}" "#{tag}")
107
- exec "git push origin #{tag}"
111
+ exec %Q(tag -a -m "Tagged to #{tag}" "#{tag}")
112
+ exec "push origin #{tag}"
108
113
  end
109
114
  end
110
115
 
@@ -1,3 +1,3 @@
1
1
  module Docman
2
- VERSION = "0.0.20"
2
+ VERSION = "0.0.21"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tolstikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler