chlorine 0.1.2 → 0.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/chlorine.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{chlorine}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Trevor Burnham"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-08-02}
|
13
13
|
s.description = %q{Automatically cleans out directories you specify when the server starts up.}
|
14
14
|
s.email = %q{trevor@iterative.ly}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/chlorine/clean.rb
CHANGED
@@ -8,11 +8,17 @@ module Chlorine
|
|
8
8
|
initializer "chlorine.configure_rails_initialization" do
|
9
9
|
begin
|
10
10
|
@config = YAML::load_file File.expand_path('config/chlorine.yml', RAILS_ROOT)
|
11
|
-
|
11
|
+
require_clean = @config['envs'] and @config['envs'].include? Rails.env
|
12
12
|
rescue Exception => e
|
13
13
|
puts "Chlorine was unable to read its configuration: #{e}"
|
14
14
|
end
|
15
15
|
|
16
|
+
do_clean if require_clean
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def do_clean
|
16
22
|
@config['dirs'].each do |dir_name, dir_config|
|
17
23
|
begin
|
18
24
|
dir_config['excludes'] = dir_config['excludes'].collect {|x| x[-1] == '/' ? x[0...-1] : x}
|
@@ -35,8 +41,6 @@ module Chlorine
|
|
35
41
|
end
|
36
42
|
end
|
37
43
|
|
38
|
-
private
|
39
|
-
|
40
44
|
def valid_dir_config?(dir_config)
|
41
45
|
dir_config['excludes'].each do |exclude|
|
42
46
|
next if exclude == ''
|
data/lib/chlorine/version.rb
CHANGED
@@ -3,14 +3,6 @@ module Chlorine
|
|
3
3
|
class ConfigGenerator < Rails::Generators::Base
|
4
4
|
desc 'Creates a Chlorine configuration file at config/chlorine.yml'
|
5
5
|
|
6
|
-
def self.source_root
|
7
|
-
@_mongoid_source_root ||= File.expand_path('../templates', __FILE__)
|
8
|
-
end
|
9
|
-
|
10
|
-
def app_name
|
11
|
-
Rails::Application.subclasses.first.parent.to_s.underscore
|
12
|
-
end
|
13
|
-
|
14
6
|
def create_config_file
|
15
7
|
template 'chlorine.yml', File.join('config', 'chlorine.yml')
|
16
8
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Trevor Burnham
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-08-02 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|