mediashelf-loggable 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +12 -13
- data/VERSION +1 -1
- data/lib/loggable/log_methods.rb +2 -4
- data/mediashelf-loggable.gemspec +2 -3
- data/test/examples/log_methods_test.rb +1 -35
- metadata +4 -5
- data/loggable.gemspec +0 -30
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,22 +1,23 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
mediashelf-loggable (0.4.6)
|
5
|
+
|
1
6
|
GEM
|
2
7
|
remote: http://rubygems.org/
|
3
8
|
specs:
|
4
9
|
RedCloth (4.2.7)
|
5
10
|
columnize (0.3.4)
|
6
|
-
gemcutter (0.6.1)
|
7
11
|
git (1.2.5)
|
8
|
-
jeweler (1.4
|
9
|
-
|
12
|
+
jeweler (1.6.4)
|
13
|
+
bundler (~> 1.0)
|
10
14
|
git (>= 1.2.5)
|
11
|
-
|
15
|
+
rake
|
12
16
|
jnunemaker-matchy (0.4.0)
|
13
|
-
json_pure (1.4.6)
|
14
17
|
linecache (0.46)
|
15
18
|
rbx-require-relative (> 0.0.4)
|
16
|
-
|
17
|
-
|
18
|
-
rake
|
19
|
-
rake (0.8.7)
|
19
|
+
mocha (0.9.12)
|
20
|
+
rake (0.9.2)
|
20
21
|
rbx-require-relative (0.0.5)
|
21
22
|
rcov (0.9.9)
|
22
23
|
ruby-debug (0.10.4)
|
@@ -24,10 +25,8 @@ GEM
|
|
24
25
|
ruby-debug-base (~> 0.10.4.0)
|
25
26
|
ruby-debug-base (0.10.4)
|
26
27
|
linecache (>= 0.3)
|
27
|
-
rubyforge (2.0.4)
|
28
|
-
json_pure (>= 1.1.7)
|
29
28
|
thoughtbot-shoulda (2.11.1)
|
30
|
-
yard (0.
|
29
|
+
yard (0.7.2)
|
31
30
|
|
32
31
|
PLATFORMS
|
33
32
|
ruby
|
@@ -36,7 +35,7 @@ DEPENDENCIES
|
|
36
35
|
RedCloth
|
37
36
|
jeweler
|
38
37
|
jnunemaker-matchy
|
39
|
-
|
38
|
+
mediashelf-loggable!
|
40
39
|
mocha
|
41
40
|
rcov
|
42
41
|
ruby-debug
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.7
|
data/lib/loggable/log_methods.rb
CHANGED
@@ -20,10 +20,8 @@ module Loggable
|
|
20
20
|
def logger
|
21
21
|
|
22
22
|
if defined?(::Rails) && ::Rails.respond_to?(:version)
|
23
|
-
if ::Rails.version >= "
|
23
|
+
if ::Rails.version >= "2.1" && !::Rails.logger.nil?
|
24
24
|
@@logger = ::Rails.logger
|
25
|
-
elsif ::Rails.version < "3.0"
|
26
|
-
@@logger = RAILS_DEFAULT_LOGGER
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
@@ -41,4 +39,4 @@ module Loggable
|
|
41
39
|
end
|
42
40
|
end
|
43
41
|
|
44
|
-
end
|
42
|
+
end
|
data/mediashelf-loggable.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mediashelf-loggable}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Patrick Reagan}, %q{Matt Zumwalt}]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-08-01}
|
13
13
|
s.description = %q{A gem that provides logging capabilities to any class. Relies on Rails logger if it's available. Extended from loggable gem by viget}
|
14
14
|
s.email = %q{matt.zumwalt@yourmediashelf.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -28,7 +28,6 @@ Gem::Specification.new do |s|
|
|
28
28
|
"lib/loggable/log_methods.rb",
|
29
29
|
"lib/loggable/logger_stub.rb",
|
30
30
|
"lib/tasks/loggable.rake",
|
31
|
-
"loggable.gemspec",
|
32
31
|
"mediashelf-loggable.gemspec",
|
33
32
|
"test/examples/log_methods_test.rb",
|
34
33
|
"test/examples/logger_stub_test.rb",
|
@@ -68,40 +68,6 @@ class LogMethodsTest < Test::Unit::TestCase
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
|
72
|
-
context "MyModule in Rails2" do
|
73
|
-
setup do
|
74
|
-
class ::Rails
|
75
|
-
def self.version
|
76
|
-
return "2.8.5"
|
77
|
-
end
|
78
|
-
end
|
79
|
-
module ::ActiveSupport
|
80
|
-
class BufferedLogger
|
81
|
-
def initialize(arg)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
Object.const_set(:RAILS_DEFAULT_LOGGER, ActiveSupport::BufferedLogger.new(STDOUT))
|
86
|
-
# ::RAILS_DEFAULT_LOGGER =
|
87
|
-
end
|
88
|
-
|
89
|
-
teardown do
|
90
|
-
Object.send(:remove_const, :Rails)
|
91
|
-
Object.send(:remove_const, :ActiveSupport)
|
92
|
-
Object.send(:remove_const, :RAILS_DEFAULT_LOGGER)
|
93
|
-
end
|
94
|
-
|
95
|
-
should "use Rails2 logger" do
|
96
|
-
MyModule.logger = nil
|
97
|
-
MyModule.logger.should == ::RAILS_DEFAULT_LOGGER
|
98
|
-
end
|
99
|
-
should "switch to using Rails2 logger even if a default logger was already defined" do
|
100
|
-
MyModule.logger = Logger.new(STDOUT)
|
101
|
-
MyModule.logger.should == ::RAILS_DEFAULT_LOGGER
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
71
|
context "MyModule in Rails3" do
|
106
72
|
setup do
|
107
73
|
module ::Rails
|
@@ -128,4 +94,4 @@ class LogMethodsTest < Test::Unit::TestCase
|
|
128
94
|
MyModule.logger.should == Rails.logger
|
129
95
|
end
|
130
96
|
end
|
131
|
-
end
|
97
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mediashelf-loggable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 7
|
10
|
+
version: 0.4.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Patrick Reagan
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-08-01 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: thoughtbot-shoulda
|
@@ -53,7 +53,6 @@ files:
|
|
53
53
|
- lib/loggable/log_methods.rb
|
54
54
|
- lib/loggable/logger_stub.rb
|
55
55
|
- lib/tasks/loggable.rake
|
56
|
-
- loggable.gemspec
|
57
56
|
- mediashelf-loggable.gemspec
|
58
57
|
- test/examples/log_methods_test.rb
|
59
58
|
- test/examples/logger_stub_test.rb
|
data/loggable.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{loggable}
|
5
|
-
s.version = "0.3.0"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Patrick Reagan"]
|
9
|
-
s.date = %q{2009-04-28}
|
10
|
-
s.email = %q{patrick.reagan@viget.com}
|
11
|
-
s.extra_rdoc_files = ["README.rdoc"]
|
12
|
-
s.files = ["README.rdoc", "Rakefile", "lib/loggable", "lib/loggable/log_methods.rb", "lib/loggable/logger_stub.rb", "lib/loggable/version.rb", "lib/loggable.rb", "test/examples", "test/examples/log_methods_test.rb", "test/examples/logger_stub_test.rb", "test/test_helper.rb"]
|
13
|
-
s.has_rdoc = true
|
14
|
-
s.homepage = %q{http://viget.com/extend}
|
15
|
-
s.rdoc_options = ["--main", "README.rdoc"]
|
16
|
-
s.require_paths = ["lib"]
|
17
|
-
s.rubyforge_project = %q{viget}
|
18
|
-
s.rubygems_version = %q{1.3.2}
|
19
|
-
s.summary = %q{A gem that provides logging capabilities to any class}
|
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::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
26
|
-
else
|
27
|
-
end
|
28
|
-
else
|
29
|
-
end
|
30
|
-
end
|