Sha256: c5216b2a88fe734d7c2a3fb6f130580f683ff410276e2e3a98da5b089d25c4ae

Contents?: true

Size: 859 Bytes

Versions: 10

Compression:

Stored size: 859 Bytes

Contents

require 'generators/cream/string_ext'
require 'generators/views/haml_util'

module Cream
  module Generators
    class ViewsGenerator < Rails::Generators::Base
      desc "Copies all AuthAssist views to your application."
  
      argument :scope, :required => false, :default => nil, :desc => "The scope to copy views to"
  
      class_option :haml, :type => :boolean, :default => "erb", :desc => "Use HAML"
  
      def self.source_root
        @_devise_source_root ||= File.expand_path("app/views".up(4), __FILE__)
      end

      def copy_views
        if options[:haml]
          create_and_copy_haml_views
        else
          copy_erb_views
        end
      end
  
      protected

      def copy_erb_views
        directory "cream", "app/views/#{scope || 'devise'}"        
      end
  
      include Cream::Generators::HamlUtil
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cream-0.7.0 lib/generators/cream/views/views_generator.rb
cream-0.6.4 lib/generators/cream/views/views_generator.rb
cream-0.6.3 lib/generators/cream/views/views_generator.rb
cream-0.6.1 lib/generators/cream/views/views_generator.rb
cream-0.6.0 lib/generators/cream/views/views_generator.rb
cream-0.5.10 lib/generators/cream/views/views_generator.rb
cream-0.5.9 lib/generators/cream/views/views_generator.rb
cream-0.5.8 lib/generators/cream/views/views_generator.rb
cream-0.5.7 lib/generators/cream/views/views_generator.rb
cream-0.5.6 lib/generators/cream/views/views_generator.rb