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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 924e83450b374686420c3fa3025dba6086dc17ef
4
- data.tar.gz: 5d0e676d279958e90f38b66a42723907dab06338
3
+ metadata.gz: bdedd4162b4541f5585a387a2c57f58c3df00e99
4
+ data.tar.gz: 14466f1fa3b839d42cadebcbfe4eaeb0cd9d76c2
5
5
  SHA512:
6
- metadata.gz: b7b765b43509106622ce490fc3249a37961da75441fe453a73ca85e71875499b6b009c47345d0feed2f7006872f2d5bbe654d6dc120d6f4d9d8bb6de699dec50
7
- data.tar.gz: e9e6c0c9ce6bb79b68b2eeef80f3dc27a803a787f87c017acbbcdd3dab48cc889fdc0ae20839988bf20f1aac28b1233cc7ece288b2f1112f13f9bec0c7345d63
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 under an early alpha stage and may change it's API faster than you blink. Still any contributions are highly appreciated.**
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
 
@@ -14,11 +14,12 @@ module Tomahawk
14
14
  end
15
15
 
16
16
  @httpd.groups.each do |group|
17
- config += group.to_str
17
+ config += group.to_conf
18
18
  end
19
19
 
20
20
  config
21
21
  end
22
+ alias_method :to_s, :to_str
22
23
  end
23
24
  end
24
25
  end
@@ -1,3 +1,3 @@
1
1
  module Tomahawk
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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
- config = Tomahawk::ConfigParser.new(google_com.to_conf.to_s + github_com.to_conf.to_s)
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.groups).to eq([google_com, github_com])
23
+ expect(config.result).to eq(httpd)
18
24
  end
19
25
  end
20
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomahawk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Schell