chlorine 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/chlorine.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chlorine}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
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"]
@@ -7,8 +7,9 @@ module Chlorine
7
7
 
8
8
  initializer "chlorine.configure_rails_initialization" do
9
9
  begin
10
- @config = YAML::load_file File.expand_path('config/chlorine.yml', RAILS_ROOT)
11
- require_clean = @config['envs'] and @config['envs'].include? Rails.env
10
+ @config = YAML::load_file File.expand_path('config/chlorine.yml', Rails.root)
11
+ return unless @config && @config['envs']
12
+ require_clean = (@config['envs'].collect {|env| env.downcase}).include? Rails.env
12
13
  rescue Exception => e
13
14
  puts "Chlorine was unable to read its configuration: #{e}"
14
15
  end
@@ -23,11 +24,11 @@ module Chlorine
23
24
  begin
24
25
  dir_config['excludes'] = dir_config['excludes'].collect {|x| x[-1] == '/' ? x[0...-1] : x}
25
26
  next unless valid_dir_config? dir_config
26
- next unless Dir.exists? File.expand_path(dir_name, RAILS_ROOT)
27
- dir = Dir.new File.expand_path(dir_name, RAILS_ROOT)
27
+ next unless Dir.exists? File.expand_path(dir_name, Rails.root)
28
+ dir = Dir.new File.expand_path(dir_name, Rails.root)
28
29
  dir.each { |filename|
29
30
  unless (['.', '..'] + dir_config['excludes']).include?(filename)
30
- filepath = File.expand_path(dir_name + '/' + filename, RAILS_ROOT)
31
+ filepath = File.expand_path(dir_name + '/' + filename, Rails.root)
31
32
  if File.file?(filepath)
32
33
  File.delete filepath
33
34
  elsif File.directory?(filepath)
@@ -36,7 +37,7 @@ module Chlorine
36
37
  end
37
38
  }
38
39
  rescue Exception => e
39
- puts "Chlorine hit an exception: #{e}"
40
+ puts "Chlorine hit an exception while cleaning: #{e}"
40
41
  end
41
42
  end
42
43
  end
@@ -2,7 +2,7 @@ module Chlorine
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 4
5
+ PATCH = 5
6
6
  STRING = [MAJOR, MINOR, PATCH].join(".")
7
7
  end
8
8
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Trevor Burnham