Sha256: adc555b74c9fb4966032e8188f4bee3c89cbeb04f2d294f4670478d1e2563a42

Contents?: true

Size: 703 Bytes

Versions: 10

Compression:

Stored size: 703 Bytes

Contents

require 'rails/generators'

module BaiduUeditorRails
  module Generators
    class InstallGenerator < ::Rails::Generators::Base

      source_root File.expand_path("../templates", __FILE__)
      desc "This generator installs baidu ueditor custom config"

      def add_custom_config
        if File.exist?("app/assets/javascripts/ueditor_custom_config.js")
          js = File.read("app/assets/javascripts/ueditor_custom_config.js")
          insert_into_file "app/assets/javascripts/ueditor_custom_config.js", js, :after => "ueditor custom config\n"
        else
          copy_file "ueditor_custom_config.js", "app/assets/javascripts/ueditor_custom_config.js"
        end
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
baidu_ueditor_rails-0.2.3 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.2.2 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.2.1 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.2.0 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.1.0 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.0.5 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.0.4 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.0.3 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.0.2 lib/generators/baidu_ueditor_rails/install/install_generator.rb
baidu_ueditor_rails-0.0.1 lib/generators/baidu_ueditor_rails/install/install_generator.rb