Class: I0n::Generators::LayoutGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/i0n/layout/layout_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_compass_configObject



45
46
47
48
# File 'lib/generators/i0n/layout/layout_generator.rb', line 45

def create_compass_config
  copy_file "config/initializers/compass.rb", "#{Rails.root}/config/initializers/compass.rb" 
  copy_file "config/compass.rb", "#{Rails.root}/config/compass.rb"
end

#create_jammit_assetsObject



59
60
61
62
# File 'lib/generators/i0n/layout/layout_generator.rb', line 59

def create_jammit_assets
  copy_file "config/assets.yml", "#{Rails.root}/config/assets.yml"
  directory "public/javascripts", "#{Rails.root}/public/javascripts" 
end

#create_layoutObject



64
65
66
67
# File 'lib/generators/i0n/layout/layout_generator.rb', line 64

def create_layout
  copy_file "app/views/layouts/application.haml", "#{Rails.root}/app/views/layouts/application.haml"
  copy_file "app/views/shared/_error_messages.haml", "#{Rails.root}/app/views/shared/_error_messages.haml" 
end

#create_sass_directoryObject



55
56
57
# File 'lib/generators/i0n/layout/layout_generator.rb', line 55

def create_sass_directory
  directory "app/sass", "#{Rails.root}/app/sass"    
end

#create_sass_extensions_and_rake_tasksObject



50
51
52
53
# File 'lib/generators/i0n/layout/layout_generator.rb', line 50

def create_sass_extensions_and_rake_tasks
  copy_file "lib/sass_extensions.rb", "#{Rails.root}/lib/sass_extensions.rb" 
  copy_file "lib/tasks/sass.rake", "#{Rails.root}/lib/tasks/sass.rake"
end

#gemfileObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/generators/i0n/layout/layout_generator.rb', line 7

def gemfile
  # Memcached
  gem 'dalli'

  # Data storage
  gem 'bson_ext'
  gem 'mongoid'

  # File uplaod
  gem 'carrierwave'
  gem 'mini_magick'

  # File minification 
  gem 'jammit'

  # Templates
  gem 'haml'
  gem 'haml-rails'

  # jQuery
  gem 'jquery-rails'

  # Stylesheets
  gem "compass"
  gem 'compass-susy-plugin'
end

#remove_default_layoutObject



69
70
71
# File 'lib/generators/i0n/layout/layout_generator.rb', line 69

def remove_default_layout
  remove_file "app/views/layouts/application.html.erb" 
end

#setup_applicationObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/generators/i0n/layout/layout_generator.rb', line 34

def setup_application
  application do
    '
config.generators do |g|
  g.stylesheets false
  g.template_engine :haml
end
    '
  end  
end