Module: IE6Fixer
- Defined in:
- lib/ie6_fixer.rb,
lib/ie6_fixer/helpers.rb,
lib/ie6_fixer/railtie.rb,
lib/ie6_fixer/version.rb
Defined Under Namespace
Modules: Helpers
Classes: Railtie
Constant Summary
collapse
- VERSION =
"0.5.1"
Class Method Summary
collapse
Class Method Details
.initialize ⇒ Object
4
5
6
7
8
9
10
|
# File 'lib/ie6_fixer.rb', line 4
def self.initialize
return if @initialized
raise "ActionController is not available yet." unless defined?(ActionController)
ActionController::Base.send(:helper, IE6Fixer::Helpers)
IE6Fixer.install_or_update_ie6_fixer
@initialized = true
end
|
.install_or_update_ie6_fixer ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/ie6_fixer.rb', line 12
def self.install_or_update_ie6_fixer
require 'fileutils'
orig = File.join(File.dirname(__FILE__), 'ie6_fixer', 'assets', 'ie6_fixer')
dest = File.join(Rails.root, 'public', 'javascripts', 'ie6_fixer')
readme = File.join(dest, 'README.txt')
unless File.exists?(readme) && FileUtils.identical?(File.join(orig, 'README.txt'), readme)
if File.exists?(readme)
begin
puts "Removing directory #{dest}..."
FileUtils.rm_rf dest
puts "Creating directory #{dest}..."
FileUtils.mkdir_p dest
puts "Copying ie6_fixer to #{dest}..."
FileUtils.cp_r "#{orig}/.", dest
puts "Successfully updated ie6_fixer."
rescue
puts 'ERROR: Problem updating ie6_fixer. Please manually copy '
puts orig
puts 'to'
puts dest
end
else
begin
puts "Creating directory #{dest}..."
FileUtils.mkdir_p dest
puts "Copying ie6_fixer to #{dest}..."
FileUtils.cp_r "#{orig}/.", dest
puts "Successfully installed ie6_fixer."
rescue
puts "ERROR: Problem installing ie6_fixer. Please manually copy "
puts orig
puts "to"
puts dest
end
end
end
end
|