mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
wip
This commit is contained in:
committed by
Aiden McClelland
parent
16a4c41886
commit
070835c40e
@@ -56,6 +56,8 @@ instance Show Version where
|
||||
let postfix = if q == 0 then "" else '.' : show q in show x <> "." <> show y <> "." <> show z <> postfix
|
||||
instance IsString Version where
|
||||
fromString s = either error id $ Atto.parseOnly parseVersion (T.pack s)
|
||||
instance Read Version where
|
||||
readsPrec i =
|
||||
|
||||
-- | A change in the value found at 'major' implies a breaking change in the API that this version number describes
|
||||
major :: Version -> Word
|
||||
|
||||
@@ -3,16 +3,17 @@ module Lib.Types.Emver.Orphans where
|
||||
|
||||
import Startlude
|
||||
|
||||
import Control.Monad.Fail
|
||||
import Data.Aeson
|
||||
|
||||
import Lib.Types.Emver
|
||||
import qualified Data.Attoparsec.Text as Atto
|
||||
import qualified Data.Text as T
|
||||
import Database.Persist
|
||||
import Database.Persist.Sql
|
||||
import qualified Data.Attoparsec.Text as Atto
|
||||
import Control.Monad.Fail
|
||||
import qualified Data.Text as T
|
||||
import Web.HttpApiData
|
||||
import Yesod.Core.Dispatch
|
||||
|
||||
import Lib.Types.Emver
|
||||
|
||||
instance ToJSON Version where
|
||||
toJSON = String . show
|
||||
instance FromJSON Version where
|
||||
@@ -38,3 +39,10 @@ instance PersistFieldSql Version where
|
||||
instance PathPiece VersionRange where
|
||||
toPathPiece = show
|
||||
fromPathPiece = hush . Atto.parseOnly parseRange
|
||||
|
||||
instance FromHttpApiData Version where
|
||||
parseUrlPiece = first toS . Atto.parseOnly parseVersion
|
||||
|
||||
instance PathPiece Version where
|
||||
toPathPiece = show
|
||||
fromPathPiece = hush . Atto.parseOnly parseVersion
|
||||
|
||||
@@ -59,4 +59,7 @@ BackupRecord sql=backup
|
||||
IconDigest
|
||||
Id AppId
|
||||
tag (Digest MD5)
|
||||
|
||||
WelcomeAck
|
||||
Id Version
|
||||
|]
|
||||
|
||||
Reference in New Issue
Block a user