Skip to content
Browse files

Add script to build Sass-In-One

  • Loading branch information...
1 parent 46564dc commit cb1bdef12e43d52ec98234762f1891ff79602caa @paulcbetts committed
Showing with 36 additions and 0 deletions.
  1. +9 −0 BuildingSassInOne.md
  2. +27 −0 ext/build_sass_in_one.rb
View
9 BuildingSassInOne.md
@@ -0,0 +1,9 @@
+# How to build Sass-In-One
+
+1. Check out Sass.
+2. Copy the ext/build\_sass\_in\_one.rb script to the sass/lib directory.
+3. ruby build\_sass\_in\_one.rb > sass\_in\_one.rb 2>log.txt - this will
+ probably throw a few errors.
+4. Keep trying to run sass\_in\_one.rb and fixing up the runtime errors
+ (Sass tries to build its version info from files in the Gem - replace
+ it with hardcoded strings)
View
27 ext/build_sass_in_one.rb
@@ -0,0 +1,27 @@
+$root_dir = File.dirname(__FILE__)
+$included_paths = {}
+
+def parse_sass_file(path)
+ File.readlines(path).each do |line|
+ unless line =~ /require '.*?'/
+ puts line
+ next
+ end
+
+ file = /require '(.*?)'/.match(line)[1] + ".rb"
+
+ unless $included_paths[file]
+ $included_paths[file] = true
+ STDERR.puts file
+
+ if line =~ /sass/
+ parse_sass_file(File.join($root_dir, file))
+ next
+ end
+
+ puts line
+ end
+ end
+end
+
+parse_sass_file('./sass.rb')

0 comments on commit cb1bdef

Please sign in to comment.
Something went wrong with that request. Please try again.