capistrano_api_docs_external_git 1.0.2 → 1.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceb788060cd24e4aa1bf9d0b6c6fb663ff769a95
|
4
|
+
data.tar.gz: 60254ff94d892d93bea48e29d6ee122224059c8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e218eac2eb93b8dcc544a4c1bf9ed73aaba3633d5a4b51fdbfe6d39f22a8adf6530afcfbbb74e167d6c262693327636122dafa96fe34cdbabb570621b6294d6b
|
7
|
+
data.tar.gz: 6a05c8b167013041f267f83ff0434508886e6c1abcb48edd8f62f51a6e5cd33b791c31111feaa71156bca0701adf8290633a13bb14c092f92885b469434831b3
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "capistrano_api_docs_external_git"
|
7
|
-
spec.version = "1.0.
|
7
|
+
spec.version = "1.0.3"
|
8
8
|
spec.authors = ["DevOps Team"]
|
9
9
|
spec.email = ["devops@ndrive.com"]
|
10
10
|
spec.summary = %q{Add tasks to capistrano to a Rails project to work with gem api_docs.}
|
@@ -1,4 +1,7 @@
|
|
1
1
|
namespace :api_docs_external_git do
|
2
|
+
def print_message message
|
3
|
+
SSHKit.config.output << SSHKit::LogMessage.new(Logger::INFO, "[#{Color.green("unknown")}] #{message}")
|
4
|
+
end
|
2
5
|
|
3
6
|
set :doc_git_repository, nil
|
4
7
|
set :doc_repository_name, "api-docs"
|
@@ -8,7 +11,7 @@ namespace :api_docs_external_git do
|
|
8
11
|
set :api_docs_path, fetch(:rails_root).join("doc", "api")
|
9
12
|
|
10
13
|
task :setup do
|
11
|
-
|
14
|
+
print_message "Updating API documentation"
|
12
15
|
invoke :'api_docs_external_git:clone_repo'
|
13
16
|
invoke :'api_docs_external_git:copy_files'
|
14
17
|
invoke :'api_docs_external_git:add_files_git'
|
@@ -17,7 +20,7 @@ namespace :api_docs_external_git do
|
|
17
20
|
|
18
21
|
desc 'Clone documentation repository to tmp folder'
|
19
22
|
task :clone_repo do
|
20
|
-
|
23
|
+
print_message "Cloning #{fetch(:doc_git_repository)} for temporary folder"
|
21
24
|
@git_repo = Git.clone(fetch(:doc_git_repository), fetch(:doc_repository_name), path: fetch(:rails_root_tmp_path))
|
22
25
|
end
|
23
26
|
|
@@ -28,20 +31,20 @@ namespace :api_docs_external_git do
|
|
28
31
|
|
29
32
|
FileUtils.rm_r destination_folder, force: true
|
30
33
|
|
31
|
-
|
34
|
+
print_message "Copying documentation files"
|
32
35
|
FileUtils.mkdir_p destination_folder
|
33
36
|
FileUtils.cp_r files, destination_folder
|
34
37
|
end
|
35
38
|
|
36
39
|
desc 'Remove documentation repository'
|
37
40
|
task :remove_files do
|
38
|
-
|
41
|
+
print_message "Removing documentation repository"
|
39
42
|
FileUtils.rm_r fetch(:rails_root_tmp_path).join(fetch(:doc_repository_name))
|
40
43
|
end
|
41
44
|
|
42
45
|
desc 'Add files to documentation git'
|
43
46
|
task :add_files_git do
|
44
|
-
|
47
|
+
print_message "Saving documentation files on git repository"
|
45
48
|
|
46
49
|
@git_repo.add(all: true)
|
47
50
|
begin
|