Class: ConvertToBootstrap3::Converter

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL
Defined in:
lib/convert_to_bootstrap3.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConverter

Returns a new instance of Converter.



18
19
20
# File 'lib/convert_to_bootstrap3.rb', line 18

def initialize
  @converter_url = 'http://code.divshot.com/bootstrap3_upgrader/'
end

Instance Attribute Details

#converter_urlObject

Returns the value of attribute converter_url.



16
17
18
# File 'lib/convert_to_bootstrap3.rb', line 16

def converter_url
  @converter_url
end

Instance Method Details

#convert_in_place(directory = "") ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/convert_to_bootstrap3.rb', line 22

def convert_in_place(directory = "")
  directory << '**/*.html*'

  visit @converter_url

  all_files = Dir.glob(directory).reject { |file| File.directory? file }

  all_files.each { |file| convert_file_contents(file) }
end