Sha256: 9e6c24510698f7128ff1993a7f1d08debce22a1dd076fc09c0ffd3013ba4fde6

Contents?: true

Size: 989 Bytes

Versions: 4

Compression:

Stored size: 989 Bytes

Contents

module Initial
  class RedactorRailsGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    def add
      gem 'redactor-rails'
      gem "carrierwave"
      gem "mini_magick"

      Bundler.with_clean_env do
        run "bundle install"
      end

      @with_devise = ask 'Generate for devise? (y/n)'
      if @with_devise =~ /y/
        generate 'redactor:install --devise'
      else
        generate 'redactor:install'
      end

      rake 'db:migrate'

      append_to_file "app/assets/javascripts/application.js",
%Q{
//= require redactor-rails
//= require redactor-rails/config
//= require redactor-rails/langs/ru
}

      insert_into_file "app/assets/stylesheets/application.css",
%Q{
 *= require redactor-rails
}, after: "/*\n"


      generate 'redactor:config'

      insert_into_file "app/assets/javascripts/redactor-rails/config.js",
%Q{
       "lang":'ru',
}, after:
%Q{
      "path":"/assets/redactor-rails",
}
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
teleporter-1.2.4 lib/generators/initial/redactor_rails.rb
teleporter-1.2.3 lib/generators/initial/redactor_rails.rb
teleporter-1.2.2 lib/generators/initial/redactor_rails.rb
teleporter-1.2.1 lib/generators/initial/redactor_rails.rb