pangdudu-rofl 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rofl.rb +17 -0
- data/lib/test_rofl.rb +1 -0
- metadata +2 -2
data/lib/rofl.rb
CHANGED
@@ -22,26 +22,40 @@ module Rofl
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
#set the debug level
|
27
|
+
def rofl_log_level level=""
|
28
|
+
@logger.level = Logger::DEBUG if level.eql? "debug"
|
29
|
+
@logger.level = Logger::INFO if level.eql? "info"
|
30
|
+
@logger.level = Logger::WARN if level.eql? "warning"
|
31
|
+
@logger.level = Logger::ERROR if level.eql? "error"
|
32
|
+
puts "ROFL-LOG-LEVEL: #{@logger.level}"
|
33
|
+
end
|
34
|
+
|
25
35
|
#error message
|
26
36
|
def elog text="error"
|
27
37
|
rofl_logger_check #check if logger is setup
|
28
38
|
@logger.error "#{@debugname}.#{rofl_meth_trace.to_s}: #{text.to_s}"
|
29
39
|
end
|
40
|
+
|
30
41
|
#warning
|
31
42
|
def wlog text="warning"
|
32
43
|
rofl_logger_check #check if logger is setup
|
33
44
|
@logger.warn "#{@debugname}.#{rofl_meth_trace.to_s}: #{text.to_s}"
|
34
45
|
end
|
46
|
+
|
35
47
|
#info message
|
36
48
|
def ilog text="info"
|
37
49
|
rofl_logger_check #check if logger is setup
|
38
50
|
@logger.info "#{@debugname}.#{rofl_meth_trace.to_s}: #{text.to_s}"
|
39
51
|
end
|
52
|
+
|
40
53
|
#debug message
|
41
54
|
def dlog text="debug"
|
42
55
|
rofl_logger_check #check if logger is setup
|
43
56
|
@logger.debug "#{@debugname}.#{rofl_meth_trace.to_s}: #{text.to_s}"
|
44
57
|
end
|
58
|
+
|
45
59
|
#get method call trace
|
46
60
|
def rofl_meth_trace
|
47
61
|
last_meth_name = "notrace"
|
@@ -53,6 +67,7 @@ module Rofl
|
|
53
67
|
last_meth_name = last_meth_name.delete("\'") unless last_meth_name.nil?
|
54
68
|
return last_meth_name
|
55
69
|
end
|
70
|
+
|
56
71
|
#check if we or an object are ready to rofl
|
57
72
|
def rofl? object=self
|
58
73
|
has_rofl = (defined? object.rofl?).eql? "method"
|
@@ -60,7 +75,9 @@ module Rofl
|
|
60
75
|
return has_rofl
|
61
76
|
end
|
62
77
|
end
|
78
|
+
|
63
79
|
#finally we just include ourselves, a little dirty ... what the hell :)
|
64
80
|
include Rofl
|
81
|
+
|
65
82
|
#and check, if we're ready to go
|
66
83
|
rofl_logger_check
|
data/lib/test_rofl.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pangdudu-rofl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pangdudu
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-29 00:00:00 -07:00
|
13
13
|
default_executable: rofl
|
14
14
|
dependencies: []
|
15
15
|
|