waitforit 0.0.0.pre6 → 0.0.1.pre1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source :rubygems
2
2
 
3
3
  group :development do
4
- gem "jeweler", "1.5.2", :require => 'jeweler'
4
+ gem "jeweler", :require => 'jeweler'
5
5
  gem "rspec", :require => ['rspec', 'rspec/core/rake_task']
6
6
  end
data/Gemfile.lock CHANGED
@@ -3,8 +3,8 @@ GEM
3
3
  specs:
4
4
  diff-lcs (1.1.2)
5
5
  git (1.2.5)
6
- jeweler (1.5.2)
7
- bundler (~> 1.0.0)
6
+ jeweler (1.6.4)
7
+ bundler (~> 1.0)
8
8
  git (>= 1.2.5)
9
9
  rake
10
10
  rake (0.9.2)
@@ -21,5 +21,5 @@ PLATFORMS
21
21
  ruby
22
22
 
23
23
  DEPENDENCIES
24
- jeweler (= 1.5.2)
24
+ jeweler
25
25
  rspec
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  Bundler.require(:default, :development)
2
2
  RSpec::Core::RakeTask.new('default')
3
+
3
4
  Jeweler::RubygemsDotOrgTasks.new
4
5
 
5
6
  Jeweler::Tasks.new do |gem|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0.pre6
1
+ 0.0.1.pre1
data/lib/waitforit.rb CHANGED
@@ -12,7 +12,7 @@ class Fixnum
12
12
  end
13
13
 
14
14
  def wait_until opts={}
15
- opts = {:timeout_after => 5.seconds,:retry_every => 0.1.seconds}.merge(opts)
15
+ opts.merge!(:timeout_after => 2.seconds,:retry_every => 0.1.seconds)
16
16
  start_time = Time.now
17
17
  until Time.now > start_time + opts[:timeout_after]
18
18
  return if yield == true
@@ -9,29 +9,25 @@ describe 'waitforit' do
9
9
  end
10
10
  end_time.should be < Time.now
11
11
  end
12
-
12
+
13
13
  it 'should throw an exception if when the prescribed action does not happen in time' do
14
- expect { wait_until(:timeout_after => 1.second) { false } }.to raise_error RuntimeError
14
+ expect{wait_until{false}}.to raise_error RuntimeError
15
15
  end
16
-
16
+
17
17
  it 'should keep trying for a specified period' do
18
18
  start_time = Time.now
19
19
  wait_time = 1.second
20
-
21
- lambda { wait_until(:timeout_after => wait_time) { false } }
22
-
23
- (start_time + wait_time).should be >= Time.now
20
+
21
+ lambda{wait_until(:timeout_after => wait_time){false}}
22
+
23
+ (start_time + wait_time).should be >= Time.now
24
24
  end
25
-
25
+
26
26
  it 'should be possible for user to supply the retry time' do
27
27
  count = 0
28
-
29
- begin
30
- wait_until(:timeout_after => 1.second, :retry_every => 0.5.seconds) do
31
- count += 1
32
- end
33
- rescue
34
- count.should == 2
28
+ wait_until(:timeout_after => 2.seconds, :retry_every => 0.5.seconds) do
29
+ count += 1
30
+ count == 4
35
31
  end
36
32
  end
37
33
  end
data/waitforit.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{waitforit}
8
- s.version = "0.0.0.pre6"
8
+ s.version = "0.0.1.pre1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["lashd"]
@@ -37,22 +37,19 @@ Gem::Specification.new do |s|
37
37
  s.require_paths = ["lib"]
38
38
  s.rubygems_version = %q{1.6.1}
39
39
  s.summary = %q{Tired of sleeping when something is supposed to happen? use this to waitforit instead :)}
40
- s.test_files = [
41
- "spec/waitforit_spec.rb"
42
- ]
43
40
 
44
41
  if s.respond_to? :specification_version then
45
42
  s.specification_version = 3
46
43
 
47
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
- s.add_development_dependency(%q<jeweler>, ["= 1.5.2"])
45
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
49
46
  s.add_development_dependency(%q<rspec>, [">= 0"])
50
47
  else
51
- s.add_dependency(%q<jeweler>, ["= 1.5.2"])
48
+ s.add_dependency(%q<jeweler>, [">= 0"])
52
49
  s.add_dependency(%q<rspec>, [">= 0"])
53
50
  end
54
51
  else
55
- s.add_dependency(%q<jeweler>, ["= 1.5.2"])
52
+ s.add_dependency(%q<jeweler>, [">= 0"])
56
53
  s.add_dependency(%q<rspec>, [">= 0"])
57
54
  end
58
55
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: waitforit
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 6
5
- version: 0.0.0.pre6
5
+ version: 0.0.1.pre1
6
6
  platform: ruby
7
7
  authors:
8
8
  - lashd
@@ -18,9 +18,9 @@ dependencies:
18
18
  requirement: &id001 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
- - - "="
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.5.2
23
+ version: "0"
24
24
  type: :development
25
25
  prerelease: false
26
26
  version_requirements: *id001
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
- hash: 140276702136187881
81
+ hash: -512404082193466775
82
82
  segments:
83
83
  - 0
84
84
  version: "0"
@@ -95,5 +95,5 @@ rubygems_version: 1.6.1
95
95
  signing_key:
96
96
  specification_version: 3
97
97
  summary: Tired of sleeping when something is supposed to happen? use this to waitforit instead :)
98
- test_files:
99
- - spec/waitforit_spec.rb
98
+ test_files: []
99
+