Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 0bf34d8

Browse files
authored
fly.io support + ruby 3.1.2 (#130)
- ruby 3.1.2 - fly.io - codespaces support for ruby 3.1.2
1 parent 8f6bbfb commit 0bf34d8

File tree

6 files changed

+71
-26
lines changed

6 files changed

+71
-26
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.1, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.1-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
2+
ARG VARIANT=3.1-bullseye
3+
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.3
1+
3.1.2

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ git_source(:github) do |repo_name|
66
"https://github.com/#{repo_name}.git"
77
end
88

9-
ruby "2.5.3"
9+
ruby "3.1.2"
1010

1111
gem "activesupport"
1212
gem "erector", "~> 0.10.0"
13-
gem "sinatra", "~> 1.4.0"
13+
gem "sinatra", "~> 1.4.7"
1414
gem "nokogiri"
1515
gem "thin"
1616
gem "eventmachine", "~> 1.0.3"

Gemfile.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GIT
1313
GEM
1414
remote: https://rubygems.org/
1515
specs:
16-
activesupport (4.1.11)
16+
activesupport (4.1.16)
1717
i18n (~> 0.6, >= 0.6.9)
1818
json (~> 1.7, >= 1.7.7)
1919
minitest (~> 5.1)
@@ -39,7 +39,7 @@ GEM
3939
erector (0.10.0)
4040
treetop (>= 1.2.3)
4141
eventmachine (1.0.4)
42-
ffi (1.9.6)
42+
ffi (1.15.5)
4343
files (0.3.1)
4444
font-awesome-sass (4.2.2)
4545
sass (~> 3.2)
@@ -53,16 +53,16 @@ GEM
5353
celluloid (>= 0.15.2)
5454
rb-fsevent (>= 0.9.3)
5555
rb-inotify (>= 0.9)
56-
mini_portile2 (2.5.1)
57-
minitest (5.13.0)
56+
mini_portile2 (2.8.0)
57+
minitest (5.16.3)
5858
multi_json (1.14.1)
59-
nokogiri (1.11.4)
60-
mini_portile2 (~> 2.5.0)
59+
nokogiri (1.13.8)
60+
mini_portile2 (~> 2.8.0)
6161
racc (~> 1.4)
6262
polyglot (0.3.5)
6363
predicated (0.2.6)
64-
racc (1.5.2)
65-
rack (1.6.12)
64+
racc (1.6.0)
65+
rack (1.6.13)
6666
rack-codehighlighter (0.5.0)
6767
nokogiri (>= 1.4.1)
6868
rack (>= 1.0.0)
@@ -97,10 +97,10 @@ GEM
9797
rubyzip (1.3.0)
9898
sass (3.4.8)
9999
sexp_processor (4.10.1)
100-
sinatra (1.4.5)
101-
rack (~> 1.4)
100+
sinatra (1.4.8)
101+
rack (~> 1.5)
102102
rack-protection (~> 1.4)
103-
tilt (~> 1.3, >= 1.3.4)
103+
tilt (>= 1.3, < 3)
104104
sprockets (2.12.5)
105105
hike (~> 1.2)
106106
multi_json (~> 1.0)
@@ -117,7 +117,7 @@ GEM
117117
treetop (1.5.3)
118118
polyglot (~> 0.3)
119119
trollop (2.0)
120-
tzinfo (1.2.5)
120+
tzinfo (1.2.10)
121121
thread_safe (~> 0.1)
122122

123123
PLATFORMS
@@ -144,13 +144,13 @@ DEPENDENCIES
144144
rspec
145145
rubyzip
146146
sass
147-
sinatra (~> 1.4.0)
147+
sinatra (~> 1.4.7)
148148
sprockets
149149
thin
150150
wrong!
151151

152152
RUBY VERSION
153-
ruby 2.5.3p105
153+
ruby 3.1.2p20
154154

155155
BUNDLED WITH
156-
1.17.1
156+
2.3.7

fly.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# fly.toml file generated for rbb-docs on 2022-09-11T14:07:43Z
2+
3+
app = "rbb-docs"
4+
kill_signal = "SIGINT"
5+
kill_timeout = 5
6+
processes = []
7+
8+
[build]
9+
builder = "heroku/buildpacks:20"
10+
11+
[env]
12+
PORT = "8080"
13+
14+
[experimental]
15+
allowed_public_ports = []
16+
auto_rollback = true
17+
18+
[[services]]
19+
http_checks = []
20+
internal_port = 8080
21+
processes = ["app"]
22+
protocol = "tcp"
23+
script_checks = []
24+
[services.concurrency]
25+
hard_limit = 25
26+
soft_limit = 20
27+
type = "connections"
28+
29+
[[services.ports]]
30+
force_https = true
31+
handlers = ["http"]
32+
port = 80
33+
34+
[[services.ports]]
35+
handlers = ["tls", "http"]
36+
port = 443
37+
38+
[[services.tcp_checks]]
39+
grace_period = "1s"
40+
interval = "15s"
41+
restart_limit = 0
42+
timeout = "2s"

lib/step.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def insert file
7979
end
8080
end
8181

82-
def step name = nil, options = {}
82+
def step name = nil, options = {}, &block
8383
num = next_step_number
8484
a(:name => "step#{current_anchor_num}")
8585
a(:name => options[:anchor_name]) if options[:anchor_name]
@@ -90,7 +90,7 @@ def step name = nil, options = {}
9090
(!name.nil? ? I18n.t("general.step_title_suffix") : '')
9191
text name
9292
end
93-
_render_inner_content &Proc.new if block_given?
93+
_render_inner_content(&block) if block_given?
9494
end
9595
end
9696

@@ -137,19 +137,19 @@ def next_step name
137137
end
138138
end
139139

140-
def situation name
140+
def situation name, &block
141141
h1 name
142-
_render_inner_content &Proc.new if block_given?
142+
_render_inner_content(&block) if block_given?
143143
end
144144

145-
def option name
145+
def option name, &block
146146
num = next_step_number
147147
a(:name => "step#{current_anchor_num}")
148148
h1 :class => "option" do
149149
span I18n.t("general.option", :num => num)
150150
text name
151151
end
152-
_render_inner_content &Proc.new if block_given?
152+
_render_inner_content(&block) if block_given?
153153
end
154154

155155
def option_half title
@@ -395,10 +395,10 @@ def js_expected_results(lesson)
395395

396396
private
397397

398-
def _render_inner_content
398+
def _render_inner_content(&block)
399399
blockquote do
400400
@step_stack.push 0
401-
yield
401+
yield(block)
402402
@step_stack.pop
403403
end
404404
end

0 commit comments

Comments
 (0)