chalk-log 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chalk-log.rb +5 -5
- data/lib/chalk-log/version.rb +1 -1
- data/test/functional/log.rb +4 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4824cc22e190bf08c636bc73e7e1477759ae417
|
4
|
+
data.tar.gz: 596b7064e2fcb9176defe530a208df1171b04a79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81bd3261e2aa9950f3091448421297142298b7d110b417c7984e791732af0865f72fc5638f91f1bacfc8c6be31add26fece46b020888e78fe617e4a8a28be044
|
7
|
+
data.tar.gz: 0cee6fdaeb9e1d5e89bd6931d1e956fd9f897668f91746a8e3276b6ed4fa82bc1c29b1e3c14eedf16685a7d455de9b2aa2b8b4161c09afeaa1fb11dc2633931e
|
data/lib/chalk-log.rb
CHANGED
@@ -129,15 +129,15 @@ module Chalk::Log
|
|
129
129
|
include ClassMethods
|
130
130
|
|
131
131
|
# The technique here is a bit tricky. The same `log` implementation
|
132
|
-
# defined on any class needs to be callable by either an instance or
|
133
|
-
# class. (See the "correctly make the end class loggable when it has
|
132
|
+
# defined on any class/module needs to be callable by either an instance or
|
133
|
+
# the class/module itself. (See the "correctly make the end class loggable when it has
|
134
134
|
# already included loggable" test for why. In particular, someone
|
135
|
-
# may have already included me, and then clobbered the class
|
135
|
+
# may have already included me, and then clobbered the class/module
|
136
136
|
# implementations by extending me.) Hence we do this "defer to
|
137
|
-
# class, unless I am a class" logic.
|
137
|
+
# class, unless I am a class/module" logic.
|
138
138
|
log = instance_method(:log)
|
139
139
|
define_method(:log) do
|
140
|
-
if self.kind_of?(
|
140
|
+
if self.kind_of?(Module)
|
141
141
|
log.bind(self).call
|
142
142
|
else
|
143
143
|
self.class.log
|
data/lib/chalk-log/version.rb
CHANGED
data/test/functional/log.rb
CHANGED
@@ -119,6 +119,9 @@ module Critic::Functional
|
|
119
119
|
it 'make the extendee loggable' do
|
120
120
|
module ExtendLogTestA
|
121
121
|
include Chalk::Log
|
122
|
+
def say_hi
|
123
|
+
log.info('hello')
|
124
|
+
end
|
122
125
|
end
|
123
126
|
|
124
127
|
module ExtendLogTestB
|
@@ -127,6 +130,7 @@ module Critic::Functional
|
|
127
130
|
|
128
131
|
assert(ExtendLogTestB < Chalk::Log)
|
129
132
|
assert(ExtendLogTestB.respond_to?(:log))
|
133
|
+
assert(ExtendLogTestB.say_hi)
|
130
134
|
end
|
131
135
|
end
|
132
136
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chalk-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chalk-config
|
@@ -171,4 +171,3 @@ test_files:
|
|
171
171
|
- test/functional/log.rb
|
172
172
|
- test/unit/_lib.rb
|
173
173
|
- test/unit/chalk-log/utils.rb
|
174
|
-
has_rdoc:
|