Add missing requires in routes
This commit is contained in:
parent
1ab14e9188
commit
a891892bd8
|
@ -4,7 +4,6 @@ require 'helpers/urls'
|
||||||
config_keys_map = Travis.CONFIG_KEYS_MAP
|
config_keys_map = Travis.CONFIG_KEYS_MAP
|
||||||
config = Travis.config
|
config = Travis.config
|
||||||
githubCommitUrl = Travis.Urls.githubCommit
|
githubCommitUrl = Travis.Urls.githubCommit
|
||||||
currentDate = Travis.currentDate
|
|
||||||
timeago = $.timeago
|
timeago = $.timeago
|
||||||
intersect = $.intersect
|
intersect = $.intersect
|
||||||
only = $.only
|
only = $.only
|
||||||
|
@ -47,9 +46,9 @@ formatConfig = (config) ->
|
||||||
formatMessage = (message, options) ->
|
formatMessage = (message, options) ->
|
||||||
message = message || ''
|
message = message || ''
|
||||||
message = message.split(/\n/)[0] if options.short
|
message = message.split(/\n/)[0] if options.short
|
||||||
message = @_emojize(@_escape(message))
|
message = _emojize(_escape(message))
|
||||||
if !!options.repo
|
if !!options.repo
|
||||||
message = @githubify(message, options.repo.get('owner'), options.repo.get('name'))
|
message = githubify(message, options.repo.get('owner'), options.repo.get('name'))
|
||||||
if !!options.pre
|
if !!options.pre
|
||||||
message = message.replace /\n/g, '<br/>'
|
message = message.replace /\n/g, '<br/>'
|
||||||
message
|
message
|
||||||
|
@ -61,8 +60,8 @@ timeAgoInWords = (date) ->
|
||||||
timeago.distanceInWords date
|
timeago.distanceInWords date
|
||||||
|
|
||||||
durationFrom = (started, finished) ->
|
durationFrom = (started, finished) ->
|
||||||
started = started and @_toUtc(new Date(@_normalizeDateString(started)))
|
started = started and _toUtc(new Date(_normalizeDateString(started)))
|
||||||
finished = if finished then @_toUtc(new Date(@_normalizeDateString(finished))) else @_nowUtc()
|
finished = if finished then _toUtc(new Date(_normalizeDateString(finished))) else _nowUtc()
|
||||||
if started && finished then Math.round((finished - started) / 1000) else 0
|
if started && finished then Math.round((finished - started) / 1000) else 0
|
||||||
|
|
||||||
timeInWords = (duration) ->
|
timeInWords = (duration) ->
|
||||||
|
@ -83,11 +82,11 @@ timeInWords = (duration) ->
|
||||||
|
|
||||||
githubify = (text, owner, repo) ->
|
githubify = (text, owner, repo) ->
|
||||||
self = this
|
self = this
|
||||||
text = text.replace @_githubReferenceRegexp, (reference, matchedOwner, matchedRepo, matchedNumber) ->
|
text = text.replace _githubReferenceRegexp, (reference, matchedOwner, matchedRepo, matchedNumber) ->
|
||||||
self._githubReferenceLink(reference, { owner: owner, repo: repo }, { owner: matchedOwner, repo: matchedRepo, number: matchedNumber } )
|
self._githubReferenceLink(reference, { owner: owner, repo: repo }, { owner: matchedOwner, repo: matchedRepo, number: matchedNumber } )
|
||||||
text = text.replace @_githubUserRegexp, (reference, username) ->
|
text = text.replace _githubUserRegexp, (reference, username) ->
|
||||||
self._githubUserLink(reference, username)
|
self._githubUserLink(reference, username)
|
||||||
text = text.replace @_githubCommitReferenceRegexp, (reference, matchedOwner, matchedRepo, matchedSHA) ->
|
text = text.replace _githubCommitReferenceRegexp, (reference, matchedOwner, matchedRepo, matchedSHA) ->
|
||||||
self._githubCommitReferenceLink(reference, { owner: owner, repo: repo }, { owner: matchedOwner, repo: matchedRepo, sha: matchedSHA })
|
self._githubCommitReferenceLink(reference, { owner: owner, repo: repo }, { owner: matchedOwner, repo: matchedRepo, sha: matchedSHA })
|
||||||
text
|
text
|
||||||
|
|
||||||
|
@ -118,7 +117,9 @@ _normalizeDateString = (string) ->
|
||||||
string
|
string
|
||||||
|
|
||||||
_nowUtc = ->
|
_nowUtc = ->
|
||||||
@_toUtc currentDate()
|
# TODO: we overwrite Travis.currentDate in tests, so we need to leave this
|
||||||
|
# global usage as it is for now, but it should be removed at some point
|
||||||
|
_toUtc Travis.currentDate()
|
||||||
|
|
||||||
_toUtc = (date) ->
|
_toUtc = (date) ->
|
||||||
Date.UTC date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()
|
Date.UTC date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'travis/model'
|
require 'travis/model'
|
||||||
|
require 'models/extensions'
|
||||||
|
|
||||||
@Travis.Build = Travis.Model.extend Travis.DurationCalculations,
|
@Travis.Build = Travis.Model.extend Travis.DurationCalculations,
|
||||||
repositoryId: Ember.attr('number')
|
repositoryId: Ember.attr('number')
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'travis/model'
|
require 'travis/model'
|
||||||
|
require 'models/extensions'
|
||||||
|
|
||||||
@Travis.Job = Travis.Model.extend Travis.DurationCalculations,
|
@Travis.Job = Travis.Model.extend Travis.DurationCalculations,
|
||||||
repoId: Ember.attr('string', key: 'repository_id')
|
repoId: Ember.attr('string', key: 'repository_id')
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
require 'models/account'
|
||||||
|
|
||||||
Account = Travis.Account
|
Account = Travis.Account
|
||||||
TravisRoute = Travis.Route
|
TravisRoute = Travis.Route
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
|
||||||
TravisRoute = TravisRoute
|
TravisRoute = Travis.Route
|
||||||
|
|
||||||
Route = TravisRoute.extend
|
Route = TravisRoute.extend
|
||||||
needsAuth: false
|
needsAuth: false
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
require 'models/build'
|
||||||
|
|
||||||
Build = Travis.Build
|
Build = Travis.Build
|
||||||
TravisRoute = Travis.Route
|
TravisRoute = Travis.Route
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
require 'models/request'
|
||||||
|
require 'travis/ajax'
|
||||||
|
|
||||||
Request = Travis.Request
|
Request = Travis.Request
|
||||||
Ajax = Travis.ajax
|
Ajax = Travis.ajax
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
require 'models/job'
|
||||||
|
|
||||||
Job = Travis.Job
|
Job = Travis.Job
|
||||||
TravisRoute = Travis.Route
|
TravisRoute = Travis.Route
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
require 'models/request'
|
||||||
|
|
||||||
Request = Travis.Request
|
Request = Travis.Request
|
||||||
TravisRoute = Travis.Route
|
TravisRoute = Travis.Route
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
require 'models/request'
|
||||||
|
|
||||||
TravisRoute = Travis.Route
|
TravisRoute = Travis.Route
|
||||||
Request = Travis.Request
|
Request = Travis.Request
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
require 'routes/route'
|
require 'routes/route'
|
||||||
|
require 'models/ssh_key'
|
||||||
|
require 'travis/ajax'
|
||||||
|
|
||||||
SshKey = Travis.SshKey
|
SshKey = Travis.SshKey
|
||||||
Ajax = Travis.ajax
|
Ajax = Travis.ajax
|
||||||
|
|
Loading…
Reference in New Issue
Block a user