Sha256: b5370a7436470bffe1d0884686797962b0ded948c7e13d25f6e3d303793046d8

Contents?: true

Size: 849 Bytes

Versions: 39

Compression:

Stored size: 849 Bytes

Contents

module RailsKindeditor
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)
    desc "Install kindeditor for your application."

    def copy_kindeditor_files
      if ::Rails.version < "3.1.0"
        warn "Warning: rails_kindeditor ~> v0.3.0 only support Rails3.1+!"
        warn "If you're using rails3.0.x, please check rails_kindeditor v0.2.8"
      else
        template "rails_kindeditor.rb", "config/initializers/rails_kindeditor.rb"
      end
    end
    
    def insert_or_copy_js_files
      if File.exist?('app/assets/javascripts/application.js')
        insert_into_file "app/assets/javascripts/application.js", "//= require kindeditor\n", :after => "jquery_ujs\n"
      else
        copy_file "application.js", "app/assets/javascripts/application.js"
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 7 rubygems

Version Path
rails_editor_liu-0.5.1 lib/generators/rails_kindeditor/install/install_generator.rb
rails_editor_liu-0.5.0 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor_video-0.5.2 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor_video-0.5.1 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.5.0 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.4.7 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.4.6 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-plus-0.4.5 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor_upyun-0.4.5 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.4.5 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.4.4 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.4.2 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.4.1 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.4.0 lib/generators/rails_kindeditor/install/install_generator.rb
loyal_rails_kindeditor-0.0.9 lib/generators/rails_kindeditor/install/install_generator.rb
loyal_rails_kindeditor-0.0.8 lib/generators/rails_kindeditor/install/install_generator.rb
loyal_rails_kindeditor-0.0.7 lib/generators/rails_kindeditor/install/install_generator.rb
loyal_rails_kindeditor-0.0.6 lib/generators/rails_kindeditor/install/install_generator.rb
loyal_rails_kindeditor-0.0.5 lib/generators/rails_kindeditor/install/install_generator.rb
rails_kindeditor-0.3.20 lib/generators/rails_kindeditor/install/install_generator.rb