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

Conflicts:
	public/scripts/app.js
	public/scripts/min/app.js
	public/styles/app.css
	public/version
	script/server
This commit is contained in:
Sven Fuchs 2012-10-18 03:55:17 +02:00
commit 52bdbf5468
12 changed files with 1636 additions and 1648 deletions

View File

@ -2,7 +2,7 @@ ruby '1.9.3' rescue nil
source :rubygems source :rubygems
gem 'unicorn' gem 'puma'
gem 'rack-ssl', '~> 1.3' gem 'rack-ssl', '~> 1.3'
gem 'rack-cache' gem 'rack-cache'

View File

@ -43,15 +43,15 @@ GEM
guard (1.4.0) guard (1.4.0)
listen (>= 0.4.2) listen (>= 0.4.2)
thor (>= 0.14.6) thor (>= 0.14.6)
kgio (2.7.4)
listen (0.5.3) listen (0.5.3)
multi_json (1.3.6) multi_json (1.3.6)
puma (1.6.3)
rack (~> 1.2)
rack (1.4.1) rack (1.4.1)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
rack-ssl (1.3.2) rack-ssl (1.3.2)
rack rack
raindrops (0.10.0)
rake (0.9.2.2) rake (0.9.2.2)
rb-fsevent (0.9.2) rb-fsevent (0.9.2)
rerun (0.7.1) rerun (0.7.1)
@ -62,10 +62,6 @@ GEM
uglifier (1.3.0) uglifier (1.3.0)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2) multi_json (~> 1.0, >= 1.0.2)
unicorn (4.4.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
PLATFORMS PLATFORMS
ruby ruby
@ -76,6 +72,7 @@ DEPENDENCIES
debugger debugger
foreman foreman
guard guard
puma
rack-cache rack-cache
rack-ssl (~> 1.3) rack-ssl (~> 1.3)
rake (~> 0.9.2) rake (~> 0.9.2)
@ -85,4 +82,3 @@ DEPENDENCIES
rerun rerun
tilt tilt
uglifier uglifier
unicorn

View File

@ -1,3 +1,3 @@
web: script/server web: bundle exec rackup -s puma -p $PORT
assets: rerun -x -p 'assets/**/*' 'bundle exec rakep' assets: rerun -x -p 'assets/**/*' 'bundle exec rakep'
#specs: rerun -x -p 'public/**/*' './run_jasmine.coffee public/spec.html' #specs: rerun -x -p 'public/**/*' './run_jasmine.coffee public/spec.html'

View File

@ -148,12 +148,6 @@ Travis.Router = Ember.Router.extend
needsAuth: (path) -> needsAuth: (path) ->
path.indexOf('/profile') == 0 path.indexOf('/profile') == 0
afterSignIn: ->
path = sessionStorage.getItem('travis.after_signin_path')
sessionStorage.removeItem('travis.after_signin_path')
@transitionTo('root')
@route(path || '/')
afterSignOut: -> afterSignOut: ->
@authorize('/') @authorize('/')
@ -174,6 +168,7 @@ Travis.Router = Ember.Router.extend
root: Ember.Route.extend root: Ember.Route.extend
route: '/' route: '/'
loading: Ember.State.extend() loading: Ember.State.extend()
afterSignIn: (-> )
auth: Ember.Route.extend auth: Ember.Route.extend
route: '/auth' route: '/auth'
@ -183,9 +178,13 @@ Travis.Router = Ember.Router.extend
router.get('authLayoutController').connectOutlet('top', 'top') router.get('authLayoutController').connectOutlet('top', 'top')
router.get('authLayoutController').connectOutlet('main', 'signin') router.get('authLayoutController').connectOutlet('main', 'signin')
afterSignIn: (router) ->
path = sessionStorage.getItem('travis.after_signin_path')
sessionStorage.removeItem('travis.after_signin_path')
router.route(path || '/')
stats: Ember.Route.extend stats: Ember.Route.extend
route: '/stats' route: '/stats'
afterSignIn: (-> )
connectOutlets: (router) -> connectOutlets: (router) ->
router.get('applicationController').connectOutlet 'statsLayout' router.get('applicationController').connectOutlet 'statsLayout'
$('body').attr('id', 'stats') $('body').attr('id', 'stats')
@ -194,7 +193,6 @@ Travis.Router = Ember.Router.extend
profile: Ember.Route.extend profile: Ember.Route.extend
initialState: 'index' initialState: 'index'
afterSignIn: (-> )
route: '/profile' route: '/profile'
connectOutlets: (router) -> connectOutlets: (router) ->
@ -261,7 +259,6 @@ Travis.Router = Ember.Router.extend
home: Ember.Route.extend home: Ember.Route.extend
route: '/' route: '/'
afterSignIn: (-> )
connectOutlets: (router) -> connectOutlets: (router) ->
router.get('applicationController').connectOutlet 'homeLayout' router.get('applicationController').connectOutlet 'homeLayout'
$('body').attr('id', 'home') $('body').attr('id', 'home')

View File

@ -9,5 +9,3 @@
<a href="#" {{action signIn target="Travis.app"}}>Please sign in with GitHub.</a> <a href="#" {{action signIn target="Travis.app"}}>Please sign in with GitHub.</a>
</p> </p>
{{/if}} {{/if}}

View File

@ -3,6 +3,7 @@
#auth #auth
#page #page
display: block display: block
min-height: 500px
#main #main
top: 200px top: 200px

View File

@ -1,4 +0,0 @@
# http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the-new-celadon-cedar-stack/
worker_processes 3 # amount of unicorn workers to spin up
timeout 30 # restarts workers that hang for 15 seconds

View File

@ -17,6 +17,11 @@ class Travis::Web::App
end end
end end
def self.new(options = {})
return super unless options[:environment] == 'development'
proc { |e| super.call(e) } # poor man's reloader
end
attr_reader :app, :router, :environment, :version, :last_modified, :age, :options, :root attr_reader :app, :router, :environment, :version, :last_modified, :age, :options, :root
def initialize(options = {}) def initialize(options = {})
@ -62,9 +67,8 @@ class Travis::Web::App
end end
def each_file def each_file
Dir.chdir(root) do pattern = File.join(root, '**/*')
Dir.glob('**/*') { |f| yield f if File.file? f } Dir.glob(pattern) { |f| yield f if File.file? f }
end
end end
def prefix?(file) def prefix?(file)
@ -72,19 +76,20 @@ class Travis::Web::App
end end
def index?(file) def index?(file)
file == "index.html" file.end_with? 'index.html'
end end
def route_for(file) def route_for(file)
file = file.sub("#{root}/", '')
file = File.join(version, file) if prefix? file file = File.join(version, file) if prefix? file
file = "" if index? file file = "" if index? file
"/#{file}" "/#{file}"
end end
def cache_control(file) def cache_control(file)
case file case route_for(file)
when 'index.html' then "public, must-revalidate" when '/' then "public, must-revalidate"
when 'version' then "no-cache" when 'version' then "no-cache"
else "public, max-age=#{age}" else "public, max-age=#{age}"
end end
end end
@ -105,8 +110,10 @@ class Travis::Web::App
def builder def builder
builder = Rack::Builder.new builder = Rack::Builder.new
builder.use Rack::SSL if environment == 'production' if environment == 'production'
builder.use Rack::Cache builder.use Rack::SSL
builder.use Rack::Cache
end
builder.use Rack::Deflater builder.use Rack::Deflater
builder.use Rack::Head builder.use Rack::Head
builder.use Rack::ConditionalGet builder.use Rack::ConditionalGet

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
63abb082 7db0e854