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

github.com/twbs/bootstrap-sass.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2014-06-24 06:21:35 +0400
committerGleb Mazovetskiy <glex.spb@gmail.com>2014-06-24 06:21:35 +0400
commit430a80a2be7bf84acf5022cf7ab4989d858c5581 (patch)
treefc3923ddd7e11ce23c0cc75c121606f295def769 /templates
parent0d415362dbbd37626d0ad02325738de3a431d7e1 (diff)
Fix compass manifest
Compass generator will copy javascripts and fonts on project creation Refs #645
Diffstat (limited to 'templates')
-rw-r--r--templates/project/manifest.rb33
1 files changed, 17 insertions, 16 deletions
diff --git a/templates/project/manifest.rb b/templates/project/manifest.rb
index 19b01c11..20d6b639 100644
--- a/templates/project/manifest.rb
+++ b/templates/project/manifest.rb
@@ -3,23 +3,24 @@ description 'Bootstrap for Sass'
# Stylesheet importing bootstrap
stylesheet 'styles.sass'
-# SCSS:
-
-assets = '../../assets'
+manifest = Pathname.new(File.dirname(__FILE__))
+assets = File.expand_path('../../assets', manifest)
+# Provide variables files
bs_stylesheets = "#{assets}/stylesheets/bootstrap"
-stylesheet '_bootstrap-variables.sass.erb', :to => '_bootstrap-variables.sass', :erb => true,
- :bs_variables_path => File.expand_path("#{bs_stylesheets}/_variables.scss", File.dirname(__FILE__))
-
-# JS:
-bs_javascripts = "#{assets}/javascripts/bootstrap"
-Dir.glob File.expand_path("#{bs_javascripts}/*.js", File.dirname(__FILE__)) do |path|
- file = File.basename(path)
- javascript "#{bs_javascripts}/#{file}", :to => "bootstrap/#{file}"
-end
+stylesheet '_bootstrap-variables.sass.erb',
+ :erb => true,
+ :to => '_bootstrap-variables.sass',
+ :bs_variables_path => File.expand_path("#{bs_stylesheets}/_variables.scss", manifest)
-bs_fonts = "#{assets}/fonts/bootstrap"
-Dir.glob File.expand_path("#{bs_fonts}/*", File.dirname(__FILE__)) do |path|
- file = File.basename(path)
- font "#{bs_fonts}/#{file}", :to => "bootstrap/#{file}"
+# Copy JS and fonts
+{:javascript => 'javascripts',
+ :font => 'fonts'
+}.each do |method, dir|
+ root = Pathname.new(assets).join(dir)
+ Dir.glob root.join('**', '*.*') do |path|
+ path = Pathname.new(path)
+ send method, path.relative_path_from(manifest).to_s,
+ :to => path.relative_path_from(root).to_s
+ end
end