From bebee068a98f6f085a606e72edaab5a189377e48 Mon Sep 17 00:00:00 2001 From: Charly POLY Date: Fri, 12 Sep 2014 15:08:45 +0200 Subject: [PATCH 1/3] feat(cli): add --sass-loadpath option Closes #1 --- lib/csscss/cli.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/csscss/cli.rb b/lib/csscss/cli.rb index 0adec9e..c1608cc 100644 --- a/lib/csscss/cli.rb +++ b/lib/csscss/cli.rb @@ -75,6 +75,10 @@ def parse(argv) opts.on("--[no-]color", "Colorize output", "(default is #{@color})") do |c| @color = c end + + opts.on("--sass-loadpath", "Add loadpath to options given to Sass::Engine") do |sass_loadpath| + @sass_loadpath = sass_loadpath + end opts.on("-n", "--num N", Integer, "Print matches with at least this many rules.", "(default is 3)") do |n| @minimum = n @@ -173,6 +177,7 @@ def load_sass_file(filename) sass_options = {cache:false} sass_options[:load_paths] = Compass.configuration.sass_load_paths if @compass + sass_options[:load_paths] = (sass_options[:load_paths] || []).concat(@sass_loadpath) if @sass_loadpath begin Sass::Engine.for_file(filename, sass_options).render rescue Sass::SyntaxError => e From b4b9d02d9e31b133db4789d9f04a2d582b503a50 Mon Sep 17 00:00:00 2001 From: Charly POLY Date: Fri, 12 Sep 2014 15:13:16 +0200 Subject: [PATCH 2/3] fix(cli): split --sass-loadpath value to provide an array --- lib/csscss/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/csscss/cli.rb b/lib/csscss/cli.rb index c1608cc..8f5f109 100644 --- a/lib/csscss/cli.rb +++ b/lib/csscss/cli.rb @@ -177,7 +177,7 @@ def load_sass_file(filename) sass_options = {cache:false} sass_options[:load_paths] = Compass.configuration.sass_load_paths if @compass - sass_options[:load_paths] = (sass_options[:load_paths] || []).concat(@sass_loadpath) if @sass_loadpath + sass_options[:load_paths] = (sass_options[:load_paths] || []).concat(@sass_loadpath.split(',')) if @sass_loadpath begin Sass::Engine.for_file(filename, sass_options).render rescue Sass::SyntaxError => e From 859e94fae1bd9219f839279565707b8dd8431de3 Mon Sep 17 00:00:00 2001 From: Charly POLY Date: Fri, 12 Sep 2014 15:18:57 +0200 Subject: [PATCH 3/3] Update cli.rb --- lib/csscss/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/csscss/cli.rb b/lib/csscss/cli.rb index 8f5f109..19dc517 100644 --- a/lib/csscss/cli.rb +++ b/lib/csscss/cli.rb @@ -76,7 +76,7 @@ def parse(argv) @color = c end - opts.on("--sass-loadpath", "Add loadpath to options given to Sass::Engine") do |sass_loadpath| + opts.on("--sass-loadpath path", "Add loadpath to options given to Sass::Engine") do |sass_loadpath| @sass_loadpath = sass_loadpath end