cowtech-rails 2.3.0.1 → 2.3.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ module Cowtech
16
16
  IO.popen(cmd) do |f| print f.gets end
17
17
  end
18
18
 
19
- def self.rotate
19
+ def self.rotate(email_class = nil)
20
20
  puts "Rotating log files..."
21
21
 
22
22
  # Get timestamp
@@ -33,9 +33,8 @@ module Cowtech
33
33
  new_file = generate_new_name(new_name, i)
34
34
 
35
35
  # Send file via mail
36
- @email_class = defined?(Common::EMail) ? Common::EMail : EMail
37
- @email_class.log_report(log_file).deliver if Rails.env == "production"
38
-
36
+ email_class.constantize.log_report(log_file).deliver if Rails.env == "production" && email_class.present?
37
+
39
38
  # Copy file
40
39
  FileUtils.cp(log_file, new_file)
41
40
 
@@ -66,8 +65,8 @@ end
66
65
 
67
66
  namespace :log do
68
67
  desc "Rotates log files"
69
- task :rotate => :environment do |task|
70
- Cowtech::RubyOnRails::LogUtils.rotate
68
+ task :rotate => [:email_class] => [:environment] do |task, args|
69
+ Cowtech::RubyOnRails::LogUtils.rotate(args[:email_class])
71
70
  end
72
71
 
73
72
  desc "Clean every log file"
@@ -10,7 +10,7 @@ module Cowtech
10
10
  MAJOR = 2
11
11
  MINOR = 3
12
12
  PATCH = 0
13
- BUILD = 1
13
+ BUILD = 2
14
14
 
15
15
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cowtech-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.1
4
+ version: 2.3.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-16 00:00:00.000000000Z
12
+ date: 2011-11-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cowtech-extensions
16
- requirement: &70302379849120 !ruby/object:Gem::Requirement
16
+ requirement: &70226223573120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70302379849120
24
+ version_requirements: *70226223573120
25
25
  description: A general purpose Rails utility plugin.
26
26
  email: shogun_panda@me.com
27
27
  executables: []