kungfuig 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e147fdbfff4e931aab6fab60c7e9c8e0e01a2b98
4
- data.tar.gz: 4c99c246604c2086cea2483f4323f9cf8afe0d84
3
+ metadata.gz: cc430df3b6cfe95416a9954f8a70af80cb28192a
4
+ data.tar.gz: ca05a19e089810361ed88492c3d65ca256365a42
5
5
  SHA512:
6
- metadata.gz: a0acfe6396c2525b61a191c12627e770a17c3049b053073fb5310cd63cc594b36b293314abd3848f08260eed9c37ecf49366c40f76138da5de15366963e9e35e
7
- data.tar.gz: 64d728123dc3a180198f65c18a03afefdb64e365a61b8929dc49f67144b884720964f9f1d3382ff9002ed4878120c0cdac83d8acdec1a53412f3ca9f3985d132
6
+ metadata.gz: 4c91b9e77ef5988557eb0f2a3cde047eeec3d83448d42d02a8b65e31885582918512a13e31bebf7c2807578dce855fc29b31ae43131e8c6919fdce057717b582
7
+ data.tar.gz: d3a55b372986ee6128b29aa33ac7ad2c8bdb6a4322384ea0bdd586efebeaa3da60a5a42272232706d89c098570cbe92f234474c09e202fddda51bb4327372859
@@ -40,8 +40,9 @@ module Kungfuig
40
40
  )
41
41
  end
42
42
 
43
- def bottleneck(method: nil, receiver: nil, result: nil, args: nil, **params)
43
+ def bottleneck(method: nil, receiver: nil, result: nil, **params)
44
44
  respond_to = ->(m, r) { r.respond_to? m.to_sym }
45
+
45
46
  r = case receiver
46
47
  when Hash, Array, String then receiver
47
48
  when respond_to.curry[:to_hash] then receiver.to_hash
@@ -54,13 +55,13 @@ module Kungfuig
54
55
 
55
56
  destination = Kernel.const_get(@hash[receiver_class.name][method])
56
57
  destination.send(:prepend, Kungfuig::Worker) unless destination.ancestors.include? Kungfuig::Worker
57
- destination.perform_async(receiver: r, method: method, result: result, args: args, params: params)
58
+ destination.perform_async(receiver: r, method: method, result: result, **params)
58
59
  rescue => e
59
60
  Kungfuig.✍(receiver: [
60
61
  "Fail [#{e.message}]",
61
62
  *e.backtrace.unshift("Backtrace:").join("#{$/}⮩ "),
62
63
  "while #{receiver}"
63
- ].join($/), method: method, result: result, args: args)
64
+ ].join($/), method: method, result: result, args: params)
64
65
  end
65
66
  end
66
67
  end
@@ -30,7 +30,7 @@ module Kungfuig
30
30
  end
31
31
 
32
32
  def anteponer *args
33
- raise MalformedTarget.new "Factory requires a block; use Prepender#new for more accurate tuning", args unless block_given?
33
+ fail MalformedTarget.new "Factory requires a block; use Prepender#new for more accurate tuning", args unless block_given?
34
34
  Prepender.new(*args, &Proc.new)
35
35
  end
36
36
  end
@@ -67,8 +67,8 @@ module Kungfuig
67
67
  @options = params
68
68
  after(Proc.new) if block_given? # assign the block to after by default
69
69
 
70
- raise MalformedTarget.new "Unable to lookup class", args unless @klazz
71
- raise MalformedTarget.new "Unable to lookup method", args unless @method
70
+ fail MalformedTarget.new "Unable to lookup class", args unless @klazz
71
+ fail MalformedTarget.new "Unable to lookup method", args unless @method
72
72
 
73
73
  postpone_hook
74
74
  end
@@ -96,7 +96,7 @@ module Kungfuig
96
96
 
97
97
  def to_hash
98
98
  {
99
- klazz: klazz,
99
+ klazz: klazz.to_s,
100
100
  method: @method,
101
101
  lambdas: @λ
102
102
  }
@@ -110,7 +110,7 @@ module Kungfuig
110
110
  p = Module.new do
111
111
  include Kungfuig::I★I
112
112
  define_method(hash[:method]) do |*args, **params, &cb|
113
- before_params = hash.merge(receiver: self, args: args, params: params, cb: cb)
113
+ before_params = hash.merge(receiver: self, ★: args, ★★: params, λ: cb)
114
114
  begin
115
115
  λ[:before].call(**before_params) if λ[:before]
116
116
  rescue => e
@@ -1,3 +1,3 @@
1
1
  module Kungfuig
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
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.7.1
4
+ version: 0.7.2
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-18 00:00:00.000000000 Z
11
+ date: 2016-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie