nginx_config_generator 1.3 → 1.4
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.
- data/Rakefile +1 -1
- data/lib/nginx_config_generator.rb +9 -1
- data/nginx_config_generator.gemspec +4 -4
- metadata +2 -2
data/Rakefile
CHANGED
@@ -17,7 +17,15 @@ error "Usage: generate_nginx_config [config file] [out file]" if ARGV.empty? &&
|
|
17
17
|
overwrite = %w(-y -o -f --force --overwrite).any? { |f| ARGV.delete(f) }
|
18
18
|
|
19
19
|
config = YAML.load(ERB.new(File.read(env_in || ARGV.shift || 'config.yml')).result)
|
20
|
-
template =
|
20
|
+
template = if custom_template_index = (ARGV.index('--template') || ARGV.index('-t'))
|
21
|
+
custom = ARGV[custom_template_index+1]
|
22
|
+
error "=> Specified template file #{custom} does not exist." unless File.exist?(custom)
|
23
|
+
ARGV.delete_at(custom_template_index) # delete the --argument
|
24
|
+
ARGV.delete_at(custom_template_index) # and its value
|
25
|
+
custom
|
26
|
+
else
|
27
|
+
file:'nginx.erb'
|
28
|
+
end
|
21
29
|
|
22
30
|
if File.exists?(out_file = env_out || ARGV.shift || 'nginx.conf') && !overwrite
|
23
31
|
error "=> #{out_file} already exists, won't overwrite it. Quitting."
|
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Nginx_config_generator-1.
|
2
|
+
# Gem::Specification for Nginx_config_generator-1.4
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{nginx_config_generator}
|
7
|
-
s.version = "1.
|
8
|
-
s.date = %q{2007-
|
7
|
+
s.version = "1.4"
|
8
|
+
s.date = %q{2007-10-16}
|
9
9
|
s.summary = %q{}
|
10
10
|
s.email = %q{chris@ozmm.org}
|
11
11
|
s.homepage = %q{http://require.errtheblog.com/projects}
|
@@ -24,7 +24,7 @@ end
|
|
24
24
|
# require 'rubygems'
|
25
25
|
# require 'echoe'
|
26
26
|
#
|
27
|
-
# Echoe.new('nginx_config_generator', '1.
|
27
|
+
# Echoe.new('nginx_config_generator', '1.4') do |p|
|
28
28
|
# p.rubyforge_name = 'err'
|
29
29
|
# p.author = 'Chris Wanstrath'
|
30
30
|
# p.email = 'chris@ozmm.org'
|
metadata
CHANGED