Class: SourceFile

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ckeditor-rails/source_file.rb

Instance Method Summary collapse

Instance Method Details

#cleanupObject


43
44
45
# File 'lib/ckeditor-rails/source_file.rb', line 43

def cleanup
  FileUtils.rm_rf source_root
end

#fetch(version) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ckeditor-rails/source_file.rb', line 8

def fetch version
  download_url = file_url version
  archive_file = "#{source_root}/#{filename(version)}"

  in_root do
    say_status '       fetch', archive_file, :green
    get download_url, archive_file
    if File.exist? archive_file
      FileUtils.mkdir_p source_root
      extract archive_file, source_root
      FileUtils.rm_rf archive_file
    end
  end

  bump_version version
end

#fix_cssObject


35
36
37
38
39
40
# File 'lib/ckeditor-rails/source_file.rb', line 35

def fix_css
  self.destination_root = 'vendor/assets/stylesheets/ckeditor'
  inside destination_root do
    # gsub_file 'skins/moono-lisa/dialog_iequirks.css',  /\{filter\:\}/, '{}'
  end
end

#moveObject


26
27
28
29
30
31
32
# File 'lib/ckeditor-rails/source_file.rb', line 26

def move
  FileUtils.rm_rf destination_root
  copy_files_in_source_root
  copy_langs
  copy_plugins
  copy_skins
end