kantox-chronoscope 0.2.0 → 0.2.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: 90a61593f47c00bb6eed136f202b05a98b4b3e6b
4
- data.tar.gz: ef8dd7722fb00a6f687dcef0ea3e04609689406a
3
+ metadata.gz: c6d28754b2595ecfc31f595f08474d07405c8ddf
4
+ data.tar.gz: 90b19750de99c9b317c59d53ceb850234aaa07f8
5
5
  SHA512:
6
- metadata.gz: 31bec9c70173b8e4fedd0984944f3aae010d95b469d62642a6f6a7f1c915a86a2c31c9777fbea6916395ffff38bda9f9077d83abff584c2b25e640911010691f
7
- data.tar.gz: 965d1650c1bcdfe67f837afe689dec6c228203a47f38fe30ccbc7819875eddbb483cd321c8f5a2475c74d689cd0a01aa37f71f7ca5d521f9ecf41d1598d1ce75
6
+ metadata.gz: a530d3ecc287e92acc653f09a494c20c5c937c7f8800f448c742f0d08e387175c29f6ee2d11a7070f32056fe7f44ff62178fa39361f3d59e65a567bfc86f8ab5
7
+ data.tar.gz: ec9614646ce1dcafb53df11419b53bfc3c436ee825a864bd1b457017ca201d41f77f29c42aadf72cbb3664ced19e1c7a2466df3593df349e831a9f1a6121a687
@@ -1,5 +1,5 @@
1
1
  module Kantox
2
2
  module Chronoscope
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -10,6 +10,8 @@ module Kantox
10
10
  module Generic; end
11
11
  module Dummy; end
12
12
 
13
+ CHAIN_PREFIX = '⚑'
14
+
13
15
  DEFAULT_ENV = :development
14
16
  CONFIG_LOCATION = 'config/chronoscope.yml'.freeze
15
17
 
@@ -34,6 +36,10 @@ module Kantox
34
36
  end
35
37
  chronoscope.inject(general_config.top)
36
38
 
39
+ # rubocop:disable Metrics/CyclomaticComplexity
40
+ # rubocop:disable Metrics/PerceivedComplexity
41
+ # rubocop:disable Metrics/AbcSize
42
+ # rubocop:disable Metrics/MethodLength
37
43
  module ClassMethods
38
44
  # `methods` parameter accepts:
39
45
  # none for all instance methods
@@ -43,13 +49,15 @@ module Kantox
43
49
  methods = klazz.instance_methods(false) if methods.empty?
44
50
 
45
51
  methods.each do |m|
46
- next if m.to_s =~ /\A⚑/ || methods.include?("⚑#{m}".to_sym) # skip already wrapped functions
52
+ next if m.to_s =~ /\A#{CHAIN_PREFIX}/ # skip wrappers
53
+ next if m.to_s.end_with?('=') # skip attr_writers # FIXME: WTF?????
54
+ next if methods.include?("#{CHAIN_PREFIX}#{m}".to_sym) # skip already wrapped functions
47
55
  next if (klazz.instance_method(m).parameters.to_h[:block] rescue false) # FIXME: report
48
56
 
49
57
  klazz.class_eval %Q|
50
- alias_method '⚑#{m}', '#{m}'
51
- def #{m} *args
52
- ⌚('#{klazz}##{m}') { ⚑#{m}(*args) }
58
+ alias_method :'#{CHAIN_PREFIX}#{m}', :'#{m}'
59
+ def #{m}(*args)
60
+ ⌚('#{klazz}##{m}') { #{CHAIN_PREFIX}#{m} *args }
53
61
  end
54
62
  |
55
63
  end
@@ -57,6 +65,10 @@ module Kantox
57
65
  # FIXME: report
58
66
  end
59
67
  end
68
+ # rubocop:enable Metrics/MethodLength
69
+ # rubocop:enable Metrics/AbcSize
70
+ # rubocop:enable Metrics/PerceivedComplexity
71
+ # rubocop:enable Metrics/CyclomaticComplexity
60
72
  extend ClassMethods
61
73
  end
62
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kantox-chronoscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kantox