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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d048cfbc81f42620ae076e33691d303559fb14b097048e2d4dcfb9574ed5bae
4
- data.tar.gz: 3015ae96353d4e65c10569115d3c7b43d08474cfdf9223e82f8c2710e1663efc
3
+ metadata.gz: 8ebb8048967ee1732b68d54ed6c10798e0959d533e7ed9744a843f1a129f764d
4
+ data.tar.gz: 4799587764dcaa848e76971b50df220e72ffa914a5f1bc7c3cad20ef2e5de83d
5
5
  SHA512:
6
- metadata.gz: f8ff314239f2b28ba8b2d87dadb07136c050d80a32a34e214e02d9826b375db886f09fe911cb8f42a63cbdf2a4ba244b8745d65bbf7be9177bc79c3bed20a835
7
- data.tar.gz: 474c1ecad5be50f06599fca50aeee7c33bdfeba778310c77f0830653235de30c34fed85f144a24044555cdce551ab28e645af268afbf1da55674e2e38c48f372
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: @config.dig("ticket", "attachments", "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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tractive
4
- VERSION = "1.0.10"
4
+ VERSION = "1.0.11"
5
5
  end
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.10
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-15 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2