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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6c1274fc4f10b8860e681795296cca03927b332
4
- data.tar.gz: 08ce22e83b9a42170d38984e3915b07c77d84129
3
+ metadata.gz: 1a543c0944777c77f982ab1cd4c168111b3d1f0d
4
+ data.tar.gz: 6d4873e309978e224b33721fc92e73ed41e8623e
5
5
  SHA512:
6
- metadata.gz: e8e6eb7f31ef0fafa6d804224e0c7d42f0b33fd0bde9454b251c92e2bc720acd8577ade34a06f393e6e3a968ab7a59fa7a8c97cd51b304e410281f7617801ebc
7
- data.tar.gz: eb84db096172fe21dc5fb752bf242d1a2c5b9e7300b75bf8feb6869594dc6dd5cf32ee7b1886f42d658983d9538f8106a4659cd6cbb9a4c45c8052449740bf1b
6
+ metadata.gz: c5ac6813b68f2ffaee52ce46a78058e6b0e624008cc77db1666d39ae8509946367689bd8f12a66290c31f693817a3a2b9f26cf7ed16349b3cdb4cbd4bb8c35e7
7
+ data.tar.gz: f7d57a17d661b271746981f8dfbc1ed4d4a9a0447a3134b73436d433a5e893015dda52b2b475b00eb645252cbe388bd9e83607ffb1e2b49dd0ed8fa87218340b
data/.gitignore CHANGED
@@ -1,2 +1,6 @@
1
1
  Gemfile.lock
2
2
  *.gem
3
+ gemfiles/*.lock
4
+
5
+ # Ignore IDE-specific files.
6
+ /.idea
@@ -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 }
@@ -0,0 +1,7 @@
1
+ appraise 'activesupport3' do
2
+ gem 'activesupport', '~> 3.2.13'
3
+ end
4
+
5
+ appraise 'activesupport4' do
6
+ gem 'activesupport', '~> 4.0.0'
7
+ end
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.
@@ -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
@@ -1,5 +1,9 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'appraisal'
1
5
  require 'rspec/core/rake_task'
2
6
 
3
7
  RSpec::Core::RakeTask.new(:spec)
4
8
 
5
- task :default => :spec
9
+ task default: :spec
@@ -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.authors = ['Hari Gopal']
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.2'
18
+ s.required_ruby_version = '>= 1.9.3'
19
19
 
20
- s.add_development_dependency 'rake'
21
- s.add_development_dependency 'rspec'
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 .rvmrc)
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
@@ -1,6 +1,5 @@
1
- require 'active_support/time'
2
- require 'enat/import'
1
+ require_relative '../lib/enat'
3
2
 
4
- every(2.seconds) do |iteration|
3
+ every 2.seconds do |iteration|
5
4
  puts "Hello no. #{iteration}!"
6
5
  end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~> 3.2.13"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~> 4.0.0"
6
+
7
+ gemspec :path=>"../"
@@ -1,5 +1,5 @@
1
1
  module Enat
2
2
  def self.version
3
- Gem::Version.new '0.1.2'
3
+ Gem::Version.new '0.1.3'
4
4
  end
5
5
  end
@@ -34,8 +34,8 @@ describe DummyClass do
34
34
  end
35
35
 
36
36
  it 'works' do
37
- subject.stub :sleep
38
- subject.should_receive(:repeatable_task).exactly(5).times
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.2
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: 2013-07-10 00:00:00.000000000 Z
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: '0'
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: '0'
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
- - .ruby-version
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.2
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.0.3
113
+ rubygems_version: 2.4.5.1
96
114
  signing_key:
97
115
  specification_version: 4
98
116
  summary: Does something every specified interval.
@@ -1 +0,0 @@
1
- ruby-2.0.0