Skip to content

Commit c5f77d6

Browse files
committed
Updated ruby version, now running with Docker at Zeit
1 parent 1532baa commit c5f77d6

File tree

7 files changed

+79
-38
lines changed

7 files changed

+79
-38
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git/
2+
README.md

Gemfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
2-
ruby '1.8.7'
3-
gem 'sinatra', '1.4.3'
4-
gem 'sinatra-contrib', '1.4.1'
5-
gem 'sinatra-jsonp', '0.4.2'
6-
gem 'thin', '1.5.1'
2+
ruby '2.3.7'
3+
gem 'sinatra'
4+
gem 'sinatra-contrib'
5+
gem 'sinatra-jsonp'
6+
gem 'thin'

Gemfile.lock

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
backports (3.3.3)
5-
daemons (1.1.9)
6-
eventmachine (1.0.3)
7-
multi_json (1.3.7)
8-
rack (1.5.2)
9-
rack-protection (1.5.0)
4+
backports (3.11.3)
5+
daemons (1.2.6)
6+
eventmachine (1.2.5)
7+
multi_json (1.13.1)
8+
mustermann (1.0.2)
9+
rack (2.0.4)
10+
rack-protection (2.0.1)
1011
rack
11-
rack-test (0.6.2)
12-
rack (>= 1.0)
13-
sinatra (1.4.3)
14-
rack (~> 1.4)
15-
rack-protection (~> 1.4)
16-
tilt (~> 1.3, >= 1.3.4)
17-
sinatra-contrib (1.4.1)
12+
sinatra (2.0.1)
13+
mustermann (~> 1.0)
14+
rack (~> 2.0)
15+
rack-protection (= 2.0.1)
16+
tilt (~> 2.0)
17+
sinatra-contrib (2.0.1)
1818
backports (>= 2.0)
1919
multi_json
20-
rack-protection
21-
rack-test
22-
sinatra (~> 1.4.0)
23-
tilt (~> 1.3)
24-
sinatra-jsonp (0.4.2)
25-
multi_json (~> 1.3.7)
26-
sinatra (~> 1.0)
27-
thin (1.5.1)
28-
daemons (>= 1.0.9)
29-
eventmachine (>= 0.12.6)
30-
rack (>= 1.0.0)
31-
tilt (1.4.1)
20+
mustermann (~> 1.0)
21+
rack-protection (= 2.0.1)
22+
sinatra (= 2.0.1)
23+
tilt (>= 1.3, < 3)
24+
sinatra-jsonp (0.5.0)
25+
multi_json (~> 1.8)
26+
sinatra (>= 1.0)
27+
thin (1.7.2)
28+
daemons (~> 1.0, >= 1.0.9)
29+
eventmachine (~> 1.0, >= 1.0.4)
30+
rack (>= 1, < 3)
31+
tilt (2.0.8)
3232

3333
PLATFORMS
3434
ruby
3535

3636
DEPENDENCIES
37-
sinatra (= 1.4.3)
38-
sinatra-contrib (= 1.4.1)
39-
sinatra-jsonp (= 0.4.2)
40-
thin (= 1.5.1)
37+
sinatra
38+
sinatra-contrib
39+
sinatra-jsonp
40+
thin
41+
42+
RUBY VERSION
43+
ruby 2.3.1p112
44+
45+
BUNDLED WITH
46+
1.16.1

README.markdown renamed to README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ This is the Ruby backend for RegexPlanet, a tool for online regular expression t
55
See [API docs](http://www.regexplanet.com/support/api.html) for what it is supposed to do.
66

77
See [Ruby online regex test page](http://www.regexplanet.com/advanced/ruby/index.html) to use it to test your regular expressions.
8+
9+
## Notes
10+
11+
* [Ruby on Docker](https://docs.docker.com/samples/library/ruby/)
12+
13+
## Credits
14+
15+
* Ruby
16+
* Docker
17+
* Heroku
18+
* Sinatra

deploy.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
#!/bin/bash
2-
git push heroku
2+
#
3+
# deploy the xregexp backend to zeit
4+
#
5+
6+
heroku container:push --app regexplanet-postgresql web
7+
8+
9+
#echo "INFO: listing existing versions"
10+
#now ls regexplanet-postgresql
11+
12+
#echo "INFO: deploying"
13+
#now && now alias
14+
15+
#
16+
# need to kill the old version!
17+
#
18+
#echo "INFO: removing the old version "
19+
#echo "WARNING: must be done manually with 'now rm'"

regexplanet.rb

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/local/bin/ruby
2+
13
require 'cgi'
24
require 'sinatra'
35
require "sinatra/jsonp"
@@ -6,6 +8,7 @@
68
configure do
79
mime_type :ico, 'image/x-icon'
810
set :static_cache_control, [:public, {:max_age => 604800 } ]
11+
set :bind, '0.0.0.0'
912
#set :protection, :except => [:frame_options ]
1013
#disable :protection
1114
end

run.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
export PATH=$PATH:/var/lib/gems/1.8/bin
2-
echo $PATH
3-
foreman start
1+
#!/bin/bash
2+
3+
4+
docker build -t regexplanet-ruby .
5+
docker run -p 4000:4000 --expose 4000 -e PORT='4000' regexplanet-ruby

0 commit comments

Comments
 (0)