Merge branch 'master' of github.com:travis-ci/travis-ember

Conflicts:
	public/javascripts/application.js
This commit is contained in:
Sven Fuchs 2012-09-27 17:22:11 +02:00
commit c80203afd3
8 changed files with 175 additions and 199 deletions

View File

@ -31,4 +31,5 @@ end
group :development do
gem 'foreman'
gem 'rerun'
gem 'rb-fsevent', '~> 0.9.1'
end

View File

@ -42,7 +42,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-api.git
revision: f2e8ccafc1efb0da8e14c2e03021d27dd1b40431
revision: fbd89ceeb0c4d3682e26fe04f7f105248153273b
specs:
travis-api (0.0.1)
backports (~> 2.5)
@ -213,6 +213,7 @@ GEM
thor (>= 0.14.6, < 2.0)
raindrops (0.10.0)
rake (0.9.2.2)
rb-fsevent (0.9.1)
rdoc (3.12)
json (~> 1.4)
redcarpet (2.1.1)
@ -273,6 +274,7 @@ DEPENDENCIES
rack-contrib!
rake-pipeline!
rake-pipeline-web-filters!
rb-fsevent (~> 0.9.1)
rerun
sinatra
sinatra-contrib

View File

@ -1,6 +1,5 @@
Travis.RepositoryController = Travis.Controller.extend
bindings: []
params: {}
init: ->
@_super.apply this, arguments
@ -16,9 +15,8 @@ Travis.RepositoryController = Travis.Controller.extend
Ember.run.later(@updateTimes.bind(this), Travis.INTERVALS.updateTimes)
activate: (action, params) ->
activate: (action) ->
@_unbind()
@setParams(params)
this["view#{$.camelize(action)}"]()
viewIndex: ->
@ -28,47 +26,27 @@ Travis.RepositoryController = Travis.Controller.extend
viewCurrent: ->
@connectTab('current')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('build', 'repository.lastBuild')
viewBuilds: ->
@connectTab('builds')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('builds', 'repository.builds')
viewPullRequests: ->
@connectTab('pull_requests')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('builds', 'repository.pullRequests')
viewBranches: ->
@connectTab('branches')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('builds', 'repository.branches')
viewBuild: ->
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('build', 'buildById')
@connectTab('build')
viewJob: ->
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('build', 'job.build')
@_bind('job', 'jobById')
@connectTab('job')
repositoriesByParams: (->
Travis.Repository.bySlug("#{@get('params.owner')}/#{@get('params.name')}")
).property('params.owner', 'params.name')
buildById: (->
Travis.Build.find(id) if id = @get('params.id')
).property('params.id')
jobById: (->
Travis.Job.find(id) if id = @get('params.id')
).property('params.id')
repositoryObserver: (->
repository = @get('repository')
repository.select() if repository
@ -84,10 +62,6 @@ Travis.RepositoryController = Travis.Controller.extend
@set('tab', tab)
@connectOutlet(outletName: 'pane', controller: this, viewClass: viewClass)
setParams: (params) ->
# TODO if we just @set('params', params) it will update the repositoriesByParams property
@set("params.#{key}", params[key]) for key, value of params
_bind: (to, from) ->
@bindings.push Ember.oneWay(this, to, from)

View File

@ -28,11 +28,11 @@ require 'travis/model'
requiredJobs: (->
@get('jobs').filter (data) -> !data.get('allowFailure')
).property('jobs.@each.allowFailure')
).property()
allowedFailureJobs: (->
@get('jobs').filter (data) -> data.get('allowFailure')
).property('jobs.@each.allowFailure')
).property()
configKeys: (->
return [] unless config = @get('config')

View File

@ -134,12 +134,7 @@ Travis.Router = Ember.Router.extend
route: '/:owner/:name'
connectOutlets: (router, repository) ->
params = { owner: repository.get('owner'), name: repository.get('name') }
# TODO: we can just pass objects instead of params now, I'm leaving this
# to not have to rewrite too much, but it would be nice to fix this
# later
router.get('repositoryController').setParams(params)
router.get('repositoryController').set 'repository', repository
deserialize: (router, params) ->
slug = "#{params.owner}/#{params.name}"
@ -178,7 +173,8 @@ Travis.Router = Ember.Router.extend
show: Ember.Route.extend
route: '/:build_id'
connectOutlets: (router, build) ->
router.get('repositoryController').activate 'build', id: build.get('id')
router.get('repositoryController').set 'build', build
router.get('repositoryController').activate 'build'
deserialize: (router, params) ->
# Something is wrong here. If I don't use deferred, id is not
@ -211,7 +207,8 @@ Travis.Router = Ember.Router.extend
job: Ember.Route.extend
route: '/jobs/:job_id'
connectOutlets: (router, job) ->
router.get('repositoryController').activate 'job', id: job.get('id')
router.get('repositoryController').set 'job', job
router.get('repositoryController').activate 'job'
deserialize: (router, params) ->
job = Travis.Job.find params.job_id

View File

@ -1,5 +1,5 @@
// Version: v1.0.pre-157-g896f794
// Last commit: 896f794 (2012-09-26 21:30:45 +0200)
// Version: v1.0.pre-161-g4255d0a
// Last commit: 4255d0a (2012-09-27 14:32:08 +0200)
(function() {
@ -140,8 +140,8 @@ window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprec
})();
// Version: v1.0.pre-157-g896f794
// Last commit: 896f794 (2012-09-26 21:30:45 +0200)
// Version: v1.0.pre-161-g4255d0a
// Last commit: 4255d0a (2012-09-27 14:32:08 +0200)
(function() {
@ -3096,9 +3096,11 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
hadCachedValue = false,
ret;
this._suspended = obj;
try {
ret = this.func.call(obj, keyName, value);
if (cacheable && keyName in meta.cache) {
if (meta.cache[keyName] === value) {
if (meta.cache[keyName] === ret) {
return;
}
hadCachedValue = true;
@ -3110,8 +3112,6 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
delete meta.cache[keyName];
}
ret = this.func.call(obj, keyName, value);
if (cacheable) {
if (!watched && !hadCachedValue) {
addDependentKeys(this, obj, keyName, meta);
@ -3120,8 +3120,9 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
}
if (watched) { Ember.propertyDidChange(obj, keyName); }
} finally {
this._suspended = oldSuspended;
}
return ret;
};
@ -22354,8 +22355,8 @@ Ember Handlebars
})();
// Version: v1.0.pre-157-g896f794
// Last commit: 896f794 (2012-09-26 21:30:45 +0200)
// Version: v1.0.pre-161-g4255d0a
// Last commit: 4255d0a (2012-09-27 14:32:08 +0200)
(function() {

File diff suppressed because one or more lines are too long

View File

@ -1952,8 +1952,8 @@ Handlebars.VM = {
Handlebars.template = Handlebars.VM.template;
;
// Version: v1.0.pre-157-g896f794
// Last commit: 896f794 (2012-09-26 21:30:45 +0200)
// Version: v1.0.pre-161-g4255d0a
// Last commit: 4255d0a (2012-09-27 14:32:08 +0200)
(function() {
@ -2094,8 +2094,8 @@ window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprec
})();
// Version: v1.0.pre-157-g896f794
// Last commit: 896f794 (2012-09-26 21:30:45 +0200)
// Version: v1.0.pre-161-g4255d0a
// Last commit: 4255d0a (2012-09-27 14:32:08 +0200)
(function() {
@ -5050,9 +5050,11 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
hadCachedValue = false,
ret;
this._suspended = obj;
try {
ret = this.func.call(obj, keyName, value);
if (cacheable && keyName in meta.cache) {
if (meta.cache[keyName] === value) {
if (meta.cache[keyName] === ret) {
return;
}
hadCachedValue = true;
@ -5064,8 +5066,6 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
delete meta.cache[keyName];
}
ret = this.func.call(obj, keyName, value);
if (cacheable) {
if (!watched && !hadCachedValue) {
addDependentKeys(this, obj, keyName, meta);
@ -5074,8 +5074,9 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
}
if (watched) { Ember.propertyDidChange(obj, keyName); }
} finally {
this._suspended = oldSuspended;
}
return ret;
};
@ -24308,8 +24309,8 @@ Ember Handlebars
})();
// Version: v1.0.pre-157-g896f794
// Last commit: 896f794 (2012-09-26 21:30:45 +0200)
// Version: v1.0.pre-161-g4255d0a
// Last commit: 4255d0a (2012-09-27 14:32:08 +0200)
(function() {