sleep2 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfb0c06a9f091832dcfa13ce7996f27626335442
4
- data.tar.gz: 792e923777e1e6f6eb682a02d25d7849c428acf3
3
+ metadata.gz: 6aa42b4d7a08e76a9286f915dad31be946ef8799
4
+ data.tar.gz: 902f693b95b9f75eaf95315fdbc2b218c6d3bd63
5
5
  SHA512:
6
- metadata.gz: b740c8560d8b65db38313d8880e9b85f1295cbada30f6ccc1ddf38cb0c27a10cacd4037bab141e8dfeb12c750c679e5bd02834b8c2ae5d728dc9226312c7c7b6
7
- data.tar.gz: 02b67b43d475528d2dfbd922d95ffa8b855baea649371746fdcd88e00a4ed6eb1c3933c7c10e49cb12025a2d52ec10db4d525416744ac86eb14ab6462cdbf1c3
6
+ metadata.gz: 9d083104f206bdacb79635f9905e9f22c93adc1172a28a1bd4e1615ade62df0c4e95828e37e65e570400299fc724a3b300c629eaae9b8470e707df3dee06bf0d
7
+ data.tar.gz: 0a8bb0d665df888535f652607c31cc56ac2958edf712c83c582c2384dd2eb64f4283814da4eaa0c926e617f82d5843564967a8a9557c0db8a43d406e0dc65ef9
data/Gemfile CHANGED
@@ -1,4 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in sleep2.gemspec
4
- gemspec
4
+ # gemspec
5
+
6
+ group :development do
7
+ gem "bundler", "~> 1.14"
8
+ gem "rake", "~> 10.0"
9
+ gem "rspec", "~> 3.0"
10
+ end
11
+ group :development, :test do
12
+ gem 'pry', '~> 0.10.4'
13
+ end
@@ -10,13 +10,14 @@ class Sleep2
10
10
  attr_accessor :duration, :sleep_proc
11
11
  attr_writer :new
12
12
 
13
- def initialize duration
14
- if duration.class.ancestors.include?(Numeric)
15
- @duration = duration.to_f
16
- elsif duration.class == self.class
17
- @duration = duration.duration.to_f
13
+ def initialize time_interval
14
+ if time_interval.class.ancestors.include?(Numeric)
15
+ self.duration = time_interval.to_f
16
+ elsif time_interval.class == self.class
17
+ self.duration = time_interval.duration.to_f
18
18
  else
19
- raise TypeError, "can't convert #{duration.class} into time interval"
19
+ msg = "can't convert #{time_interval.class} into time interval"
20
+ raise TypeError, msg
20
21
  end
21
22
  @new = true
22
23
  end
@@ -30,7 +31,7 @@ class Sleep2
30
31
  unless new?
31
32
  self.sleep_proc.call
32
33
  else
33
- self.new = false
34
+ self.new = false
34
35
  self.sleep_proc = proc { sleep duration }
35
36
  end
36
37
  end
@@ -40,7 +41,7 @@ class Sleep2
40
41
  end
41
42
 
42
43
  # Creates new sleep instance by calculating it with integer
43
- [:*, :/, :+, :-, :%, :**].each do |m|
44
+ %i[* / + - % **].each do |m|
44
45
  define_method m do |num|
45
46
  num = num.duration if num.kind_of? self.class
46
47
  self.class[ duration.public_send(m, num) ]
@@ -1,3 +1,3 @@
1
1
  class Sleep2
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -20,8 +20,4 @@ Gem::Specification.new do |spec|
20
20
  spec.bindir = "exe"
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
-
24
- spec.add_development_dependency "bundler", "~> 1.14"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- spec.add_development_dependency "rspec", "~> 3.0"
27
23
  end
metadata CHANGED
@@ -1,57 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleep2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Setyadi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-20 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.14'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.14'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
11
+ date: 2017-09-19 00:00:00.000000000 Z
12
+ dependencies: []
55
13
  description: ''
56
14
  email:
57
15
  - a.styd@yahoo.com