sassmagic 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md ADDED
File without changes
data/Readme.md ADDED
File without changes
data/bin/sassmagic ADDED
@@ -0,0 +1,53 @@
1
+ # !/usr/bin/env ruby
2
+ # The command line Sass parser.
3
+ THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
4
+ begin
5
+ require File.dirname(THIS_FILE) + '/../lib/sass'
6
+ rescue LoadError
7
+ end
8
+
9
+ require 'sass'
10
+ require 'sass/exec'
11
+ require 'sassmagic/utils'
12
+ require 'sassmagic/reset'
13
+ # require 'debugger'
14
+
15
+
16
+ class Engine
17
+ # include Sass::Tree
18
+ def absolutize(file)
19
+ File.expand_path("#{File.dirname(__FILE__)}/#{file}")
20
+ end
21
+ def go
22
+ args = ARGV
23
+ input = args[-2]
24
+ output = args[-1]
25
+ if input && output
26
+ Sass.compile_file(input,output, ARGV)
27
+ end
28
+ end
29
+ end
30
+
31
+ multiple = false
32
+ # debugger
33
+ # ARGV.each{|v|
34
+ # if v == '-x'
35
+ # multiple = true
36
+ # end
37
+ # }
38
+
39
+ if ARGV.include?'--x'
40
+ multiple = true
41
+ end
42
+
43
+
44
+ # Engine.new.go
45
+ if multiple
46
+ Engine.new.go
47
+ else
48
+ opts = Sass::Exec::SassScss.new(ARGV, :sass)
49
+ opts.parse!
50
+ end
51
+
52
+
53
+