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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51740a04663dc5789cf617d795902c878753da4d
4
- data.tar.gz: ddce4867174594d0e261b1451cf8fcf2bb195e44
3
+ metadata.gz: a4824cc22e190bf08c636bc73e7e1477759ae417
4
+ data.tar.gz: 596b7064e2fcb9176defe530a208df1171b04a79
5
5
  SHA512:
6
- metadata.gz: 599c1125ff94b46bd016c78a45126b6648bedd03a0fe92d20c10d9595a57eaf81e9e9c9e64ef2862545525f07af68b1a4df0dd68ba70fe90a5fe96e3eb4607c3
7
- data.tar.gz: f9f6143c0c9cac78ee48e5629d01b7b849766047dd3bfcf959337f4c0231846083584a3173326f73875b385e3c1a877dd1171b93b0edf7e1c2e174ae04553326
6
+ metadata.gz: 81bd3261e2aa9950f3091448421297142298b7d110b417c7984e791732af0865f72fc5638f91f1bacfc8c6be31add26fece46b020888e78fe617e4a8a28be044
7
+ data.tar.gz: 0cee6fdaeb9e1d5e89bd6931d1e956fd9f897668f91746a8e3276b6ed4fa82bc1c29b1e3c14eedf16685a7d455de9b2aa2b8b4161c09afeaa1fb11dc2633931e
@@ -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?(Class)
140
+ if self.kind_of?(Module)
141
141
  log.bind(self).call
142
142
  else
143
143
  self.class.log
@@ -1,5 +1,5 @@
1
1
  module Chalk
2
2
  module Log
3
- VERSION = '0.1.6'
3
+ VERSION = '0.1.7'
4
4
  end
5
5
  end
@@ -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.6
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: 2016-08-31 00:00:00.000000000 Z
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: