From: Alexandre Terrasa Date: Fri, 21 Jun 2019 03:08:12 +0000 (-0400) Subject: github: Remove GithubEntity X-Git-Url: http://nitlanguage.org github: Remove GithubEntity Signed-off-by: Alexandre Terrasa --- diff --git a/lib/github/api.nit b/lib/github/api.nit index 67a9fac..cc2abf4 100644 --- a/lib/github/api.nit +++ b/lib/github/api.nit @@ -507,7 +507,7 @@ class GithubAPIError var requested_uri: String end -# An Error returned while deserializing GithubEntity objects +# An Error returned while deserializing objects from the API class GithubDeserializerErrors super GithubError @@ -515,16 +515,6 @@ class GithubDeserializerErrors var deserizalization_errors: Array[Error] end -# Something returned by the Github API. -# -# Mainly a Nit wrapper around a JSON objet. -abstract class GithubEntity - serialize - - # Github page url. - var html_url: nullable String is writable -end - # A Github user # # Provides access to [Github user data](https://developer.github.com/v3/users/). @@ -554,7 +544,6 @@ end # Provides access to [Github repo data](https://developer.github.com/v3/repos/). # Should be accessed from `GithubAPI::get_repo`. class Repo - super GithubEntity serialize # Repo full name on Github. @@ -576,7 +565,6 @@ end # # See . class Branch - super GithubEntity serialize # Branch name. @@ -592,7 +580,6 @@ end # # See . class Commit - super GithubEntity serialize # Commit SHA. @@ -639,7 +626,6 @@ end # A Git Commit representation class GitCommit - super GithubEntity serialize # Commit SHA. @@ -660,7 +646,6 @@ end # Git user authoring data class GitUser - super GithubEntity serialize # Authoring date. @@ -680,7 +665,6 @@ end # # See . class Issue - super GithubEntity serialize # Issue Github ID. @@ -841,7 +825,6 @@ end # # See . class Label - super GithubEntity serialize # Label name. @@ -857,7 +840,6 @@ end # # See . class Milestone - super GithubEntity serialize # The milestone id on Github. @@ -930,7 +912,6 @@ end # * `IssueComment` are made on an issue or pull request page. # * `ReviewComment` are made on the diff associated to a pull request. abstract class Comment - super GithubEntity serialize # Identifier of this comment. @@ -1040,7 +1021,6 @@ end # # See . class IssueEvent - super GithubEntity serialize # Event id on Github. diff --git a/lib/github/cache.nit b/lib/github/cache.nit index 8384030..a34bb4e 100644 --- a/lib/github/cache.nit +++ b/lib/github/cache.nit @@ -60,7 +60,7 @@ redef class GithubAPI if store.has_key(key) then message(1, "Get {key} (cache)") was_error = false - return deserialize(store.load_object(key).to_json).as(nullable GithubEntity) + return deserialize(store.load_object(key).to_json) end var obj = super if not was_error and obj isa Serializable then