Sha256: 0e201ed1ebdb4314230f68f532c578bc6e1d90168b5f954d999baa5ae8dc8b2b

Contents?: true

Size: 1.3 KB

Versions: 32

Compression:

Stored size: 1.3 KB

Contents

!(angular => {
  'use strict';

  class GithubUrlService {
    constructor(ServerConfigurations) {
      this._isValid = _.exists(ServerConfigurations.configurations.github_owner)
        && _.exists(ServerConfigurations.configurations.github_repo)
        && _.exists(ServerConfigurations.configurations.github_ref);

      if (this._isValid) {
        this._branch = ServerConfigurations.configurations.github_ref.split('/')[1];
        this._githubRoot = [
          'https://github.com',
          ServerConfigurations.configurations.github_owner,
          ServerConfigurations.configurations.github_repo
        ].join('/');
      }
    }

    commits(queryId) {
      return [
        this._githubRoot,
        'commits',
        this._branch,
        'query_' + queryId
      ].join('/');
    }

    commit(version) {
      return [
        this._githubRoot,
        'commit',
        version.commit_sha
      ].join('/');
    }

    compare(base, compare) {
      return [
        this._githubRoot,
        'compare',
        base.commit_sha + '...' + compare.commit_sha
      ].join('/');
    }

    isValid() {
      return this._isValid;
    }

  }

  GithubUrlService.$inject = ['ServerConfigurations'];
  angular.module('alephServices.githubUrlService', []).service('GithubUrlService', GithubUrlService);
}(angular));

Version data entries

32 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.4.9.pre.dev app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.4.8 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.4.8 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.4.7 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.4.7 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.4.4 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.4.4 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.4.2 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.4.2 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.4.1 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.4.1 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.3.0 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.3.0 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.2.0 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.2.0 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.1.0 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.1.0 app/assets/javascripts/angular/services/lib/github_url_service.js.es6
aleph_analytics-0.0.6 public/assets/angular/services/lib/github_url_service.js-719084a625f60d20c24097f00813b481.es6
aleph_analytics-0.0.6 app/assets/javascripts/angular/services/lib/github_url_service.js.es6