Class: HappySeed::Generators::CkeditorGenerator

Inherits:
HappySeedGenerator
  • Object
show all
Defined in:
lib/generators/happy_seed/ckeditor/ckeditor_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.fingerprintObject



9
10
11
# File 'lib/generators/happy_seed/ckeditor/ckeditor_generator.rb', line 9

def self.fingerprint
  gem_available? 'ckeditor'
end

Instance Method Details

#install_html_emailObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/generators/happy_seed/ckeditor/ckeditor_generator.rb', line 13

def install_html_email
  return if already_installed

  require_generator BootstrapGenerator

  gem 'ckeditor'

  Bundler.with_clean_env do
    run "bundle install --without production"
  end

  inject_into_file "config/environments/production.rb", "  config.assets.precompile += Ckeditor.assets\n  config.assets.precompile += ['ckeditor/*']\n", before: "end\n"
  inject_into_file "app/assets/javascripts/application.js", "\n//= require ckeditor/init", after: "//= require bootstrap-sprockets"

  directory "."
end