Class: WysihatGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/wysihat_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



5
6
7
# File 'lib/generators/wysihat_generator.rb', line 5

def self.source_root
  File.join(File.dirname(__FILE__), '..', '..', 'generators', 'wysihat', 'templates')
end

Instance Method Details

#install_wysihatObject



9
10
11
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/generators/wysihat_generator.rb', line 9

def install_wysihat
  copy_file 'javascripts/wysihat_engine_pack.js', 'public/javascripts/wysihat_engine_pack.js'
   
  # javascript source
  # TODO: build the --include-js-src option
  
  # facebox
  # TODO: build the --sass option
   
  copy_file 'css/facebox.css',   'public/stylesheets/facebox.css'
   
  copy_file 'images/facebox/b.png',                  'public/images/facebox/b.png'      
  copy_file 'images/facebox/bl.png',                 'public/images/facebox/bl.png'      
  copy_file 'images/facebox/br.png',                 'public/images/facebox/br.png'      
  copy_file 'images/facebox/closelabel.gif',         'public/images/facebox/closelabel.gif'
  copy_file 'images/facebox/tl.png',                 'public/images/facebox/tl.png'      
  copy_file 'images/facebox/tr.png',                 'public/images/facebox/tr.png'
  copy_file 'images/facebox/loading.gif',            'public/images/facebox/loading.gif'
  
  # stylesheet
  # TODO: build the --sass option
    
  copy_file 'css/wysihat.css',   'public/stylesheets/wysihat.css'
  
  # icons
  
  copy_file 'images/icons/arrow_redo.png',         'public/images/icons/arrow_redo.png'      
  copy_file 'images/icons/arrow_undo.png',         'public/images/icons/arrow_undo.png'
  copy_file 'images/icons/exclamation.png',        'public/images/icons/exclamation.png'      
  copy_file 'images/icons/image.png',              'public/images/icons/image.png'      
  copy_file 'images/icons/link.png',               'public/images/icons/link.png'      
  copy_file 'images/icons/page_code.png',          'public/images/icons/page_code.png'      
  copy_file 'images/icons/text_align_center.png',  'public/images/icons/text_align_center.png'      
  copy_file 'images/icons/text_align_left.png',    'public/images/icons/text_align_left.png'      
  copy_file 'images/icons/text_align_right.png',   'public/images/icons/text_align_right.png'      
  copy_file 'images/icons/text_bold.png',          'public/images/icons/text_bold.png'           
  copy_file 'images/icons/text_italic.png',        'public/images/icons/text_italic.png'      
  copy_file 'images/icons/text_list_bullets.png',  'public/images/icons/text_list_bullets.png'      
  copy_file 'images/icons/text_list_numbers.png',  'public/images/icons/text_list_numbers.png'      
  copy_file 'images/icons/text_strikethrough.png', 'public/images/icons/text_strikethrough.png'      
  copy_file 'images/icons/text_underline.png',     'public/images/icons/text_underline.png'
  copy_file 'images/icons/text_heading_1.png',     'public/images/icons/text_heading_1.png'
  copy_file 'images/icons/text_heading_2.png',     'public/images/icons/text_heading_2.png'
  copy_file 'images/icons/text_heading_3.png',     'public/images/icons/text_heading_3.png'
  copy_file 'images/icons/text_heading_4.png',     'public/images/icons/text_heading_4.png'
  copy_file 'images/icons/text_heading_5.png',     'public/images/icons/text_heading_5.png'
  copy_file 'images/icons/text_heading_6.png',     'public/images/icons/text_heading_6.png'
  copy_file 'images/icons/cancel.png',             'public/images/icons/cancel.png'
  
  # migration
  
  migration_template 'migrations/create_wysihat_files.rb', 'db/migrate/create_wysihat_files.rb'
       
  # routes
  
  route 'resource :wysihat_files'
  
  # install the responds_to_parent plugin
  
  plugin 'responds_to_parent', :git => 'git://github.com/markcatley/responds_to_parent.git'
end