compass-configparser 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/compass-configparser.rb +21 -19
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 300bd0e99f355b7460b66c04a495535717b443da
|
4
|
+
data.tar.gz: cc8f146fa8ccf3d8bf4f1a8de2724ac33039e945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc98c8c4496ba30121e901c63b6df8a0867beb0f671380541463014b4b87a5785d1103bf44aa72e5eefa7ae4eed455cacbc2bb725dacaeda29d573e8a4073605
|
7
|
+
data.tar.gz: 20c7a2d06f4c6db182b4d0f9b564f5aa3f10c162db648c59d5a1ebcb5fb71e1c7f441e593b1eae76cbd5a7902722c1a3f88390991a7ac6fdc3f44b5e58d8cf3c
|
data/lib/compass-configparser.rb
CHANGED
@@ -15,27 +15,29 @@ class CompassConfigParser
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def parse_config()
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
if
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
if value
|
30
|
-
|
18
|
+
if self.config_file != nil && File.readable?(self.config_file)
|
19
|
+
IO.foreach(self.config_file) do |fLine|
|
20
|
+
line = fLine.lstrip.rstrip
|
21
|
+
# ignore comments, require, include, import and empty lines
|
22
|
+
if !line.match(/^\#|require|include|import|load|discover/) && line.length > 0
|
23
|
+
if(/\s*=\s*/.match(line))
|
24
|
+
param, value = line.split(/\s*=\s*/, 2)
|
25
|
+
var_name = "#{param}".chomp.strip
|
26
|
+
value = value.chomp.strip
|
27
|
+
|
28
|
+
new_value = ''
|
29
|
+
if (value)
|
30
|
+
if value =~ /^['"](.*)['"]$/
|
31
|
+
new_value = $1
|
32
|
+
else
|
33
|
+
new_value = value
|
34
|
+
end
|
31
35
|
else
|
32
|
-
new_value =
|
36
|
+
new_value = ''
|
33
37
|
end
|
34
|
-
else
|
35
|
-
new_value = ''
|
36
|
-
end
|
37
38
|
|
38
|
-
|
39
|
+
self.params[param] = new_value
|
40
|
+
end
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
@@ -49,4 +51,4 @@ class CompassConfigParser
|
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
52
|
-
end
|
54
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-configparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tino Wehe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Helper to parse compass-style.org config files
|
14
14
|
email: tino.wehe@brandrockers.com
|
@@ -28,17 +28,17 @@ require_paths:
|
|
28
28
|
- lib
|
29
29
|
required_ruby_version: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
|
-
- -
|
36
|
+
- - ">="
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
40
|
rubyforge_project:
|
41
|
-
rubygems_version: 2.2.
|
41
|
+
rubygems_version: 2.2.2
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: Helper to parse compass-style.org config files
|