Skip to content

Commit 014de26

Browse files
committed
add magnification via squish
1 parent 737adbe commit 014de26

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# About
22

33
This project provides Lua modules for [Websocket Version 13](http://tools.ietf.org/html/rfc6455) conformant clients and servers. [![Build Status](https://travis-ci.org/lipp/lua-websockets.png)](https://travis-ci.org/lipp/lua-websockets)
4+
The minified version is only ~10k bytes in size.
45

56
Clients are available in three different flavours:
67

7-
- synchronous
8+
- synchronous
89
- coroutine based ([copas](http://keplerproject.github.com/copas))
910
- asynchronous ([lua-ev](https://github.com/brimworks/lua-ev))
1011

@@ -73,7 +74,7 @@ local server = require'websocket'.server.ev.listen
7374
ws:on_message(function(ws,message)
7475
ws:send(message)
7576
end)
76-
77+
7778
-- this is optional
7879
ws:on_close(function()
7980
ws:close()
@@ -118,12 +119,24 @@ The client and server modules depend on:
118119

119120
# Install
120121

121-
```shell
122+
```shell
122123
$ git clone git://github.com/lipp/lua-websockets.git
123124
$ cd lua-websockets
124-
$ luarocks make rockspecs/lua-websockets-scm-1.rockspec
125+
$ luarocks make rockspecs/lua-websockets-scm-1.rockspec
126+
```
127+
128+
# Minify
129+
130+
A `squishy` file for [squish](http://matthewwild.co.uk/projects/squish/home) is
131+
provided. Creating the minified version (~10k) can be created with:
132+
133+
```sh
134+
$ squish --gzip
125135
```
126136

137+
The minifed version has be to be installed manually though.
138+
139+
127140
# Tests
128141

129142
Running tests requires:

minify.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env sh
2+
mkdir min
3+
mkdir min/src
4+
mkdir min/src/websocket
5+
for i in `find src -name "*.lua"`
6+
do
7+
echo "minifying" $i
8+
luamin -f {$i} > min/$i
9+
done

squishy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Module "websocket.sync" "src/websocket/sync.lua"
2+
Module "websocket.client" "src/websocket/client.lua"
3+
Module "websocket.client_copas" "src/websocket/client_copas.lua"
4+
Module "websocket.server" "src/websocket/server.lua"
5+
Module "websocket.server_copas" "src/websocket/server_copas.lua"
6+
Module "websocket.handshake" "src/websocket/handshake.lua"
7+
Module "websocket.tools" "src/websocket/tools.lua"
8+
Module "websocket.frame" "src/websocket/frame.lua"
9+
Module "websocket.bit" "src/websocket/bit.lua"
10+
Module "websocket.client_ev" "src/websocket/client_ev.lua"
11+
Module "websocket.ev_common" "src/websocket/ev_common.lua"
12+
Module "websocket.server_ev" "src/websocket/server_ev.lua"
13+
14+
Main "src/websocket.lua"
15+
Output "websocket.lua"

0 commit comments

Comments
 (0)