enat 0.1.2 → 0.1.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.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.travis.yml +10 -0
- data/Appraisals +7 -0
- data/LICENSE +20 -0
- data/README.markdown +2 -0
- data/Rakefile +5 -1
- data/enat.gemspec +7 -6
- data/examples/test.rb +2 -3
- data/gemfiles/activesupport3.gemfile +7 -0
- data/gemfiles/activesupport4.gemfile +7 -0
- data/lib/enat/version.rb +1 -1
- data/spec/enat/enat_spec.rb +2 -2
- data/test.rb +5 -0
- metadata +38 -20
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a543c0944777c77f982ab1cd4c168111b3d1f0d
|
4
|
+
data.tar.gz: 6d4873e309978e224b33721fc92e73ed41e8623e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5ac6813b68f2ffaee52ce46a78058e6b0e624008cc77db1666d39ae8509946367689bd8f12a66290c31f693817a3a2b9f26cf7ed16349b3cdb4cbd4bb8c35e7
|
7
|
+
data.tar.gz: f7d57a17d661b271746981f8dfbc1ed4d4a9a0447a3134b73436d433a5e893015dda52b2b475b00eb645252cbe388bd9e83607ffb1e2b49dd0ed8fa87218340b
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
matrix:
|
4
|
+
include:
|
5
|
+
# Current stable ruby is being tested comprehensively.
|
6
|
+
- { rvm: 2.0.0, gemfile: gemfiles/activesupport3.gemfile }
|
7
|
+
- { rvm: 2.0.0, gemfile: gemfiles/activesupport4.gemfile }
|
8
|
+
|
9
|
+
- { rvm: 1.9.3, gemfile: gemfiles/activesupport3.gemfile }
|
10
|
+
- { rvm: 1.9.3, gemfile: gemfiles/activesupport4.gemfile }
|
data/Appraisals
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2013 Hari Gopal
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
18
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
19
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
20
|
+
OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
Every Now And Then
|
2
2
|
==================
|
3
3
|
|
4
|
+
[<img src="https://secure.travis-ci.org/harigopal/enat.png?branch=master" alt="Build Status" />](http://travis-ci.org/harigopal/enat)
|
5
|
+
|
4
6
|
It's quite simple, really - it lets you do something every specified interval of time. When supplied with a block, it
|
5
7
|
yields the iteration count (starts at zero).
|
6
8
|
|
data/Rakefile
CHANGED
data/enat.gemspec
CHANGED
@@ -8,21 +8,22 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = Enat.version
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
|
11
|
-
s.
|
11
|
+
s.author = 'Hari Gopal'
|
12
12
|
s.email = 'harigopal1@gmail.com'
|
13
13
|
s.summary = 'Does something every specified interval.'
|
14
14
|
s.description = 'Executes a block of code at intervals of time, without guarantee of timing.'
|
15
15
|
s.homepage = 'http://github.com/harigopal/enat'
|
16
16
|
s.license = 'MIT'
|
17
17
|
|
18
|
-
s.required_ruby_version = '>= 1.9.
|
18
|
+
s.required_ruby_version = '>= 1.9.3'
|
19
19
|
|
20
|
-
s.add_development_dependency '
|
21
|
-
s.add_development_dependency '
|
20
|
+
s.add_development_dependency 'appraisal', '~> 2.0'
|
21
|
+
s.add_development_dependency 'rake', '~> 10.0'
|
22
|
+
s.add_development_dependency 'rspec', '~> 3.0'
|
22
23
|
|
23
|
-
s.add_dependency 'activesupport'
|
24
|
+
s.add_dependency 'activesupport', '>= 3.2.13'
|
24
25
|
|
25
|
-
s.files = `git ls-files`.split("\n") - %w(Gemfile.lock .
|
26
|
+
s.files = `git ls-files`.split("\n") - %w(Gemfile.lock .ruby-version)
|
26
27
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
27
28
|
s.require_paths = %w(lib)
|
28
29
|
end
|
data/examples/test.rb
CHANGED
data/lib/enat/version.rb
CHANGED
data/spec/enat/enat_spec.rb
CHANGED
@@ -34,8 +34,8 @@ describe DummyClass do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'works' do
|
37
|
-
subject.
|
38
|
-
subject.
|
37
|
+
allow(subject).to receive(:sleep)
|
38
|
+
expect(subject).to receive(:repeatable_task).exactly(5).times
|
39
39
|
subject.test_method
|
40
40
|
end
|
41
41
|
end
|
data/test.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
require_relative 'lib/enat'
|
2
2
|
|
3
|
+
start_time = Time.now
|
4
|
+
|
3
5
|
every 5.seconds do |iteration|
|
6
|
+
time_since_start = (Time.now.to_f - start_time.to_f).round(2)
|
7
|
+
drift = (time_since_start - (iteration * 5)).round(2)
|
8
|
+
puts "Starting new iteration. Time since start: #{time_since_start}s (Drift: #{drift}s)"
|
4
9
|
sleep_time = rand(5)
|
5
10
|
puts "#{Time.now.to_f}: Sleeping for #{sleep_time} seconds... (Iteration #{iteration})"
|
6
11
|
sleep sleep_time
|
metadata
CHANGED
@@ -1,70 +1,88 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hari Gopal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: appraisal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rake
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- -
|
31
|
+
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
33
|
+
version: '10.0'
|
20
34
|
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- -
|
38
|
+
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
40
|
+
version: '10.0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- -
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
47
|
+
version: '3.0'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- -
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
54
|
+
version: '3.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: activesupport
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
61
|
+
version: 3.2.13
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
68
|
+
version: 3.2.13
|
55
69
|
description: Executes a block of code at intervals of time, without guarantee of timing.
|
56
70
|
email: harigopal1@gmail.com
|
57
71
|
executables: []
|
58
72
|
extensions: []
|
59
73
|
extra_rdoc_files: []
|
60
74
|
files:
|
61
|
-
- .gitignore
|
62
|
-
- .
|
75
|
+
- ".gitignore"
|
76
|
+
- ".travis.yml"
|
77
|
+
- Appraisals
|
63
78
|
- Gemfile
|
79
|
+
- LICENSE
|
64
80
|
- README.markdown
|
65
81
|
- Rakefile
|
66
82
|
- enat.gemspec
|
67
83
|
- examples/test.rb
|
84
|
+
- gemfiles/activesupport3.gemfile
|
85
|
+
- gemfiles/activesupport4.gemfile
|
68
86
|
- lib/enat.rb
|
69
87
|
- lib/enat/enat.rb
|
70
88
|
- lib/enat/error.rb
|
@@ -82,17 +100,17 @@ require_paths:
|
|
82
100
|
- lib
|
83
101
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
102
|
requirements:
|
85
|
-
- -
|
103
|
+
- - ">="
|
86
104
|
- !ruby/object:Gem::Version
|
87
|
-
version: 1.9.
|
105
|
+
version: 1.9.3
|
88
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
107
|
requirements:
|
90
|
-
- -
|
108
|
+
- - ">="
|
91
109
|
- !ruby/object:Gem::Version
|
92
110
|
version: '0'
|
93
111
|
requirements: []
|
94
112
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.4.5.1
|
96
114
|
signing_key:
|
97
115
|
specification_version: 4
|
98
116
|
summary: Does something every specified interval.
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-2.0.0
|