forked from hackerwins/summernote-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
27 lines (21 loc) · 894 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require "bundler/gem_tasks"
def copy_locales
Dir["summernote/lang/*"].each do |file|
`cp #{file} vendor/assets/javascripts/summernote/locales/#{File.basename(file).gsub('summernote-', '')}`
end
end
desc "Update assets"
task 'update' do
if Dir.exist?('summernote')
system("cd summernote; git fetch")
last_revision = `cd summernote; git describe --abbrev=0 --tags`
system("cd summernote; git checkout #{last_revision}")
else
system("git clone git@github.com:summernote/summernote.git")
end
`cp summernote/dist/summernote.js vendor/assets/javascripts/summernote/summernote.js`
`cp summernote/dist/summernote.css vendor/assets/stylesheets/summernote/summernote.css`
`cp summernote/dist/summernote-bs3.css vendor/assets/stylesheets/summernote/bs3.css`
`cp summernote/dist/summernote-bs2.css vendor/assets/stylesheets/summernote/bs2.css`
copy_locales
end