Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2016-09-10 15:21:42 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2016-09-10 15:21:42 +0300
commit23d70bc283e00043623bb4539c12e2f5a7ab0739 (patch)
treea955bd41beb0b7e66c138badcdc556d198d08ef5 /tasks
parent721b59662d029883cf08c377ab5b2f12ef41b3b3 (diff)
Update variables template generator for alpha4
Diffstat (limited to 'tasks')
-rw-r--r--tasks/updater/scss.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/tasks/updater/scss.rb b/tasks/updater/scss.rb
index 527ba03..939e09a 100644
--- a/tasks/updater/scss.rb
+++ b/tasks/updater/scss.rb
@@ -26,9 +26,18 @@ class Updater
log_status 'Generating variable template file'
save_file 'templates/project/_bootstrap-variables.scss',
- "// Override Bootstrap variables here (defaults from bootstrap v#{upstream_version}):\n\n" +
- File.read("#{save_to}/_variables.scss").lines[1..-1].join.gsub(/^(?=\$|\)|[ ]{2})/, '// ').gsub(/ !default/, '')
-
+ "// Override Bootstrap variables here (defaults from bootstrap v#{upstream_version}):\n" +
+ File.read("#{save_to}/_variables.scss").
+ # The instructions in the file header are replaced with the line above
+ lines[4..-1].
+ # Remove the _assert-ascending mixin definition and usages
+ reject { |line| line.start_with?('@include _assert-ascending') }.
+ join.
+ gsub(/@mixin _assert-ascending.*?\n}\n/m, '').
+ # Comment out the assignments
+ gsub(/^(?=\$|\)|[ ]{2})/, '// ').
+ # Remove the !default modifier
+ gsub(/ !default/, '')
end
end
end