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 CHANGED
@@ -1 +1,3 @@
1
- pkg
1
+ pkg
2
+ *~
3
+ Gemfile.lock
@@ -0,0 +1 @@
1
+ deferrable
@@ -0,0 +1 @@
1
+ ree-1.8.7-2012.02
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://www.rubygems.org"
2
+
3
+ gemspec
@@ -30,7 +30,7 @@ process or thread.
30
30
 
31
31
  == Install:
32
32
 
33
- sudo gem install deferrable -s http://gemcutter.org
33
+ gem install deferrable
34
34
 
35
35
  == License:
36
36
 
data/Rakefile CHANGED
@@ -1,44 +1,10 @@
1
- require 'rake'
2
1
  require 'rake/testtask'
3
- require 'rake/rdoctask'
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 << 'lib'
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
1
+ 0.2.0
@@ -1,50 +1,21 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
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 |s|
7
- s.name = %q{deferrable}
8
- s.version = "0.1.0"
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
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Justin Balthrop"]
12
- s.date = %q{2009-11-20}
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
- if s.respond_to? :specification_version then
41
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
42
- s.specification_version = 3
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
-
@@ -1,7 +1,47 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  class DeferrableTest < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
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
@@ -1,10 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'test/unit'
3
3
  require 'shoulda'
4
- require 'mocha'
4
+ require 'mocha/setup'
5
5
 
6
- $LOAD_PATH.unshift(File.dirname(__FILE__))
7
6
  require 'deferrable'
8
7
 
9
- class Test::Unit::TestCase
10
- end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deferrable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
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: 2009-11-20 00:00:00 -08:00
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: code@justinbalthrop
66
+ email:
67
+ - git@justinbalthrop.com
18
68
  executables: []
19
69
 
20
70
  extensions: []
21
71
 
22
- extra_rdoc_files:
23
- - LICENSE
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: http://github.com/ninjudd/deferrable
88
+ homepage: https://github.com/ninjudd/deferrable
37
89
  licenses: []
38
90
 
39
91
  post_install_message:
40
- rdoc_options:
41
- - --charset=UTF-8
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.3.5
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