-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add timer support - tidy-up - bump version to v1.1.0
- Loading branch information
1 parent
a409e33
commit d8bb5e7
Showing
8 changed files
with
338 additions
and
130 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
puts <<~INFO | ||
This is an example how to use named and anonymous timers. | ||
INFO | ||
|
||
require_relative '../lib/im-lost' | ||
|
||
puts 'Create a named timer:' | ||
ImLost.timer.create(:first) | ||
|
||
puts 'Create an anonymous timer:' | ||
second = ImLost.timer.create | ||
|
||
sleep(0.5) # or whatever | ||
|
||
puts 'print runtime for named timer:' | ||
ImLost.timer[:first] | ||
|
||
puts 'print runtime for anonymous timer:' | ||
ImLost.timer[second] | ||
|
||
puts 'delete a named timer' | ||
ImLost.timer.delete(:first) | ||
|
||
puts 'delete an anonymous timer' | ||
ImLost.timer.delete(second) |
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
module ImLost | ||
# The version number of the gem. | ||
VERSION = '1.0.2' | ||
VERSION = '1.1.0' | ||
end |
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,7 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'stringio' | ||
require_relative '../lib/im-lost' | ||
|
||
$stdout.sync = $stderr.sync = $VERBOSE = true | ||
|
||
RSpec.configure(&:disable_monkey_patching!) | ||
|
||
require 'stringio' | ||
|
||
RE_FLOAT = '[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?' | ||
|
||
require_relative '../lib/im-lost' |
Oops, something went wrong.