read_time 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/read_time.rb +17 -14
- data/lib/read_time/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82f314044371b282c264c7049096df3f79b7b0d4
|
4
|
+
data.tar.gz: 24a3cd52545e4c3bcaa6a16fe354784232d22817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bd1b36bec470e614331004ff7b02355f5f9af95e5ba5d6de2ae725bf8f2dff1a8ece78bd24187651ebd6afdab575676e85f6bc0eea77dc6670c00b2fa76fe89
|
7
|
+
data.tar.gz: 758ccdcd837c6740d18c1d9275317fc56c4a9c9b77925d2e3a40b173cca160ccca5c4bef8270d2a234c05467e9d3a1d1904b55770a453af9e4cf55089ed5d486
|
data/lib/read_time.rb
CHANGED
@@ -4,6 +4,23 @@ module ReadTime
|
|
4
4
|
module String
|
5
5
|
@output = ""
|
6
6
|
|
7
|
+
def time_to_read
|
8
|
+
if seconds_to_read <= 1
|
9
|
+
puts "1 second"
|
10
|
+
elsif seconds_to_read > 1 && seconds_to_read < 60
|
11
|
+
puts "#{seconds_to_read} seconds"
|
12
|
+
else
|
13
|
+
if seconds_to_read >= 3600
|
14
|
+
hours_to_read(seconds_to_read)
|
15
|
+
else
|
16
|
+
minutes_to_read(seconds_to_read)
|
17
|
+
end
|
18
|
+
puts @output
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
7
24
|
def seconds_to_read
|
8
25
|
(self.split(" ").count/3.3333333333).to_i
|
9
26
|
end
|
@@ -38,20 +55,6 @@ module ReadTime
|
|
38
55
|
end
|
39
56
|
end
|
40
57
|
|
41
|
-
def time_to_read
|
42
|
-
if seconds_to_read <= 1
|
43
|
-
puts "1 second"
|
44
|
-
elsif seconds_to_read > 1 && seconds_to_read < 60
|
45
|
-
puts "#{seconds_to_read} seconds"
|
46
|
-
else
|
47
|
-
if seconds_to_read >= 3600
|
48
|
-
hours_to_read(seconds_to_read)
|
49
|
-
else
|
50
|
-
minutes_to_read(seconds_to_read)
|
51
|
-
end
|
52
|
-
puts @output
|
53
|
-
end
|
54
|
-
end
|
55
58
|
end
|
56
59
|
end
|
57
60
|
|
data/lib/read_time/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: read_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaan Kölköy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|