i0n_rails3_generators 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :version_major: 0
3
3
  :version_minor: 2
4
- :version_patch: 5
4
+ :version_patch: 6
@@ -1,32 +1,40 @@
1
1
  module I0n
2
2
  module Generators
3
3
  class LayoutGenerator < Rails::Generators::Base
4
- require 'rails/generators'
5
- require 'rails/generators/migration'
6
- include Rails::Generators::Migration
7
4
 
8
5
  source_root File.expand_path('../templates', __FILE__)
9
6
 
10
- def setup_application_for_haml
11
- inject_into_file 'config/application.rb', IO.read("#{LayoutGenerator.source_root}/config/_application.rb", :after => 'config.encoding = "utf-8"'
7
+ def setup_application
8
+ application do
9
+ "
10
+ config.generators do |g|
11
+ g.stylesheets false
12
+ g.template_engine :haml
13
+ end
14
+ "
15
+ end
16
+ end
17
+
18
+ def setup_gemfile
19
+ gem("i0n_rails_3_generators", :group => ["test", "development"])
12
20
  end
13
21
 
14
22
  def create_compass_config
15
- copy_file 'config/initializers/compass.rb', 'config/initializers/compass.rb'
16
- copy_file 'config/compass.rb', 'config/compass.rb'
23
+ copy_file "config/initializers/compass.rb", "#{Rails.root}/config/initializers/compass.rb"
24
+ copy_file "config/compass.rb", "#{Rails.root}/config/compass.rb"
17
25
  end
18
26
 
19
27
  def create_sass_extensions
20
- copy_file 'lib/sass_extensions', 'lib/sass_extensions'
28
+ copy_file "lib/sass_extensions.rb", "#{Rails.root}/lib/sass_extensions.rb"
21
29
  end
22
30
 
23
31
  def create_sass_directory
24
- directory 'app/sass', 'app/sass'
32
+ directory "app/sass", "#{Rails.root}/app/sass"
25
33
  end
26
34
 
27
35
  def create_layout
28
- copy_file 'app/views/layout/application.haml', 'app/views/layout/application.haml'
29
- copy_file 'app/views/shared/_error_messages.haml', 'app/views/shared/_error_messages.haml'
36
+ copy_file "app/views/layouts/application.haml", "#{Rails.root}/app/views/layouts/application.haml"
37
+ copy_file "app/views/shared/_error_messages.haml", "#{Rails.root}/app/views/shared/_error_messages.haml"
30
38
  end
31
39
 
32
40
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: i0n_rails3_generators
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.5
5
+ version: 0.2.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ian Alexander Wood (i0n)