flnt 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flnt/logger.rb +14 -1
- data/lib/flnt/version.rb +1 -1
- data/spec/lib/flnt_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6288d322043de28dae84a50b8d134770f6ff596f
|
4
|
+
data.tar.gz: bba575379bbcdfebd459bfa2d5f563efd92457c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b28886b4ef11edd9113b31bafb7a6eab62c3195d4ffa2d605e4877a8c07647f4a928f564de65eaef8c9523511499dcb2eb234c59c971c798a1a17be3a4901f1
|
7
|
+
data.tar.gz: 8d84a6180cbb0594d023a395e885c652aba06a6a34fdae7e375bb5bffb3f888934fa5f6036e9499a709f50afbb4569aad195862b10129fa1eae5259e3386f6f6
|
data/lib/flnt/logger.rb
CHANGED
@@ -3,7 +3,20 @@ require 'logger'
|
|
3
3
|
require 'pathname'
|
4
4
|
|
5
5
|
module Flnt
|
6
|
-
class Logger <
|
6
|
+
class Logger < Object
|
7
|
+
# Logger should behaves like a BasicObject,
|
8
|
+
# but can skip xxx! or xxx? style methods...
|
9
|
+
((Object.instance_methods + Object.private_instance_methods) -
|
10
|
+
(BasicObject.instance_methods + BasicObject.private_instance_methods)).
|
11
|
+
delete_if {|method_name| method_name.to_s =~ /([\-\[\]\/~=+*&|%<>!?])/}.
|
12
|
+
each do |target_method|
|
13
|
+
|
14
|
+
# Also pass the :singleton_class to avoid rspec stubbing errors
|
15
|
+
unless [:singleton_class, :object_id].include?(target_method.to_sym)
|
16
|
+
eval %Q(undef #{target_method})
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
7
20
|
def initialize(init_tag)
|
8
21
|
@tag = init_tag
|
9
22
|
end
|
data/lib/flnt/version.rb
CHANGED
data/spec/lib/flnt_spec.rb
CHANGED
@@ -31,7 +31,8 @@ describe "Flnt" do
|
|
31
31
|
expect(ret.instance_eval { @tag }).to eq "init_foo"
|
32
32
|
|
33
33
|
expect { ret.chain_bar }.not_to raise_error
|
34
|
-
expect { ret.respond_to? }.
|
34
|
+
expect { ret.respond_to? :foo }.not_to raise_error
|
35
|
+
expect { ret.missing_method? }.to raise_error NoMethodError
|
35
36
|
end
|
36
37
|
|
37
38
|
it "should create a new logger for each call" do
|