tomahawk 0.0.2 → 0.0.3
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/README.md +1 -1
- data/lib/tomahawk/generators/httpd.rb +2 -1
- data/lib/tomahawk/version.rb +1 -1
- data/spec/lib/tomahawk/config_parser_spec.rb +8 -2
- 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: bdedd4162b4541f5585a387a2c57f58c3df00e99
|
4
|
+
data.tar.gz: 14466f1fa3b839d42cadebcbfe4eaeb0cd9d76c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c92bf8f091b9f09c4f8ff3f16f881a2ca7c647fdc2185646a082f556ba8e22bf2763547abef2b41d81434006b3f39fd0a8650bf032c9e9f80147870020fd83be
|
7
|
+
data.tar.gz: 69ce697949fe15130a26fc760a8c590fb38b6b971df899841b9f86ecf72a6f9ade930caa00b12385a8a46472147d088e23f202274109663d94f9686989814a1a
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Tomahawk helps generating and parsing Apache 2 configuration files. You can for example parse VirtualHost configs, CRUD some directives in your Ruby code and generate a new config file out of it afterwards.
|
4
4
|
|
5
|
-
**This gem is still
|
5
|
+
**This gem is still in an early alpha stage and may change it's API faster than you blink. Still any contributions are highly appreciated.**
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
data/lib/tomahawk/version.rb
CHANGED
@@ -2,6 +2,8 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Tomahawk::ConfigParser do
|
4
4
|
it "parses Vhost files correctly" do
|
5
|
+
httpd = Tomahawk::DirectiveGroups::HTTPd.new
|
6
|
+
|
5
7
|
google_com = Tomahawk::DirectiveGroups::VirtualHost.new('173.194.35.174:80', 'server_name' => 'google.com', 'server_alias' => 'www.google.com', 'document_root' => '/var/www/google.com')
|
6
8
|
google_com.groups << Tomahawk::DirectiveGroups::Directory.new('/var/www/google.com', 'options' => '-Indexes FollowSymLinks MultiViews', 'allow_override' => 'AuthConfig Limit Indexes Options=All,MultiViews FileInfo')
|
7
9
|
|
@@ -9,12 +11,16 @@ describe Tomahawk::ConfigParser do
|
|
9
11
|
github_com.groups << Tomahawk::DirectiveGroups::Directory.new('/var/www/github.com', 'options' => '-Indexes FollowSymLinks MultiViews', 'allow_override' => 'AuthConfig Indexes Options=All FileInfo')
|
10
12
|
github_com.groups << Tomahawk::DirectiveGroups::Directory.new('/var/www/github.com/private', 'order' => 'allow, deny', 'allow' => 'from all')
|
11
13
|
|
12
|
-
|
14
|
+
|
15
|
+
httpd.groups << google_com
|
16
|
+
httpd.groups << github_com
|
17
|
+
|
18
|
+
config = Tomahawk::ConfigParser.new(httpd.to_conf.to_s)
|
13
19
|
|
14
20
|
|
15
21
|
config.call
|
16
22
|
|
17
|
-
expect(config.result
|
23
|
+
expect(config.result).to eq(httpd)
|
18
24
|
end
|
19
25
|
end
|
20
26
|
|