time-duration 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 1f502a9a7070e49f482194bc32b0088c870a17982fc0813eefcfe2bde1f37cd8
4
- data.tar.gz: a1e7b1f887269a4968c01bb295d0b83d39334c59c2f52f0ae7978c26758e0be4
3
+ metadata.gz: 0442605737d2771dfc2851b423314004a3ff36c90ca333d3a853b65406383312
4
+ data.tar.gz: aa2393be39bea4695c7a58c0d36b336b622484faa592f077af1cd0e5b97ee5f1
5
5
  SHA512:
6
- metadata.gz: b645c411287e086d4e881e384a5679ceea4d4825621fd39078c219dde65084ca122efe0d35b7a219bd9a6338422f94c7101d29434301f76a5c5fbebfda60e583
7
- data.tar.gz: '094da884457bac621c2b7d3bd4b54d06f42d50a7fb7eb73207439e2933ab9086c98dfe4cd5592c2dfc1872fd423f0b3ed552b42340c5189dc0119cff49985fef'
6
+ metadata.gz: 3a62509caf01a6cf2ed7ef996d3b3bbb19038cfd2da849e7657aa788251def6fd3db46b8faa8e769482b75305f7f85a51787fa244c73981f2b9c8086117151ef
7
+ data.tar.gz: b151a4f20375f6067bec4dea7265db305d9a198d3c9a8d09a0568a8a398f1dca80b4a49ac02c5cf416f1f35225bb40035b6242b4887eea870195229f56aa5429
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- time-duration (0.1.0)
4
+ time-duration (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,15 +1,11 @@
1
1
  # TimeDuration
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/time_duration`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
10
6
 
11
7
  ```ruby
12
- gem 'time_duration'
8
+ gem 'time-duration'
13
9
  ```
14
10
 
15
11
  And then execute:
@@ -18,11 +14,48 @@ And then execute:
18
14
 
19
15
  Or install it yourself as:
20
16
 
21
- $ gem install time_duration
17
+ $ gem install time-duration
22
18
 
23
19
  ## Usage
24
20
 
25
- TODO: Write usage instructions here
21
+
22
+
23
+ ### Parser
24
+
25
+ ```ruby
26
+ duration = TimeDuration.parse('1:10')
27
+ duration.to_s # => "1:10"
28
+
29
+ duration = TimeDuration.parse('1:70')
30
+ duration.to_s # => "2:10"
31
+ ```
32
+
33
+ ### Initializer
34
+
35
+ ```ruby
36
+ TimeDuration::Duration.new # => 0:00
37
+ TimeDuration::Duration.new(minutes: 10) # => 0:10
38
+ TimeDuration::Duration.new(hours: 1) # => 1:00
39
+ TimeDuration::Duration.new(hours: 1, minutes: 10) # => 1:10
40
+ ```
41
+
42
+ ### Operations
43
+
44
+ ```ruby
45
+ duration = TimeDuration.parse('0:40') + TimeDuration.parse('0:30')
46
+ duration.to_s # => "1:10"
47
+
48
+ duration = TimeDuration.parse('0:40') - TimeDuration.parse('0:30')
49
+ duration.to_s # => "0:10"
50
+ ```
51
+
52
+ ### Comparisons
53
+
54
+ ```ruby
55
+ TimeDuration.parse('0:40') > TimeDuration.parse('0:30') # => true
56
+
57
+ TimeDuration.parse('0:60') == TimeDuration.parse('1:00') # => true
58
+ ```
26
59
 
27
60
  ## Development
28
61
 
@@ -1,3 +1,3 @@
1
1
  module TimeDuration
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time-duration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daiki Matoba