Sha256: 0ed2c73be472b9589beff2e4142653471b99dde6054084e938bc965fa20d80e5

Contents?: true

Size: 970 Bytes

Versions: 16

Compression:

Stored size: 970 Bytes

Contents

require 'rails/generators/named_base'

module Rails
  module Generators
    class JoosyBase < ::Rails::Generators::NamedBase
      class_option :template_kind, :type => :string, :aliases => "-T", :default => 'hamlc',
                                   :desc => "Generate templates with specified extension (default: .hamlc)"

      class_option :skip_git,      :type => :boolean, :aliases => "-G", :default => false,
                                   :desc => "Skip Git keeps"


      def create_files
        self.destination_root = "app/assets/javascripts"
      end

      protected

      # From https://github.com/rails/rails/blob/master/railties/lib/rails/generators/app_base.rb
      def empty_directory_with_gitkeep(destination, config = {})
        empty_directory(destination, config)
        git_keep(destination)
      end

      def git_keep(destination)
        create_file("#{destination}/.gitkeep") unless options[:skip_git]
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
joosy-1.1.2 lib/rails/generators/joosy/joosy_base.rb
joosy-1.1.1 lib/rails/generators/joosy/joosy_base.rb
joosy-1.1.0 lib/rails/generators/joosy/joosy_base.rb
joosy-1.1.0.alpha.3 lib/rails/generators/joosy/joosy_base.rb
joosy-1.1.0.alpha.2 lib/rails/generators/joosy/joosy_base.rb
joosy-1.1.0.alpha.1 lib/rails/generators/joosy/joosy_base.rb
joosy-1.0.0.RC7 lib/rails/generators/joosy/joosy_base.rb
joosy-1.0.0.RC6 lib/rails/generators/joosy/joosy_base.rb
joosy-1.0.0.RC5 lib/rails/generators/joosy/joosy_base.rb
joosy-1.0.0.RC4 lib/rails/generators/joosy/joosy_base.rb
joosy-1.0.0.RC3 lib/rails/generators/joosy/joosy_base.rb
joosy-1.0.0.RC2 lib/rails/generators/joosy/joosy_base.rb
joosy-1.0.0.RC1 lib/rails/generators/joosy/joosy_base.rb
joosy-0.1.0.RC3 lib/rails/generators/joosy/joosy_base.rb
joosy-0.1.0.RC2 lib/rails/generators/joosy/joosy_base.rb
joosy-0.1.0.RC1 lib/rails/generators/joosy/joosy_base.rb