amirka-async-fu 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/async_fu.rb +3 -3
  3. data/test/test-1.rb +6 -0
  4. metadata +1 -1
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 2
4
- :patch: 0
4
+ :patch: 1
@@ -9,13 +9,13 @@ class AsyncFu
9
9
  end
10
10
  }
11
11
  end
12
- def method_missing(name, *args)
12
+ def method_missing(name, *args, &block)
13
13
  if @class.respond_to?(name)
14
14
  Thread.new{
15
- @class.send name, *args
15
+ @class.send name, *args, &block
16
16
  }
17
17
  else
18
- @class.send name, *args
18
+ @class.send name, *args, &block
19
19
  end
20
20
  end
21
21
  def exit
@@ -22,9 +22,15 @@ class YourClass2 < AsyncFu
22
22
  p 'this ' + Thread.current.to_s
23
23
  p 'end'
24
24
  end
25
+ def block(&block)
26
+ block.call
27
+ end
25
28
  end
26
29
 
27
30
  ai = YourClass2.new
28
31
  ai.hello
29
32
  p ai.methods
33
+ ai.block{
34
+ p 'hello iam block'
35
+ }
30
36
  ai.exit
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amirka-async-fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amir Mamedov