kungfuig 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -1
- data/README.md +1 -1
- data/img/kungfuig-100.png +0 -0
- data/img/kungfuig-16.png +0 -0
- data/img/kungfuig-200.png +0 -0
- data/img/kungfuig-400.png +0 -0
- data/img/kungfuig.xcf +0 -0
- data/kungfuig.png +0 -0
- data/lib/kungfuig.rb +5 -7
- data/lib/kungfuig/jobber.rb +6 -11
- data/lib/kungfuig/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70ebdf0a5662d38602eac378b7ec01ec641f00b3
|
4
|
+
data.tar.gz: d4a756c9db21daa1548f3e41e04089d5c622527c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9997c1a39cdedef891fa5e02e50b496daa4ee87179294819818bcca442312d55d4cfe42e44f80c8152040f1644d401f0853ef16db7e09893834020581fc49810
|
7
|
+
data.tar.gz: 70bbeda0218ca5edaa9a2bbc88ffaba37522fa222dba3b4eed936a4426bd52dc50eeecd7c6fc323a6037306bf02e628f3fb289b9cf4c9daca5bdf6fa33229f0f
|
data/.rubocop_todo.yml
CHANGED
data/README.md
CHANGED
Binary file
|
data/img/kungfuig-16.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/img/kungfuig.xcf
ADDED
Binary file
|
data/kungfuig.png
ADDED
Binary file
|
data/lib/kungfuig.rb
CHANGED
@@ -25,7 +25,6 @@ module Kungfuig
|
|
25
25
|
# rubocop:enable Style/MethodName
|
26
26
|
# rubocop:enable Style/VariableName
|
27
27
|
|
28
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
29
28
|
# rubocop:disable Metrics/MethodLength
|
30
29
|
def load_stuff hos
|
31
30
|
case hos
|
@@ -33,13 +32,13 @@ module Kungfuig
|
|
33
32
|
when Hash then Hashie::Mash.new(hos)
|
34
33
|
when String
|
35
34
|
begin
|
36
|
-
File.exist?(hos) ? Hashie::Mash.load(hos) : Hashie::Mash.new(YAML.load(hos))
|
37
|
-
fail ArgumentError.new "#{__callee__} expects valid YAML configuration file or YAML string." unless opts.is_a?(Hash)
|
38
|
-
end
|
35
|
+
File.exist?(hos) ? Hashie::Mash.load(hos) : Hashie::Mash.new(YAML.load(hos))
|
39
36
|
rescue ArgumentError
|
40
|
-
fail ArgumentError
|
37
|
+
fail ArgumentError, "#{__callee__} expects valid YAML configuration file. “#{hos.inspect}” contains invalid syntax."
|
41
38
|
rescue Psych::SyntaxError
|
42
|
-
fail ArgumentError
|
39
|
+
fail ArgumentError, "#{__callee__} expects valid YAML configuration string. Got:\n#{hos.inspect}"
|
40
|
+
rescue
|
41
|
+
fail ArgumentError, "#{__callee__} expects valid YAML configuration string (misspelled file name?). Got:\n#{hos.inspect}"
|
43
42
|
end
|
44
43
|
when ->(h) { h.respond_to?(:to_hash) } then Hashie::Mash.new(h.to_hash)
|
45
44
|
else
|
@@ -47,7 +46,6 @@ module Kungfuig
|
|
47
46
|
end
|
48
47
|
end
|
49
48
|
# rubocop:enable Metrics/MethodLength
|
50
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
51
49
|
module_function :load_stuff
|
52
50
|
|
53
51
|
module InstanceMethods
|
data/lib/kungfuig/jobber.rb
CHANGED
@@ -24,8 +24,6 @@ module Kungfuig
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# rubocop:disable Metrics/AbcSize
|
27
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
28
|
-
# rubocop:disable Metrics/PerceivedComplexity
|
29
27
|
# rubocop:disable Metrics/MethodLength
|
30
28
|
def bottleneck(receiver, method, result, *args)
|
31
29
|
respond_to = ->(m, r) { r.respond_to? m.to_sym }
|
@@ -39,18 +37,15 @@ module Kungfuig
|
|
39
37
|
@hash[c.name] && @hash[c.name][method]
|
40
38
|
end)
|
41
39
|
|
42
|
-
|
43
|
-
if Kernel.const_defined?('Rails') && Rails.env.development?
|
44
|
-
job.new.perform(r, method, result, *args)
|
45
|
-
else
|
46
|
-
job.perform_async(r, method, result, *args)
|
47
|
-
end
|
40
|
+
Kernel.const_get(@hash[receiver_class.name][method]).perform_async(r, method, result, *args)
|
48
41
|
rescue => e
|
49
|
-
Kungfuig.✍(
|
42
|
+
Kungfuig.✍([
|
43
|
+
"Fail [#{e.message}]",
|
44
|
+
*e.backtrace.unshift("Backtrace:").join("#{$/}⮩ "),
|
45
|
+
"while #{receiver}"
|
46
|
+
].join($/), method, result, *args)
|
50
47
|
end
|
51
48
|
# rubocop:enable Metrics/MethodLength
|
52
|
-
# rubocop:enable Metrics/PerceivedComplexity
|
53
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
54
49
|
# rubocop:enable Metrics/AbcSize
|
55
50
|
end
|
56
51
|
end
|
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.5.
|
4
|
+
version: 0.5.8
|
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-04-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -157,7 +157,13 @@ files:
|
|
157
157
|
- Gemfile
|
158
158
|
- README.md
|
159
159
|
- Rakefile
|
160
|
+
- img/kungfuig-100.png
|
161
|
+
- img/kungfuig-16.png
|
162
|
+
- img/kungfuig-200.png
|
163
|
+
- img/kungfuig-400.png
|
164
|
+
- img/kungfuig.xcf
|
160
165
|
- kungfuig.gemspec
|
166
|
+
- kungfuig.png
|
161
167
|
- lib/kungfuig.rb
|
162
168
|
- lib/kungfuig/aspector.rb
|
163
169
|
- lib/kungfuig/color.rb
|