-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combine everything into a single file
- Loading branch information
Showing
9 changed files
with
177 additions
and
132 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,3 +1 @@ | ||
require_relative "x/version" | ||
require_relative "x/errors" | ||
require_relative "x/client" |
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 was deleted.
Oops, something went wrong.
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,3 +1,39 @@ | ||
module X | ||
VERSION = "0.2.0".freeze | ||
# The version of this library | ||
module Version | ||
module_function | ||
|
||
def major | ||
0 | ||
end | ||
|
||
def minor | ||
2 | ||
end | ||
|
||
def patch | ||
0 | ||
end | ||
|
||
def pre | ||
nil | ||
end | ||
|
||
def to_h | ||
{ | ||
major: major, | ||
minor: minor, | ||
patch: patch, | ||
pre: pre | ||
} | ||
end | ||
|
||
def to_a | ||
[major, minor, patch, pre].compact | ||
end | ||
|
||
def to_s | ||
to_a.join(".") | ||
end | ||
end | ||
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
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 was deleted.
Oops, something went wrong.
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,31 @@ | ||
require "test_helper" | ||
|
||
class TestX < Minitest::Test | ||
class VersionTest < Minitest::Test | ||
def test_major_version | ||
refute_nil X::Version.major | ||
end | ||
|
||
def test_minor_version | ||
refute_nil X::Version.minor | ||
end | ||
|
||
def test_patch_version | ||
refute_nil X::Version.patch | ||
end | ||
|
||
def test_to_h | ||
assert_kind_of Hash, X::Version.to_h | ||
end | ||
|
||
def test_to_a | ||
assert_kind_of Array, X::Version.to_a | ||
end | ||
|
||
def test_to_s | ||
assert_kind_of String, X::Version.to_s | ||
end | ||
|
||
def test_that_it_has_a_version_number | ||
refute_nil ::X::VERSION | ||
refute_nil ::X::Version | ||
end | ||
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ require_relative "lib/x/version" | |
|
||
Gem::Specification.new do |spec| | ||
spec.name = "x" | ||
spec.version = X::VERSION | ||
spec.version = X::Version | ||
spec.authors = ["Erik Berlin"] | ||
spec.email = ["[email protected]"] | ||
|
||
|