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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39acf970ab7a4cba53d738adec952246cdb7e36d
4
- data.tar.gz: 84b4141111b47aafb6a133913f4d118c6ba7bacf
3
+ metadata.gz: 52f2f551d156ddf2cac81cc1fd65175a58e6cb57
4
+ data.tar.gz: 24d93d72aa28bf70a8b56be3996f00a7b3354d31
5
5
  SHA512:
6
- metadata.gz: d59e9dea06165dea70ad6d4f49e7e271065452c8c58c7656fbcac166dc20d792f2033219416941abe28e2274308945f6b88fea7c1c9c8643b1362397681dc1e1
7
- data.tar.gz: 6a2a398953b7f856988abcf74950d3e50086647b3d1b8e4ec95aadb2a93e3548f15d1e889306ab5afa1a0b44956ea5f62fd4d105320aa85fe338b763d3511397
6
+ metadata.gz: 04fea1c9766af3d4e05a8fc87dd00fd9337f77901475947c3860d686fe5fbe1373ac85d69955357d54d3e3bfc00e05caa6db3f5696e9dd125d23763b9b862b28
7
+ data.tar.gz: 8574b553f1ed8f1d77e6facd45d5a9ac3820272430116333552fe3b638e4d7901a6051bee9048c6747255569c9fb886b753329322f97603bac017a27865c0baa
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 1.1.1 (11/25/2013)
2
+ ------------------
3
+
4
+ handle mattr as well as cattr when preventing rails override <4b4138c> [Matt Conway]
5
+
1
6
  1.1.0 (11/10/2013)
2
7
  ------------------
3
8
 
@@ -11,11 +11,30 @@ module Lumber
11
11
 
12
12
  class << self
13
13
  # Prevent rails from overwriting our logger
14
- def cattr_accessor_with_lumber(*syms)
14
+ def cattr_reader_with_lumber(*syms)
15
15
  without_logger = syms.reject {|s| s == :logger}
16
- cattr_accessor_without_lumber(*without_logger)
16
+ cattr_reader_without_lumber(*without_logger)
17
17
  end
18
- alias_method_chain :cattr_accessor, :lumber
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
@@ -1,3 +1,3 @@
1
1
  module Lumber
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -8,7 +8,8 @@ describe Lumber::PreventRailsOverride do
8
8
  Foo1.class_eval do
9
9
  cattr_accessor :logger
10
10
  end
11
- defined?(Foo1.logger).should be_false
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
- defined?(Foo1.foo).should be_true
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.0
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-10 00:00:00.000000000 Z
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.0.6
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: