diff --git a/app/assets/stylesheets/asciicasts.css.scss b/app/assets/stylesheets/asciicasts.css.scss index 0fc58d1..183fabf 100644 --- a/app/assets/stylesheets/asciicasts.css.scss +++ b/app/assets/stylesheets/asciicasts.css.scss @@ -28,6 +28,15 @@ // font-size: 18px; // margin: 20px 0; // } + + .env-info { + margin: 15px 0 0 0; + font-size: 12px; + + .value { + font-weight: bold; + } + } } .asciicast-delete-link { diff --git a/app/models/asciicast.rb b/app/models/asciicast.rb index 16e948a..eb8c35e 100644 --- a/app/models/asciicast.rb +++ b/app/models/asciicast.rb @@ -38,6 +38,20 @@ class Asciicast < ActiveRecord::Base self.terminal_type = data['term']['type'] end + def os + if uname =~ /Linux/ + 'Linux' + elsif uname =~ /Darwin/ + 'OSX' + else + uname.split(' ', 2)[0] + end + end + + def shell_name + File.basename(shell.to_s) + end + def as_json(opts = {}) super :methods => [:escaped_stdout_data, :stdout_timing_data] end diff --git a/app/views/asciicasts/show.html.erb b/app/views/asciicasts/show.html.erb index e920d19..bb609fe 100644 --- a/app/views/asciicasts/show.html.erb +++ b/app/views/asciicasts/show.html.erb @@ -18,6 +18,12 @@ <%= asciicast_time(@asciicast) %> + +

+ OS=<%= @asciicast.os %> + SHELL=<%= @asciicast.shell_name %> + TERM=<%= @asciicast.terminal_type || '?' %> +

<%= render :partial => 'asciicasts/asciicast', :object => @asciicast %>