diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-09-02 05:13:58 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-09-02 05:13:58 +0300 |
commit | 5ef4dee608c93e6b3d7538500bbac4d05c79b94b (patch) | |
tree | c6fbc7278771ab9242679f7ff9c800526e539da2 /tasks/updater | |
parent | b5d4805cf57c9bf757363340cd0ca42e3cb1b0f6 (diff) |
Read JS concat order directly from Gruntfile
Diffstat (limited to 'tasks/updater')
-rw-r--r-- | tasks/updater/js.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tasks/updater/js.rb b/tasks/updater/js.rb index b5d4bce..bfc1c11 100644 --- a/tasks/updater/js.rb +++ b/tasks/updater/js.rb @@ -2,7 +2,7 @@ class Updater module Js def update_javascript_assets log_status 'Updating javascripts...' - save_to = @save_to[:js] + save_to = @save_to[:js] contents = {} read_files('js/dist', bootstrap_js_files).each do |name, file| contents[name] = file @@ -29,18 +29,8 @@ class Updater def bootstrap_js_files @bootstrap_js_files ||= begin - files = get_paths_by_type('js/dist', /\.js$/) - files.sort_by { |f| - case f - # tooltip depends on popover and must be loaded earlier - when /tooltip/ then - 1 - when /popover/ then - 2 - else - 0 - end - } + gruntfile = get_file(file_url 'Gruntfile.js') + JSON.parse(/concat:.*?src: (\[[^\]]+\])/m.match(gruntfile)[1].tr("'", '"')).map { |p| p.sub %r(\Ajs/src/), '' } end end end |