// this is just for testing, read from local file public read_github_release(string github_releases_page) { is_stable = default_is_stable; is_beta = default_is_beta; parse_releases_page(github_releases_page); }
public read_github_release(string github_user, string github_repository) { is_stable = default_is_stable; is_beta = default_is_beta; // Example: // https://api.github.com/repos/jtorjo/logwizard/releases // GET /repos/:owner/:repo/releases parse_releases_page(read_html_page("https://api.github.com/repos/" + github_user + "/" + github_repository + "/releases")); }
public List <release_info> stable_releases(string after_version) { Version min = new Version(after_version); List <release_info> releases = new List <release_info>(); bool at_least_one_bigger = false; if (json_page_ != null) { foreach (object o in (object[])json_page_) { var ver = (Dictionary <string, object>)o; if (is_valid_version(ver)) { if (new Version(ver["tag_name"].ToString()) <= min) { break; } } if (is_valid_version(ver)) { at_least_one_bigger = true; } // if this version is not a valid version, we will show it in the list // (perhaps an interim - still, the user should be able to see it) bool is_stable = true; if (is_valid_version(ver)) { if (!this.is_stable(ver)) { is_stable = false; } } if (is_stable) { releases.Add(to_release(ver)); } } } if (!at_least_one_bigger) { releases.Clear(); } return(releases); }
public read_github_release(string github_user, string github_repository) { is_stable = default_is_stable; is_beta = default_is_beta; // Example: // https://api.github.com/repos/jtorjo/logwizard/releases // GET /repos/:owner/:repo/releases parse_releases_page( read_html_page("https://api.github.com/repos/" + github_user + "/" + github_repository + "/releases") ); }
public List<release_info> stable_releases(string after_version) { Version min = new Version(after_version); List<release_info> releases = new List<release_info>(); bool at_least_one_bigger = false; if ( json_page_ != null) foreach (object o in (object[]) json_page_) { var ver = (Dictionary<string, object>) o; if ( is_valid_version(ver)) if (new Version(ver["tag_name"].ToString()) <= min) break; if ( is_valid_version(ver)) at_least_one_bigger = true; // if this version is not a valid version, we will show it in the list // (perhaps an interim - still, the user should be able to see it) bool is_stable = true; if ( is_valid_version(ver)) if (!this.is_stable(ver)) is_stable = false; if ( is_stable) releases.Add( to_release(ver) ); } if ( !at_least_one_bigger) releases.Clear(); return releases; }
// this is just for testing, read from local file public read_github_release(string github_releases_page) { is_stable = default_is_stable; is_beta = default_is_beta; parse_releases_page(github_releases_page); }