-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Playing around with Tryout formatting
- Loading branch information
Showing
13 changed files
with
137 additions
and
146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require 'gibbler' | ||
|
||
# TEST 1: has String#clear | ||
"".respond_to? :clear | ||
## has String#clear | ||
"".respond_to? :clear | ||
#=> true | ||
|
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,16 +1,14 @@ | ||
require 'gibbler' | ||
|
||
## Gibbler Objects have gibbler_cache method | ||
"kimmy".respond_to? :gibbler_cache | ||
"kimmy".respond_to? :gibbler_cache | ||
#=> true | ||
|
||
|
||
## Gibbler Objects have __gibbler_cache method | ||
"kimmy".respond_to? :__gibbler_cache | ||
"kimmy".respond_to? :__gibbler_cache | ||
#=> true | ||
|
||
|
||
## __gibbler_cache returns the same value as gibbler_cache | ||
@a = "kimmy" and @a.gibbler | ||
@a.gibbler_cache | ||
@a = "kimmy" and @a.gibbler | ||
@a.gibbler_cache | ||
#=> @a.__gibbler_cache |
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,41 +1,41 @@ | ||
require 'gibbler' | ||
|
||
## has short method | ||
"kimmy".gibbler.short | ||
"kimmy".gibbler.short | ||
#=> Gibbler::Digest.new("c8027100") | ||
|
||
# can Gibbler::Digest#short | ||
Gibbler::Digest.new("1234567890").short | ||
Gibbler::Digest.new("1234567890").short | ||
#=> Gibbler::Digest.new("12345678") | ||
|
||
# == is strict (only exact matches) | ||
Gibbler::Digest.new("1234567890") == "12345678" | ||
#=> false | ||
Gibbler::Digest.new("1234567890") != "12345678" | ||
#=> true | ||
|
||
# === is relaxed (allows partial matches) | ||
Gibbler::Digest.new("1234567890") === "12345678" | ||
Gibbler::Digest.new("1234567890") === "12345678" | ||
#=> true | ||
|
||
# supports base36 output | ||
Gibbler::Digest.new("1234567890").base36 | ||
Gibbler::Digest.new("1234567890").base36 | ||
#=> 'zx2tc40' | ||
|
||
# base36 works on digests too | ||
"kimmy".gibbler.base36 | ||
"kimmy".gibbler.base36 | ||
#=> 'nd2w8270caslmly0ix3s8ruh0y8yjdt' | ||
|
||
# base36 digests can be short too | ||
"kimmy".gibbler.base36.short | ||
"kimmy".gibbler.base36.short | ||
#=> 'nd2w8270' | ||
|
||
# to_s returns a string and can accept a base | ||
"kimmy".gibbler.to_s(16) | ||
"kimmy".gibbler.to_s(16) | ||
#=> "kimmy".gibbler.base(16).to_s | ||
|
||
# base takes a base | ||
"kimmy".gibbler.base(17) | ||
"kimmy".gibbler.base(17) | ||
#=> '12gaabd69eg5b32gf69a7a021c22g977d4gf46d6' | ||
|
||
# to_s can take a base | ||
"kimmy".gibbler.to_s(36) | ||
"kimmy".gibbler.to_s(36) | ||
#=> "kimmy".gibbler.base36 |
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
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.