lumber 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/lib/lumber/prevent_rails_override.rb +22 -3
- data/lib/lumber/version.rb +1 -1
- data/spec/prevent_rails_override_spec.rb +24 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52f2f551d156ddf2cac81cc1fd65175a58e6cb57
|
4
|
+
data.tar.gz: 24d93d72aa28bf70a8b56be3996f00a7b3354d31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04fea1c9766af3d4e05a8fc87dd00fd9337f77901475947c3860d686fe5fbe1373ac85d69955357d54d3e3bfc00e05caa6db3f5696e9dd125d23763b9b862b28
|
7
|
+
data.tar.gz: 8574b553f1ed8f1d77e6facd45d5a9ac3820272430116333552fe3b638e4d7901a6051bee9048c6747255569c9fb886b753329322f97603bac017a27865c0baa
|
data/CHANGELOG
CHANGED
@@ -11,11 +11,30 @@ module Lumber
|
|
11
11
|
|
12
12
|
class << self
|
13
13
|
# Prevent rails from overwriting our logger
|
14
|
-
def
|
14
|
+
def cattr_reader_with_lumber(*syms)
|
15
15
|
without_logger = syms.reject {|s| s == :logger}
|
16
|
-
|
16
|
+
cattr_reader_without_lumber(*without_logger)
|
17
17
|
end
|
18
|
-
alias_method_chain :
|
18
|
+
alias_method_chain :cattr_reader, :lumber
|
19
|
+
|
20
|
+
def cattr_writer_with_lumber(*syms)
|
21
|
+
without_logger = syms.reject {|s| s == :logger}
|
22
|
+
cattr_writer_without_lumber(*without_logger)
|
23
|
+
end
|
24
|
+
alias_method_chain :cattr_writer, :lumber
|
25
|
+
|
26
|
+
def mattr_reader_with_lumber(*syms)
|
27
|
+
without_logger = syms.reject {|s| s == :logger}
|
28
|
+
mattr_reader_without_lumber(*without_logger)
|
29
|
+
end
|
30
|
+
alias_method_chain :mattr_reader, :lumber
|
31
|
+
|
32
|
+
def mattr_writer_with_lumber(*syms)
|
33
|
+
without_logger = syms.reject {|s| s == :logger}
|
34
|
+
mattr_writer_without_lumber(*without_logger)
|
35
|
+
end
|
36
|
+
alias_method_chain :mattr_writer, :lumber
|
37
|
+
|
19
38
|
end
|
20
39
|
|
21
40
|
end
|
data/lib/lumber/version.rb
CHANGED
@@ -8,7 +8,8 @@ describe Lumber::PreventRailsOverride do
|
|
8
8
|
Foo1.class_eval do
|
9
9
|
cattr_accessor :logger
|
10
10
|
end
|
11
|
-
|
11
|
+
Foo1.method_defined?(:logger).should be_false
|
12
|
+
Foo1.method_defined?(:logger=).should be_false
|
12
13
|
end
|
13
14
|
|
14
15
|
it "should allow cattr_accessor for attrs other than :logger" do
|
@@ -17,7 +18,28 @@ describe Lumber::PreventRailsOverride do
|
|
17
18
|
Foo1.class_eval do
|
18
19
|
cattr_accessor :foo
|
19
20
|
end
|
20
|
-
|
21
|
+
Foo1.method_defined?(:foo).should be_true
|
22
|
+
Foo1.method_defined?(:foo=).should be_true
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should prevent mattr_accessor for :logger" do
|
26
|
+
new_class('Foo1')
|
27
|
+
Foo1.send(:include, Lumber::PreventRailsOverride)
|
28
|
+
Foo1.class_eval do
|
29
|
+
mattr_accessor :logger
|
30
|
+
end
|
31
|
+
Foo1.method_defined?(:logger).should be_false
|
32
|
+
Foo1.method_defined?(:logger=).should be_false
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should allow mattr_accessor for attrs other than :logger" do
|
36
|
+
new_class('Foo1')
|
37
|
+
Foo1.send(:include, Lumber::PreventRailsOverride)
|
38
|
+
Foo1.class_eval do
|
39
|
+
mattr_accessor :foo
|
40
|
+
end
|
41
|
+
Foo1.method_defined?(:foo).should be_true
|
42
|
+
Foo1.method_defined?(:foo=).should be_true
|
21
43
|
end
|
22
44
|
|
23
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Conway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: log4r
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
version: '0'
|
227
227
|
requirements: []
|
228
228
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.
|
229
|
+
rubygems_version: 2.1.11
|
230
230
|
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: Lumber integrates the log4r logging system within your application.
|
@@ -240,4 +240,3 @@ test_files:
|
|
240
240
|
- spec/server_spec.rb
|
241
241
|
- spec/spec.opts
|
242
242
|
- spec/spec_helper.rb
|
243
|
-
has_rdoc:
|