relevance-log_buddy 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/CHANGELOG +2 -0
- data/Rakefile +3 -0
- data/lib/log_buddy.rb +10 -6
- data/log_buddy.gemspec +6 -4
- data/spec/helper.rb +1 -1
- data/spec/log_buddy_spec.rb +9 -0
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -29,5 +29,8 @@ Rake::TestTask.new(:test) do |t|
|
|
29
29
|
t.verbose = true
|
30
30
|
end
|
31
31
|
|
32
|
+
# The below results in 'input stream exhausted' - dunno why?
|
33
|
+
# task :release => [:test, :publish_docs, :announce]
|
34
|
+
|
32
35
|
echoe.spec.add_development_dependency "allison"
|
33
36
|
echoe.spec.add_development_dependency "markaby"
|
data/lib/log_buddy.rb
CHANGED
@@ -16,7 +16,7 @@ Examples:
|
|
16
16
|
|
17
17
|
=end
|
18
18
|
class LogBuddy
|
19
|
-
VERSION = '0.1.
|
19
|
+
VERSION = '0.1.1'
|
20
20
|
|
21
21
|
# Use LogBuddy!
|
22
22
|
def self.init(options = {})
|
@@ -46,11 +46,15 @@ class LogBuddy
|
|
46
46
|
def d(msg = nil, &blk)
|
47
47
|
LogBuddy.debug(msg) if msg
|
48
48
|
return unless block_given?
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
begin
|
50
|
+
logged_line = LogBuddy.read_line(caller[0])
|
51
|
+
arguments = LogBuddy.parse_args(logged_line)
|
52
|
+
arguments.each do |arg|
|
53
|
+
result = eval(arg, blk.binding)
|
54
|
+
LogBuddy.debug(%[#{arg} = '#{result}'\n])
|
55
|
+
end
|
56
|
+
rescue Exception => e
|
57
|
+
LogBuddy.debug "LogBuddy caught an exception: #{e.message}"
|
54
58
|
end
|
55
59
|
end
|
56
60
|
|
data/log_buddy.gemspec
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
4
|
s.name = %q{log_buddy}
|
3
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.1"
|
4
6
|
|
5
7
|
s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version=
|
6
8
|
s.authors = ["Rob Sanheim - Relevance"]
|
7
|
-
s.date = %q{2008-
|
9
|
+
s.date = %q{2008-10-31}
|
8
10
|
s.description = %q{Log statements along with their name easily. Mixin a logger everywhere when you need it.}
|
9
11
|
s.email = %q{opensource@thinkrelevance.com}
|
10
12
|
s.extra_rdoc_files = ["CHANGELOG", "lib/log_buddy.rb", "LICENSE", "README.rdoc"]
|
@@ -14,14 +16,14 @@ Gem::Specification.new do |s|
|
|
14
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Log_buddy", "--main", "README.rdoc"]
|
15
17
|
s.require_paths = ["lib"]
|
16
18
|
s.rubyforge_project = %q{thinkrelevance}
|
17
|
-
s.rubygems_version = %q{1.
|
19
|
+
s.rubygems_version = %q{1.3.1}
|
18
20
|
s.summary = %q{Log Buddy is your little development buddy.}
|
19
21
|
|
20
22
|
if s.respond_to? :specification_version then
|
21
23
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
22
24
|
s.specification_version = 2
|
23
25
|
|
24
|
-
if
|
26
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
25
27
|
s.add_development_dependency(%q<echoe>, [">= 0"])
|
26
28
|
s.add_development_dependency(%q<allison>, [">= 0"])
|
27
29
|
s.add_development_dependency(%q<markaby>, [">= 0"])
|
data/spec/helper.rb
CHANGED
@@ -3,7 +3,7 @@ require "test/unit"
|
|
3
3
|
require "test/spec"
|
4
4
|
require "test/spec/should-output"
|
5
5
|
require "mocha"
|
6
|
-
require "redgreen"
|
6
|
+
require "redgreen" unless Object.const_defined?("TextMate")
|
7
7
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "log_buddy"))
|
8
8
|
|
9
9
|
def silence_warnings
|
data/spec/log_buddy_spec.rb
CHANGED
@@ -8,6 +8,10 @@ module SomeModule
|
|
8
8
|
def self.message
|
9
9
|
"hello"
|
10
10
|
end
|
11
|
+
|
12
|
+
def self.raise_exception
|
13
|
+
raise Exception
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
describe "LogBuddy" do
|
@@ -109,5 +113,10 @@ describe "LogBuddy" do
|
|
109
113
|
LogBuddy.expects(:debug).with(%[@ivar1 = '1'\n])
|
110
114
|
d { local1; local2; @ivar1 }
|
111
115
|
end
|
116
|
+
|
117
|
+
it "should gracefully handle exceptions" do
|
118
|
+
LogBuddy.expects(:debug).with('LogBuddy caught an exception: Exception')
|
119
|
+
d { SomeModule.raise_exception }
|
120
|
+
end
|
112
121
|
end
|
113
122
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relevance-log_buddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Sanheim - Relevance
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|