caramelize 0.1.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +21 -53
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/Gemfile +3 -3
- data/LICENSE.md +1 -1
- data/README.md +48 -46
- data/Rakefile +8 -7
- data/bin/caramelize +73 -10
- data/caramelize.gemspec +28 -24
- data/lib/caramelize.rb +14 -0
- data/lib/caramelize/caramel.rb +48 -44
- data/lib/caramelize/content_transferer.rb +126 -69
- data/lib/caramelize/database_connector.rb +3 -6
- data/lib/caramelize/filter_processor.rb +27 -0
- data/lib/caramelize/filters/remove_table_tab_line_endings.rb +15 -0
- data/lib/caramelize/filters/swap_wiki_links.rb +26 -0
- data/lib/caramelize/filters/wikka_to_markdown.rb +67 -0
- data/lib/caramelize/health_check.rb +85 -0
- data/lib/caramelize/input_wiki/redmine_wiki.rb +120 -0
- data/lib/caramelize/input_wiki/wiki.rb +59 -0
- data/lib/caramelize/input_wiki/wikkawiki.rb +69 -0
- data/lib/caramelize/output_wiki/gollum.rb +80 -0
- data/lib/caramelize/page.rb +38 -14
- data/lib/caramelize/services/page_builder.rb +20 -0
- data/lib/caramelize/version.rb +1 -1
- data/spec/fixtures/markup/swap-links-input.textile +57 -0
- data/spec/fixtures/markup/swap-links-output.textile +57 -0
- data/spec/fixtures/markup/table-tab-line-endings-input.textile +145 -0
- data/spec/fixtures/markup/table-tab-line-endings-output.textile +145 -0
- data/spec/lib/caramelize/content_transferer_spec.rb +9 -0
- data/spec/lib/caramelize/filter_processor_spec.rb +34 -0
- data/spec/lib/caramelize/filters/remove_table_tab_line_endings_spec.rb +49 -0
- data/spec/lib/caramelize/filters/swap_wiki_links_spec.rb +49 -0
- data/spec/lib/caramelize/filters/wikka_to_markdown_spec.rb +198 -0
- data/spec/lib/caramelize/input_wiki/wiki_spec.rb +57 -0
- data/spec/lib/caramelize/output_wiki/gollum_spec.rb +113 -0
- data/spec/lib/caramelize/page_spec.rb +67 -0
- data/spec/lib/caramelize/services/page_builder.rb +29 -0
- data/spec/spec_helper.rb +8 -0
- metadata +165 -54
- data/lib/caramelize/author.rb +0 -8
- data/lib/caramelize/cli.rb +0 -80
- data/lib/caramelize/cli/create_command.rb +0 -52
- data/lib/caramelize/cli/run_command.rb +0 -33
- data/lib/caramelize/ext.rb +0 -17
- data/lib/caramelize/gollum_output.rb +0 -56
- data/lib/caramelize/wiki/redmine_wiki.rb +0 -60
- data/lib/caramelize/wiki/trac_converter.rb +0 -82
- data/lib/caramelize/wiki/wiki.rb +0 -41
- data/lib/caramelize/wiki/wikka_converter.rb +0 -38
- data/lib/caramelize/wiki/wikkawiki.rb +0 -55
- data/test/helper.rb +0 -18
- data/test/test_caramelize.rb +0 -7
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Caramelize::Page do
|
4
|
+
|
5
|
+
let(:message) { 'Dinosaurs really had feathers, do not forget!' }
|
6
|
+
let(:author) { OpenStruct.new(name: 'Jeff Goldblum', email: 'jeff.g@example.com') }
|
7
|
+
let(:title){ 'Feathered Dinosaurs' }
|
8
|
+
subject(:page) do
|
9
|
+
Caramelize::Page.new(title: title,
|
10
|
+
message: message,
|
11
|
+
time: Time.parse('2015-02-12'),
|
12
|
+
body: 'Dinosaurs are awesome and have feathers!',
|
13
|
+
author: author )
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
describe '#author' do
|
18
|
+
context 'no author is set' do
|
19
|
+
let(:author) { nil }
|
20
|
+
|
21
|
+
it 'fills with Caramelize user' do
|
22
|
+
expect(page.author.name).to eql('Caramelize')
|
23
|
+
expect(page.author.email).to eql('mail@example.com')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'author is set' do
|
28
|
+
it 'fills with Caramelize user' do
|
29
|
+
expect(page.author.name).to eql(author.name)
|
30
|
+
expect(page.author.email).to eql(author.email)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe '#path' do
|
36
|
+
context "title is 'Home'" do
|
37
|
+
let(:title) { 'Home' }
|
38
|
+
it { expect(page.path).to eq 'Home'}
|
39
|
+
end
|
40
|
+
|
41
|
+
context "title is 'Feathered Dinosaurs'" do
|
42
|
+
it { expect(page.path).to eq 'Feathered Dinosaurs'}
|
43
|
+
end
|
44
|
+
|
45
|
+
context "title is 'Space/Feathered Dinosaurs'" do
|
46
|
+
let(:title) { 'Space/Feathered Dinosaurs' }
|
47
|
+
it { expect(page.path).to eq 'Space/feathered dinosaurs'}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
describe '#commit_message' do
|
53
|
+
context 'page has message' do
|
54
|
+
it 'uses page.title' do
|
55
|
+
expect(page.commit_message).to eq 'Dinosaurs really had feathers, do not forget!'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'page has no message' do
|
60
|
+
let(:message) { '' }
|
61
|
+
|
62
|
+
it 'creates message "Edit in page Feathered Dinosaurs"' do
|
63
|
+
expect(page.commit_message).to eq 'Edit in page Feathered Dinosaurs'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Caramelize::Service::Pagebuilder do
|
4
|
+
describe '.build_namespace_overview' do
|
5
|
+
let(:body) do
|
6
|
+
"## Overview of namespaces\n\n* [[Velociraptor|velociraptors/Wiki]] \n* [[Allosaurus|allosaurus/Wiki]] \n"
|
7
|
+
end
|
8
|
+
let(:expected_page) do
|
9
|
+
Caramelize::Page.new(title: 'Home',
|
10
|
+
body: body,
|
11
|
+
message: 'Create Namespace Overview',
|
12
|
+
latest: true)
|
13
|
+
end
|
14
|
+
let(:namespaces) do
|
15
|
+
[
|
16
|
+
OpenStruct.new(identifier: 'velociraptors', name: 'Velociraptor'),
|
17
|
+
OpenStruct.new(identifier: 'allosaurus', name: 'Allosaurus')
|
18
|
+
]
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'returns page with expected attributes' do
|
22
|
+
page = described_class.build_namespace_overview
|
23
|
+
expected(page.title).to eql(expected_page.title)
|
24
|
+
expected(page.body).to eql(expected_page.body)
|
25
|
+
expected(page.latest).to eql(expected_page.latest)
|
26
|
+
expected(page.message).to eql(expected_page.message)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,82 +1,170 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caramelize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Daniel Senff
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2020-12-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
14
|
+
name: commander
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
28
|
+
name: gollum-lib
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
42
|
+
name: mysql2
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
56
|
+
name: ruby-progressbar
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
61
|
+
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.6'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.6'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: byebug
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
76
123
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
78
|
-
|
79
|
-
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: guard
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: guard-rspec
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: With Caramelize you can migrate any wiki to git-based Gollum wiki repositories.
|
80
168
|
email:
|
81
169
|
- mail@danielsenff.de
|
82
170
|
executables:
|
@@ -84,7 +172,9 @@ executables:
|
|
84
172
|
extensions: []
|
85
173
|
extra_rdoc_files: []
|
86
174
|
files:
|
87
|
-
- .gitignore
|
175
|
+
- ".gitignore"
|
176
|
+
- ".travis.yml"
|
177
|
+
- CODE_OF_CONDUCT.md
|
88
178
|
- Gemfile
|
89
179
|
- Gemfile.lock
|
90
180
|
- LICENSE.md
|
@@ -92,50 +182,71 @@ files:
|
|
92
182
|
- Rakefile
|
93
183
|
- bin/caramelize
|
94
184
|
- caramelize.gemspec
|
95
|
-
- lib/caramelize
|
185
|
+
- lib/caramelize.rb
|
96
186
|
- lib/caramelize/caramel.rb
|
97
|
-
- lib/caramelize/cli.rb
|
98
|
-
- lib/caramelize/cli/create_command.rb
|
99
|
-
- lib/caramelize/cli/run_command.rb
|
100
187
|
- lib/caramelize/content_transferer.rb
|
101
188
|
- lib/caramelize/database_connector.rb
|
102
|
-
- lib/caramelize/
|
103
|
-
- lib/caramelize/
|
189
|
+
- lib/caramelize/filter_processor.rb
|
190
|
+
- lib/caramelize/filters/remove_table_tab_line_endings.rb
|
191
|
+
- lib/caramelize/filters/swap_wiki_links.rb
|
192
|
+
- lib/caramelize/filters/wikka_to_markdown.rb
|
193
|
+
- lib/caramelize/health_check.rb
|
194
|
+
- lib/caramelize/input_wiki/redmine_wiki.rb
|
195
|
+
- lib/caramelize/input_wiki/wiki.rb
|
196
|
+
- lib/caramelize/input_wiki/wikkawiki.rb
|
197
|
+
- lib/caramelize/output_wiki/gollum.rb
|
104
198
|
- lib/caramelize/page.rb
|
199
|
+
- lib/caramelize/services/page_builder.rb
|
105
200
|
- lib/caramelize/version.rb
|
106
|
-
-
|
107
|
-
-
|
108
|
-
-
|
109
|
-
-
|
110
|
-
- lib/caramelize/
|
111
|
-
-
|
112
|
-
-
|
201
|
+
- spec/fixtures/markup/swap-links-input.textile
|
202
|
+
- spec/fixtures/markup/swap-links-output.textile
|
203
|
+
- spec/fixtures/markup/table-tab-line-endings-input.textile
|
204
|
+
- spec/fixtures/markup/table-tab-line-endings-output.textile
|
205
|
+
- spec/lib/caramelize/content_transferer_spec.rb
|
206
|
+
- spec/lib/caramelize/filter_processor_spec.rb
|
207
|
+
- spec/lib/caramelize/filters/remove_table_tab_line_endings_spec.rb
|
208
|
+
- spec/lib/caramelize/filters/swap_wiki_links_spec.rb
|
209
|
+
- spec/lib/caramelize/filters/wikka_to_markdown_spec.rb
|
210
|
+
- spec/lib/caramelize/input_wiki/wiki_spec.rb
|
211
|
+
- spec/lib/caramelize/output_wiki/gollum_spec.rb
|
212
|
+
- spec/lib/caramelize/page_spec.rb
|
213
|
+
- spec/lib/caramelize/services/page_builder.rb
|
214
|
+
- spec/spec_helper.rb
|
113
215
|
homepage: http://github.com/Dahie/caramelize
|
114
216
|
licenses:
|
115
217
|
- MIT
|
116
|
-
|
218
|
+
metadata: {}
|
219
|
+
post_install_message:
|
117
220
|
rdoc_options: []
|
118
221
|
require_paths:
|
119
222
|
- lib
|
120
223
|
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
224
|
requirements:
|
123
|
-
- -
|
225
|
+
- - ">="
|
124
226
|
- !ruby/object:Gem::Version
|
125
227
|
version: '0'
|
126
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
229
|
requirements:
|
129
|
-
- -
|
230
|
+
- - ">="
|
130
231
|
- !ruby/object:Gem::Version
|
131
232
|
version: '0'
|
132
233
|
requirements: []
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
specification_version: 3
|
234
|
+
rubygems_version: 3.0.8
|
235
|
+
signing_key:
|
236
|
+
specification_version: 4
|
137
237
|
summary: Flexible and modular wiki conversion tool
|
138
238
|
test_files:
|
139
|
-
-
|
140
|
-
-
|
141
|
-
|
239
|
+
- spec/fixtures/markup/swap-links-input.textile
|
240
|
+
- spec/fixtures/markup/swap-links-output.textile
|
241
|
+
- spec/fixtures/markup/table-tab-line-endings-input.textile
|
242
|
+
- spec/fixtures/markup/table-tab-line-endings-output.textile
|
243
|
+
- spec/lib/caramelize/content_transferer_spec.rb
|
244
|
+
- spec/lib/caramelize/filter_processor_spec.rb
|
245
|
+
- spec/lib/caramelize/filters/remove_table_tab_line_endings_spec.rb
|
246
|
+
- spec/lib/caramelize/filters/swap_wiki_links_spec.rb
|
247
|
+
- spec/lib/caramelize/filters/wikka_to_markdown_spec.rb
|
248
|
+
- spec/lib/caramelize/input_wiki/wiki_spec.rb
|
249
|
+
- spec/lib/caramelize/output_wiki/gollum_spec.rb
|
250
|
+
- spec/lib/caramelize/page_spec.rb
|
251
|
+
- spec/lib/caramelize/services/page_builder.rb
|
252
|
+
- spec/spec_helper.rb
|
data/lib/caramelize/author.rb
DELETED
data/lib/caramelize/cli.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
#Encoding: UTF-8
|
2
|
-
require 'cmdparse'
|
3
|
-
require 'caramelize/version'
|
4
|
-
|
5
|
-
module Caramelize
|
6
|
-
autoload :ContentTransferer, 'caramelize/content_transferer'
|
7
|
-
module CLI
|
8
|
-
|
9
|
-
# Namespace for all classes that act as CLI commands.
|
10
|
-
autoload :RunCommand, 'caramelize/cli/run_command'
|
11
|
-
autoload :CreateCommand, 'caramelize/cli/create_command'
|
12
|
-
|
13
|
-
|
14
|
-
# This is the command parser class used for handling the webgen command line interface. After
|
15
|
-
# creating an instance, the inherited #parse method can be used for parsing the command line
|
16
|
-
# arguments and executing the requested command.
|
17
|
-
class CommandParser < CmdParse::CommandParser
|
18
|
-
|
19
|
-
# The verbosity level. Default: <tt>:normal</tt>
|
20
|
-
attr_reader :verbosity
|
21
|
-
|
22
|
-
# Create a new CommandParser class. T
|
23
|
-
def initialize
|
24
|
-
super(true)
|
25
|
-
@verbosity = :normal
|
26
|
-
|
27
|
-
self.program_name = "caramelize"
|
28
|
-
self.program_version = Caramelize::VERSION
|
29
|
-
self.options = CmdParse::OptionParserWrapper.new do |opts|
|
30
|
-
opts.separator "Global options:"
|
31
|
-
opts.on("--verbose", "-v", "Print more output") { @verbosity = :verbose }
|
32
|
-
opts.on("--quiet", "-q", "No output") { @verbosity = :quiet }
|
33
|
-
end
|
34
|
-
self.add_command(CmdParse::HelpCommand.new)
|
35
|
-
self.add_command(CmdParse::VersionCommand.new)
|
36
|
-
end
|
37
|
-
|
38
|
-
KNOWN_CONFIG_LOCATIONS = ['config/caramel.rb', "config/caramel.config", "caramel.rb", "src/caramel.rb"]
|
39
|
-
|
40
|
-
# Finds the configuration file, if it exists in a known location.
|
41
|
-
def detect_configuration_file(config_path = nil)
|
42
|
-
possible_files = KNOWN_CONFIG_LOCATIONS
|
43
|
-
possible_files << config_path if config_path
|
44
|
-
possible_files.detect{|f| File.exists?(f)}
|
45
|
-
end
|
46
|
-
|
47
|
-
# Utility method for sub-commands to transfer wiki contents
|
48
|
-
def transfer_content config_file = ""
|
49
|
-
time_start = Time.now
|
50
|
-
|
51
|
-
file = detect_configuration_file config_file
|
52
|
-
puts "Read config file: #{file}" if @verbosity == :verbose
|
53
|
-
if file && File.exists?(file)
|
54
|
-
instance_eval(File.read(file), file || '<eval>')
|
55
|
-
original_wiki = input_wiki
|
56
|
-
|
57
|
-
ContentTransferer.execute(original_wiki, {:verbosity => @verbosity})
|
58
|
-
|
59
|
-
time_end = Time.now
|
60
|
-
|
61
|
-
puts "Time required: #{time_end - time_start} s" if @verbosity == :verbose
|
62
|
-
else
|
63
|
-
puts "No config file found."
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
# :nodoc:
|
69
|
-
def parse(argv = ARGV)
|
70
|
-
Caramelize::CLI.constants.select {|c| c =~ /.+Command$/ }.each do |c|
|
71
|
-
self.add_command(Caramelize::CLI.const_get(c).new, (c.to_s == 'RunCommand' ? false : false)) # set runcommand as default
|
72
|
-
end
|
73
|
-
super
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|