nginx-conf 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/lib/nginx-conf/compiler.rb +5 -4
- data/lib/nginx-conf/conf.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 976d24d4a019605bec7576424ec3da5e380d349d
|
4
|
+
data.tar.gz: d3ecb1b97016b1f9b51c2212439283eafa96317f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7085b6e59d682fcd8a4057123df3970b9539f5b40acef4506347e81ac7fec5550d8183d8ec3c673c40c2d1b6525bfdffca7b3e9132e9d3f809e94c645bb4312
|
7
|
+
data.tar.gz: d6caffe30dbf26e1d496ef231110cee712e5d34b80880be6d5e51c93d8242662d2bd8ba10b4e125eaf198983c9c2d6d1a0e9554c1f7b571cf99f0c043b7b1d02
|
data/lib/nginx-conf/compiler.rb
CHANGED
@@ -29,7 +29,7 @@ class Compiler
|
|
29
29
|
|
30
30
|
def compile_hash_without_brackets hash
|
31
31
|
hash.map do |key, values|
|
32
|
-
|
32
|
+
case key
|
33
33
|
when :servers
|
34
34
|
values.map do |config|
|
35
35
|
compile_hash_item :server, [config]
|
@@ -37,13 +37,14 @@ class Compiler
|
|
37
37
|
else
|
38
38
|
compile_hash_item key, values
|
39
39
|
end
|
40
|
-
|
41
|
-
indent(s) + "\n"
|
42
40
|
end.join()
|
43
41
|
end
|
44
42
|
|
45
43
|
def compile_hash_item key, values
|
46
|
-
|
44
|
+
values = [values] if not values.is_a? Array
|
45
|
+
|
46
|
+
indent(key.to_s + ' ' + compile_elem(values) \
|
47
|
+
+ (values[-1].is_a?(Hash) ? "" : ";")) + "\n"
|
47
48
|
end
|
48
49
|
|
49
50
|
def indent line
|
data/lib/nginx-conf/conf.rb
CHANGED