Class: Caramelize::ContentTransferer

Inherits:
Object
  • Object
show all
Defined in:
lib/caramelize/content_transferer.rb

Constant Summary collapse

DEFAULT_GOLLUM_HOME_TITLE =
'Home'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_wiki, options) ⇒ ContentTransferer

Returns a new instance of ContentTransferer.



17
18
19
20
21
22
23
# File 'lib/caramelize/content_transferer.rb', line 17

def initialize(input_wiki, options)
  @input_wiki = input_wiki
  @options = options

  options[:default_author] = options.fetch(:default_author, "Caramelize")
  options[:markup] = target_markup
end

Instance Attribute Details

#input_wikiObject (readonly)

Returns the value of attribute input_wiki.



13
14
15
# File 'lib/caramelize/content_transferer.rb', line 13

def input_wiki
  @input_wiki
end

#optionsObject (readonly)

Returns the value of attribute options.



13
14
15
# File 'lib/caramelize/content_transferer.rb', line 13

def options
  @options
end

Instance Method Details

#executeObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/caramelize/content_transferer.rb', line 25

def execute
  input_wiki.read_authors

  commit_history

  if verbose?
    puts "From markup: #{input_wiki.markup.to_s}"
    puts "To markup: #{target_markup.to_s}"
    puts "Convert latest revisions:"
  end

  migrate_markup_of_latest_revisions

  puts 'Create Namespace Overview' if verbose?
  create_overview_page_of_namespaces if options[:create_namespace_overview]

  rename_home_page
end