async_methods 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,14 +6,13 @@ desc 'Default: run unit tests.'
6
6
  task :default => :test
7
7
 
8
8
  begin
9
- require 'spec/rake/spectask'
10
- desc 'Test the gem.'
11
- Spec::Rake::SpecTask.new(:test) do |t|
12
- t.spec_files = FileList.new('spec/**/*_spec.rb')
13
- end
9
+ require 'rspec'
10
+ require 'rspec/core/rake_task'
11
+ desc 'Run the unit tests'
12
+ RSpec::Core::RakeTask.new(:test)
14
13
  rescue LoadError
15
- tast :test do
16
- STDERR.puts "You must have rspec >= 1.3.0 to run the tests"
14
+ task :test do
15
+ STDERR.puts "You must have rspec 2.0 installed to run the tests"
17
16
  end
18
17
  end
19
18
 
@@ -32,11 +31,11 @@ begin
32
31
  gem.summary = %Q{Gem that adds asynchronous method calls for all methods on every object to aid in throughput on I/O bound processes.}
33
32
  gem.description = %Q(Gem that adds asynchronous method calls for all methods on every object to aid in throughput on I/O bound processes. This is intended to improve throughput on I/O bound processes like making several HTTP calls in row.)
34
33
  gem.email = "brian@embellishedvisions.com"
35
- gem.homepage = "http://github.com/bdurand/acts_as_revisionable"
34
+ gem.homepage = "http://github.com/bdurand/async_methods"
36
35
  gem.authors = ["Brian Durand"]
37
36
  gem.rdoc_options = ["--charset=UTF-8", "--main", "README.rdoc"]
38
37
 
39
- gem.add_development_dependency('rspec', '>= 1.3.0')
38
+ gem.add_development_dependency('rspec', '>= 2.0.0')
40
39
  gem.add_development_dependency('jeweler')
41
40
  end
42
41
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -1,57 +1,55 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{async_methods}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Durand"]
12
- s.date = %q{2010-06-24}
12
+ s.date = %q{2011-01-19}
13
13
  s.description = %q{Gem that adds asynchronous method calls for all methods on every object to aid in throughput on I/O bound processes. This is intended to improve throughput on I/O bound processes like making several HTTP calls in row.}
14
14
  s.email = %q{brian@embellishedvisions.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
18
18
  s.files = [
19
- ".gitignore",
20
- "MIT-LICENSE",
21
- "README.rdoc",
22
- "Rakefile",
23
- "VERSION",
24
- "async_methods.gemspec",
25
- "lib/async_methods.rb",
26
- "lib/async_methods/async_methods.rb",
27
- "spec/async_method_spec.rb",
28
- "spec/method_tester.rb",
29
- "spec/spec_helper.rb"
19
+ "MIT-LICENSE",
20
+ "README.rdoc",
21
+ "Rakefile",
22
+ "VERSION",
23
+ "async_methods.gemspec",
24
+ "lib/async_methods.rb",
25
+ "lib/async_methods/async_methods.rb",
26
+ "spec/async_method_spec.rb",
27
+ "spec/method_tester.rb",
28
+ "spec/spec_helper.rb"
30
29
  ]
31
- s.homepage = %q{http://github.com/bdurand/acts_as_revisionable}
30
+ s.homepage = %q{http://github.com/bdurand/async_methods}
32
31
  s.rdoc_options = ["--charset=UTF-8", "--main", "README.rdoc"]
33
32
  s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.7}
33
+ s.rubygems_version = %q{1.4.1}
35
34
  s.summary = %q{Gem that adds asynchronous method calls for all methods on every object to aid in throughput on I/O bound processes.}
36
35
  s.test_files = [
37
36
  "spec/async_method_spec.rb",
38
- "spec/method_tester.rb",
39
- "spec/spec_helper.rb"
37
+ "spec/method_tester.rb",
38
+ "spec/spec_helper.rb"
40
39
  ]
41
40
 
42
41
  if s.respond_to? :specification_version then
43
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
42
  s.specification_version = 3
45
43
 
46
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
- s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
45
+ s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
48
46
  s.add_development_dependency(%q<jeweler>, [">= 0"])
49
47
  else
50
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
48
+ s.add_dependency(%q<rspec>, [">= 2.0.0"])
51
49
  s.add_dependency(%q<jeweler>, [">= 0"])
52
50
  end
53
51
  else
54
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
52
+ s.add_dependency(%q<rspec>, [">= 2.0.0"])
55
53
  s.add_dependency(%q<jeweler>, [">= 0"])
56
54
  end
57
55
  end
@@ -2,22 +2,22 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'async_m
2
2
  Object.send(:include, AsyncMethods::InstanceMethods) unless Object.include?(AsyncMethods::InstanceMethods)
3
3
  require File.expand_path(File.dirname(__FILE__) + '/method_tester')
4
4
 
5
- context "AsyncMethods InstanceMethods" do
5
+ describe AsyncMethods::InstanceMethods do
6
6
 
7
7
  let(:object) { AsyncMethods::Tester.new }
8
8
 
9
- specify "should inject async method handling" do
9
+ it "should inject async method handling" do
10
10
  proxy = object.async_test("arg")
11
11
  proxy.to_s.should == "ARG"
12
12
  proxy.__proxy_loaded__.should == true
13
13
  end
14
14
 
15
- specify "should return a proxy object that has not been invoked yet" do
15
+ it "should return a proxy object that has not been invoked yet" do
16
16
  proxy = object.async_test("arg", 1)
17
17
  proxy.__proxy_loaded__.should == false
18
18
  end
19
19
 
20
- specify "should be able to run a block asynchronously" do
20
+ it "should be able to run a block asynchronously" do
21
21
  proxy = asynchronous_block{object.test("arg", 0.1)}
22
22
  proxy.__proxy_loaded__.should == false
23
23
  proxy.to_s.should == "ARG"
@@ -26,35 +26,35 @@ context "AsyncMethods InstanceMethods" do
26
26
 
27
27
  end
28
28
 
29
- context "AsyncMethods Proxy" do
29
+ describe AsyncMethods::Proxy do
30
30
 
31
31
  let(:object) { AsyncMethods::Tester.new }
32
32
 
33
- specify "should be able to wrap a method without waiting for it to finish" do
33
+ it "should be able to wrap a method without waiting for it to finish" do
34
34
  proxy = object.async_test("arg", 1)
35
35
  object.test_called.should == 0
36
36
  end
37
37
 
38
- specify "should execute the wrapped method when it needs to" do
38
+ it "should execute the wrapped method when it needs to" do
39
39
  proxy = object.async_test("arg")
40
40
  proxy.to_s
41
41
  object.test_called.should == 1
42
42
  end
43
43
 
44
- specify "should only execute the wrapped method once" do
44
+ it "should only execute the wrapped method once" do
45
45
  proxy = object.async_test("arg")
46
46
  proxy.to_s
47
47
  proxy.to_s
48
48
  object.test_called.should == 1
49
49
  end
50
50
 
51
- specify "should allow nil as a valid proxied value" do
51
+ it "should allow nil as a valid proxied value" do
52
52
  proxy = object.async_test(nil)
53
53
  proxy.should_not
54
54
  object.test_called.should == 1
55
55
  end
56
56
 
57
- specify "should allow blocks in the async method" do
57
+ it "should allow blocks in the async method" do
58
58
  n = 1
59
59
  proxy = object.async_test("arg", 0.1) do
60
60
  n = 2
@@ -64,23 +64,23 @@ context "AsyncMethods Proxy" do
64
64
  n.should == 2
65
65
  end
66
66
 
67
- specify "should be indistinguishable from the real object" do
67
+ it "should be indistinguishable from the real object" do
68
68
  proxy = object.async_test("arg")
69
69
  proxy.class.should == String
70
70
  proxy.kind_of?(String).should == true
71
71
  end
72
72
 
73
- specify "should proxy core methods on Object" do
73
+ it "should proxy core methods on Object" do
74
74
  proxy = "xxx".async_to_s
75
75
  proxy.should == "xxx"
76
76
  end
77
77
 
78
- specify "should proxy missing methods" do
78
+ it "should proxy missing methods" do
79
79
  proxy = object.async_find_test
80
80
  proxy.to_s.should == "FINDER"
81
81
  end
82
82
 
83
- specify "should allow blocks in the async missing methods" do
83
+ it "should allow blocks in the async missing methods" do
84
84
  n = 1
85
85
  proxy = object.async_find_test do
86
86
  n = 2
@@ -88,12 +88,12 @@ context "AsyncMethods Proxy" do
88
88
  n.should == 2
89
89
  end
90
90
 
91
- specify "should not interfere with the proxied object's method_missing" do
91
+ it "should not interfere with the proxied object's method_missing" do
92
92
  real = object.find_test
93
93
  real.to_s.should == "FINDER"
94
94
  end
95
95
 
96
- specify "should not interfere with real methods that begin with async_" do
96
+ it "should not interfere with real methods that begin with async_" do
97
97
  object.async_real_method_called.should == false
98
98
  object.async_real_method
99
99
  object.async_real_method_called.should == true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async_methods
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease: false
4
+ hash: 19
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Durand
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-24 00:00:00 -05:00
18
+ date: 2011-01-19 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 27
29
+ hash: 15
30
30
  segments:
31
- - 1
32
- - 3
31
+ - 2
32
+ - 0
33
33
  - 0
34
- version: 1.3.0
34
+ version: 2.0.0
35
35
  type: :development
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -57,7 +57,6 @@ extensions: []
57
57
  extra_rdoc_files:
58
58
  - README.rdoc
59
59
  files:
60
- - .gitignore
61
60
  - MIT-LICENSE
62
61
  - README.rdoc
63
62
  - Rakefile
@@ -69,7 +68,7 @@ files:
69
68
  - spec/method_tester.rb
70
69
  - spec/spec_helper.rb
71
70
  has_rdoc: true
72
- homepage: http://github.com/bdurand/acts_as_revisionable
71
+ homepage: http://github.com/bdurand/async_methods
73
72
  licenses: []
74
73
 
75
74
  post_install_message:
@@ -100,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
99
  requirements: []
101
100
 
102
101
  rubyforge_project:
103
- rubygems_version: 1.3.7
102
+ rubygems_version: 1.4.1
104
103
  signing_key:
105
104
  specification_version: 3
106
105
  summary: Gem that adds asynchronous method calls for all methods on every object to aid in throughput on I/O bound processes.
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- pkg