Change all occurrences of old project name to the new one

openid
Marcin Kulik 11 years ago
parent 5c80bf21f1
commit 0634f52c99

@ -4,4 +4,4 @@
require File.expand_path('../config/application', __FILE__)
AsciiIo::Application.load_tasks
Asciinema::Application.load_tasks

@ -11,7 +11,7 @@
//= require underscore-min
//= require backbone-min
//= require jquery.timeago
//= require backbone/ascii_io
//= require backbone/asciinema
$(function() {
$('abbr.timeago').timeago();

@ -4,7 +4,7 @@
#= require_tree ./views
#= require_tree ./routers
window.AsciiIo =
window.Asciinema =
Models: {}
Collections: {}
Routers: {}

@ -1,7 +1,7 @@
class AsciiIo.Models.Comment extends Backbone.Model
class Asciinema.Models.Comment extends Backbone.Model
user: ->
this.get('user')
class AsciiIo.Collections.Comments extends Backbone.Collection
model: AsciiIo.Models.Comment
class Asciinema.Collections.Comments extends Backbone.Collection
model: Asciinema.Models.Comment

@ -1,4 +1,4 @@
class AsciiIo.Views.Base extends Backbone.View
class Asciinema.Views.Base extends Backbone.View
current_user: ->
AsciiIo.current_user
Asciinema.current_user

@ -1,4 +1,4 @@
class AsciiIo.Views.CommentsIndex extends AsciiIo.Views.Base
class Asciinema.Views.CommentsIndex extends Asciinema.Views.Base
el: '#comments'
@ -14,7 +14,7 @@ class AsciiIo.Views.CommentsIndex extends AsciiIo.Views.Base
@addOne(comment)
addOne:(comment) ->
view = new AsciiIo.Views.CommentEntry({ model: comment, collection: @collection})
view = new Asciinema.Views.CommentEntry({ model: comment, collection: @collection})
$(this.el).append view.render().el
createComment: (event) ->

@ -8,4 +8,4 @@
//= require player/movie
//= require player/workers/main_worker
AsciiIo = {};
Asciinema = {};

@ -1,4 +1,4 @@
class AsciiIo.Asciicast extends Backbone.Model
class Asciinema.Asciicast extends Backbone.Model
url: ->
"/a/#{@get('id')}.json"

@ -1,5 +1,5 @@
if (!window.AsciiIo){
window.AsciiIo = {};
if (!window.Asciinema){
window.Asciinema = {};
}
AsciiIo.Renderer = {};
Asciinema.Renderer = {};

@ -1,4 +1,4 @@
class AsciiIo.AbstractPlayer
class Asciinema.AbstractPlayer
constructor: (@options) ->
@model = @options.model
@ -6,7 +6,7 @@ class AsciiIo.AbstractPlayer
@loadFrames()
createView: ->
@view = new AsciiIo.PlayerView
@view = new Asciinema.PlayerView
el: @options.el
model: @model
cols: @model.get 'width'

@ -1,4 +1,4 @@
class AsciiIo.Brush
class Asciinema.Brush
@default_fg = 7
@default_bg = 0
@ -18,7 +18,7 @@ class AsciiIo.Brush
brush = @cache[key]
if not brush
brush = new AsciiIo.Brush(options)
brush = new Asciinema.Brush(options)
@cache[key] = brush
brush
@ -35,7 +35,7 @@ class AsciiIo.Brush
this[name] = value
hash: ->
AsciiIo.Brush.hash this
Asciinema.Brush.hash this
attributes: ->
fg : @fg
@ -51,7 +51,7 @@ class AsciiIo.Brush
if color != undefined
color
else
AsciiIo.Brush.default_bg
Asciinema.Brush.default_bg
else
@calculateFgColor()
@ -61,7 +61,7 @@ class AsciiIo.Brush
if color != undefined
color
else
AsciiIo.Brush.default_fg
Asciinema.Brush.default_fg
else
@calculateBgColor()
@ -77,8 +77,8 @@ class AsciiIo.Brush
hasDefaultFg: ->
color = @fgColor()
color is undefined || color == AsciiIo.Brush.default_fg
color is undefined || color == Asciinema.Brush.default_fg
hasDefaultBg: ->
color = @bgColor()
color is undefined || color == AsciiIo.Brush.default_bg
color is undefined || color == Asciinema.Brush.default_bg

@ -1 +1 @@
AsciiIo.colors = {"0":"#000000","1":"#CC0000","2":"#4E9A06","3":"#C4A000","4":"#3465A4","5":"#75507B","6":"#06989A","7":"#D3D7CF","8":"#555753","9":"#EF2929","10":"#8AE234","11":"#FCE94F","12":"#729FCF","13":"#AD7FA8","14":"#34E2E2","15":"#EEEEEC","16":"#000000","17":"#00005f","18":"#000087","19":"#0000af","20":"#0000d7","21":"#0000ff","22":"#005f00","23":"#005f5f","24":"#005f87","25":"#005faf","26":"#005fd7","27":"#005fff","28":"#008700","29":"#00875f","30":"#008787","31":"#0087af","32":"#0087d7","33":"#0087ff","34":"#00af00","35":"#00af5f","36":"#00af87","37":"#00afaf","38":"#00afd7","39":"#00afff","40":"#00d700","41":"#00d75f","42":"#00d787","43":"#00d7af","44":"#00d7d7","45":"#00d7ff","46":"#00ff00","47":"#00ff5f","48":"#00ff87","49":"#00ffaf","50":"#00ffd7","51":"#00ffff","52":"#5f0000","53":"#5f005f","54":"#5f0087","55":"#5f00af","56":"#5f00d7","57":"#5f00ff","58":"#5f5f00","59":"#5f5f5f","60":"#5f5f87","61":"#5f5faf","62":"#5f5fd7","63":"#5f5fff","64":"#5f8700","65":"#5f875f","66":"#5f8787","67":"#5f87af","68":"#5f87d7","69":"#5f87ff","70":"#5faf00","71":"#5faf5f","72":"#5faf87","73":"#5fafaf","74":"#5fafd7","75":"#5fafff","76":"#5fd700","77":"#5fd75f","78":"#5fd787","79":"#5fd7af","80":"#5fd7d7","81":"#5fd7ff","82":"#5fff00","83":"#5fff5f","84":"#5fff87","85":"#5fffaf","86":"#5fffd7","87":"#5fffff","88":"#870000","89":"#87005f","90":"#870087","91":"#8700af","92":"#8700d7","93":"#8700ff","94":"#875f00","95":"#875f5f","96":"#875f87","97":"#875faf","98":"#875fd7","99":"#875fff","100":"#878700","101":"#87875f","102":"#878787","103":"#8787af","104":"#8787d7","105":"#8787ff","106":"#87af00","107":"#87af5f","108":"#87af87","109":"#87afaf","110":"#87afd7","111":"#87afff","112":"#87d700","113":"#87d75f","114":"#87d787","115":"#87d7af","116":"#87d7d7","117":"#87d7ff","118":"#87ff00","119":"#87ff5f","120":"#87ff87","121":"#87ffaf","122":"#87ffd7","123":"#87ffff","124":"#af0000","125":"#af005f","126":"#af0087","127":"#af00af","128":"#af00d7","129":"#af00ff","130":"#af5f00","131":"#af5f5f","132":"#af5f87","133":"#af5faf","134":"#af5fd7","135":"#af5fff","136":"#af8700","137":"#af875f","138":"#af8787","139":"#af87af","140":"#af87d7","141":"#af87ff","142":"#afaf00","143":"#afaf5f","144":"#afaf87","145":"#afafaf","146":"#afafd7","147":"#afafff","148":"#afd700","149":"#afd75f","150":"#afd787","151":"#afd7af","152":"#afd7d7","153":"#afd7ff","154":"#afff00","155":"#afff5f","156":"#afff87","157":"#afffaf","158":"#afffd7","159":"#afffff","160":"#d70000","161":"#d7005f","162":"#d70087","163":"#d700af","164":"#d700d7","165":"#d700ff","166":"#d75f00","167":"#d75f5f","168":"#d75f87","169":"#d75faf","170":"#d75fd7","171":"#d75fff","172":"#d78700","173":"#d7875f","174":"#d78787","175":"#d787af","176":"#d787d7","177":"#d787ff","178":"#d7af00","179":"#d7af5f","180":"#d7af87","181":"#d7afaf","182":"#d7afd7","183":"#d7afff","184":"#d7d700","185":"#d7d75f","186":"#d7d787","187":"#d7d7af","188":"#d7d7d7","189":"#d7d7ff","190":"#d7ff00","191":"#d7ff5f","192":"#d7ff87","193":"#d7ffaf","194":"#d7ffd7","195":"#d7ffff","196":"#ff0000","197":"#ff005f","198":"#ff0087","199":"#ff00af","200":"#ff00d7","201":"#ff00ff","202":"#ff5f00","203":"#ff5f5f","204":"#ff5f87","205":"#ff5faf","206":"#ff5fd7","207":"#ff5fff","208":"#ff8700","209":"#ff875f","210":"#ff8787","211":"#ff87af","212":"#ff87d7","213":"#ff87ff","214":"#ffaf00","215":"#ffaf5f","216":"#ffaf87","217":"#ffafaf","218":"#ffafd7","219":"#ffafff","220":"#ffd700","221":"#ffd75f","222":"#ffd787","223":"#ffd7af","224":"#ffd7d7","225":"#ffd7ff","226":"#ffff00","227":"#ffff5f","228":"#ffff87","229":"#ffffaf","230":"#ffffd7","231":"#ffffff","232":"#080808","233":"#121212","234":"#1c1c1c","235":"#262626","236":"#303030","237":"#3a3a3a","238":"#444444","239":"#4e4e4e","240":"#585858","241":"#626262","242":"#6c6c6c","243":"#767676","244":"#808080","245":"#8a8a8a","246":"#949494","247":"#9e9e9e","248":"#a8a8a8","249":"#b2b2b2","250":"#bcbcbc","251":"#c6c6c6","252":"#d0d0d0","253":"#dadada","254":"#e4e4e4","255":"#eeeeee"};
Asciinema.colors = {"0":"#000000","1":"#CC0000","2":"#4E9A06","3":"#C4A000","4":"#3465A4","5":"#75507B","6":"#06989A","7":"#D3D7CF","8":"#555753","9":"#EF2929","10":"#8AE234","11":"#FCE94F","12":"#729FCF","13":"#AD7FA8","14":"#34E2E2","15":"#EEEEEC","16":"#000000","17":"#00005f","18":"#000087","19":"#0000af","20":"#0000d7","21":"#0000ff","22":"#005f00","23":"#005f5f","24":"#005f87","25":"#005faf","26":"#005fd7","27":"#005fff","28":"#008700","29":"#00875f","30":"#008787","31":"#0087af","32":"#0087d7","33":"#0087ff","34":"#00af00","35":"#00af5f","36":"#00af87","37":"#00afaf","38":"#00afd7","39":"#00afff","40":"#00d700","41":"#00d75f","42":"#00d787","43":"#00d7af","44":"#00d7d7","45":"#00d7ff","46":"#00ff00","47":"#00ff5f","48":"#00ff87","49":"#00ffaf","50":"#00ffd7","51":"#00ffff","52":"#5f0000","53":"#5f005f","54":"#5f0087","55":"#5f00af","56":"#5f00d7","57":"#5f00ff","58":"#5f5f00","59":"#5f5f5f","60":"#5f5f87","61":"#5f5faf","62":"#5f5fd7","63":"#5f5fff","64":"#5f8700","65":"#5f875f","66":"#5f8787","67":"#5f87af","68":"#5f87d7","69":"#5f87ff","70":"#5faf00","71":"#5faf5f","72":"#5faf87","73":"#5fafaf","74":"#5fafd7","75":"#5fafff","76":"#5fd700","77":"#5fd75f","78":"#5fd787","79":"#5fd7af","80":"#5fd7d7","81":"#5fd7ff","82":"#5fff00","83":"#5fff5f","84":"#5fff87","85":"#5fffaf","86":"#5fffd7","87":"#5fffff","88":"#870000","89":"#87005f","90":"#870087","91":"#8700af","92":"#8700d7","93":"#8700ff","94":"#875f00","95":"#875f5f","96":"#875f87","97":"#875faf","98":"#875fd7","99":"#875fff","100":"#878700","101":"#87875f","102":"#878787","103":"#8787af","104":"#8787d7","105":"#8787ff","106":"#87af00","107":"#87af5f","108":"#87af87","109":"#87afaf","110":"#87afd7","111":"#87afff","112":"#87d700","113":"#87d75f","114":"#87d787","115":"#87d7af","116":"#87d7d7","117":"#87d7ff","118":"#87ff00","119":"#87ff5f","120":"#87ff87","121":"#87ffaf","122":"#87ffd7","123":"#87ffff","124":"#af0000","125":"#af005f","126":"#af0087","127":"#af00af","128":"#af00d7","129":"#af00ff","130":"#af5f00","131":"#af5f5f","132":"#af5f87","133":"#af5faf","134":"#af5fd7","135":"#af5fff","136":"#af8700","137":"#af875f","138":"#af8787","139":"#af87af","140":"#af87d7","141":"#af87ff","142":"#afaf00","143":"#afaf5f","144":"#afaf87","145":"#afafaf","146":"#afafd7","147":"#afafff","148":"#afd700","149":"#afd75f","150":"#afd787","151":"#afd7af","152":"#afd7d7","153":"#afd7ff","154":"#afff00","155":"#afff5f","156":"#afff87","157":"#afffaf","158":"#afffd7","159":"#afffff","160":"#d70000","161":"#d7005f","162":"#d70087","163":"#d700af","164":"#d700d7","165":"#d700ff","166":"#d75f00","167":"#d75f5f","168":"#d75f87","169":"#d75faf","170":"#d75fd7","171":"#d75fff","172":"#d78700","173":"#d7875f","174":"#d78787","175":"#d787af","176":"#d787d7","177":"#d787ff","178":"#d7af00","179":"#d7af5f","180":"#d7af87","181":"#d7afaf","182":"#d7afd7","183":"#d7afff","184":"#d7d700","185":"#d7d75f","186":"#d7d787","187":"#d7d7af","188":"#d7d7d7","189":"#d7d7ff","190":"#d7ff00","191":"#d7ff5f","192":"#d7ff87","193":"#d7ffaf","194":"#d7ffd7","195":"#d7ffff","196":"#ff0000","197":"#ff005f","198":"#ff0087","199":"#ff00af","200":"#ff00d7","201":"#ff00ff","202":"#ff5f00","203":"#ff5f5f","204":"#ff5f87","205":"#ff5faf","206":"#ff5fd7","207":"#ff5fff","208":"#ff8700","209":"#ff875f","210":"#ff8787","211":"#ff87af","212":"#ff87d7","213":"#ff87ff","214":"#ffaf00","215":"#ffaf5f","216":"#ffaf87","217":"#ffafaf","218":"#ffafd7","219":"#ffafff","220":"#ffd700","221":"#ffd75f","222":"#ffd787","223":"#ffd7af","224":"#ffd7d7","225":"#ffd7ff","226":"#ffff00","227":"#ffff5f","228":"#ffff87","229":"#ffffaf","230":"#ffffd7","231":"#ffffff","232":"#080808","233":"#121212","234":"#1c1c1c","235":"#262626","236":"#303030","237":"#3a3a3a","238":"#444444","239":"#4e4e4e","240":"#585858","241":"#626262","242":"#6c6c6c","243":"#767676","244":"#808080","245":"#8a8a8a","246":"#949494","247":"#9e9e9e","248":"#a8a8a8","249":"#b2b2b2","250":"#bcbcbc","251":"#c6c6c6","252":"#d0d0d0","253":"#dadada","254":"#e4e4e4","255":"#eeeeee"};

@ -1,4 +1,4 @@
class AsciiIo.FallbackPlayer extends AsciiIo.AbstractPlayer
class Asciinema.FallbackPlayer extends Asciinema.AbstractPlayer
createMovie: ->
@movie = new AsciiIo.Movie @movieOptions()
@movie = new Asciinema.Movie @movieOptions()

@ -1,4 +1,4 @@
class AsciiIo.Movie
class Asciinema.Movie
MIN_DELAY: 0.01
constructor: (@options) ->

@ -1,11 +1,11 @@
class AsciiIo.Player extends AsciiIo.AbstractPlayer
class Asciinema.Player extends Asciinema.AbstractPlayer
constructor: (@options) ->
@createWorkerProxy()
super
createWorkerProxy: ->
@workerProxy = new AsciiIo.WorkerProxy(window.mainWorkerPath)
@workerProxy = new Asciinema.WorkerProxy(window.mainWorkerPath)
createMovie: ->
@movie = @workerProxy.getObjectProxy 'movie'

@ -1,4 +1,4 @@
class AsciiIo.HudView extends Backbone.View
class Asciinema.HudView extends Backbone.View
tagName: 'pre'
className: 'hud'

@ -1,4 +1,4 @@
class AsciiIo.PlayerView extends Backbone.View
class Asciinema.PlayerView extends Backbone.View
events:
'click .start-prompt': 'onStartPromptClick'
@ -27,7 +27,7 @@ class AsciiIo.PlayerView extends Backbone.View
@rightClipWidth = 0
createHudView: ->
@hudView = new AsciiIo.HudView(cols: @options.cols)
@hudView = new Asciinema.HudView(cols: @options.cols)
@hudView.on 'play-click', => @onPlayClicked()
@hudView.on 'seek-click', (percent) => @onSeekClicked percent

@ -1,4 +1,4 @@
class AsciiIo.Renderer.Base extends Backbone.View
class Asciinema.Renderer.Base extends Backbone.View
events:
'click': 'onClick'
@ -71,7 +71,7 @@ class AsciiIo.Renderer.Base extends Backbone.View
for line in snapshot
fragments = _(line).map (fragment) ->
fragment[1].bright = fragment[1].bold
[fragment[0], new AsciiIo.Brush(fragment[1])]
[fragment[0], new Asciinema.Brush(fragment[1])]
@renderLine i, fragments, undefined
i++

@ -1,4 +1,4 @@
class AsciiIo.Renderer.Canvas extends AsciiIo.Renderer.Base
class Asciinema.Renderer.Canvas extends Asciinema.Renderer.Base
tagName: 'canvas'
className: 'terminal'
@ -35,7 +35,7 @@ class AsciiIo.Renderer.Canvas extends AsciiIo.Renderer.Base
for fragment in fragments
[text, brush] = fragment
brush = AsciiIo.Brush.create brush if brush
brush = Asciinema.Brush.create brush if brush
if cursorX isnt undefined and rendered <= cursorX < rendered + text.length
@cursorBrush = brush
@ -57,10 +57,10 @@ class AsciiIo.Renderer.Canvas extends AsciiIo.Renderer.Base
@renderCursor()
setBackgroundAttributes: (brush) ->
@ctx.fillStyle = AsciiIo.colors[brush.bgColor()]
@ctx.fillStyle = Asciinema.colors[brush.bgColor()]
setTextAttributes: (brush) ->
@ctx.fillStyle = AsciiIo.colors[brush.fgColor()]
@ctx.fillStyle = Asciinema.colors[brush.fgColor()]
font = @font
@ -82,14 +82,14 @@ class AsciiIo.Renderer.Canvas extends AsciiIo.Renderer.Base
y = @cursorY * @cellHeight
if @cursorVisible
@ctx.fillStyle = AsciiIo.colors[7]
@ctx.fillStyle = Asciinema.colors[7]
@ctx.fillRect x, y, @cellWidth, @cellHeight
@ctx.fillStyle = AsciiIo.colors[0]
@ctx.fillStyle = Asciinema.colors[0]
@ctx.fillText @cursorText, x, y + @cellHeight
else
@ctx.fillStyle = AsciiIo.colors[@cursorBrush.bgColor()]
@ctx.fillStyle = Asciinema.colors[@cursorBrush.bgColor()]
@ctx.fillRect x, y, @cellWidth, @cellHeight
@ctx.fillStyle = AsciiIo.colors[@cursorBrush.fgColor()]
@ctx.fillStyle = Asciinema.colors[@cursorBrush.fgColor()]
@ctx.fillText @cursorText, x, y + @cellHeight
showCursor: (show) ->

@ -1,4 +1,4 @@
class AsciiIo.Renderer.Pre extends AsciiIo.Renderer.Base
class Asciinema.Renderer.Pre extends Asciinema.Renderer.Base
tagName: 'pre'
className: 'terminal'
@ -64,7 +64,7 @@ class AsciiIo.Renderer.Pre extends AsciiIo.Renderer.Base
text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
spanFromBrush: (brush, isCursor) ->
brush = AsciiIo.Brush.create brush
brush = Asciinema.Brush.create brush
key = "#{brush.hash()}_#{isCursor}"
span = @cachedSpans[key]
@ -72,7 +72,7 @@ class AsciiIo.Renderer.Pre extends AsciiIo.Renderer.Base
if not span
span = ""
if brush != AsciiIo.Brush.default() || isCursor
if brush != Asciinema.Brush.default() || isCursor
if isCursor
span = "<span data-fg=#{brush.fgColor()} data-bg=#{brush.bgColor()} class=\"cursor"
else

@ -14,7 +14,7 @@ addEventListener 'message', (e) =>
@initialize = (options) ->
movie = new AsciiIo.Movie(
movie = new Asciinema.Movie(
stdout_frames: options.stdout_frames
duration: options.duration
speed: options.speed

@ -1,4 +1,4 @@
class AsciiIo.WorkerObjectProxy
class Asciinema.WorkerObjectProxy
constructor: (@webWorker, @objectName) ->
_.extend(this, Backbone.Events)
@webWorker.addEventListener 'message', @onMessage

@ -1,4 +1,4 @@
class AsciiIo.WorkerProxy
class Asciinema.WorkerProxy
constructor: (url) ->
@webWorker = new window.Worker(url)
@webWorker.addEventListener 'message', @onMessage
@ -9,7 +9,7 @@ class AsciiIo.WorkerProxy
options: options
getObjectProxy: (objectName) ->
new AsciiIo.WorkerObjectProxy(@webWorker, objectName)
new Asciinema.WorkerObjectProxy(@webWorker, objectName)
onMessage: (e) =>
if e.data.message == 'log'

@ -2,15 +2,15 @@ module AsciicastsHelper
def player(asciicast, options = {})
if params[:fallback]
player_class = "AsciiIo.FallbackPlayer"
player_class = "Asciinema.FallbackPlayer"
else
player_class = "window.Worker ? AsciiIo.Player : AsciiIo.FallbackPlayer"
player_class = "window.Worker ? Asciinema.Player : Asciinema.FallbackPlayer"
end
if custom_renderer = params[:renderer]
renderer_class = "AsciiIo.Renderer.#{custom_renderer.capitalize}"
renderer_class = "Asciinema.Renderer.#{custom_renderer.capitalize}"
else
renderer_class = "AsciiIo.Renderer.Pre"
renderer_class = "Asciinema.Renderer.Pre"
end
render :partial => 'asciicasts/player', :locals => {

@ -7,7 +7,7 @@ javascript:
el: $('.player'),
speed: #{speed},
benchmark: #{benchmark},
model: new AsciiIo.Asciicast(#{asciicast.html_safe}),
model: new Asciinema.Asciicast(#{asciicast.html_safe}),
containerWidth: #{container_width || 'null'},
rendererClass: #{renderer_class.html_safe},
autoPlay: #{auto_play},

@ -1,5 +1,5 @@
<script type="text/javascript">
jQuery(document).ready(function(){
AsciiIo.current_user = <%= raw current_user.to_json(:only => [:id, :nickname, :avatar_url]) %>;
Asciinema.current_user = <%= raw current_user.to_json(:only => [:id, :nickname, :avatar_url]) %>;
});
</script>

@ -4,4 +4,4 @@ require ::File.expand_path('../config/environment', __FILE__)
use Rack::Deflater
run AsciiIo::Application
run Asciinema::Application

@ -8,7 +8,7 @@ Bundler.require(:default, Rails.env)
require File.expand_path('../cfg', __FILE__)
module AsciiIo
module Asciinema
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers

@ -6,7 +6,7 @@
development:
adapter: postgresql
encoding: unicode
database: ascii_io_development
database: asciinema_development
pool: 25
# username: asciiio
# password:
@ -19,7 +19,7 @@ development:
test:
adapter: postgresql
encoding: unicode
database: ascii_io_test
database: asciinema_test
pool: 5
# username: asciiio
# password:
@ -28,7 +28,7 @@ test:
production:
adapter: postgresql
encoding: unicode
database: ascii_io_production
database: asciinema_production
pool: 25
username: asciiio
password:

@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
AsciiIo::Application.initialize!
Asciinema::Application.initialize!

@ -1,4 +1,4 @@
AsciiIo::Application.configure do
Asciinema::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on

@ -1,4 +1,4 @@
AsciiIo::Application.configure do
Asciinema::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.

@ -1,4 +1,4 @@
AsciiIo::Application.configure do
Asciinema::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's

@ -9,4 +9,4 @@
# Make sure your secret_key_base is kept private
# if you're sharing your code publicly.
AsciiIo::Application.config.secret_key_base = CFG['SECRET_TOKEN'] || '21deaa1a1228e119434aa783ecb4af21be7513ff1f5b8c1d8894241e5fc70ad395db72c8c1b0508a0ebb994ed88a8d73f6c84e44f7a4bc554a40d77f9844d2f4'
Asciinema::Application.config.secret_key_base = CFG['SECRET_TOKEN'] || '21deaa1a1228e119434aa783ecb4af21be7513ff1f5b8c1d8894241e5fc70ad395db72c8c1b0508a0ebb994ed88a8d73f6c84e44f7a4bc554a40d77f9844d2f4'

@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.
AsciiIo::Application.config.session_store :cookie_store, key: '_ascii_io_session'
Asciinema::Application.config.session_store :cookie_store, key: '_asciinema_session'

@ -1,4 +1,4 @@
AsciiIo::Application.routes.draw do
Asciinema::Application.routes.draw do
get "/browse" => "asciicasts#index", :as => :browse
get "/browse/popular" => "asciicasts#popular", :as => :popular

@ -16,6 +16,6 @@ task :gen_color_palettes do
File.open('app/assets/stylesheets/colors.css', 'w') { |f| f.write out }
File.open('app/assets/javascripts/player/colors.js', 'w') do |f|
f.write "AsciiIo.colors = #{JSON.dump(colors)};"
f.write "Asciinema.colors = #{JSON.dump(colors)};"
end
end

@ -9,7 +9,7 @@ id = ARGV[0]
id = id[/\d+/].to_i
url = "http://ascii.io/a/#{id}.json"
url = "http://asciinema.org/a/#{id}.json"
json = open(url).read
data = JSON.parse(json)

@ -3,7 +3,7 @@ include ActionDispatch::TestProcess
FactoryGirl.define do
fixture_file = lambda { |name, mime_type|
AsciiIo::FixtureHelpers.fixture_file(name, mime_type)
Asciinema::FixtureHelpers.fixture_file(name, mime_type)
}
factory :asciicast do

@ -1,12 +1,12 @@
describe 'AsciiIo.Brush', ->
describe 'Asciinema.Brush', ->
describe '.clearCache', ->
it 'resets cache hash', ->
AsciiIo.Brush.create()
expect(_(AsciiIo.Brush.cache).keys().length > 0).toBeTruthy()
AsciiIo.Brush.clearCache()
expect(_(AsciiIo.Brush.cache).keys().length).toEqual(0)
Asciinema.Brush.create()
expect(_(Asciinema.Brush.cache).keys().length > 0).toBeTruthy()
Asciinema.Brush.clearCache()
expect(_(Asciinema.Brush.cache).keys().length).toEqual(0)
describe '.hash', ->
@ -20,66 +20,66 @@ describe 'AsciiIo.Brush', ->
underline: true
reverse : true
hash = AsciiIo.Brush.hash attrs
hash = Asciinema.Brush.hash attrs
expect(hash).toEqual '1_2_false_true_false_true_true'
describe '.create', ->
beforeEach ->
AsciiIo.Brush.clearCache()
Asciinema.Brush.clearCache()
it 'returns new brush instance if not cached', ->
brush = AsciiIo.Brush.create({ fg: 1 })
expect(brush instanceof AsciiIo.Brush).toBeTruthy()
brush = Asciinema.Brush.create({ fg: 1 })
expect(brush instanceof Asciinema.Brush).toBeTruthy()
it 'returns existing brush instance if cached', ->
brush = AsciiIo.Brush.create({ fg: 1 })
otherBrush = AsciiIo.Brush.create({ fg: 1, bg: 100 })
anotherBrush = AsciiIo.Brush.create({ fg: 1 })
brush = Asciinema.Brush.create({ fg: 1 })
otherBrush = Asciinema.Brush.create({ fg: 1, bg: 100 })
anotherBrush = Asciinema.Brush.create({ fg: 1 })
expect(_(AsciiIo.Brush.cache).keys().length).toEqual(2)
expect(_(Asciinema.Brush.cache).keys().length).toEqual(2)
expect(brush is anotherBrush).toBeTruthy()
describe '#fgColor', ->
it 'returns 7 if fg is undefined', ->
brush = new AsciiIo.Brush fg: undefined
brush = new Asciinema.Brush fg: undefined
expect(brush.fgColor()).toEqual 7
it 'returns fg if bright is off', ->
brush = new AsciiIo.Brush fg: 3, bright: false
brush = new Asciinema.Brush fg: 3, bright: false
expect(brush.fgColor()).toEqual 3
it 'returns fg+8 if bright is on', ->
brush = new AsciiIo.Brush fg: 3, bright: true
brush = new Asciinema.Brush fg: 3, bright: true
expect(brush.fgColor()).toEqual 11
it 'returns bg if reverse is on', ->
brush = new AsciiIo.Brush fg: 1, bg: 2, reverse: true
brush = new Asciinema.Brush fg: 1, bg: 2, reverse: true
expect(brush.fgColor()).toEqual 2
describe '#bgColor', ->
it 'returns 0 if bg is undefined', ->
brush = new AsciiIo.Brush bg: undefined
brush = new Asciinema.Brush bg: undefined
expect(brush.bgColor()).toEqual 0
it 'returns bg if blink is off', ->
brush = new AsciiIo.Brush bg: 4, blink: false
brush = new Asciinema.Brush bg: 4, blink: false
expect(brush.bgColor()).toEqual 4
it 'returns bg+8 if blink is on', ->
brush = new AsciiIo.Brush bg: 4, blink: true
brush = new Asciinema.Brush bg: 4, blink: true
expect(brush.bgColor()).toEqual 12
it 'returns fg if reverse is on', ->
brush = new AsciiIo.Brush fg: 1, bg: 2, reverse: true
brush = new Asciinema.Brush fg: 1, bg: 2, reverse: true
expect(brush.bgColor()).toEqual 1
describe '#attributes', ->
it 'includes fg, bg, blink, bright, italic, underline, reverse', ->
brush = new AsciiIo.Brush
brush = new Asciinema.Brush
attrs = brush.attributes()
expectedAttrs =
['fg', 'bg', 'blink', 'bright', 'italic', 'underline', 'reverse']
@ -92,13 +92,13 @@ describe 'AsciiIo.Brush', ->
describe '#applyChanges', ->
it 'returns new brush', ->
brush = new AsciiIo.Brush
brush = new Asciinema.Brush
newBrush = brush.applyChanges fg: 5
expect(newBrush).toNotEqual brush
it 'applies changes to attributes', ->
brush = new AsciiIo.Brush fg: 1
brush = new Asciinema.Brush fg: 1
newBrush = brush.applyChanges fg: 2
expect(newBrush.fg).toEqual 2

@ -28,9 +28,9 @@ RSpec.configure do |config|
config.order = "random"
config.include FactoryGirl::Syntax::Methods
config.include AsciiIo::FixtureHelpers
config.include AsciiIo::FeatureHelpers
config.include AsciiIo::ControllerMacros, :type => :controller
config.include Asciinema::FixtureHelpers
config.include Asciinema::FeatureHelpers
config.include Asciinema::ControllerMacros, :type => :controller
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)

@ -1,4 +1,4 @@
module AsciiIo
module Asciinema
module ControllerMacros
def login_as(user)
controller.stub(:current_user => user)

@ -1,4 +1,4 @@
module AsciiIo
module Asciinema
module FeatureHelpers
def uploaded_file(path, type)

@ -1,4 +1,4 @@
module AsciiIo
module Asciinema
module FixtureHelpers
extend self

Loading…
Cancel
Save