tractive 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tractive/migrator/wikis/migrate_from_db.rb +19 -1
- data/lib/tractive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ebb8048967ee1732b68d54ed6c10798e0959d533e7ed9744a843f1a129f764d
|
4
|
+
data.tar.gz: 4799587764dcaa848e76971b50df220e72ffa914a5f1bc7c3cad20ef2e5de83d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c052a1f936f6e4d4749e4fd9f8ec9fcab3042f4220e2c4f10e6a7ed127f2c1ee8a856f49a58ae8b960a38f12ffdc35d9097a55361142b39bfa605a269ea2d1b
|
7
|
+
data.tar.gz: 6d0025c7682c74526aa3a0fb8a4d93d4f46fad4cab5e560898e3b2c504e8981cffe10203e59afb7c8d818d3598efe3729b854c2939d7b8ca64105846de55f131
|
@@ -17,9 +17,10 @@ module Migrator
|
|
17
17
|
@wiki_attachments_url = @options["attachment-base-url"] || @config.dig("wiki", "attachments", "url") || ""
|
18
18
|
@repo_path = @options["repo-path"] || ""
|
19
19
|
@revmap_path = @config["revmap_path"]
|
20
|
+
@attachments_hashed = @config.dig("wiki", "attachments", "hashed")
|
20
21
|
|
21
22
|
@attachment_options = {
|
22
|
-
hashed: @
|
23
|
+
hashed: @attachments_hashed
|
23
24
|
}
|
24
25
|
|
25
26
|
verify_options
|
@@ -47,6 +48,7 @@ module Migrator
|
|
47
48
|
$logger.debug("Object: #{wiki}")
|
48
49
|
|
49
50
|
wiki_markdown_text = @twf_to_markdown.convert(wiki[:text])
|
51
|
+
wiki_markdown_text += wiki_attachments(wiki)
|
50
52
|
|
51
53
|
# Create file with content
|
52
54
|
File.open(file_name, "w") do |f|
|
@@ -118,6 +120,22 @@ module Migrator
|
|
118
120
|
"#{author_name} <#{author_email}>"
|
119
121
|
end
|
120
122
|
|
123
|
+
def wiki_attachments(wiki)
|
124
|
+
attachments = wiki.attachments
|
125
|
+
return "" if attachments.count.zero?
|
126
|
+
|
127
|
+
attachments_list = ["# Attachments\n"]
|
128
|
+
|
129
|
+
attachments.each do |attachment|
|
130
|
+
attachment_path = Tractive::Utilities.attachment_path(
|
131
|
+
wiki.name, attachment.filename, hashed: @attachments_hashed
|
132
|
+
)
|
133
|
+
attachments_list << "- [#{attachment.filename}](#{@wiki_attachments_url}/#{attachment_path})"
|
134
|
+
end
|
135
|
+
|
136
|
+
attachments_list.join("\n")
|
137
|
+
end
|
138
|
+
|
121
139
|
def execute_command(command)
|
122
140
|
`#{command}`
|
123
141
|
$CHILD_STATUS
|
data/lib/tractive/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tractive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|