deferrable 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/.rbenv-gemsets +1 -0
- data/.rbenv-version +1 -0
- data/Gemfile +3 -0
- data/README.rdoc +1 -1
- data/Rakefile +2 -36
- data/VERSION +1 -1
- data/deferrable.gemspec +17 -46
- data/test/deferrable_test.rb +43 -3
- data/test/test_helper.rb +1 -4
- metadata +72 -14
data/.gitignore
CHANGED
data/.rbenv-gemsets
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
deferrable
|
data/.rbenv-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ree-1.8.7-2012.02
|
data/Gemfile
ADDED
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -1,44 +1,10 @@
|
|
1
|
-
require 'rake'
|
2
1
|
require 'rake/testtask'
|
3
|
-
require '
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'jeweler'
|
7
|
-
Jeweler::Tasks.new do |s|
|
8
|
-
s.name = "deferrable"
|
9
|
-
s.summary = %Q{Simple mechanism for deferred execution of a block}
|
10
|
-
s.email = "code@justinbalthrop"
|
11
|
-
s.homepage = "http://github.com/ninjudd/deferrable"
|
12
|
-
s.description = "Simple mechanism for deferred execution of a block"
|
13
|
-
s.authors = ["Justin Balthrop"]
|
14
|
-
end
|
15
|
-
Jeweler::GemcutterTasks.new
|
16
|
-
rescue LoadError
|
17
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
18
|
-
end
|
2
|
+
require 'bundler/gem_tasks'
|
19
3
|
|
20
4
|
Rake::TestTask.new do |t|
|
21
|
-
t.libs
|
5
|
+
t.libs = ['lib']
|
22
6
|
t.pattern = 'test/**/*_test.rb'
|
23
7
|
t.verbose = false
|
24
8
|
end
|
25
9
|
|
26
|
-
Rake::RDocTask.new do |rdoc|
|
27
|
-
rdoc.rdoc_dir = 'rdoc'
|
28
|
-
rdoc.title = 'deferrable'
|
29
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
30
|
-
rdoc.rdoc_files.include('README*')
|
31
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
32
|
-
end
|
33
|
-
|
34
|
-
begin
|
35
|
-
require 'rcov/rcovtask'
|
36
|
-
Rcov::RcovTask.new do |t|
|
37
|
-
t.libs << 'test'
|
38
|
-
t.test_files = FileList['test/**/*_test.rb']
|
39
|
-
t.verbose = true
|
40
|
-
end
|
41
|
-
rescue LoadError
|
42
|
-
end
|
43
|
-
|
44
10
|
task :default => :test
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/deferrable.gemspec
CHANGED
@@ -1,50 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
3
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "deferrable"
|
6
|
+
gem.version = IO.read('VERSION')
|
7
|
+
gem.authors = ["Justin Balthrop"]
|
8
|
+
gem.email = ["git@justinbalthrop.com"]
|
9
|
+
gem.description = %q{Simple mechanism for deferred execution of a block}
|
10
|
+
gem.summary = gem.description
|
11
|
+
gem.homepage = "https://github.com/ninjudd/deferrable"
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
s.description = %q{Simple mechanism for deferred execution of a block}
|
14
|
-
s.email = %q{code@justinbalthrop}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".gitignore",
|
21
|
-
"LICENSE",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION",
|
25
|
-
"deferrable.gemspec",
|
26
|
-
"lib/deferrable.rb",
|
27
|
-
"test/deferrable_test.rb",
|
28
|
-
"test/test_helper.rb"
|
29
|
-
]
|
30
|
-
s.homepage = %q{http://github.com/ninjudd/deferrable}
|
31
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
32
|
-
s.require_paths = ["lib"]
|
33
|
-
s.rubygems_version = %q{1.3.5}
|
34
|
-
s.summary = %q{Simple mechanism for deferred execution of a block}
|
35
|
-
s.test_files = [
|
36
|
-
"test/deferrable_test.rb",
|
37
|
-
"test/test_helper.rb"
|
38
|
-
]
|
13
|
+
gem.add_development_dependency 'shoulda', '3.0.1'
|
14
|
+
gem.add_development_dependency 'mocha'
|
15
|
+
gem.add_development_dependency 'rake'
|
39
16
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
45
|
-
else
|
46
|
-
end
|
47
|
-
else
|
48
|
-
end
|
17
|
+
gem.files = `git ls-files`.split($/)
|
18
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
19
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
|
+
gem.require_paths = ["lib"]
|
49
21
|
end
|
50
|
-
|
data/test/deferrable_test.rb
CHANGED
@@ -1,7 +1,47 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/test_helper'
|
2
2
|
|
3
3
|
class DeferrableTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
|
4
|
+
class Foo
|
5
|
+
include Deferrable
|
6
|
+
|
7
|
+
def later
|
8
|
+
complete_deferred
|
9
|
+
end
|
10
|
+
|
11
|
+
def nevermind
|
12
|
+
clear_deferred
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
should "defer execution" do
|
17
|
+
foo = Foo.new
|
18
|
+
|
19
|
+
count = 0
|
20
|
+
foo.deferred do
|
21
|
+
count += 1
|
22
|
+
end
|
23
|
+
|
24
|
+
assert_equal 0, count
|
25
|
+
|
26
|
+
foo.later
|
27
|
+
|
28
|
+
assert_equal 1, count
|
29
|
+
end
|
30
|
+
|
31
|
+
should "now_and_later" do
|
32
|
+
foo = Foo.new
|
33
|
+
|
34
|
+
count = 0
|
35
|
+
foo.now_and_later do
|
36
|
+
count = 7
|
37
|
+
end
|
38
|
+
|
39
|
+
assert_equal 7, count
|
40
|
+
|
41
|
+
count = 0
|
42
|
+
|
43
|
+
foo.later
|
44
|
+
|
45
|
+
assert_equal 7, count
|
6
46
|
end
|
7
|
-
end
|
47
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deferrable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Justin Balthrop
|
@@ -9,21 +15,67 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2013-06-03 00:00:00 -07:00
|
13
19
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: shoulda
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - "="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 5
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 1
|
34
|
+
version: 3.0.1
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: mocha
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
version: "0"
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: rake
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
63
|
+
type: :development
|
64
|
+
version_requirements: *id003
|
16
65
|
description: Simple mechanism for deferred execution of a block
|
17
|
-
email:
|
66
|
+
email:
|
67
|
+
- git@justinbalthrop.com
|
18
68
|
executables: []
|
19
69
|
|
20
70
|
extensions: []
|
21
71
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
24
|
-
- README.rdoc
|
72
|
+
extra_rdoc_files: []
|
73
|
+
|
25
74
|
files:
|
26
75
|
- .gitignore
|
76
|
+
- .rbenv-gemsets
|
77
|
+
- .rbenv-version
|
78
|
+
- Gemfile
|
27
79
|
- LICENSE
|
28
80
|
- README.rdoc
|
29
81
|
- Rakefile
|
@@ -33,30 +85,36 @@ files:
|
|
33
85
|
- test/deferrable_test.rb
|
34
86
|
- test/test_helper.rb
|
35
87
|
has_rdoc: true
|
36
|
-
homepage:
|
88
|
+
homepage: https://github.com/ninjudd/deferrable
|
37
89
|
licenses: []
|
38
90
|
|
39
91
|
post_install_message:
|
40
|
-
rdoc_options:
|
41
|
-
|
92
|
+
rdoc_options: []
|
93
|
+
|
42
94
|
require_paths:
|
43
95
|
- lib
|
44
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
45
98
|
requirements:
|
46
99
|
- - ">="
|
47
100
|
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
102
|
+
segments:
|
103
|
+
- 0
|
48
104
|
version: "0"
|
49
|
-
version:
|
50
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
51
107
|
requirements:
|
52
108
|
- - ">="
|
53
109
|
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
111
|
+
segments:
|
112
|
+
- 0
|
54
113
|
version: "0"
|
55
|
-
version:
|
56
114
|
requirements: []
|
57
115
|
|
58
116
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.
|
117
|
+
rubygems_version: 1.5.2
|
60
118
|
signing_key:
|
61
119
|
specification_version: 3
|
62
120
|
summary: Simple mechanism for deferred execution of a block
|