Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for coffeescript during install #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/rails/generators/kendoui/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ class InstallGenerator < ::Rails::Generators::Base
def add_kendoui_scripts
say_status("adding", "Kendo UI (#{Kendoui::Rails::KENDOUI_VERSION}) to javascripts pipeline", :green)

insert_into_file "app/assets/javascripts/application.js", "//= require kendo/kendo.web.min\n", :before => "//= require_tree ."
asset_path = "app/assets/javascripts/application.js"
require_kendo = "require kendo/kendo.web.min\n"
require_tree = "require_tree ."

if File.exist?("#{asset_path}.coffee")
insert_into_file "#{asset_path}.coffee", "#= #{require_kendo}", :before => "#= #{require_tree}"
else
insert_into_file asset_path, "//= #{require_kendo}", :before => "//= #{require_tree}"
end
end

def add_kendoui_styles
Expand Down Expand Up @@ -85,4 +93,4 @@ def add_kendoui_styles
end
end
end
end
end