Skip to content

Commit 80901fb

Browse files
authored
Merge pull request #706 from FerPerales/fp-upgrade-ruby-to-3-2
Upgrade Ruby to 3.2.2
2 parents ad308b4 + 3ce743f commit 80901fb

File tree

9 files changed

+130
-60
lines changed

9 files changed

+130
-60
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.6
1+
3.2.2

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.2.2

Gemfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
source "https://rubygems.org"
22

3-
ruby '2.7.6'
3+
ruby '3.2.2'
44

55
gem 'activesupport'
6-
gem "erector", "~> 0.10.0"
7-
gem "sinatra", "~> 3.0.3"
8-
gem "sinatra-contrib", "~> 3.0.3"
6+
gem "erector", github: "erector/erector"
7+
gem "sinatra"
8+
gem "sinatra-contrib"
99
gem "nokogiri"
10-
gem "thin", "1.8.1"
10+
gem "thin"
1111
gem 'rack-codehighlighter'
1212
gem 'coderay'
13-
gem "deckrb", "~> 0.5.2"
13+
gem "deckrb"
1414
gem "sass"
1515
gem "redcarpet"
1616
gem "rubyzip"
17-
gem "i18n", "~> 0.7"
17+
gem "i18n"
1818
gem 'font-awesome-sass'
1919
gem 'bootstrap-sass'
2020
gem 'jquery-cdn'
2121
gem 'sprockets'
22-
gem 'ffi', "1.15.5"
23-
gem 'backports', "3.23.0"
22+
gem 'ffi'
23+
gem 'backports'
2424

2525
group :development do
2626
gem "rspec"
2727
gem "rerun"
2828
gem "rake"
2929
gem "rack-test"
30-
gem "files", "~> 0.3.0"
30+
gem 'files', github: "alexch/files"
3131
gem 'rb-fsevent', :platform => :ruby
3232
end

Gemfile.lock

Lines changed: 107 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1+
GIT
2+
remote: https://github.com/alexch/files.git
3+
revision: 4938dd85ed79f421b808e8798764661a71cab5a4
4+
specs:
5+
files (0.4.0)
6+
7+
GIT
8+
remote: https://github.com/erector/erector.git
9+
revision: 32cb38e3381889295183230caf8bf334d2f0e82a
10+
specs:
11+
erector (0.10.0)
12+
haml
13+
jeweler
14+
nokogiri
15+
sass
16+
treetop (>= 1.2.3)
17+
118
GEM
219
remote: https://rubygems.org/
320
specs:
4-
activesupport (5.2.4.3)
21+
activesupport (6.0.6.1)
522
concurrent-ruby (~> 1.0, >= 1.0.2)
623
i18n (>= 0.7, < 2)
724
minitest (~> 5.1)
825
tzinfo (~> 1.1)
9-
autoprefixer-rails (10.4.2.0)
26+
zeitwerk (~> 2.2, >= 2.2.2)
27+
addressable (2.4.0)
28+
autoprefixer-rails (10.4.15.0)
1029
execjs (~> 2)
1130
backports (3.23.0)
1231
bootstrap-sass (3.4.1)
1332
autoprefixer-rails (>= 5.2.1)
1433
sassc (>= 2.0.0)
15-
coderay (1.1.1)
34+
builder (3.2.4)
35+
coderay (1.1.3)
1636
concurrent-ruby (1.1.9)
1737
daemons (1.2.4)
1838
deckrb (0.5.2)
@@ -25,47 +45,89 @@ GEM
2545
redcarpet (~> 2)
2646
thin
2747
trollop
28-
diff-lcs (1.3)
29-
erector (0.10.0)
30-
treetop (>= 1.2.3)
48+
descendants_tracker (0.0.4)
49+
thread_safe (~> 0.3, >= 0.3.1)
50+
diff-lcs (1.5.0)
3151
eventmachine (1.2.3)
3252
execjs (2.8.1)
53+
faraday (0.9.2)
54+
multipart-post (>= 1.2, < 3)
3355
ffi (1.15.5)
34-
files (0.3.1)
35-
font-awesome-sass (4.7.0)
36-
sass (>= 3.2)
37-
i18n (0.8.1)
56+
font-awesome-sass (6.4.2)
57+
sassc (~> 2.0)
58+
git (1.11.0)
59+
rchardet (~> 1.8)
60+
github_api (0.16.0)
61+
addressable (~> 2.4.0)
62+
descendants_tracker (~> 0.0.4)
63+
faraday (~> 0.8, < 0.10)
64+
hashie (>= 3.4)
65+
mime-types (>= 1.16, < 3.0)
66+
oauth2 (~> 1.0)
67+
haml (6.2.3)
68+
temple (>= 0.8.2)
69+
thor
70+
tilt
71+
hashie (5.0.0)
72+
highline (2.1.0)
73+
i18n (0.9.5)
74+
concurrent-ruby (~> 1.0)
75+
jeweler (2.3.9)
76+
builder
77+
bundler
78+
git (>= 1.2.5)
79+
github_api (~> 0.16.0)
80+
highline (>= 1.6.15)
81+
nokogiri (>= 1.5.10)
82+
psych
83+
rake
84+
rdoc
85+
semver2
3886
jquery-cdn (2.2.4)
3987
sprockets (>= 2)
4088
json (2.6.1)
41-
listen (3.1.5)
89+
jwt (2.7.1)
90+
listen (3.0.8)
4291
rb-fsevent (~> 0.9, >= 0.9.4)
4392
rb-inotify (~> 0.9, >= 0.9.7)
44-
ruby_dep (~> 1.2)
93+
mime-types (2.99.3)
4594
mini_portile2 (2.8.0)
46-
minitest (5.15.0)
95+
minitest (5.20.0)
4796
multi_json (1.15.0)
97+
multi_xml (0.6.0)
98+
multipart-post (2.3.0)
4899
mustermann (3.0.0)
49100
ruby2_keywords (~> 0.0.1)
50-
nokogiri (1.13.9)
101+
nokogiri (1.14.5)
51102
mini_portile2 (~> 2.8.0)
52103
racc (~> 1.4)
104+
oauth2 (1.4.8)
105+
faraday (>= 0.8, < 3.0)
106+
jwt (>= 1.0, < 3.0)
107+
multi_json (~> 1.3)
108+
multi_xml (~> 0.5)
109+
rack (>= 1.2, < 3)
53110
polyglot (0.3.5)
54-
racc (1.6.0)
111+
psych (5.1.1.1)
112+
stringio
113+
racc (1.7.2)
55114
rack (2.2.4)
56115
rack-codehighlighter (0.6.0)
57116
nokogiri (>= 1.4.1)
58117
rack (>= 2.0.0)
59-
rack-protection (3.0.3)
60-
rack
118+
rack-protection (3.1.0)
119+
rack (~> 2.2, >= 2.2.4)
61120
rack-test (0.6.3)
62121
rack (>= 1.0)
63-
rake (12.3.3)
122+
rake (13.1.0)
64123
rb-fsevent (0.9.8)
65124
rb-inotify (0.9.8)
66125
ffi (>= 0.5.0)
126+
rchardet (1.8.0)
127+
rdoc (6.5.0)
128+
psych (>= 4.0.0)
67129
redcarpet (2.3.0)
68-
rerun (0.11.0)
130+
rerun (0.14.0)
69131
listen (~> 3.0)
70132
rspec (3.5.0)
71133
rspec-core (~> 3.5.0)
@@ -81,51 +143,59 @@ GEM
81143
rspec-support (~> 3.5.0)
82144
rspec-support (3.5.0)
83145
ruby2_keywords (0.0.5)
84-
ruby_dep (1.5.0)
85-
rubyzip (1.3.0)
86-
sass (3.4.23)
146+
rubyzip (2.3.2)
147+
sass (3.7.4)
148+
sass-listen (~> 4.0.0)
149+
sass-listen (4.0.0)
150+
rb-fsevent (~> 0.9, >= 0.9.4)
151+
rb-inotify (~> 0.9, >= 0.9.7)
87152
sassc (2.4.0)
88153
ffi (~> 1.9)
89-
sinatra (3.0.3)
154+
semver2 (3.4.2)
155+
sinatra (3.1.0)
90156
mustermann (~> 3.0)
91157
rack (~> 2.2, >= 2.2.4)
92-
rack-protection (= 3.0.3)
158+
rack-protection (= 3.1.0)
93159
tilt (~> 2.0)
94-
sinatra-contrib (3.0.3)
160+
sinatra-contrib (3.1.0)
95161
multi_json
96162
mustermann (~> 3.0)
97-
rack-protection (= 3.0.3)
98-
sinatra (= 3.0.3)
163+
rack-protection (= 3.1.0)
164+
sinatra (= 3.1.0)
99165
tilt (~> 2.0)
100166
sprockets (3.7.2)
101167
concurrent-ruby (~> 1.0)
102168
rack (> 1, < 3)
169+
stringio (3.0.8)
170+
temple (0.10.3)
103171
thin (1.8.1)
104172
daemons (~> 1.0, >= 1.0.9)
105173
eventmachine (~> 1.0, >= 1.0.4)
106174
rack (>= 1, < 3)
175+
thor (1.3.0)
107176
thread_safe (0.3.6)
108177
tilt (2.0.11)
109178
treetop (1.6.8)
110179
polyglot (~> 0.3)
111180
trollop (2.1.2)
112181
tzinfo (1.2.10)
113182
thread_safe (~> 0.1)
183+
zeitwerk (2.6.12)
114184

115185
PLATFORMS
116186
ruby
117187

118188
DEPENDENCIES
119189
activesupport
120-
backports (= 3.23.0)
190+
backports
121191
bootstrap-sass
122192
coderay
123-
deckrb (~> 0.5.2)
124-
erector (~> 0.10.0)
125-
ffi (= 1.15.5)
126-
files (~> 0.3.0)
193+
deckrb
194+
erector!
195+
ffi
196+
files!
127197
font-awesome-sass
128-
i18n (~> 0.7)
198+
i18n
129199
jquery-cdn
130200
nokogiri
131201
rack-codehighlighter
@@ -137,13 +207,13 @@ DEPENDENCIES
137207
rspec
138208
rubyzip
139209
sass
140-
sinatra (~> 3.0.3)
141-
sinatra-contrib (~> 3.0.3)
210+
sinatra
211+
sinatra-contrib
142212
sprockets
143-
thin (= 1.8.1)
213+
thin
144214

145215
RUBY VERSION
146-
ruby 2.7.6p219
216+
ruby 3.2.2p53
147217

148218
BUNDLED WITH
149219
2.3.26

app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def render_deck
250250

251251
get "/:site/:name.zip" do
252252
manifest_path = "#{site_dir}/#{params[:name]}.zip-manifest"
253-
if File.exists?(manifest_path)
253+
if File.exist?(manifest_path)
254254
manifest_files = File.read(manifest_path).split("\n")
255255
zip_path = File.join(Dir.tmpdir, "#{params[:name]}.zip")
256256
FileUtils.rm_rf(zip_path)

assets/stylesheets/font_awesome.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
$fa-font-path: '/fonts/font-awesome/';
2-
3-
@import 'font-awesome';

lib/step.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def insert file
7474
## steps
7575

7676
%w[
77-
steps explanation overview discussion hints challenge
77+
steps explanation overview discussion hints challenge
7878
tools_and_references requirements
7979
].each do |type|
8080
define_method type.to_sym do |&block|
@@ -87,7 +87,7 @@ def insert file
8787
end
8888
end
8989

90-
def step name = nil, options = {}
90+
def step name = nil, options = {}, &block
9191
num = next_step_number
9292
a(name: "step#{current_anchor_num}")
9393
a(name: options[:anchor_name]) if options[:anchor_name]
@@ -98,7 +98,7 @@ def step name = nil, options = {}
9898
(!name.nil? ? I18n.t("general.step_title_suffix") : '')
9999
text name
100100
end
101-
_render_inner_content &Proc.new if block_given?
101+
_render_inner_content(&block) if block_given?
102102
end
103103
end
104104

@@ -131,19 +131,19 @@ def next_step name
131131
end
132132
end
133133

134-
def situation name
134+
def situation name, &block
135135
h1 name
136-
_render_inner_content &Proc.new if block_given?
136+
_render_inner_content(&block) if block_given?
137137
end
138138

139-
def option name
139+
def option name, &block
140140
num = next_step_number
141141
a(:name => "step#{current_anchor_num}")
142142
h1 :class => "option" do
143143
span I18n.t("general.option", :num => num)
144144
text name
145145
end
146-
_render_inner_content &Proc.new if block_given?
146+
_render_inner_content(&block) if block_given?
147147
end
148148

149149
def option_half title

spec/app_deck_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ def app
4141
expect(last_response.body).to include("/* Code ray css */")
4242
end
4343
end
44-
end
44+
end

spec/site_syntax_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require "cgi"
12
require "spec_helper"
23
require_relative "../app"
34

@@ -29,7 +30,7 @@ def app
2930

3031
site.docs.each do |doc|
3132
it "renders #{doc.filename}" do
32-
path = URI.escape "/#{site.name}/#{doc.name}"
33+
path = CGI.escape "/#{site.name}/#{doc.name}"
3334
get path, locale: locale
3435
if (last_response.status != 200)
3536
errors = last_response.errors

0 commit comments

Comments
 (0)