Class: Rowr::CommandLine

Inherits:
Thor
  • Object
show all
Defined in:
lib/rowr/command_line.rb

Instance Method Summary collapse

Instance Method Details

#continueObject



19
20
21
22
# File 'lib/rowr/command_line.rb', line 19

def continue
  rowr = Rowr::Resurrector.new
  rowr.continue
end

#resetObject



27
28
29
30
# File 'lib/rowr/command_line.rb', line 27

def reset
  rowr = Rowr::Resurrector.new
  rowr.reset
end

#startObject



11
12
13
14
# File 'lib/rowr/command_line.rb', line 11

def start
  rowr = Rowr::Resurrector.new
  rowr.start
end

#test(file) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/rowr/command_line.rb', line 35

def test(file)
  return unless File.exist? File.expand_path(file)

  f = File.expand_path(file)
  rowr = Rowr::Resurrector.new

  rowr.options.source_directory = File.dirname(f)
  rowr.prompt_user_for_option 'old_host?'
  rowr.prompt_user_for_option 'new_base_path?'
  rowr.prompt_user_for_option 'check_external_urls?'

  rowr.init_link_processor

  rowr.link_processor.containing_file = f

  text = File.read(f)
  unless text.valid_encoding?
    text = text.encode('UTF-16be', :invalid=>:replace, :replace=>' ').encode('UTF-8')
  end
  text = rowr.clean_no_quotes(text)
  rowr.check_urls(text)

end