cowtech-rails 2.3.0.1 → 2.3.0.2
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/lib/cowtech/tasks/log.rake +5 -6
- data/lib/cowtech/version.rb +1 -1
- metadata +4 -4
data/lib/cowtech/tasks/log.rake
CHANGED
@@ -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
|
-
|
37
|
-
|
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"
|
data/lib/cowtech/version.rb
CHANGED
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.
|
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-
|
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: &
|
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: *
|
24
|
+
version_requirements: *70226223573120
|
25
25
|
description: A general purpose Rails utility plugin.
|
26
26
|
email: shogun_panda@me.com
|
27
27
|
executables: []
|