docman 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/application.rb +5 -2
- data/lib/docman/builders/git_direct_builder.rb +3 -1
- data/lib/docman/cli.rb +2 -1
- data/lib/docman/git_util.rb +9 -4
- data/lib/docman/info.rb +1 -0
- data/lib/docman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d91c91e2da9dc5481483fc7e9bdbd5483f2690b
|
4
|
+
data.tar.gz: 387e3605485f728f50a760f9800e8c579904a9e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7028de3b0029ac4e81bd537171ad23474573a62fda966c099a747cc4e23c2953ffd2fa6a2198c718a730727e4f87bd0bf50253b95fcfdb0343501c5f818eae43
|
7
|
+
data.tar.gz: 7da3e17324ae345528ae23b4d01d77b86e0a7e9086fd68378eb6413eba60cb07340c93f402e42018e9fdcd6942898fb42a72714f080d20316cfeb09b1cd0a69c
|
data/lib/application.rb
CHANGED
@@ -45,8 +45,11 @@ module Docman
|
|
45
45
|
@force = false
|
46
46
|
end
|
47
47
|
|
48
|
-
def init(name, repo)
|
49
|
-
|
48
|
+
def init(name, repo, options)
|
49
|
+
branch = options['branch'] ? options['branch'] : 'master'
|
50
|
+
`mkdir #{name} && cd #{name} && git clone -b #{branch} --single-branch --depth 1 #{repo} config`
|
51
|
+
#Dir.chdir File.join(name, 'config')
|
52
|
+
#`git checkout #{branch} & git branch -u origin #{branch}`
|
50
53
|
end
|
51
54
|
|
52
55
|
def with_rescue
|
@@ -5,10 +5,12 @@ module Docman
|
|
5
5
|
register_builder :git_direct_builder
|
6
6
|
|
7
7
|
def execute
|
8
|
+
old_revision = GitUtil.last_revision @context['full_build_path']
|
8
9
|
execute_result = GitUtil.get(@context['repo'], @context['full_build_path'], @context.version_type, @context.version)
|
9
10
|
# No commit hash for 'root' as it will be changed later
|
11
|
+
last_revision = GitUtil.last_revision @context['full_build_path']
|
10
12
|
@version = @context['type'] == 'root' ? @context['build_path'] : execute_result
|
11
|
-
|
13
|
+
old_revision != last_revision ? @version : false
|
12
14
|
end
|
13
15
|
|
14
16
|
def changed?
|
data/lib/docman/cli.rb
CHANGED
@@ -10,6 +10,7 @@ module Docman
|
|
10
10
|
desc 'init "dirname" "repo"', 'Initialize docroot in "dirname" from config repo "repo"'
|
11
11
|
method_option :force, :aliases => '-f', :desc => 'Force init'
|
12
12
|
method_option :skip, :aliases => '-s', :desc => 'Skip if docroot initialized already'
|
13
|
+
option :branch
|
13
14
|
def init(name, repo)
|
14
15
|
if File.directory? name
|
15
16
|
say("Directory #{name} already exists")
|
@@ -32,7 +33,7 @@ module Docman
|
|
32
33
|
end
|
33
34
|
|
34
35
|
puts "Init docroot directory #{name} and retrieve config from provided repo."
|
35
|
-
Application.instance.init(name, repo)
|
36
|
+
Application.instance.init(name, repo, options)
|
36
37
|
say('Complete!', :green)
|
37
38
|
end
|
38
39
|
|
data/lib/docman/git_util.rb
CHANGED
@@ -47,14 +47,19 @@ module Docman
|
|
47
47
|
Dir.chdir path
|
48
48
|
exec "git checkout #{version}"
|
49
49
|
end
|
50
|
-
result = type == 'branch' ? self.last_revision : version
|
50
|
+
result = type == 'branch' ? self.last_revision(path) : version
|
51
51
|
result
|
52
52
|
end
|
53
53
|
|
54
54
|
|
55
|
-
def self.last_revision
|
56
|
-
result =
|
57
|
-
|
55
|
+
def self.last_revision(path = nil)
|
56
|
+
result = nil
|
57
|
+
if self.repo? path
|
58
|
+
Dir.chdir path unless path.nil?
|
59
|
+
result = `git rev-parse --short HEAD`
|
60
|
+
result.delete!("\n")
|
61
|
+
end
|
62
|
+
result
|
58
63
|
end
|
59
64
|
|
60
65
|
def self.update(path)
|
data/lib/docman/info.rb
CHANGED
data/lib/docman/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.18
|
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-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|