sugamasao-saag 0.2.1 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +7 -0
- data/VERSION +1 -1
- data/lib/saag.rb +18 -11
- metadata +2 -2
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/lib/saag.rb
CHANGED
@@ -5,14 +5,25 @@ require 'logger'
|
|
5
5
|
require 'pp'
|
6
6
|
|
7
7
|
class Saag
|
8
|
-
Version = '0.1.0'
|
9
8
|
SASS_EXT = '.sass'
|
10
9
|
CSS_EXT = '.css'
|
11
10
|
|
12
11
|
def initialize(argv = [])
|
13
|
-
#
|
12
|
+
# クラス共通の値
|
13
|
+
@app_name = self.class
|
14
|
+
begin
|
15
|
+
@version = File.read("#{File.dirname(__FILE__)}/../VERSION").chomp
|
16
|
+
rescue => e
|
17
|
+
@version = "0.0.0"
|
18
|
+
end
|
19
|
+
|
20
|
+
# 引数オプション格納用
|
14
21
|
@conf = {}
|
22
|
+
|
23
|
+
# シグナル受信用フラグ(シグナルを受けたら true にして終了する)
|
15
24
|
@exit = false
|
25
|
+
|
26
|
+
# Loger の設定
|
16
27
|
@logger = Logger.new(STDOUT)
|
17
28
|
@logger.level = Logger::INFO # default Log Level
|
18
29
|
|
@@ -21,11 +32,7 @@ class Saag
|
|
21
32
|
opt.on('-i', '--input_path=VAL', 'input file path(directory or filename)') {|v| @conf[:in_path] = set_dir_path(v)}
|
22
33
|
opt.on('-o', '--output_path=VAL', 'generated css file output path') {|v| @conf[:out_path] = set_dir_path(v)}
|
23
34
|
opt.on('-r', '--render_opt=VAL', 'sass render option [nested or expanded or compact or compressed]' ){|v| @conf[:render_opt] = set_render_opt(v)}
|
24
|
-
opt.on('-v', '--version',
|
25
|
-
print "#{self.class} "
|
26
|
-
puts File.read("#{File.dirname(__FILE__)}/../VERSION").chomp
|
27
|
-
exit 1
|
28
|
-
end
|
35
|
+
opt.on('-v', '--version', 'show version' ) { puts "#{@app_name} #{@version}"; exit 1 }
|
29
36
|
opt.on('-d', '--debug', 'log level to debug') {|v| @conf[:debug] = v}
|
30
37
|
end.parse!(argv)
|
31
38
|
rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e
|
@@ -33,7 +40,7 @@ class Saag
|
|
33
40
|
exit 1
|
34
41
|
end
|
35
42
|
|
36
|
-
@logger.info("sass file watching start... [
|
43
|
+
@logger.info("sass file watching start... [#{@app_name} = #{@version}]")
|
37
44
|
@logger.level = Logger::DEBUG if @conf[:debug]
|
38
45
|
|
39
46
|
@logger.debug("args input_path => #{@conf[:in_path]}")
|
@@ -150,17 +157,17 @@ class Saag
|
|
150
157
|
end
|
151
158
|
|
152
159
|
def set_default_conf()
|
153
|
-
|
160
|
+
unless @conf[:in_path]
|
154
161
|
@conf[:in_path] = Dir.pwd + '/'
|
155
162
|
end
|
156
|
-
|
163
|
+
unless @conf[:out_path]
|
157
164
|
if File.directory?(@conf[:in_path])
|
158
165
|
@conf[:out_path] = @conf[:in_path]
|
159
166
|
else
|
160
167
|
@conf[:out_path] =File.dirname( @conf[:in_path]) + '/'
|
161
168
|
end
|
162
169
|
end
|
163
|
-
|
170
|
+
unless @conf[:render_opt]
|
164
171
|
@conf[:render_opt] = :nested
|
165
172
|
end
|
166
173
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugamasao-saag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sugamasao
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-25 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
- saag
|
15
15
|
dependencies:
|