kungfuig 0.6.73 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +26 -0
- data/.rubocop.yml +30 -15
- data/.rubocop_todo.yml +10 -16
- data/Gemfile +1 -0
- data/README.md +3 -0
- data/lib/kungfuig/aspector.rb +6 -8
- data/lib/kungfuig/jobber.rb +2 -2
- data/lib/kungfuig/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e85039f32ff74b1c817cde6a1451a064b16f9f8d
|
4
|
+
data.tar.gz: fb9908f5395d155dff76fb7d2e9a07a3dcab5b05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 524e7d12eebb7d2a2f8c880690d671add757e889dd2249be04830f6c591f75ce0cb770c2f129dc4d1293a68f6c8ca56d7b0f96e257100497f1df6b0e5cfa3e8b
|
7
|
+
data.tar.gz: 1a35b9c6713c077395f5d782768c2983efc99292c0992aa2b10934a96f0cba93f5b666d4542842bbf8c8eceb0eac483dd446bdd2cb274b49a52acb4ab0242bc1
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
engines:
|
3
|
+
duplication:
|
4
|
+
enabled: true
|
5
|
+
config:
|
6
|
+
languages:
|
7
|
+
- ruby
|
8
|
+
- javascript
|
9
|
+
- python
|
10
|
+
- php
|
11
|
+
fixme:
|
12
|
+
enabled: true
|
13
|
+
rubocop:
|
14
|
+
enabled: true
|
15
|
+
ratings:
|
16
|
+
paths:
|
17
|
+
- "**.inc"
|
18
|
+
- "**.js"
|
19
|
+
- "**.jsx"
|
20
|
+
- "**.module"
|
21
|
+
- "**.php"
|
22
|
+
- "**.py"
|
23
|
+
- "**.rb"
|
24
|
+
exclude_paths:
|
25
|
+
- features/
|
26
|
+
- spec/
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
+
# Offense count: 6
|
4
|
+
# Cop supports --auto-correct.
|
5
|
+
# Configuration parameters: , SupportedStyles.
|
6
|
+
# SupportedStyles: only_raise, only_fail, semantic
|
7
|
+
Style/SignalException:
|
8
|
+
EnforcedStyle: semantic
|
9
|
+
|
10
|
+
Metrics/ClassLength:
|
11
|
+
Max: 200
|
12
|
+
|
13
|
+
Metrics/CyclomaticComplexity:
|
14
|
+
Max: 20
|
15
|
+
|
16
|
+
Metrics/LineLength:
|
17
|
+
Max: 180
|
18
|
+
|
19
|
+
Metrics/MethodLength:
|
20
|
+
Max: 42
|
21
|
+
|
22
|
+
Metrics/PerceivedComplexity:
|
23
|
+
Max: 20
|
24
|
+
|
25
|
+
Metrics/AbcSize:
|
26
|
+
Max: 42
|
27
|
+
|
28
|
+
Style/EmptyCaseCondition:
|
29
|
+
Exclude:
|
30
|
+
- 'lib/**/*'
|
31
|
+
- 'spec/**/*'
|
32
|
+
|
3
33
|
Style/AsciiIdentifiers:
|
4
34
|
Exclude:
|
5
35
|
- 'lib/**/*'
|
@@ -28,18 +58,3 @@ Style/MultilineBlockChain:
|
|
28
58
|
Exclude:
|
29
59
|
- 'lib/**/*'
|
30
60
|
- 'spec/**/*'
|
31
|
-
|
32
|
-
Metrics/ClassLength:
|
33
|
-
Max: 200
|
34
|
-
|
35
|
-
Metrics/CyclomaticComplexity:
|
36
|
-
Max: 20
|
37
|
-
|
38
|
-
Metrics/LineLength:
|
39
|
-
Max: 180
|
40
|
-
|
41
|
-
Metrics/MethodLength:
|
42
|
-
Max: 42
|
43
|
-
|
44
|
-
Metrics/PerceivedComplexity:
|
45
|
-
Max: 20
|
data/.rubocop_todo.yml
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-
|
3
|
+
# on 2016-05-18 07:15:53 +0200 using RuboCop version 0.40.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
+
# Offense count: 6
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
Lint/UnneededDisable:
|
12
|
+
Exclude:
|
13
|
+
- 'lib/kungfuig/color.rb'
|
14
|
+
|
9
15
|
# Offense count: 1
|
10
16
|
# Cop supports --auto-correct.
|
11
|
-
# Configuration parameters:
|
17
|
+
# Configuration parameters: AllowUnusedKeywordArguments.
|
12
18
|
Lint/UnusedBlockArgument:
|
13
19
|
Exclude:
|
14
20
|
- 'features/step_definitions/kungfuig_steps.rb'
|
@@ -20,10 +26,6 @@ Lint/UnusedMethodArgument:
|
|
20
26
|
Exclude:
|
21
27
|
- 'lib/kungfuig.rb'
|
22
28
|
|
23
|
-
# Offense count: 11
|
24
|
-
Metrics/AbcSize:
|
25
|
-
Max: 41
|
26
|
-
|
27
29
|
# Offense count: 4
|
28
30
|
# Cop supports --auto-correct.
|
29
31
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
@@ -61,7 +63,7 @@ Style/CommentAnnotation:
|
|
61
63
|
Exclude:
|
62
64
|
- 'lib/kungfuig/aspector.rb'
|
63
65
|
|
64
|
-
# Offense count:
|
66
|
+
# Offense count: 23
|
65
67
|
# Cop supports --auto-correct.
|
66
68
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
67
69
|
# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
|
@@ -74,14 +76,6 @@ Style/MutableConstant:
|
|
74
76
|
Exclude:
|
75
77
|
- 'lib/kungfuig/version.rb'
|
76
78
|
|
77
|
-
# Offense count: 6
|
78
|
-
# Cop supports --auto-correct.
|
79
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
80
|
-
# SupportedStyles: only_raise, only_fail, semantic
|
81
|
-
Style/SignalException:
|
82
|
-
Exclude:
|
83
|
-
- 'lib/kungfuig.rb'
|
84
|
-
|
85
79
|
# Offense count: 2
|
86
80
|
# Cop supports --auto-correct.
|
87
81
|
# Configuration parameters: AllowForAlignment.
|
@@ -95,7 +89,7 @@ Style/SpaceBeforeSemicolon:
|
|
95
89
|
Exclude:
|
96
90
|
- 'lib/kungfuig/prepender.rb'
|
97
91
|
|
98
|
-
# Offense count:
|
92
|
+
# Offense count: 14
|
99
93
|
# Cop supports --auto-correct.
|
100
94
|
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
|
101
95
|
# SupportedStyles: space, no_space
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
**Kungfuig** (_pronounced: [ˌkʌŋˈfig]_) provides a drastically easy way to plug configuration into everything.
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/am-kantox/kungfuig.svg\?branch\=master)](https://travis-ci.org/am-kantox/kungfuig)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/am-kantox/kungfuig/badges/gpa.svg)](https://codeclimate.com/github/am-kantox/kungfuig)
|
7
|
+
[![Issue Count](https://codeclimate.com/github/am-kantox/kungfuig/badges/issue_count.svg)](https://codeclimate.com/github/am-kantox/kungfuig)
|
8
|
+
[![Test Coverage](https://codeclimate.com/github/am-kantox/kungfuig/badges/coverage.svg)](https://codeclimate.com/github/am-kantox/kungfuig/coverage)
|
6
9
|
|
7
10
|
## Config on steroids
|
8
11
|
|
data/lib/kungfuig/aspector.rb
CHANGED
@@ -42,7 +42,7 @@ module Kungfuig
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def attach(to, before: nil, after: nil, exclude: nil)
|
45
|
-
|
45
|
+
fail ArgumentError, "Trying to attach nothing to #{klazz}##{to}. I need a block!" unless block_given?
|
46
46
|
|
47
47
|
cb = Proc.new
|
48
48
|
|
@@ -52,13 +52,11 @@ module Kungfuig
|
|
52
52
|
else class << to; self; end # attach to klazz’s eigenclass if object given
|
53
53
|
end
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
Kungfuig::Prepender.new(to, m).after(&cb)
|
61
|
-
end unless after.nil?
|
55
|
+
{ before: before, after: after }.each do |k, var|
|
56
|
+
H.new.value_to_method_list(klazz, var, exclude).each do |m|
|
57
|
+
Kungfuig::Prepender.new(to, m).public_send(k, &cb)
|
58
|
+
end unless var.nil?
|
59
|
+
end
|
62
60
|
|
63
61
|
klazz.is_a?(Module) ? klazz.aspects : { promise: klazz }
|
64
62
|
end
|
data/lib/kungfuig/jobber.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems/exceptions'
|
|
3
3
|
|
4
4
|
begin
|
5
5
|
require 'sidekiq'
|
6
|
-
|
6
|
+
fail LoadError.new unless Kernel.const_defined?('Sidekiq')
|
7
7
|
rescue LoadError
|
8
8
|
raise(Gem::DependencyError, "Sidekiq id required to use this functionality!")
|
9
9
|
end
|
@@ -14,7 +14,7 @@ module Kungfuig
|
|
14
14
|
|
15
15
|
module Worker
|
16
16
|
def self.prepended base
|
17
|
-
|
17
|
+
fail JobberError.new("Must be prepended to class defining ‘perform’ method!") unless base.instance_methods.include?(:perform)
|
18
18
|
base.send(:include, Sidekiq::Worker) unless base.ancestors.include? Sidekiq::Worker
|
19
19
|
end
|
20
20
|
|
data/lib/kungfuig/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kungfuig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kantox LTD
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -149,6 +149,7 @@ executables: []
|
|
149
149
|
extensions: []
|
150
150
|
extra_rdoc_files: []
|
151
151
|
files:
|
152
|
+
- ".codeclimate.yml"
|
152
153
|
- ".gitignore"
|
153
154
|
- ".rspec"
|
154
155
|
- ".rubocop.yml"
|