Skip to content

Commit

Permalink
Document and prepare for 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gsamokovarov committed Sep 6, 2013
1 parent 88d39b1 commit 99d094e
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## 0.4.0 (September 6, 2013)

* Drop the GPL dependency of vt100.js.
* Use term.js as vt100.js replacement.
* Add config.web_console.term for using custom $TERM.
* Add config.web_console.style.colors for color theming.
* Add config.web_console.style.font for using custom fonts.
* Fix zsh repeating the first command argument on servers started inside a TMUX session.

## 0.3.0 (August 23, 2013)

* Proper VT100 emulation.
Expand Down
5 changes: 1 addition & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
web-console (0.3.0)
web-console (0.4.0)
rails (~> 4.0.0)

GEM
Expand Down Expand Up @@ -37,7 +37,6 @@ GEM
tzinfo (~> 0.3.37)
arel (4.0.0)
atomic (1.1.10)
atomic (1.1.10-java)
builder (3.1.4)
coderay (1.0.9)
daemons (1.1.9)
Expand Down Expand Up @@ -110,8 +109,6 @@ GEM
thor (0.18.1)
thread_safe (0.1.2)
atomic
thread_safe (0.1.2-java)
atomic
tilt (1.4.1)
treetop (1.4.14)
polyglot
Expand Down
82 changes: 78 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documentation for:
<a href=https://github.com/gsamokovarov/web-console/tree/v0.1.0>v0.1.0</a>
<a href=https://github.com/gsamokovarov/web-console/tree/v0.2.0>v0.2.0</a>
<a href=https://github.com/gsamokovarov/web-console/tree/v0.3.0>v0.3.0</a>
</p>

Web Console [![Version](https://badge.fury.io/rb/web-console.png)](http://badge.fury.io/rb/web-console) [![Travis](https://travis-ci.org/gsamokovarov/web-console.png)](https://travis-ci.org/gsamokovarov/web-console)
Expand Down Expand Up @@ -141,6 +142,11 @@ _Poor man's solution to SSH._ ![boom](http://f.cl.ly/items/3n2h0p1w0B261u2d201b/
**If you ever decide to use _Web Console_ that way, use SSL to encrypt the
traffic, otherwise all the input can be easily sniffed!**

### config.web_console.term

By default, the _Web Console_ terminal will report itself as `xterm-color`. You
can override this option to change that.

### config.web_console.timeout

You may have noticed that _Web Console_ client sends a lot of requests to the
Expand All @@ -165,30 +171,98 @@ class Application < Rails::Application
# synchronous.
config.allow_concurrency = true

# For long-polling 45 seconds timeout seems reasonable.
# For long-polling, 45 seconds timeout for the development server seems
reasonable.
config.web_console.timeout = 45.seconds
end
```

Styling
-------

If you would like to style the terminal a bit different than the default
appearance, you can do so with the following options.

### config.web_console.style.colors

_Web Console_ supports up to 256 color themes, though most of the common
terminal themes are usually just 16 colors.

The default color theme is a white-on-black theme called `light`. For
different appearance you may want to experiment with the other included color
themes.

- `xterm` _the standard xterm theme_
- `tango` _theme based on the tango colors_
- `solarized_dark` _light version of the common solarized colors_
- `solarized_light` _dark version of the common solarized colors_

If you would like to use a custom theme, you may do so with the following
syntax.

```ruby
class Application < Rails::Application
# First, you have to define and register your custom color theme. Each color
# theme is mapped to a name.
WebConsole::Colors.register_theme(:custom) do |c|
# The most common color themes are the 16 colors one. They are built from 3
# parts.

# 8 darker colors.
c.add '#000000'
c.add '#cd0000'
c.add '#00cd00'
c.add '#cdcd00'
c.add '#0000ee'
c.add '#cd00cd'
c.add '#00cdcd'
c.add '#e5e5e5'

# 8 lighter colors.
c.add '#7f7f7f'
c.add '#ff0000'
c.add '#00ff00'
c.add '#ffff00'
c.add '#5c5cff'
c.add '#ff00ff'
c.add '#00ffff'
c.add '#ffffff'

# Background and foreground colors.
c.background '#ffffff'
c.foreground '#000000'
end

# Now you have to tell Web Console to actually use it.
config.web_console.style.colors = :custom
end
```

### config.web_console.style.font

You may also change the font, which is following the CSS font property syntax.
By default it is `large DejaVu Sans Mono, Liberation Mono, monospace`.

FAQ
---

### I'm running JRuby and the console doesn't load.

**TL;DR** Give it a bit of time, it will load.

While spawning processes is relatively cheap on _MRI_, this is not the case in
_JRuby_. Spawning another process is slow. Spawning another **JRuby** process
is even slower. Read more about the problem at the _JRuby_ [wiki].

**TL;DR** Give it a bit of time, it will load.

Test Drive
----------

If you just want to try the web-console, without having to go through the
trouble of installing it, we provide a [Docker] container that does that for
you.

To try it, install [Docker] first and then run the following snippet in your shell.
To try it, install [Docker] first and then paste the following snippet in your
shell.

```bash
sudo docker build -t gsamokovarov/web-console github.com/!#:4 && !#:0-1 run -i -t !#:4
Expand Down
2 changes: 1 addition & 1 deletion lib/web_console/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module WebConsole
VERSION = '0.3.0'
VERSION = '0.4.0'
end

0 comments on commit 99d094e

Please sign in to comment.