mirror of
https://github.com/faye/wstest.git
synced 2025-11-01 13:58:47 +00:00
Extract shell environment logic into a single file
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
.vagrant
|
||||
code
|
||||
reports
|
||||
|
||||
+5
-6
@@ -1,13 +1,12 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
source ~/.nvmrc
|
||||
source ~/.rubyrc
|
||||
source shellenv
|
||||
|
||||
|
||||
ruby-client () {
|
||||
local version="$1"
|
||||
|
||||
cd ~/repo/ruby/$version/websocket
|
||||
cd "$CODE_DIR/ruby/$version/websocket"
|
||||
chruby "$version"
|
||||
compile-driver
|
||||
ruby examples/autobahn_client.rb
|
||||
@@ -19,7 +18,7 @@ compile-driver () {
|
||||
cd -
|
||||
}
|
||||
|
||||
# cd ~/repo/ruby/jruby-1.7/websocket
|
||||
# cd "$CODE_DIR/ruby/jruby-1.7/websocket"
|
||||
# chruby jruby-1.7
|
||||
# compile-driver
|
||||
# ruby -J-Xmx2048m --1.9 examples/autobahn_client.rb
|
||||
@@ -37,7 +36,7 @@ done
|
||||
node-client () {
|
||||
local version="$1"
|
||||
|
||||
cd ~/repo/node/websocket
|
||||
cd "$CODE_DIR/node/websocket"
|
||||
nvm use "$version"
|
||||
node examples/autobahn_client.js
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
source ~/.nvmrc
|
||||
source shellenv
|
||||
|
||||
|
||||
websocket-driver-node-server () {
|
||||
local version="$1"
|
||||
local port="$2"
|
||||
|
||||
cd ~/repo/node/driver
|
||||
cd "$CODE_DIR/node/driver"
|
||||
nvm use "$version"
|
||||
node examples/net_server.js "$port" &
|
||||
}
|
||||
@@ -29,7 +29,7 @@ faye-websocket-node-server () {
|
||||
local version="$1"
|
||||
local port="$2"
|
||||
|
||||
cd ~/repo/node/websocket
|
||||
cd "$CODE_DIR/node/websocket"
|
||||
nvm use "$version"
|
||||
node examples/server.js "$port" &
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
source ~/.rubyrc
|
||||
source shellenv
|
||||
|
||||
|
||||
compile-driver () {
|
||||
@@ -14,7 +14,7 @@ websocket-driver-ruby-server () {
|
||||
local version="$1"
|
||||
local port="$2"
|
||||
|
||||
cd ~/repo/ruby/$version/driver
|
||||
cd "$CODE_DIR/ruby/$version/driver"
|
||||
chruby "$version"
|
||||
compile-driver
|
||||
ruby examples/em_server.rb "$port" &
|
||||
@@ -33,7 +33,7 @@ websocket-driver-ruby-server ruby-3.2 6110
|
||||
websocket-driver-ruby-server ruby-3.3 6111
|
||||
websocket-driver-ruby-server ruby-3.4 6112
|
||||
|
||||
# cd ~/repo/ruby/jruby-1.7/driver
|
||||
# cd "$CODE_DIR/ruby/jruby-1.7/driver"
|
||||
# chruby jruby-1.7
|
||||
# ruby -S bundle exec rake compile
|
||||
# ruby -J-Xmx2048m --1.9 examples/em_server.rb 6201 &
|
||||
@@ -50,7 +50,7 @@ faye-websocket-ruby-server () {
|
||||
local server="$2"
|
||||
local port="$3"
|
||||
|
||||
cd ~/repo/ruby/$version/websocket
|
||||
cd "$CODE_DIR/ruby/$version/websocket"
|
||||
chruby "$version"
|
||||
compile-driver
|
||||
ruby examples/server.rb "$port" '' "$server" &
|
||||
@@ -69,7 +69,7 @@ faye-websocket-ruby-server ruby-3.2 thin 7110
|
||||
faye-websocket-ruby-server ruby-3.3 thin 7111
|
||||
faye-websocket-ruby-server ruby-3.4 thin 7112
|
||||
|
||||
cd ~/repo/ruby/ruby-3.1/websocket
|
||||
cd "$CODE_DIR/ruby/ruby-3.1/websocket"
|
||||
chruby ruby-3.1
|
||||
ruby examples/server.rb 7201 '' goliath -svp 7201 &
|
||||
cd examples
|
||||
@@ -78,7 +78,7 @@ ruby -S bundle exec passenger start -p 7202 &
|
||||
faye-websocket-ruby-server ruby-3.2 puma 7203
|
||||
faye-websocket-ruby-server ruby-3.2 rainbows 7204
|
||||
|
||||
# cd ~/repo/ruby/jruby-1.7/websocket
|
||||
# cd "$CODE_DIR/ruby/jruby-1.7/websocket"
|
||||
# chruby jruby-1.7
|
||||
# ruby -J-Xmx2048m --1.9 examples/server.rb 7301 '' puma &
|
||||
# ruby -J-Xmx2048m --2.0 examples/server.rb 7302 '' puma &
|
||||
|
||||
+5
-6
@@ -1,11 +1,10 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
source ~/.nvmrc
|
||||
source ~/.rubyrc
|
||||
source shellenv
|
||||
|
||||
|
||||
mkdir -p ~/repo/{node,ruby}
|
||||
PATCH_DIR="$PWD/patches"
|
||||
mkdir -p "$CODE_DIR"/{node,ruby}
|
||||
|
||||
|
||||
checkout () {
|
||||
@@ -30,7 +29,7 @@ checkout () {
|
||||
}
|
||||
|
||||
|
||||
cd ~/repo/node
|
||||
cd "$CODE_DIR/node"
|
||||
|
||||
install-node-modules () {
|
||||
local dir="$1"
|
||||
@@ -74,7 +73,7 @@ link-repo websocket-extensions extensions
|
||||
cd -
|
||||
|
||||
|
||||
cd ~/repo/ruby
|
||||
cd "$CODE_DIR/ruby"
|
||||
|
||||
RUBY_VERSIONS=(
|
||||
# ruby-1.9
|
||||
|
||||
Reference in New Issue
Block a user