cogsworth 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Jon buda"]
10
10
  s.email = ["jon.buda@gmail.com"]
11
- s.homepage = "http://jonbuda.com"
11
+ s.homepage = "https://github.com/jonbuda/cogsworth"
12
12
  s.summary = %q{A simple natural language time parser for Ruby}
13
13
  s.description = %q{A simple natural language time parser for Ruby}
14
14
 
@@ -13,15 +13,15 @@ module Cogsworth
13
13
  end
14
14
  end
15
15
 
16
- def unparse(seconds, strings=[])
17
- return strings.join(' ') if seconds == 0
16
+ def unparse(seconds, results=[])
17
+ return results.join(' ') if seconds == 0
18
18
 
19
19
  ['d','h','m','s'].each do |unit|
20
- times = seconds/MULTIPLIERS[unit]
21
- return unparse(seconds%MULTIPLIERS[unit], strings << "#{times}#{unit}") if times > 0
20
+ occurrences = seconds/MULTIPLIERS[unit]
21
+ return unparse(seconds%MULTIPLIERS[unit], results.push("#{occurrences}#{unit}")) if occurrences > 0
22
22
  end
23
23
 
24
- return unparse(seconds, strings)
24
+ return unparse(seconds, results)
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module Cogsworth
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cogsworth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jon buda
@@ -55,7 +55,7 @@ files:
55
55
  - spec/cogsworth_spec.rb
56
56
  - spec/spec_helper.rb
57
57
  has_rdoc: true
58
- homepage: http://jonbuda.com
58
+ homepage: https://github.com/jonbuda/cogsworth
59
59
  licenses: []
60
60
 
61
61
  post_install_message: