micro_q 0.6.2 → 0.6.3

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.
@@ -9,8 +9,6 @@ module MicroQ
9
9
  # message invocation
10
10
  #
11
11
  module Class
12
- extend MicroQ::Methods::SharedMethods
13
-
14
12
  def async
15
13
  MicroQ::Proxy::Class.new(:class => self, :loader => {})
16
14
  end
@@ -11,8 +11,6 @@ module MicroQ
11
11
  # what the default worker does.
12
12
  #
13
13
  module Instance
14
- include MicroQ::Methods::SharedMethods
15
-
16
14
  def async
17
15
  MicroQ::Proxy::Instance.new(:class => self.class)
18
16
  end
@@ -1,26 +1,3 @@
1
- module MicroQ
2
- module Methods
3
- module SharedMethods
4
- def method_missing(method, *other)
5
- super unless /((.+)\_async$)/ === method
6
-
7
- name = $2
8
-
9
- # Define the method and call through.
10
- if name && respond_to?(name)
11
- define_singleton_method method do |*args|
12
- async.send(name, *args)
13
- end
14
-
15
- async.send(name, *other)
16
- else
17
- super
18
- end
19
- end
20
- end
21
- end
22
- end
23
-
24
1
  # add Class and Instance methods first then
25
2
  # override with additional extensions
26
3
  require 'micro_q/methods/class'
@@ -1,7 +1,7 @@
1
1
  module MicroQ
2
2
  MAJOR = 0
3
3
  MINOR = 6
4
- POINT = 2
4
+ POINT = 3
5
5
 
6
6
  VERSION = [MAJOR, MINOR, POINT].join('.')
7
7
  end
@@ -7,39 +7,5 @@ shared_examples_for "a_worker" do |method|
7
7
  it 'should proxy to the object' do
8
8
  subject.async.respond_to?(method).should == true
9
9
  end
10
-
11
- describe 'before first calling the _async method' do
12
- it 'should not respond to the _async method' do
13
- subject.respond_to?(method).should == true
14
- subject.respond_to?("#{method}_async").should == false
15
- end
16
- end
17
-
18
- describe 'after first call' do
19
- before do
20
- subject.send("#{method}_async")
21
- end
22
-
23
- it "should add a _async method" do
24
- subject.respond_to?(method).should == true
25
- subject.respond_to?("#{method}_async").should == true
26
- end
27
- end
28
- end
29
-
30
- describe 'errors' do
31
- describe 'when calling a missing _async method' do
32
- it 'should fail' do
33
- expect {
34
- subject.send("some_method_async")
35
- }.to raise_error
36
- end
37
-
38
- it 'should raise an undefined method error (without the _async)' do
39
- ex = (begin; subject.send("some_method_async"); rescue => e; e end)
40
-
41
- ex.message.should match(/undefined method \`some_method_async\'/)
42
- end
43
- end
44
10
  end
45
11
  end
@@ -53,12 +53,6 @@ describe MicroQ::Methods::ActiveRecord, :active_record => true do
53
53
 
54
54
  it_behaves_like 'a_worker', 'process'
55
55
 
56
- describe 'when an _async method is called' do
57
- let(:method) { lambda {|*args| subject.process_async(*args) } }
58
-
59
- it_behaves_like 'an async AR instance'
60
- end
61
-
62
56
  describe 'when calling to async.method proxy' do
63
57
  let(:method) { lambda {|*args| subject.async.process(*args) } }
64
58
 
@@ -47,12 +47,6 @@ describe MicroQ::Methods::Class do
47
47
 
48
48
  it_behaves_like 'a_worker', 'seed'
49
49
 
50
- describe 'when an _async method is called' do
51
- let(:method) { lambda {|*args| subject.seed_async(*args) } }
52
-
53
- it_behaves_like 'an async class'
54
- end
55
-
56
50
  describe 'when calling to async.method proxy' do
57
51
  let(:method) { lambda {|*args| subject.async.seed(*args) } }
58
52
 
@@ -41,12 +41,6 @@ describe MicroQ::Methods::Instance do
41
41
 
42
42
  it_behaves_like 'a_worker', 'process'
43
43
 
44
- describe 'when an _async method is called' do
45
- let(:method) { lambda {|*args| subject.process_async(*args) } }
46
-
47
- it_behaves_like 'an async instance'
48
- end
49
-
50
44
  describe 'when calling to async.method proxy' do
51
45
  let(:method) { lambda {|*args| subject.async.process(*args) } }
52
46
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_q
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: