-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from ba-st/superluminal_needs
Add extensions needed for Superluminal
- Loading branch information
Showing
16 changed files
with
103 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
source/Buoy-Chronology-GS64-Extensions/DateAndTime.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 14 additions & 8 deletions
22
source/Buoy-Chronology-GS64-Extensions/Duration.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,43 @@ | ||
Extension { #name : #Duration } | ||
Extension { #name : 'Duration' } | ||
|
||
{ #category : #'*Buoy-Chronology-GS64-Extensions' } | ||
{ #category : '*Buoy-Chronology-GS64-Extensions' } | ||
Duration >> asMilliSeconds [ | ||
|
||
^ self asSeconds * 1000 | ||
] | ||
|
||
{ #category : #'*Buoy-Chronology-GS64-Extensions' } | ||
{ #category : '*Buoy-Chronology-GS64-Extensions' } | ||
Duration class >> days: aNumber [ | ||
|
||
^ self seconds: aNumber * 86400 | ||
] | ||
|
||
{ #category : #'*Buoy-Chronology-GS64-Extensions' } | ||
{ #category : '*Buoy-Chronology-GS64-Extensions' } | ||
Duration class >> hours: aNumber [ | ||
|
||
^ self seconds: aNumber * 3600 | ||
] | ||
|
||
{ #category : #'*Buoy-Chronology-GS64-Extensions' } | ||
{ #category : '*Buoy-Chronology-GS64-Extensions' } | ||
Duration class >> milliSeconds: aNumber [ | ||
|
||
^ self seconds: aNumber / 1000 | ||
] | ||
|
||
{ #category : #'*Buoy-Chronology-GS64-Extensions' } | ||
{ #category : '*Buoy-Chronology-GS64-Extensions' } | ||
Duration class >> minutes: aNumber [ | ||
|
||
^ self seconds: aNumber * 60 | ||
] | ||
|
||
{ #category : #'*Buoy-Chronology-GS64-Extensions' } | ||
{ #category : '*Buoy-Chronology-GS64-Extensions' } | ||
Duration >> totalSeconds [ | ||
|
||
^self asSeconds | ||
] | ||
|
||
{ #category : '*Buoy-Chronology-GS64-Extensions' } | ||
Duration >> wait [ | ||
|
||
^ Delay waitForMilliseconds: self seconds * 1000 | ||
^ Delay waitForMilliseconds: (self seconds * 1000) rounded | ||
] |
18 changes: 9 additions & 9 deletions
18
source/Buoy-Chronology-GS64-Extensions/Integer.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Package { #name : #'Buoy-Chronology-GS64-Extensions' } | ||
Package { #name : 'Buoy-Chronology-GS64-Extensions' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
source/Buoy-Chronology-Tests/DurationChronologyExtensionsTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Class { | ||
#name : 'DurationChronologyExtensionsTest', | ||
#superclass : 'TestCase', | ||
#category : 'Buoy-Chronology-Tests', | ||
#package : 'Buoy-Chronology-Tests' | ||
} | ||
|
||
{ #category : 'tests' } | ||
DurationChronologyExtensionsTest >> testTotalSeconds [ | ||
|
||
self assert: 0 seconds totalSeconds equals: 0. | ||
self assert: 1 second totalSeconds equals: 1. | ||
self assert: 100 second totalSeconds equals: 100. | ||
self assert: 500 milliSeconds totalSeconds equals: 1 / 2. | ||
self assert: 1500 milliSeconds totalSeconds equals: 3 / 2. | ||
self assert: 2500 milliSeconds totalSeconds equals: 5 / 2. | ||
self assert: 1 second negated totalSeconds equals: -1 | ||
] | ||
|
||
{ #category : 'tests' } | ||
DurationChronologyExtensionsTest >> testWait [ | ||
|
||
| ms | | ||
|
||
ms := Time millisecondsToRun: [ 2.1 seconds wait ]. | ||
self assert: ms >= 2100 | ||
] |
15 changes: 8 additions & 7 deletions
15
source/Buoy-Chronology-Tests/NumberChronologyExtensionsTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Package { #name : #'Buoy-Chronology-Tests' } | ||
Package { #name : 'Buoy-Chronology-Tests' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.