logbackup 0.0.1
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/Manifest +4 -0
- data/README +25 -0
- data/Rakefile +10 -0
- data/lib/logbackup.rb +16 -0
- data/logbackup.gemspec +30 -0
- metadata +78 -0
data/Manifest
ADDED
data/README
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Simple Log backup
|
2
|
+
|
3
|
+
USAGE:
|
4
|
+
|
5
|
+
gem install logbackup
|
6
|
+
require 'rubygems'
|
7
|
+
require 'yaml'
|
8
|
+
require 'lib/logbackup'
|
9
|
+
|
10
|
+
config = "/user/log/"
|
11
|
+
|
12
|
+
LOG_DIRECTORY_PATH = config['log_directory']
|
13
|
+
|
14
|
+
|
15
|
+
class Logbackup
|
16
|
+
|
17
|
+
p "-----------Start-------------"
|
18
|
+
|
19
|
+
logbackup = LogbackUp.new "development.log","#{Time.now}_development.log",LOG_DIRECTORY_PATH
|
20
|
+
logbackup.renamefile
|
21
|
+
logbackup.createfile
|
22
|
+
p "--------------End---------------"
|
23
|
+
end
|
24
|
+
|
25
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'echoe'
|
4
|
+
|
5
|
+
Echoe.new('logbackup', '0.0.1') do |p|
|
6
|
+
p.description = 'Simple Log backup'
|
7
|
+
p.url = 'http://github.com/shrisowdhaman/logbackup'
|
8
|
+
p.author = 'ShriSowdhaman'
|
9
|
+
p.email = 'shrisowdhaman@gmail.com'
|
10
|
+
end
|
data/lib/logbackup.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
class LogbackUp
|
2
|
+
|
3
|
+
def initialize(filename,filerename,dir)
|
4
|
+
@filename = filename
|
5
|
+
@rename = filerename
|
6
|
+
@dir = dir
|
7
|
+
end
|
8
|
+
|
9
|
+
def renamefile
|
10
|
+
File.rename("#{@dir}/#{@filename}","#{@dir}/#{@rename}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def createfile
|
14
|
+
File.new("#{@dir}/#{@filename}", "w")
|
15
|
+
end
|
16
|
+
end
|
data/logbackup.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{logbackup}
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["ShriSowdhaman"]
|
9
|
+
s.date = %q{2010-10-22}
|
10
|
+
s.description = %q{Simple Log backup}
|
11
|
+
s.email = %q{shrisowdhaman@gmail.com}
|
12
|
+
s.extra_rdoc_files = ["README", "lib/logbackup.rb"]
|
13
|
+
s.files = ["README", "Rakefile", "lib/logbackup.rb", "Manifest", "logbackup.gemspec"]
|
14
|
+
s.homepage = %q{http://github.com/shrisowdhaman/logbackup}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Logbackup", "--main", "README"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{logbackup}
|
18
|
+
s.rubygems_version = %q{1.3.7}
|
19
|
+
s.summary = %q{Simple Log backup}
|
20
|
+
|
21
|
+
if s.respond_to? :specification_version then
|
22
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logbackup
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- ShriSowdhaman
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-22 00:00:00 +05:30
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: Simple Log backup
|
23
|
+
email: shrisowdhaman@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files:
|
29
|
+
- README
|
30
|
+
- lib/logbackup.rb
|
31
|
+
files:
|
32
|
+
- README
|
33
|
+
- Rakefile
|
34
|
+
- lib/logbackup.rb
|
35
|
+
- Manifest
|
36
|
+
- logbackup.gemspec
|
37
|
+
has_rdoc: true
|
38
|
+
homepage: http://github.com/shrisowdhaman/logbackup
|
39
|
+
licenses: []
|
40
|
+
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options:
|
43
|
+
- --line-numbers
|
44
|
+
- --inline-source
|
45
|
+
- --title
|
46
|
+
- Logbackup
|
47
|
+
- --main
|
48
|
+
- README
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
hash: 11
|
66
|
+
segments:
|
67
|
+
- 1
|
68
|
+
- 2
|
69
|
+
version: "1.2"
|
70
|
+
requirements: []
|
71
|
+
|
72
|
+
rubyforge_project: logbackup
|
73
|
+
rubygems_version: 1.3.7
|
74
|
+
signing_key:
|
75
|
+
specification_version: 3
|
76
|
+
summary: Simple Log backup
|
77
|
+
test_files: []
|
78
|
+
|