apache-config-generator 0.2.2.1 → 0.2.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.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.2.3. Small updates to Rake tasks.
2
+
1
3
  v0.2.2.1. Fix another stupid bug, yanking old version.
2
4
 
3
5
  v0.2.2. Fix a stupid bug, yanking old version.
data/Manifest CHANGED
@@ -1,7 +1,6 @@
1
1
  CHANGELOG
2
2
  README.rdoc
3
3
  Rakefile
4
- apache-config-generator.gemspec
5
4
  bin/apache-configurator
6
5
  config/config.reek
7
6
  lib/apache.rb
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  $LOAD_PATH << 'lib'
2
2
 
3
3
  require 'rubygems'
4
+ require 'yaml'
4
5
 
5
6
  require 'apache'
6
7
  require 'spec/rake/spectask'
@@ -2,29 +2,29 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{apache-config-generator}
5
- s.version = "0.2.2.1"
5
+ s.version = "0.2.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Bintz"]
9
- s.date = %q{2010-05-19}
9
+ s.date = %q{2010-09-15}
10
10
  s.default_executable = %q{apache-configurator}
11
11
  s.description = %q{A Ruby DSL for programmatically generating Apache configs}
12
12
  s.email = %q{}
13
13
  s.executables = ["apache-configurator"]
14
14
  s.extra_rdoc_files = ["CHANGELOG", "README.rdoc", "bin/apache-configurator", "lib/apache.rb", "lib/apache/apachify.rb", "lib/apache/config.rb", "lib/apache/directory.rb", "lib/apache/logging.rb", "lib/apache/master.rb", "lib/apache/modules.rb", "lib/apache/mpm_prefork.rb", "lib/apache/performance.rb", "lib/apache/permissions.rb", "lib/apache/rake/create.rb", "lib/apache/rewrites.rb", "lib/apache/ssl.rb"]
15
- s.files = ["CHANGELOG", "README.rdoc", "Rakefile", "apache-config-generator.gemspec", "bin/apache-configurator", "config/config.reek", "lib/apache.rb", "lib/apache/apachify.rb", "lib/apache/config.rb", "lib/apache/directory.rb", "lib/apache/logging.rb", "lib/apache/master.rb", "lib/apache/modules.rb", "lib/apache/mpm_prefork.rb", "lib/apache/performance.rb", "lib/apache/permissions.rb", "lib/apache/rake/create.rb", "lib/apache/rewrites.rb", "lib/apache/ssl.rb", "skel/Rakefile", "skel/config.yml", "Manifest"]
15
+ s.files = ["CHANGELOG", "README.rdoc", "Rakefile", "bin/apache-configurator", "config/config.reek", "lib/apache.rb", "lib/apache/apachify.rb", "lib/apache/config.rb", "lib/apache/directory.rb", "lib/apache/logging.rb", "lib/apache/master.rb", "lib/apache/modules.rb", "lib/apache/mpm_prefork.rb", "lib/apache/performance.rb", "lib/apache/permissions.rb", "lib/apache/rake/create.rb", "lib/apache/rewrites.rb", "lib/apache/ssl.rb", "skel/Rakefile", "skel/config.yml", "Manifest", "apache-config-generator.gemspec"]
16
16
  s.homepage = %q{}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Apache-config-generator", "--main", "README.rdoc"]
18
18
  s.require_paths = ["lib"]
19
19
  s.rubyforge_project = %q{apache-config-generator}
20
- s.rubygems_version = %q{1.3.6}
20
+ s.rubygems_version = %q{1.3.7}
21
21
  s.summary = %q{A Ruby DSL for programmatically generating Apache configs}
22
22
 
23
23
  if s.respond_to? :specification_version then
24
24
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
25
  s.specification_version = 3
26
26
 
27
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
28
  s.add_runtime_dependency(%q<rainbow>, [">= 0"])
29
29
  else
30
30
  s.add_dependency(%q<rainbow>, [">= 0"])
@@ -2,7 +2,12 @@
2
2
 
3
3
  require 'fileutils'
4
4
 
5
- if File.directory? ARGV[0]
5
+ if !ARGV[0]
6
+ puts "Directory name required."
7
+ exit 1
8
+ end
9
+
10
+ if File.directory?(ARGV[0])
6
11
  puts "You can't overwrite an existing directory."
7
12
  exit 1
8
13
  end
@@ -1,15 +1,30 @@
1
1
  require 'fileutils'
2
+ require 'yaml'
2
3
  require 'apache/config'
3
4
  require 'apache/rake/create'
4
- require 'yaml'
5
5
  require 'rainbow'
6
6
 
7
+ CONFIG = Hash[YAML.load_file('config.yml').collect { |k,v| [ k.to_sym, v ] }]
8
+
9
+ def get_environments
10
+ CONFIG[:source_path] = File.expand_path(CONFIG[:source])
11
+
12
+ Dir[File.join(CONFIG[:source_path], '**', '*.rb')].collect { |file|
13
+ File.readlines(file).find_all { |line| line[%r{(if_environment|build_if)}] }.collect { |line| line.scan(%r{:[a-z_]+}) }
14
+ }.flatten.uniq.sort.collect { |name| name[1..-1] }
15
+ end
16
+
7
17
  namespace :apache do
8
18
  desc "Create all defined configs for the specified environment"
9
19
  task :create, :environment do |t, args|
10
- APACHE_ENV = (args[:environment] || 'production').to_sym
20
+ if !args[:environment]
21
+ puts "You need to specify an environment. Available environments:"
22
+ puts
23
+ puts get_environments.collect { |env| "rake apache:create[#{env}]" } * "\n"
24
+ exit 1
25
+ end
11
26
 
12
- CONFIG = Hash[YAML.load_file('config.yml').collect { |k,v| [ k.to_sym, v ] }]
27
+ APACHE_ENV = (args[:environment] || 'production').to_sym
13
28
 
14
29
  CONFIG[:source_path] = File.expand_path(CONFIG[:source])
15
30
  CONFIG[:dest_path] = File.expand_path(CONFIG[:destination])
@@ -24,4 +39,9 @@ namespace :apache do
24
39
  require file
25
40
  end
26
41
  end
42
+
43
+ desc "List all possible environments"
44
+ task :environments do
45
+ puts get_environments * "\n"
46
+ end
27
47
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apache-config-generator
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 17
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 2
8
- - 2
9
- - 1
10
- version: 0.2.2.1
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Bintz
@@ -15,16 +15,18 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-19 00:00:00 -04:00
18
+ date: 2010-09-15 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rainbow
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 3
28
30
  segments:
29
31
  - 0
30
32
  version: "0"
@@ -57,7 +59,6 @@ files:
57
59
  - CHANGELOG
58
60
  - README.rdoc
59
61
  - Rakefile
60
- - apache-config-generator.gemspec
61
62
  - bin/apache-configurator
62
63
  - config/config.reek
63
64
  - lib/apache.rb
@@ -76,6 +77,7 @@ files:
76
77
  - skel/Rakefile
77
78
  - skel/config.yml
78
79
  - Manifest
80
+ - apache-config-generator.gemspec
79
81
  has_rdoc: true
80
82
  homepage: ""
81
83
  licenses: []
@@ -91,16 +93,20 @@ rdoc_options:
91
93
  require_paths:
92
94
  - lib
93
95
  required_ruby_version: !ruby/object:Gem::Requirement
96
+ none: false
94
97
  requirements:
95
98
  - - ">="
96
99
  - !ruby/object:Gem::Version
100
+ hash: 3
97
101
  segments:
98
102
  - 0
99
103
  version: "0"
100
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
+ none: false
101
106
  requirements:
102
107
  - - ">="
103
108
  - !ruby/object:Gem::Version
109
+ hash: 11
104
110
  segments:
105
111
  - 1
106
112
  - 2
@@ -108,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
114
  requirements: []
109
115
 
110
116
  rubyforge_project: apache-config-generator
111
- rubygems_version: 1.3.6
117
+ rubygems_version: 1.3.7
112
118
  signing_key:
113
119
  specification_version: 3
114
120
  summary: A Ruby DSL for programmatically generating Apache configs