quick-debug 0.1.0 → 0.1.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/lib/quick-debug.rb +10 -1
- data/lib/quick-debug/version.rb +1 -1
- metadata +4 -4
data/lib/quick-debug.rb
CHANGED
@@ -5,6 +5,7 @@ require "#{File.dirname(Pathname.new(__FILE__).realpath)}/quick-debug/version"
|
|
5
5
|
class D
|
6
6
|
@@logpath = '/tmp/quick-debug.txt'
|
7
7
|
@@active = {:bg => true, :lg => true}
|
8
|
+
@@print_separator = true
|
8
9
|
|
9
10
|
def self.disable where
|
10
11
|
locations = if where == :all
|
@@ -37,7 +38,8 @@ class D
|
|
37
38
|
return if !@@active[:lg] && command != :force
|
38
39
|
timestamp = Time.now.strftime("%a %H:%M:%S")
|
39
40
|
File.open(@@logpath, 'a+') do |f|
|
40
|
-
f
|
41
|
+
print_separator_if_needed f
|
42
|
+
f.puts "[#{timestamp}] #{eval_inspect(caller[1], &block)}"
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
@@ -47,6 +49,13 @@ class D
|
|
47
49
|
|
48
50
|
private
|
49
51
|
|
52
|
+
def self.print_separator_if_needed file
|
53
|
+
if @@print_separator
|
54
|
+
file.puts "\n\n#{'=' * 70}\n\n"
|
55
|
+
@@print_separator = false
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
50
59
|
def self.eval_inspect(caller_string, &block)
|
51
60
|
outputs = ["[#{strip_filepath caller_string}]"]
|
52
61
|
if block
|
data/lib/quick-debug/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quick-debug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Suan-Aik Yeo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-01-
|
18
|
+
date: 2013-01-24 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: Debug your Ruby code with just a few keystrokes!
|