This repository has been archived by the owner on Mar 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Version is now built dynamically"
This reverts commit 64bb58b.
- Loading branch information
1 parent
64bb58b
commit bad9794
Showing
4 changed files
with
25 additions
and
25 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 |
---|---|---|
@@ -1,19 +1,16 @@ | ||
require 'net/http' | ||
require 'json' | ||
|
||
module GHI | ||
module Commands | ||
module Version | ||
MAJOR = 1 | ||
MINOR = 0 | ||
PATCH = 0 | ||
PRE = nil | ||
|
||
VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join '.' | ||
|
||
def self.execute args | ||
puts "ghi version #{get_latest_version}" | ||
puts "ghi version #{VERSION}" | ||
end | ||
|
||
def self.get_latest_version | ||
result = JSON.parse(Net::HTTP.get(URI.parse('https://api.github.com/repos/stephencelis/ghi/releases/latest'))) | ||
return result['tag_name'] | ||
end | ||
|
||
end | ||
end | ||
end |