vhost_writer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/vhost_writer/cli.rb +1 -1
- data/lib/vhost_writer/version.rb +1 -1
- data/lib/vhost_writer/writer.rb +1 -1
- data/spec/test/sites-available/.keep +0 -0
- data/spec/writer_spec.rb +2 -2
- metadata +4 -2
data/README.md
CHANGED
@@ -18,7 +18,7 @@ Automatically generate virtual host config files based on a directory of sites a
|
|
18
18
|
|
19
19
|
### Example
|
20
20
|
|
21
|
-
vhost_writer write /srv/www/ /etc/apache2/sites-available/ /home/bok/template.erb
|
21
|
+
$ vhost_writer write /srv/www/ /etc/apache2/sites-available/ /home/bok/template.erb
|
22
22
|
|
23
23
|
### Template Example
|
24
24
|
|
data/lib/vhost_writer/cli.rb
CHANGED
@@ -8,7 +8,7 @@ module VhostWriter
|
|
8
8
|
CONFIG_DIRECTORY using TEMPLATE'
|
9
9
|
def write(sites_dir, conf_dir, template)
|
10
10
|
writer = VhostWriter::Writer.new :sites_dir => sites_dir, :conf_dir => conf_dir
|
11
|
-
writer.
|
11
|
+
writer.write_configs! File.read template
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/vhost_writer/version.rb
CHANGED
data/lib/vhost_writer/writer.rb
CHANGED
@@ -27,7 +27,7 @@ module VhostWriter
|
|
27
27
|
Writer.new :conf_dir => @conf_dir, :sites => site_whitelist - (@sites - site_whitelist)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def write_configs!(template)
|
31
31
|
@sites.each do |site|
|
32
32
|
File.open("#{@conf_dir}#{site}", 'w') do |f|
|
33
33
|
f.write ERB.new(template).result(binding)
|
File without changes
|
data/spec/writer_spec.rb
CHANGED
@@ -59,8 +59,8 @@ describe VhostWriter::Writer do
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
describe '#
|
63
|
-
before { writer.
|
62
|
+
describe '#write_configs!' do
|
63
|
+
before { writer.write_configs! template }
|
64
64
|
let(:results_dir_contents) { Dir.glob('spec/test/sites-available/*').map { |f| File.basename f } }
|
65
65
|
|
66
66
|
it 'should write config files' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vhost_writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- spec/cli_spec.rb
|
66
66
|
- spec/spec_helper.rb
|
67
67
|
- spec/test/expected/example.com
|
68
|
+
- spec/test/sites-available/.keep
|
68
69
|
- spec/test/templates/template.erb
|
69
70
|
- spec/test/www/example.com/.keep
|
70
71
|
- spec/test/www/example.org/.keep
|
@@ -100,6 +101,7 @@ test_files:
|
|
100
101
|
- spec/cli_spec.rb
|
101
102
|
- spec/spec_helper.rb
|
102
103
|
- spec/test/expected/example.com
|
104
|
+
- spec/test/sites-available/.keep
|
103
105
|
- spec/test/templates/template.erb
|
104
106
|
- spec/test/www/example.com/.keep
|
105
107
|
- spec/test/www/example.org/.keep
|